2013-10-02 123 views
1

使用非常簡單的代碼幾乎相同的例子:維克斯安裝程序捆綁產生腐敗的「MSI」

<?xml version="1.0" encoding="utf-8"?> 
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Bundle Version="1.0" Manufacturer="ACME" UpgradeCode="6AF8AF7D-3B44-4496-9E64-56206DF66C55"> 
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/> 
    <Chain> 
    <MsiPackage SourceFile="wpftoolkit.msi"/> 
    </Chain> 
    </Bundle> 
    </Wix> 

我得到的是,在開始imidiatly產生錯誤文件的setup.msi:

msiexec /i setup.msi /l*v log.txt 
    log.txt: 
    === Verbose logging started: 02.10.2013 14:12:11 Build type: SHIP UNICODE 5.00.7600.00 Calling process: C:\Windows\system32\msiexec.exe === 
    MSI (c) (B0:48) [14:12:11:804]: Font created. Charset: Req=204, Ret=204, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg 
    MSI (c) (B0:48) [14:12:11:805]: Font created. Charset: Req=204, Ret=204, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg 
    MSI (c) (B0:A4) [14:12:11:823]: Resetting cached policy values 
    MSI (c) (B0:A4) [14:12:11:823]: Machine policy value 'Debug' is 0 
    MSI (c) (B0:A4) [14:12:11:823]: ******* RunEngine: 
    ******* Product: Setup.msi 
    ******* Action: 
    ******* CommandLine: ********** 
    MSI (c) (B0:A4) [14:12:11:824]: Note: 1: 2203 2: Setup.msi 3: -2147286960 
    MSI (c) (B0:A4) [14:12:11:824]: MainEngineThread is returning 1620 
    === Verbose logging stopped: 02.10.2013 14:12:11 === 

工具來自Wix SDK的dark.exe表示setup.msi已損壞,無法反彙編。 上週幾次我設法編譯這種類型的包,msi運行良好,但我無法弄清楚我在做什麼之間的任何關係。

我也試圖編譯這個例子中不使用的MSBuild,而是直接與維克斯SDK工具 - 仍然沒有運氣 - 編譯完成且沒有錯誤,但導致MSI已損壞反正:

candle *.wxs 
    light *.wixobj -out setup.msi -ext WixBalExtension 

有什麼我錯過了編譯Wix捆綁包,阻止它正常工作?

回答

0

這絕對是違反直覺的,但我想我已經找到了解決辦法:

candle *.wxs 
light *.wixobj -out setup.EXE -ext WixBalExtension 

輸出格式爲EXE,不MSI。很簡單,對吧?

順便說一下,SharpDevelop(以及Visual Studio,我相信)沒有任何選項來指定輸出文件爲EXE - 僅MSI,msp和wixlib。

+0

作爲SharpDevelop IDE的一種解決方法,我添加了一個用Setup.exe替換Setup.msi的後生成腳本(只是重命名並不能解決問題)。爲什麼我不只是切換到一些make.bat文件,主要原因是wxs文件中有幾個預處理器變量(即$(var.OtherProject.TargetPath))需要在編譯步驟(candle.exe)上解析, 。所以後構建腳本是: rm $(Target); (配置)\ *。wixobj -ext WixBalExtension -out bin \ $(配置)\ $(SolutionName).exe – Ujin

2

A Wix/Bundle用於生成將安裝程序鏈接在一起的可執行文件。因此,應該給出一個.exe擴展名的輸出。

您可以像調整完成或使用MSBuild項目一樣手動調用WiX Toolset編譯器和鏈接器。 WiX將安裝Visual Studio的模板項目以供使用。它被稱爲WiX Bootstrapper。如果你不知道,Visual Studio和SharpDevelop項目都是MSBuild項目。因此,還有兩種構建構建的方法:通過IDE或使用msbuild.exe的命令行。

注意:如果在Visual Studio之前安裝了WiX,Visual Studio將不會顯示四個WiX項目模板。在這種情況下,只需修復WiX安裝。

+0

在SharpDevelop中,我沒有創建Wix Budle項目的選項。只有空項目和不同風格的WixUI項目。在指定輸出文件參數的.wixproj文件中也沒有選項。我相信這取決於一個特定的wix .target文件。 – Ujin