Wix 带有ExternalUI的安装程序事务将销毁我的日志文件

Wix 带有ExternalUI的安装程序事务将销毁我的日志文件,wix,windows-installer,Wix,Windows Installer,安装程序事务和ExternalUI的奇怪行为会破坏我的日志文件 我在这个交易中链接了三个MSI。 我为每个设置创建详细的日志文件。 最后,我的“最后”详细日志将被删除。 它总是“最后”一个 我做错了什么? 如何避免这种行为 这发生在我提交事务之后 transaction.Commit(); 就在这里: private void End(bool commit) { uint ret = NativeMethods.MsiEndTransaction(commit ? 1 : 0)

安装程序事务和ExternalUI的奇怪行为会破坏我的日志文件

我在这个交易中链接了三个MSI。 我为每个设置创建详细的日志文件。 最后,我的“最后”详细日志将被删除。 它总是“最后”一个

我做错了什么? 如何避免这种行为

这发生在我提交事务之后

transaction.Commit();
就在这里:

 private void End(bool commit)
 {
     uint ret = NativeMethods.MsiEndTransaction(commit ? 1 : 0);
 }
我的最后一个日志文件将被删除并替换为此快照文件:

=== 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
来自我的班级:

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.Verbose);

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

transaction.Commit();

您是否尝试调用EnableLog()的四参数版本?在该版本中,第三个参数允许您将其置于附加模式,第四个参数启用刷新。我猜Do't append模式适用于在Commit()期间重新打开日志文件。如果仍要在开始时截断,则可以在开始安装之前删除任何现有文件

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

您是否尝试调用EnableLog()的四参数版本?在该版本中,第三个参数允许您将其置于附加模式,第四个参数启用刷新。我猜Do't append模式适用于在Commit()期间重新打开日志文件。如果仍要在开始时截断,则可以在开始安装之前删除任何现有文件

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