0
我想在我的MSI安裝程序中包含VC++ Redistributable 2013先決條件安裝。WiX - 如何將ExePackage元素鏈接到產品
我已經修改了Fragment
寫this guy執行註冊表檢查後,悄悄地下載和安裝,選擇vcredist_x64.exe包(文件 - MyWixProject/vcredist.wixobj):
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define vcredist_x86="http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe"?>
<Fragment>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" Value="Install" Variable="vcredist" />
<PackageGroup Id="vcredist">
<PackageGroupRef Id="InstallVCRedist"/>
<ExePackage Id="vcredist_x86"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="yes"
Name="Redist\vcredist_x86.exe"
SourceFile="Redist\vcredist_x86.exe"
DownloadUrl="$(var.vcredist_x86)"
InstallCommand="/q"
DetectCondition="vcredist AND (vcredist >= 1)">
<ExitCode Value ="3010" Behavior="forceReboot" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>
我想引用此Fragment
來自我的Product
元素(文件MyWixProject/Product.wxs)。我讀到「The contents of a Fragment element can be linked into a product by utilizing one of the many *Ref elements」。但是,ExePackage
或其PackageGroupRef
如何能夠從主要Product
元素引用?或者是有另一種方式從.wxs
Product
?>
那麼,我應該創建一個運行VC++可再發行的Bundle,然後是我的Package? – Elist
對。如果您有多個軟件包,則需要軟件包。 –
或者您可以將C++ redist作爲合併模塊添加:http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_vcredist.html –