[英]Why isn't WiX Burn restarting and resuming execution?
我正在使用WiX Burn 3.8構建托管代碼引導程序。 其中一個PackageGroups包含ExePackage元素,可在Windows Server 2003上安裝Windows Installer 4.5。該軟件包的x86版本如下所示。 (為了避免暴露任何敏感的客戶端信息,下面的代碼段已作了些微改動。)
<!-- Microsoft Windows Installer 4.5 Redistributable x86 -->
<ExePackage Id="WindowsServer2003_KB942288_v4_x86.exe"
DisplayName="Microsoft Windows Installer Redistributable x86"
SourceFile="{a_path}\WindowsServer2003-KB942288-v4-x86.exe"
Name="redist\Windows_Installer\WindowsServer2003-KB942288-v4-x86.exe"
InstallCommand="/q /norestart"
RepairCommand="/q /norestart"
DetectCondition="VersionMsi >= v4.5 AND Not VersionNT64"
InstallCondition="InstallSqlExpress = "yes" AND VersionMsi < v4.5 AND VersionNT = v5.2 AND Not VersionNT64"
Compressed="no"
DownloadUrl="http://downloads.{mycompany}.com/{some_path}/WindowsServer2003-KB942288-v4-x86.exe"
Permanent="yes"
SuppressSignatureVerification="no">
<!-- Exit codes
0 = Success, no reboot required
3010 = Success, reboot required
-->
<ExitCode Value="0" Behavior="success" />
<ExitCode Value="3010" Behavior="forceReboot" />
<ExitCode Behavior="error"/>
</ExePackage>
Burn似乎並沒有按照廣告中所述重新啟動或重新啟動后繼續運行,我不確定為什么。 我正在傳遞/q
和/norestart
命令行參數,並將3010退出代碼標識為需要重新啟動,如MSDN的Windows Installer可再發行文件文檔中所指定。
安裝程序日志(下面的時間戳信息修剪)顯示重新啟動。 您可以在下面看到來自Burn引擎和我的托管bootstrapper應用程序的日志事件的組合:
Restart requested by WindowsServer2003_KB942288_v4_x86.exe: RestartInitiated
Applied execute package: WindowsServer2003_KB942288_v4_x86.exe, result: 0x0, restart: Initiated
ApplyComplete. Result: None
State changed. Status: 0
Must reboot. Showing warning.
Apply complete, result: 0x0, restart: Initiated, ba requested restart: No
Exiting UI.
Shutting down, exit code: 0x0
Shutting down. Restart: RestartInitiated
Bootstrapper application requested restart at shutdown. Planned to restart already: No.
Exit code: 0x0, restarting: Yes
Restarting computer...
=======================================
刻錄引擎確實將注冊表項寫入HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run
。 GUID密鑰具有以下值,看起來它應該在重新啟動后恢復引導程序:
"C:\Documents and Settings\All Users\Application Data\Package Cache\{a_guid}\{my_burn_installer}.exe" /burn.log.append "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\{my_installer}{timestamp}.log" "/PARENTEXE=C:\Documents and Settings\Administrator\Desktop\{my_nsis_installer}.exe" {two_more_command_line_params} /burn.runonce
我已經檢查了注冊表項中列出的文件路徑,並在其中看到了基於Burn的安裝程序和一個state.rsm
文件。 但是,當日志說要去時,系統不會重新啟動,並且手動重新啟動系統后安裝程序也不會繼續。
從上面可以看到,Burn bootstrapper被包裝在NSIS包中以安裝Windows Imaging Component,這是在Windows Server 2003上安裝.NET Framework 4的先決條件。有關為什么這樣做的更多詳細信息,請參見StackOverflow問題 。 。 我不認為這是問題的根源,因為基於Burn的引導程序是從程序包緩存中運行的,但是我可能是錯的。
我正在沒有應用更新的32位Windows Server 2003 R2標准版Hyper-V虛擬機上進行測試。
使用WiX v3.9。 它包括針對在XP / 2003上RunOnce鍵太長時的修復以及安裝多個prereq軟件包的能力 (如我在鏈接的問題中所述)。
至於計算機沒有重新啟動,這是一個謎。 由於Burn在調用InitiateSystemShutdownEx
時不會強制應用程序關閉,因此應用程序可能會阻止關機。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.