102 lines
4.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!--
云仓视频溯源软件(本机服务)—— MSI 安装包定义
设计要点:
- **perUser 安装**(免管理员、无 UAC):装到 %LOCALAPPDATA%\Programs\YuncangTrace;
- **安装即注册启动协议** yuncang://(HKCU\Software\Classes),不用先启动软件;
- 注册表项属于安装包的组件 → **卸载时 MSI 自动删除(= 取消注册)**;
- 升级:MajorUpgrade;同版本重装走「修复/重装」。
构建(wix 是 dotnet 全局工具,推荐 build.ps1 一键完成):
wix build Product.wxs -arch x64 -d Version=1.0.0 -o out\YuncangTraceSetup-1.0.0.msi
发布产物要先有:desktop\publish\YuncangTrace.LocalService.exe
-->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="云仓视频溯源软件"
Manufacturer="云仓"
Version="$(var.Version)"
UpgradeCode="A1E7CF0F-4FC5-4A88-84B5-13E818F352CC"
Scope="perUser"
Compressed="yes">
<!-- 高版本已装时不允许降级安装 -->
<MajorUpgrade DowngradeErrorMessage="已安装更新版本的云仓视频溯源软件,请先在「应用和功能」里卸载旧版本。" />
<MediaTemplate EmbedCab="yes" />
<!-- 安装目录:%LOCALAPPDATA%\Programs\YuncangTrace -->
<StandardDirectory Id="LocalAppDataFolder">
<Directory Id="ProgramsFolder" Name="Programs">
<Directory Id="INSTALLFOLDER" Name="YuncangTrace">
<!-- 运行库子目录:程序按 <exe目录>\native\HCNetSDK 查找 HCNetSDK.dll -->
<Directory Id="NativeFolder" Name="native" />
</Directory>
</Directory>
</StandardDirectory>
<!-- 开始菜单 -->
<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="AppMenuFolder" Name="云仓视频溯源软件" />
</StandardDirectory>
<Feature Id="Main" Title="云仓视频溯源软件" Level="1">
<ComponentGroupRef Id="AppComponents" />
<!-- 海康 HCNetSDK 运行库(native\HCNetSDK\**):取通道/取流必需,不能漏 -->
<ComponentGroupRef Id="NativeComponents" />
</Feature>
</Package>
<Fragment>
<ComponentGroup Id="AppComponents" Directory="INSTALLFOLDER">
<!-- 主程序(单文件自包含 exe) -->
<Component Id="MainExe" Guid="C779B513-9C6B-4BEC-A963-3AF1E53FEC30">
<File Id="MainExeFile"
Source="..\publish\YuncangTrace.LocalService.exe"
KeyPath="yes" />
</Component>
<!--
启动协议 yuncang://open?code=xxx
写 HKCU(perUser 安装):安装完成即可被浏览器唤起;
卸载时随组件一起删除,不会留下无效协议。
-->
<Component Id="Protocol" Guid="857877CC-C14C-4F17-A0C6-49D5852E0D2E">
<RegistryKey Root="HKCU" Key="Software\Classes\yuncang">
<RegistryValue Type="string" Value="URL:云仓视频溯源软件" KeyPath="yes" />
<RegistryValue Name="URL Protocol" Type="string" Value="" />
<RegistryKey Key="shell\open\command">
<RegistryValue Type="string"
Value="&quot;[INSTALLFOLDER]YuncangTrace.LocalService.exe&quot; &quot;%1&quot;" />
</RegistryKey>
</RegistryKey>
</Component>
<!-- 开始菜单快捷方式(卸载时连文件夹一起删) -->
<Component Id="StartMenuShortcut" Directory="AppMenuFolder" Guid="6CE6EE8C-98FD-475F-947B-E365EBA41569">
<Shortcut Id="AppShortcut"
Name="云仓视频溯源软件"
Description="本机打印与溯源服务(打开后最小化到托盘)"
Target="[INSTALLFOLDER]YuncangTrace.LocalService.exe"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="RemoveAppMenuFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\YuncangTrace\Install"
Name="StartMenuShortcut" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<!--
HCNetSDK / ffmpeg 运行库:递归收集 publish\native 下的所有文件(含 HCNetSDKCom 子目录),
保持目录结构装到 [INSTALLFOLDER]\native\...。
Files 的 ** 通配符会保留相对路径,因此 publish\native\HCNetSDK\a.dll → INSTALLFOLDER\native\HCNetSDK\a.dll。
-->
<Fragment>
<ComponentGroup Id="NativeComponents" Directory="NativeFolder">
<Files Include="..\publish\native\**" />
</ComponentGroup>
</Fragment>
</Wix>