Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/349.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于用户选择的Wix条件注册表写入_Wix_Windows Installer - Fatal编程技术网

基于用户选择的Wix条件注册表写入

基于用户选择的Wix条件注册表写入,wix,windows-installer,Wix,Windows Installer,我使用Wix3.9和WixUI_高级对话框创建windows安装程序。用户可以选择在本地或每台机器(所有用户)上安装应用程序。为此,我使用WixPerUserFolder属性 <Publish Dialog="InstallScopeDlg" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">!(wix.WixUISupportPerUser) AND NOT Privileged<

我使用Wix3.9和WixUI_高级对话框创建windows安装程序。用户可以选择在本地或每台机器(所有用户)上安装应用程序。为此,我使用WixPerUserFolder属性

<Publish Dialog="InstallScopeDlg" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">!(wix.WixUISupportPerUser) AND NOT Privileged</Publish>

<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="1" Order="8">WixAppFolder = "WixPerUserFolder"</Publish>

<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="{}" Order="9">WixAppFolder = "WixPerMachineFolder"</Publish>

<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="{}" Order="3">WixAppFolder = "WixPerUserFolder"</Publish>

<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="1" Order="2">WixAppFolder = "WixPerMachineFolder"</Publish>

<Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Order="4">WixAppFolder = "WixPerUserFolder"</Publish>

<Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Order="5">WixAppFolder = "WixPerMachineFolder"</Publish>
!(wix.wixuissupportperuser)并且没有特权
WixAppFolder=“WixPerUserFolder”
WixAppFolder=“WixPerMachineFolder”
WixAppFolder=“WixPerUserFolder”
WixAppFolder=“WixPerMachineFolder”
WixAppFolder=“WixPerUserFolder”
WixAppFolder=“WixPerMachineFolder”
根据用户选择(WixPerUserFolder或WixPerMachineFolder),我还希望能够选择注册表项:HKCU或HKLM

如果用户选择本地安装,则:

<RegistryKey Root="HKCU" Key="$(var.RegKey)" ForceDeleteOnUninstall="yes" ForceCreateOnInstall="yes">
         <RegistryValue Type="string" Value="" KeyPath="yes" />
         <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]"/>
</RegistryKey>

否则:

<RegistryKey Root="HKLM" Key="$(var.RegKey)" ForceDeleteOnUninstall="yes" ForceCreateOnInstall="yes">
    <RegistryValue Type="string" Value="" KeyPath="yes" />
        <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]"/>
</RegistryKey>

Root=“HKMU”
将根据包是按用户还是按机器运行来选择正确的配置单元