oki*_*pol 8 xml windows-installer wix
我有一个WIX安装程序.我尝试添加一个注册表项,具体取决于安装路径(VS Installer easy),在这种情况下认为这将是一块蛋糕......这是我的WIX XML:
<Feature Id="ProductFeature" Title="ChessBarInfoSetup" Level="1">
<!--<ComponentGroupRef Id="ProductComponents" />-->
<ComponentRef Id='InstallRegistryComponent' />
<ComponentRef Id='ProductComponent' />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ManufacturerFolder" Name="$(var.manufacturer)">
<Directory Id="INSTALLFOLDER" Name="$(var.productName)">
<!--<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">-->
<Component Id="InstallRegistryComponent" Guid="*">
<RegistryKey Id='ChessInfoBarInstallDir' Root='HKLM' Key='Software\[Manufacturer]\[ProductName]' Action='createAndRemoveOnUninstall'>
<RegistryValue Type='string' Name='InstallDir' Value="[INSTALLDIR]" Action="write" KeyPath="yes" />
<!--<RegistryValue Type='integer' Name='Flag' Value='0'/>-->
</RegistryKey>
</Component>
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent" Guid="*">
<File Source="$(var.ChessInfoTaskBar.TargetPath)" />
</Component>
<!--</ComponentGroup>-->
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
Run Code Online (Sandbox Code Playgroud)
该值已创建,但始终为空字符串.用INSTALLLOCATION和其他人试过......我做错了什么(在wix教程页面上看到了Value = [INSTALLDIR])?
它是空的,因为你使用INSTALLDIR而不是INSTALLFOLDER
<Directory Id="INSTALLFOLDER" Name="$(var.productName)">
<RegistryValue Type='string' Name='InstallDir' Value="[INSTALLFOLDER]" />
Run Code Online (Sandbox Code Playgroud)
那应该给你安装目录.
| 归档时间: |
|
| 查看次数: |
6272 次 |
| 最近记录: |