Installer,Binary,source的区别

      我们在下载安装包的时候,会遇到同版本的不同类型下载版本,这不同版本应该怎么选择呢,我有遇到这种情况,因此记录下来:

   Installer版本(.msi  .pkg):它包含了所有必须文件和帮助文档等,执行exe文件通过弹出的指示即可以安装软件;
   Binary版本(.zip  .tar.gz):它是一个二进制包,里面包括了编译好的可以直接使用的程序,只需要把它解压缩到你想要安装的目录就马上可以使用;
   source版本 ( .tar.gz ):源代码包里面包括了原始的程序代码,需要在你的计算机上编译后才可以产生能运行的程序,所以从源代码安装的时间会比较长。

如图:(例如下载nodejs)

 

在Visual Studio Installer (MSI) 中,创建包含特定组件(如 Visual C++ 2015 和 2017)的离线安装包通常涉及使用`vstsdk`工具集。首先,你需要获取`vcredist_x64.exe`和`vcredist_x86.exe`文件,并将它们添加到源目录。然后,你可以通过以下步骤操作: 1. 打开命令提示符并导航至`vstsdk`安装目录,例如`C:\Program Files (x86)\Microsoft SDKs\Windows\v14.0A\Bootstrapper\Packages`。 2. 创建一个新的`WiX`项目,这将作为基础模板来生成安装包。运行如下命令: ``` msbuild /t:CreateNewProject /p:Name=MySetup.wixproj ``` 3. 修改`MySetup.wixproj`项目的XML配置,确保它引用了需要的.NET Framework和Visual C++ redistributables。你可以找到类似这样的条目: ```xml <Product Id="*" Name="My Product" Version="1.0.0.0" Language="1033" Manufacturer="Your Company"> <Package Id="*" Keywords="Installer" Description="My Product Setup" Comments="" InstallerVersion="100" Compressed="yes" InstallScope="perMachine" /> <Media Id="1" Cabinet="product.cab" EmbedCab="yes" /> <Feature Id="Full" Level="1"> <ComponentRef Id="NetFx45Redist" /> <ComponentRef Id="VC_redist" /> </Feature> </Product> ``` 其中`VC_redist`代表你的C++版本组件。 4. 添加`vcredist_x64.exe`和`vcredist_x86.exe`到安装包。在`.wxs`文件里,添加`CustomAction`元素来安装这些组件,例如: ```xml <Binary Id="vcredist_x64" SourceFile="[VSInstallDir]\[vc_redist].exe" /> <Binary Id="vcredist_x86" SourceFile="[VSInstallDir]\[vc_redist_x86].exe" /> <CustomAction Id="InstallVcRedists" BinaryKey="vcredist_x64" DllEntry="RunDLL32" Execute="deferred" Return="check" Impersonate="no" /> <CustomAction Id="InstallVcRedists_x86" BinaryKey="vcredist_x86" DllEntry="RunDLL32" Execute="deferred" Return="check" Impersonate="no" /> <InstallExecuteSequence> <!-- Add your VC Redistributable installation steps here --> <Custom Action='InstallVcRedists' After='CostFinalize' /> <Custom Action='InstallVcRedists_x86' After='InstallVcRedists' If='VersionNT64 = false' /> </InstallExecuteSequence> ``` 5. 使用` candle`和`light`命令构建离线安装包: ``` candle MySetup.wxs light -out:MySetup.msi MySetup.wixobj ``` 请注意,实际路径和组件名称(如`[vc_redist]`、`[vc_redist_x86]`等)需要替换为你下载的实际组件文件名和Visual Studio安装路径。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值