2016-11-29 28 views
0

我試圖讓「安裝範圍」屏幕在WiX中工作,使用WixUI_Advanced用戶界面,雖然我沒有收到任何錯誤,但它根本不起作用。WiXUI_Advanced安裝範圍不按廣告方式工作

Here是火巨人(WiX的DEV)教程頁面通過,一步一步,過程中得到安裝屏工作去了,我已經遵守了它。我也在跟着一本說同樣的東西的教科書。

我使用的是WiX 3.10,這很可能是問題 - 也許教程已過時?我使用的教科書是WiX 3.6。

的步驟如下:

1:確保你在你的項目中WixUIExtension參考。如果我可以顯示我的解決方案資源管理器的屏幕截圖,那麼您會看到該引用在那裏。隨着中說,我正在關注的教科書表示使用基準,而在火巨人教程中的語言說:

對話集文件中定義WixUI_Advanced.wxs在WixUIExtension在WiX源代碼。

認爲,意思是「添加引用」,但...

2:添加的標記來WixUI_Advanced參考(火巨人教程沒有提到這一點在所有 - 他們無論是忽略了這個必要的步驟,或者沒有包括):

<UIRef Id="WixUI_Advanced"/> 

3:請確保您有一個名爲APPLICATIONFOLDER目錄:

<Directory Id="TARGETDIR" Name="SourceDir"> 
    <Directory Id="ProgramFilesFolder"> 
     <Directory Id="APPLICATIONFOLDER" Name="MyFolder"/> 
    </Directory> 
</Directory> 

4:添加一個特定的屬性,其Id是ApplicationFolderName。該值將設置安裝目錄的名稱,因爲它將出現在用戶界面中。 5:添加另一個屬性,其ID爲WixAppFolder與任WixPerMachinePerFolder...每用戶的值。這將給用戶選擇哪一個:

<Property Id="ApplicationFolderName" Value="MyProgram"/> 
    <Property Id="WixAppFolder" Value="WixPerMachineFolder"/> 

就是這樣!該程序運行時沒有錯誤消息,也沒有警告,但除了安裝我正在安裝的東西(文本文件)之外,它不會執行任何操作。日誌文件不顯示錯誤。

我知道UI實際上正在發生,因爲我可以更改許可證rtf文件。

日誌還顯示某些特定操作正在跳過。下面是從日誌文件中的條目:

行動啓動十三點46分38秒:WixSetDefaultPerMachineFolder。 MSI(c)(04:A4)[13:46:38:195]:PROPERTY CHANGE:添加WixPerMachineFolder屬性。它的值是'C:\ Program Files *******返回值1。

MSI(C)(04:A4)[13:46:38:195]:跳繩動作:WixSetPerUserFolder(條件爲假)

MSI(C)(04:A4)[13時46: 38:195]:執行動作:WixSetPerMachineFolder

MSI(C)(04:A4)[13:46:38:195]:注:1:2205 2:3:ActionText

動作13時44 :54:WixSetDefaultPerUserFolder。

Action start 13:44:54:WixSetDefaultPerUserFolder。 (88:C4)[13:44:54:159]:PROPERTY CHANGE:添加WixPerUserFolder屬性。它的值是'C:\ Users *** ...'。

Action ended 13:44:54:WixSetDefaultPerUserFolder。返回值1.

MSI(一個或多個)(88:C4)[13:44:54:159]:執行動作:WixSetDefaultPerMachineFolder

MSI(一個或多個)(88:C4)[13時44分54秒:159]:注意:1:2205 2:3:ActionText

Action 13:44:54:WixSetDefaultPerMachineFolder。

Action start 13:44:54:WixSetDefaultPerMachineFolder。 (88:C4)[13:44:54:159]:PROPERTY CHANGE:添加WixPerMachineFolder屬性。它的值是'C:\ Program Files \ MyProgram'。

Action ended 13:44:54:WixSetDefaultPerMachineFolder。返回值1.

MSI(一個或多個)(88:C4)[13:44:54:159]:跳繩動作:WixSetPerUserFolder(條件爲假)

MSI(一個或多個)(88:C4)[ 13:44:54:159]:跳繩動作:WixSetPerMachineFolder(條件爲假)

MSI(一個或多個)(88:C4)[13:44:54:159]:執行動作:CostFinalize

MSI (一個或多個)(88:C4)[13:44:54:159]:注:1:2205 2:3:ActionText

這裏是叔他在其全部代碼:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
<Product Id="*" 
     Name="WixUIAdvanced" 
     Language="1033" 
     Version="1.0.0.0" 
     Manufacturer="Microsoft" 
     UpgradeCode="f3410225-cde1-4067-a6e6-2e016d7cf38b"> 
    <Package InstallerVersion="200" 
      Compressed="yes" 
      InstallScope="perMachine" /> 

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
    <MediaTemplate EmbedCab="yes"/> 

    <UIRef Id="WixUI_Advanced"/> 
    <WixVariable Id="WixUILicenseRtf" Value="src\license.rtf"/> 
    <Property Id="ApplicationFolderName" Value="MyProgram"/> 
    <Property Id="WixAppFolder" Value="WixPerMachineFolder"/> 


    <Feature Id="ProductFeature" 
      Title="WixUIAdvanced" 
      Level="1"> 
     <ComponentGroupRef Id="ProductComponents" /> 
    </Feature> 
</Product> 

<Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
      <Directory Id="APPLICATIONFOLDER" 
         Name="MyFolder"/> 
     </Directory> 
    </Directory> 
</Fragment> 

<Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER"> 
     <Component Id="ProductComponent"> 
     <File Source="TextFile1.txt"/> 
     </Component> 
    </ComponentGroup> 
</Fragment> 

我使用WiX的3.10時,Visual Studio 2015年

回答

1

這是多麼先進的UI工作。您必須單擊高級,而不是「安裝」來設置其他設置。

Advanced settings

如果你想改變顯示的對話框的順序,或類型,可以使用不同的UI,here是預製的人的名單,或者您也可以通過只是現有UI文件複製到創建自己的解決方案和editing它。