wix toolset将 cab 打包进msi
在***wxs中添加配置
<MediaTemplate EmbedCab="yes" />
下面是一个简单配置:(包含写注册表)
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="xyz" Language="1033" Version="1.0.0.0" Manufacturer="app" UpgradeCode="1eb8f796-3b8e-41d6-9951-9d70b8630e69"> <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> <MediaTemplate EmbedCab="yes" /> <Feature Id="ProductFeature" Title="xyz" Level="1"> <ComponentGroupRef Id="ProductComponents" /> <ComponentRef Id="RegistryEntry" /> </Feature> </Product> <Fragment> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLFOLDER" Name="xyz" /> </Directory> </Directory> </Fragment> <Fragment> <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> <!-- <Component Id="ProductComponent"> --> <!-- TODO: Insert files, registry keys, and other resources here. --> <!-- </Component> --> <Component Id="ProductComponent" Guid="0E5598EB-B3B8-4EF5-8E8A-78A7133B6D34"> <File Id="xyz.exe" Source="xyz.exe" /> <File Id="libxxx.dll" Source="libxxx.dll" /> <File Id="msvcp120.dll" Source="msvcp120.dll" /> <File Id="msvcr120.dll" Source="msvcr120.dll" /> <File Id="vccorlib120.dll" Source="vccorlib120.dll" /> <File Id="test.html" Source="test.html" /> <File Id="reg_test.reg" Source="reg_test.reg" /> </Component> </ComponentGroup> </Fragment> <Fragment> <DirectoryRef Id="TARGETDIR"> <Component Id="RegistryEntry" Guid="B0464DA0-31B9-4DD1-B058-8CD19D07612F"> <RegistryKey Root="HKCR" Key="xyz"> <RegistryValue Type="string" Value="xyz Protocol" /> <RegistryValue Type="string" Name="URL Protocol" Value="" /> </RegistryKey> <RegistryKey Root="HKCR" Key="xyz\DefaultIcon"> <RegistryValue Type="string" Value="[INSTALLFOLDER]xyz.exe,1" /> </RegistryKey> <RegistryKey Root="HKCR" Key="xyz\shell\open\command"> <RegistryValue Type="string" Value=""[INSTALLFOLDER]xyz.exe" "%1"" /> </RegistryKey> </Component> </DirectoryRef> </Fragment> </Wix>
踩坑之路多回顾,不要在一个坑掉两次!
THINK TWICE,CODE ONCE!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!