修复KeyPath问题

This commit is contained in:
wangdage12
2025-11-26 19:18:01 +08:00
committed by GitHub
parent cc926e4352
commit 2cc2cc80ac

View File

@@ -1,5 +1,6 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Snap.Hutao" <Package
Name="Snap.Hutao"
Manufacturer="Millennium Science Technology R-D Inst" Manufacturer="Millennium Science Technology R-D Inst"
Version="1.0.0.0" Version="1.0.0.0"
UpgradeCode="121203be-60cb-408f-92cc-7080f6598e68" UpgradeCode="121203be-60cb-408f-92cc-7080f6598e68"
@@ -10,11 +11,14 @@
<Feature Id="ProductFeature" Title="Snap.Hutao" Level="1"> <Feature Id="ProductFeature" Title="Snap.Hutao" Level="1">
<ComponentGroupRef Id="MainAppComponents" /> <ComponentGroupRef Id="MainAppComponents" />
<!-- 快捷方式组件 -->
<ComponentRef Id="ApplicationShortcut" /> <ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="DesktopShortcuts" /> <ComponentRef Id="DesktopShortcut" />
</Feature> </Feature>
</Package> </Package>
<!-- 安装目录 -->
<Fragment> <Fragment>
<StandardDirectory Id="ProgramFiles64Folder"> <StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Snap.Hutao" /> <Directory Id="INSTALLFOLDER" Name="Snap.Hutao" />
@@ -27,21 +31,34 @@
<StandardDirectory Id="DesktopFolder" /> <StandardDirectory Id="DesktopFolder" />
</Fragment> </Fragment>
<!-- 桌面快捷方式 -->
<Fragment> <Fragment>
<Component Id="DesktopShortcuts" Directory="DesktopFolder" Guid="*"> <Component Id="DesktopShortcut" Directory="DesktopFolder" Guid="*">
<Shortcut Id="DesktopShortcut_Normal"
<Shortcut
Id="DesktopShortcut_Normal"
Name="Snap Hutao" Name="Snap Hutao"
Description="Snap Hutao Client" Description="Snap Hutao Client"
Target="[INSTALLFOLDER]Snap.Hutao.exe" Target="[INSTALLFOLDER]Snap.Hutao.exe"
WorkingDirectory="INSTALLFOLDER" /> WorkingDirectory="INSTALLFOLDER" />
<RegistryValue Root="HKLM" Key="Software\Snap.Hutao" Name="DesktopShortcutInstalled" Type="integer" Value="1" KeyPath="yes" /> <!-- KeyPath 必须是 HKCU因为快捷方式安装到用户目录 -->
<RegistryValue
Root="HKCU"
Key="Software\Snap.Hutao"
Name="DesktopShortcutInstalled"
Type="integer"
Value="1"
KeyPath="yes" />
</Component> </Component>
</Fragment> </Fragment>
<!-- 开始菜单快捷方式 -->
<Fragment> <Fragment>
<Component Id="ApplicationShortcut" Directory="ApplicationProgramsFolder" Guid="*"> <Component Id="ApplicationShortcut" Directory="ApplicationProgramsFolder" Guid="*">
<Shortcut Id="ApplicationStartMenuShortcut"
<Shortcut
Id="ApplicationStartMenuShortcut"
Name="Snap Hutao" Name="Snap Hutao"
Description="Snap Hutao Client" Description="Snap Hutao Client"
Target="[INSTALLFOLDER]Snap.Hutao.exe" Target="[INSTALLFOLDER]Snap.Hutao.exe"
@@ -49,7 +66,14 @@
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall" /> <RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKLM" Key="Software\Snap.Hutao" Name="StartMenuShortcutInstalled" Type="integer" Value="1" KeyPath="yes" /> <!-- KeyPath 依然必须改为 HKCU -->
<RegistryValue
Root="HKCU"
Key="Software\Snap.Hutao"
Name="StartMenuShortcutInstalled"
Type="integer"
Value="1"
KeyPath="yes" />
</Component> </Component>
</Fragment> </Fragment>
</Wix> </Wix>