Wix安装程序在更新时使用默认应用程序路径,而不是按预期从注册表中使用
我们正在使用Wix工具集V3.11构建我们的设置 由于以下声明,我们的默认安装路径是Wix安装程序在更新时使用默认应用程序路径,而不是按预期从注册表中使用,wix,windows-installer,Wix,Windows Installer,我们正在使用Wix工具集V3.11构建我们的设置 由于以下声明,我们的默认安装路径是C:/ProgramFiles(x86)/Acme/AppName <Property Id="ApplicationFolderName" Value="$(var.Manufacturer)\$(var.AppFolderName)" /> <Property Id="WixAppFolder" Value="WixPerMachineFolder" /> 通过Regedit.ex
C:/ProgramFiles(x86)/Acme/AppName
<Property Id="ApplicationFolderName" Value="$(var.Manufacturer)\$(var.AppFolderName)" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
通过Regedit.exe,我可以看到注册表中的路径C:/ProgramFiles(x86)/Acme/FooBar
。好的
问题:但现在,当我运行一个更新的新安装程序时,所有文件都已从自定义文件夹C:/Program Files(x86)/Acme/FooBar
移动到默认文件夹C:/Program Files(x86)/Acme/AppName
当我执行更新并单击“高级”按钮时,默认路径C:/ProgramFiles(x86)/Acme/AppName
已预先分配:
我使用以下标记查询注册表外的路径:
<Property Id="APPLICATIONFOLDER">
<RegistrySearch Id='InstallationRegistrySearch' Type='raw' Root='HKLM' Key='Software\$(var.Manufacturer)\$(var.AppName)' Name='InstallDir' />
</Property>
以下是相关的标记:
<Fragment>
<ComponentGroup Id="RootComponents" Directory="APPLICATIONFOLDER">
<Component Id="RootComponent" Guid="xxxxxxxxx" Win64='yes'>
<RegistryKey
Key="Software\$(var.Manufacturer)\$(var.AppName)"
Root="HKLM">
<RegistryValue Id="InstallationRegistry"
Type="string"
Name="InstallDir"
Value="[APPLICATIONFOLDER]" />
</RegistryKey>
</Component>
</ComponentGroup>
[...]
<Product ...>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="PROGRAMFILESPATH" Name="$(var.ProgramFilesPath)">
<Directory Id="ManufacturerFolder" Name="$(var.Manufacturer)">
<Directory Id="APPLICATIONFOLDER" Name="$(var.AppFolderName)" >
<!-- here are the application files (e.g. Appname.exe)-->
[...]
</Directory>
</Directory>
</Directory>
</Directory>
[...]
<Property Id="ApplicationFolderName" Value="$(var.Manufacturer)\$(var.AppFolderName)" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Property Id="APPLICATIONFOLDER">
<RegistrySearch Id='InstallationRegistrySearch' Type='raw' Root='HKLM' Key='Software\$(var.Manufacturer)\$(var.AppName)' Name='InstallDir' />
</Property>
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Property Id="ALLUSERS" Value="1"/>
[...]
<UI>
[...]
<UIRef Id="WixUI_Advanced"/>
</UI>
</Product>
[...]
[...]
[...]
[...]
[...]
我们做错了什么?记住属性:属性值不是由MSI自动神奇地持久化的,因此需要诸如“”之类的模式
比特数:看起来您正在从注册表中读取数据,但是否存在“比特数问题”?换句话说,您是从注册表的x64部分读取的,而不是从x86部分读取的?(反之亦然)
HKEY\U LOCAL\U MACHINE\SOFTWARE\Manufacturer\Acme\Program
HKEY\U LOCAL\U MACHINE\SOFTWARE\Wow6432Node\Manufacturer\Acme\Program
<Fragment>
<ComponentGroup Id="RootComponents" Directory="APPLICATIONFOLDER">
<Component Id="RootComponent" Guid="xxxxxxxxx" Win64='yes'>
<RegistryKey
Key="Software\$(var.Manufacturer)\$(var.AppName)"
Root="HKLM">
<RegistryValue Id="InstallationRegistry"
Type="string"
Name="InstallDir"
Value="[APPLICATIONFOLDER]" />
</RegistryKey>
</Component>
</ComponentGroup>
[...]
<Product ...>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="PROGRAMFILESPATH" Name="$(var.ProgramFilesPath)">
<Directory Id="ManufacturerFolder" Name="$(var.Manufacturer)">
<Directory Id="APPLICATIONFOLDER" Name="$(var.AppFolderName)" >
<!-- here are the application files (e.g. Appname.exe)-->
[...]
</Directory>
</Directory>
</Directory>
</Directory>
[...]
<Property Id="ApplicationFolderName" Value="$(var.Manufacturer)\$(var.AppFolderName)" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Property Id="APPLICATIONFOLDER">
<RegistrySearch Id='InstallationRegistrySearch' Type='raw' Root='HKLM' Key='Software\$(var.Manufacturer)\$(var.AppName)' Name='InstallDir' />
</Property>
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Property Id="ALLUSERS" Value="1"/>
[...]
<UI>
[...]
<UIRef Id="WixUI_Advanced"/>
</UI>
</Product>