gpt4 book ai didi

installation - WiX 在 Windows 7 安装期间不会添加 HKLM 注册表设置

转载 作者:行者123 更新时间:2023-12-02 22:14:15 25 4
gpt4 key购买 nike

我编写了一个与 Windows XP 完美配合的 WiX 安装程序,但是当安装到 Windows 7 机器时,我在注册表项方面遇到了困难。我需要添加 HKLM 条目以及注册表条目,以便程序显示在开始菜单中。这是我用于两种类型输入的代码:

<!-- Create the registry entries for the program -->
<DirectoryRef Id="TARGETDIR">
<Component Id="RegistryEntriesInst" Guid="...">
<RegistryKey Root="HKLM"
Key="Software\$(var.Manufacturer)\$(var.ProductName)"
Action="createAndRemoveOnUninstall">
<RegistryValue
Type="string"
Name="installed"
Value="true"
KeyPath="yes"/>
</RegistryKey>
</Component>
<Component Id="RegistryEntriesVer" Guid="...">
<RegistryKey Root="HKLM"
Key="Software\$(var.Manufacturer)\$(var.ProductName)"
Action="createAndRemoveOnUninstall">
<RegistryValue
Type="string"
Name="version"
Value="$(var.ProductVersion)"
KeyPath="yes"/>
</RegistryKey>
</Component>
</DirectoryRef>

<!-- To add shortcuts to the start menu to run and uninstall the program -->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="...">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="$(var.ProductName)"
Description="..."
Target="[SERVERLOCATION]$(var.Project.TargetFileName)"
WorkingDirectory="SERVERLOCATION"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall $(var.ProductName)"
Description="..."
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"/>
<RemoveFolder Id="SERVERLOCATION" On="uninstall"/>
<RegistryValue
Root="HKCU"
Key="Software\$(var.Manufacturer)\$(var.ProductName)"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</DirectoryRef>

如何解决这个问题?

顺便说一句,Windows XP 和 Windows 7 计算机上的注册表权限是相同的。

最佳答案

我已经弄清楚为什么会发生这种情况。

随着 WiX 安装程序在 x86 平台上编译,Windows 7 将其选择为具有 32 位注册表项的 32 位安装程序。 Windows 7 64 位通过执行我所看到的操作来处理 32 位注册表项。

该程序仍处于注册状态;它只是不在注册表的 64 位部分中。在 x64 平台下编译它,同时进行必要的更改以使其适用于 64 位系统(ProgramFileFolder 变为 ProgramFiles64Folder 等),它会将内容放在正确的位置。

关于installation - WiX 在 Windows 7 安装期间不会添加 HKLM 注册表设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1882024/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com