Windows 从Wix安装.NET Framework
我正在使用WiX工具集v3.7和Visual Studio 2013为Excel插件创建安装程序包 该插件依赖于.NETFramework4.5,我希望安装程序自动检测目标计算机上是否存在所需的框架,如果不存在,请安装它 谷歌搜索让我进入了这个页面:,但是该页面上关于如何创建捆绑包的说明的链接被破坏了 我尝试将该元素添加到我的根元素,但最终出现错误。我还尝试了一些在web上找到的示例,但它们似乎都不能与VS2013项目创建期间为我生成的默认WiX清单正常工作 我需要向清单中添加什么才能自动安装.NET Framework 4.5 我将非常感谢这里的任何帮助!我的舱单如下所示:Windows 从Wix安装.NET Framework,windows,wix,installation,Windows,Wix,Installation,我正在使用WiX工具集v3.7和Visual Studio 2013为Excel插件创建安装程序包 该插件依赖于.NETFramework4.5,我希望安装程序自动检测目标计算机上是否存在所需的框架,如果不存在,请安装它 谷歌搜索让我进入了这个页面:,但是该页面上关于如何创建捆绑包的说明的链接被破坏了 我尝试将该元素添加到我的根元素,但最终出现错误。我还尝试了一些在web上找到的示例,但它们似乎都不能与VS2013项目创建期间为我生成的默认WiX清单正常工作 我需要向清单中添加什么才能自动安装.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Awesome Excel Add-in 1.0" Language="1033" Version="1.0" Manufacturer="Farhan Ahmed" UpgradeCode="7ffd5a6d-d38e-4d6b-b554-098d95791222">
<Package Description="Awesome Excel Add-in Installer" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Condition Message="You need to be an administrator to install this product.">
Privileged
</Condition>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="AwesomeExcelSetup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<CustomAction Id='LaunchInstallerFile' FileKey='fAddinInstaller' ExeCommand='/I /64' Return='asyncWait' />
<CustomAction Id='LaunchRemoverFile' FileKey='fAddinInstaller' ExeCommand='/U' Return='check' />
<InstallExecuteSequence>
<Custom Action='LaunchInstallerFile' After='InstallFinalize'>NOT Installed</Custom>
<Custom Action='LaunchRemoverFile' Before='RemoveFiles'>Installed AND NOT REINSTALL</Custom>
</InstallExecuteSequence>
<UI>
<UIRef Id="WixUI_Minimal" />
</UI>
<Icon Id="icon.ico" SourceFile="$(var.AwesomeExcelAddin.TargetDir)\Awesome.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="INSTALLPARENT" Name="Awesome" >
<Directory Id="INSTALLFOLDER" Name="Excel Add-in 1.0" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent" Guid="DDD3F332-0DF1-47F0-B8D0-5E1E09BF69BE">
<File Id="f32bitXLL" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeAddinPacked32.xll" />
<File Id="f64bitXLL" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeAddinPacked64.xll" />
<File Id="fAddinDll" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeExcelAddin.dll" />
<File Id="fAddinInstaller" Source="$(var.AwesomeExcelAddinInstaller.TargetDir)\AwesomeExcelAddinInstaller.exe" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
有特权的
未安装
已安装但未重新安装
多亏了网方的评论,我才得以前进
就像他(她?)提到的,诀窍是为引导程序创建另一个项目,然后在清单中引用.NET Fx和MSI
尽管我确实遇到了“环境变量未定义”的问题,但我还是能够通过使用解决方案目录作为基础指定源文件来解决这个问题
这是新的清单:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Awesome Excel Plugin Setup" Version="1.0.0.0" Manufacturer="Awesome Software" UpgradeCode="1f605e3b-2954-403c-b9cb-ca1f0e8bf65b">
<WixVariable Id="WixStdbaLogo" Value="Logo.png" />
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<WixVariable Id="WixStdbaLicenseRtf" Value="License.rtf" />
<Chain>
<PackageGroupRef Id="NetFx45Redist"/>
<MsiPackage Id="AwesomeExcelSetupMSI"
SourceFile="$(var.SolutionDir)\AwesomeExcelSetup\bin\release\AwesomeExcelSetup.msi"
Vital="yes"
Compressed="yes"/>
</Chain>
</Bundle>
</Wix>
没错,一些URL缺少/manual-wix3
,例如。您需要为此创建两个wix项目,一个用于插件,另一个用于捆绑包(将使用burn)。另外,protip:每个组件使用一个文件,这样在遵循组件规则时就省去了很多麻烦。