Files
MyGoNavi/build/windows/installer.wxs
Syngnat 7017db418b 🐛 fix(updater): 修复 MSI 更新后任务栏图标失效与桌面快捷方式重建
- 自动迁移引用失效 MSI 缓存图标的旧任务栏固定项并刷新 Shell
- 在在线更新前备份桌面快捷方式状态,成功或失败后安全恢复
- 将桌面快捷方式拆分为条件安装组件并补充 Windows 回归测试
2026-07-18 13:48:35 +08:00

101 lines
4.1 KiB
XML

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="$(var.ProductName)"
Manufacturer="Syngnat"
Language="1033"
Version="$(var.ProductVersion)"
ProductCode="*"
UpgradeCode="$(var.UpgradeCode)"
Scope="perMachine"
InstallerVersion="500"
Compressed="yes">
<MajorUpgrade AllowDowngrades="yes"
Schedule="afterInstallInitialize" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<Icon Id="GoNaviIcon" SourceFile="$(var.IconPath)" />
<Property Id="ARPPRODUCTICON" Value="GoNaviIcon" />
<Property Id="ARPURLINFOABOUT" Value="https://github.com/Syngnat/GoNavi" />
<Property Id="INSTALLDESKTOPSHORTCUT" Value="1" Secure="yes" />
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" After="CostFinalize" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.LicenseRtf)" />
<Feature Id="MainFeature" Title="$(var.ProductName)" Level="1">
<ComponentRef Id="MainExecutable" />
<ComponentRef Id="DesktopShortcutComponent" />
</Feature>
<Component Id="MainExecutable"
Directory="INSTALLFOLDER"
Guid="$(var.ComponentGuid)"
Bitness="always64">
<File Id="GoNaviExe"
Source="$(var.SourceExe)"
Name="GoNavi.exe"
KeyPath="yes">
<!-- Keep shortcut icons bound to the stable executable path. Referencing the MSI Icon table
can leave Windows shell caches pointing at the removed product cache after a major upgrade. -->
<Shortcut Id="StartMenuShortcut"
Directory="ProgramMenuFolder"
Name="$(var.ProductName)"
WorkingDirectory="INSTALLFOLDER"
Advertise="no" />
</File>
<File Id="GoNaviMsiInstallMarker"
Source="$(var.InstallMarker)"
Name=".gonavi-msi-install" />
<File Id="GoNaviLicense"
Source="$(var.LicenseFile)"
Name="LICENSE.txt" />
<File Id="GoNaviNotice"
Source="$(var.NoticeFile)"
Name="NOTICE.txt" />
<RegistryValue Root="HKLM"
Key="Software\Syngnat\$(var.RegistryKeyName)"
Name="InstallType"
Value="MSI"
Type="string"
KeyPath="no" />
<RegistryValue Root="HKLM"
Key="Software\Syngnat\$(var.RegistryKeyName)"
Name="InstallPath"
Value="[INSTALLFOLDER]GoNavi.exe"
Type="string"
KeyPath="no" />
</Component>
<!-- Online updates pass the user's pre-update desktop shortcut state. Keeping this resource
in its own component lets a major upgrade remove an unwanted old shortcut without
recreating it, while first-time and manual installs retain the existing default. -->
<Component Id="DesktopShortcutComponent"
Directory="DesktopFolder"
Guid="$(var.DesktopShortcutComponentGuid)"
Bitness="always64"
Condition="INSTALLDESKTOPSHORTCUT = 1">
<Shortcut Id="DesktopShortcut"
Name="$(var.ProductName)"
Target="[#GoNaviExe]"
WorkingDirectory="INSTALLFOLDER"
Advertise="no" />
<RegistryValue Root="HKLM"
Key="Software\Syngnat\$(var.RegistryKeyName)"
Name="DesktopShortcutInstalled"
Value="1"
Type="integer"
KeyPath="yes" />
</Component>
<ui:WixUI Id="WixUI_InstallDir"
InstallDirectory="INSTALLFOLDER"
ExtendedPathValidation="yes" />
</Package>
<Fragment>
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="$(var.InstallFolderName)" />
</StandardDirectory>
<StandardDirectory Id="ProgramMenuFolder" />
<StandardDirectory Id="DesktopFolder" />
</Fragment>
</Wix>