我試圖設置使用單選按鈕(單用戶安裝到應用程序數據和ALLUSERS安裝到PROGRAMFILES)威克斯設置從單選按鈕安裝位置可變
我的屬性被定義兩個不同的安裝位置如下:
<Property Id="INSTALLSCOPE" Secure="yes" />
我的安裝目錄下的定義如下:
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id= 'INSTALLSCOPE' Name='AppData'>
<Directory Id='MYAPP' Name='COMPANY'>
<Directory Id='INSTALLDIR' Name='MyApp'>
我的單選按鈕如下:
<Dialog Id="CustomInstallScopeDlg" Width="370" Height="270" Title="[ProductName] Install Scope"
NoMinimize="yes">
<Control Id="RadioButtonGroupID" Type="RadioButtonGroup" X="30" Y="94" Width="305" Height="100" Property="INSTALLSCOPE">
<RadioButtonGroup Property="INSTALLSCOPE">
<RadioButton Value="LocalAppDataFolder" X="0" Y="0" Width="300" Height="10" Text="SingleUser"/>
<RadioButton Value="ProgramFilesFolder" X="0" Y="20" Width="300" Height="10" Text="AllUser"/>
</RadioButtonGroup>
</Control>
...
單選按鈕改變和NEXT按鈕被點擊後,會發生以下情況:
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes"
Text="[ButtonText_Next]">
<Publish Property="INSTALLSCOPE" Value="LocalAppDataFolder">INSTALLSCOPE = "LocalAppDataFolder"</Publish>
<Publish Property="INSTALLSCOPE" Value="ProgramFilesFolder">INSTALLSCOPE = "ProgramFilesFolder"</Publish>
</Control>
目前發生了什麼,當我運行它,是它試圖在電子商務安裝:而不是正確的應用程序數據, AppData文件夾。此外,安裝程序錯誤並且UI不顯示。如果我硬編碼值LocalAppDataFolder
而不是通過變量傳遞它,這不會發生。我在安裝過程中運行了一個日誌,當我瀏覽安裝程序時,我可以看到INSTALLSCOPE的值被更改,但UI永不更新以反映此更改,實際安裝路徑也不會更改。任何幫助都會很棒。
試圖尋找到文件WixUI_Advanced.wxs(如果你還沒有把),其中實現UI模板,功能,您試圖實現。它可能會幫助你。我認爲最簡單的方法就是從UI模板中複製InstallScopeDlg的東西,並創建自己的InstallScopeDlg.wxs克隆並根據需要進行編輯,或者從那裏複製功能。 – Mischo5500
謝謝。我會研究這一點。這些模板可以在這裏找到(https://github.com/AnalogJ/Wix3.6Toolset),並且似乎與新版本的Wix不兼容。 – user5521
它不是官方的WiX存儲庫,它位於這裏[link](https://github.com/wixtoolset/)。上週我使用了從WiX4分支到WiX3.10工具集的模板,它工作正常。 – Mischo5500