Reputation: 6595
Is there tutorial for creating a WiX installer, that can check if MCR is already installed and if not can install it?
I'm working with Visual Studio 2012.
Upvotes: 1
Views: 320
Reputation: 6595
Here's my solution for MCR 2012a and .NET 4.5 please comment if there is a better way to do it: this is for documentation
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:netfx='http://schemas.microsoft.com/wix/NetFxExtension'>
<Bundle Name="MYAPP"
Version="0.6"
Manufacturer="MY Corporation"
UpgradeCode="f380ae43-5df1-4cfe-9297-526e3e638e57">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<!-- TODO: Define the list of chained packages. -->
<PackageGroupRef
Id="Netfx45FullPackage"/>
</Chain>
</Bundle>
<Fragment>
<util:RegistrySearch
Id="MatlabPath"
Variable="UniqueId"
Root="HKLM"
Key="SOFTWARE\Matworks\MATLAB\4.17\"
Result="exists"/>
<PackageGroup Id="Netfx45FullPackage">
<ExePackage
Id="Netfx45Xxx"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="no"
InstallCommand="/q"
SourceFile="..\SetupProject\dotnetfx45_full_x86_x64.exe"
DetectCondition="(Netfx4FullVersion="4.5.50709") AND (NOT VersionNT64 OR (Netfx4x64FullVersion="4.5.50709"))"
InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion="4.5.50709" OR Netfx4x64FullVersion="4.5.50709"))"/>
<ExePackage
Id="MatlabMCR2012a64"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="no"
InstallCommand="/q"
SourceFile="..\SetupProject\MCR_R2012a_win64_installer.exe"
InstallCondition="(NOT MatlabPath)"/>
<MsiPackage
Id="MYAPP"
Cache="no"
Compressed="no"
Vital="yes"
SourceFile="..\SetupProject\bin\Release\MYAPPSetup.msi"/>
</PackageGroup>
</Fragment>
</Wix>
Upvotes: 1