开发者

Installer Transaction with ExternalUI destroys my log files

Strange behavior with Installer Transaction and ExternalUI that destroys my log files.

I'm chaining three MSIs in this Transaction. I make a verbose log file for each Setup. In the end my "last" verbose Log will be deleted. It is always the "last" one that.

What I'm doing wrong? How to avoid this behavior?

This happens after i commit the Transaction

transaction.Commit();

Exactly here:

 private void End(bool commit)
 {
     uint ret = NativeMethods.MsiEndTransaction(commit ? 1 : 0);
 }

My last Logfile will be deleted and replaced with this shot one:

=== Verbose logging started: 15.02.2011  10:58:16  Build type: SHIP UNICODE 5.00.7600.00  Calling process: \\olli\Public\Hin und her\Kai-Uwe\InstallWizard.exe ===
MSI (s) (08:30) [10:58:16:631]: User policy value 'DisableRollback' is 0
MSI (s) (08:30) [10:58:16:631]: Machine policy value 'DisableRollback' is 0
MSI (s) (08:30) [10:58:16:631]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (08:30) [10:58:16:631]: MSCOREE not loaded loading copy from system32
MSI (s) (08:30) [10:58:16:959]: Note: 1: 2318 2:  
MSI (s) (08:30) [10:58:16:975]: Note: 1: 2318 2:  
MSI (s) (08:30) [10:58:16:975]: Note: 1: 2318 2:  
MSI (s) (08:30) [10:58:16:975]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
MSI (s) (08:30) [10:58:16:990]: Restoring environment variables
MSI (s) (08:30) [10:58:16:990]: Calling SRSetRestorePoint API. dwRestorePtType: 0, dwEventType: 103, llSequenceNumber: 12, szDescription: "".
MSI (c) (E0:0C) [10:58:16:990]: Cloaking enabled.
MSI (s) (08:30) [10:58:16:990]: The call to SRSetRestorePoint API succeeded. Returned status: 0.
MSI (c) (E0:0C) [10:58:16:990]: Attempting to enable all disabled privileges before calling Install on Server

From my Class:

using (Transaction transaction = new Transaction("Install", TransactionAttributes.None))

foreach (MsiPackage package in _availableMsiPackages.Values){

  Installer.EnableLog(InstallLogModes.Verbose, LogPath);
  Installer.SetInternalUI(InstallUIOptions.Silent);
  ExternalUIRecordHandler _processMessageHandler = new ExternalUIRecordHandler ProcessMessage);
  ExternalUIRecordHandler result = Installer.SetExternalUI(_processMessageHandler, InstallLogModes.Ver开发者_Python百科bose);

  Installer.InstallProduct(fi.FullName, _commandLine);
}

transaction.Commit();


Have you tried calling the four-parameter version of EnableLog()? In that version, the third parameter allows you to put it in append mode, and the fourth turns on flushing. I'm guessing the don't append mode is applying to a reopening of the log file during Commit(). If you still want to truncate at the beginning, you could delete any existing file before starting the installation.

Installer.EnableLog(InstallLogModes.Verbose, LogPath, true, true);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜