I have this bootstrap project that needs to detect if SQL Server is installed or not. If it is installed, then it skips the installing. If it is not, it should then installs SQL Express 2012. The exe installer was compiled fine, however, when I was testing the installer, I always got this error and I can't find any reason that is wrong. The machine I was testing on had the SQL server installed but it still detects no SQL installed. It then continue to install but it gets the Error 0x858c0014: Process returned error:
Failed to execute EXE package. Failed to configure per-machine EXE package.
Here is my wxs file:
<?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:dep="http://schemas.microsoft.com/wix/DependencyExtension">
<?define InstanceName = "SQLEXPRESS" ?>
<Bundle Name="EasyLobby11 Database Setup" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="4f09f7d9-f894-42b2-a865-6ae460a09c7e">
<BootstrapperApplicationRef
Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<PackageGroupRef Id="Sql2012Express"/>
</Chain>
</Bundle>
<Fragment>
<util:RegistrySearch
Id="SqlInstanceKeyFound"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
Value="InstanceName"
Result="exists"
Variable="SqlInstanceKeyFound" />
<util:RegistrySearch
Id="SqlInstanceKey"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
Value="InstanceName"
Variable="SqlInstanceKey"
After="SqlInstanceKeyFound"
Condition="SqlInstanceKeyFound" />
<util:RegistrySearch
Id="SqlInstanceFound"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SqlInstanceKey]"
Result="exists"
Variable="SqlInstanceFound"
After="SqlInstanceKey"
Condition="SqlInstanceKeyFound" />
<util:RegistrySearch
Id="SqlVersion"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SqlInstanceKey]\Setup"
Value="Version"
Variable="SqlVersion"
After="SqlInstanceKey"
Condition="SqlInstanceFound" />
<PackageGroup Id="Sql2012Express">
<ExePackage
Id="Sql2012Express"
DisplayName="Installing SQL Server Express 2012"
SourceFile="SQLEXPR_x86_ENU.exe"
Name="SQLEXPR_x86_ENU.exe"
DownloadUrl="http://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1- A1533227CD69/SQLEXPR_x86_ENU.exe "
Compressed="no"
PerMachine="yes"
Cache ="yes"
InstallCondition="(Not SqlInstanceKeyFound) AND (NOT SqlInstanceFound)"
DetectCondition= "SqlInstanceFound"
Vital="yes"
Permanent="yes"
InstallCommand="/ACTION=Install /INSTANCENAME=$(var.InstanceName) /FEATURES=SQL /SECURITYMODE=SQL [SqlVariable] /TCPENABLED=1 /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE'" /SQLSVCSTARTUPTYPE=Manual /SQLSYSADMINACCOUNTS=BUILTIN\Administrators /ADDCURRENTUSERASSQLADMIN=FALSE /Q /HIDECONSOLE /SkipRules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms"
UninstallCommand="/Action=Uninstall /INSTANCENAME=InstanceName /FEATURES=SQL /Q /HIDECONSOLE"
RepairCommand="/ACTION=Repair /INSTANCENAME=InstanceName /Q /HIDECONSOLE">
<ExitCode Value ="3010" Behavior="forceReboot" />
<dep:Provides DisplayName="Net2 SQL Server 2012 Express" Key="SQLServer2012Express,$(var.InstanceName)" Version="11.0.3000.0" />
</ExePackage>
<ExePackage Id="Sql2012ExpressUpgrade"
DisplayName="SQL Server 2012 Express Upgrade"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="yes"
Name="SQLEXPR_x86_ENU.exe"
SourceFile="SQLEXPR_x86_ENU.exe"
DownloadUrl="http://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x86_ENU.exe "
InstallCondition="(Not SqlInstanceKeyFound) AND (NOT SqlInstanceFound)"
InstallCommand="/ACTION=Upgrade /INSTANCENAME=InstanceName /Q /HIDECONSOLE /SkipRules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms"
DetectCondition="NOT (SqlInstanceFound AND (SqlVersion < v11.0.0.0))">
<ExitCode Value ="3010" Behavior="forceReboot" />
</ExePackage>
<ExePackage Id="Sql2012ExpressEditionUpgrade"
DisplayName="SQL Server 2012 SP1 Express Patch"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="yes"
Name="SQLEXPR_x86_ENU.exe"
SourceFile="SQLEXPR_x86_ENU.exe"
DownloadUrl="http://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x86_ENU.exe "
InstallCondition="(Not SqlInstanceKeyFound) AND (NOT SqlInstanceFound)"
InstallCommand="/ACTION=Patch /INSTANCENAME=$(var.InstanceName) /Q /HIDECONSOLE /SkipRules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms"
DetectCondition="NOT (SqlInstanceFound AND (SqlVersion > v11.0.0.0) AND (SqlVersion < v11.0.3000.0))">
<ExitCode Value ="3010" Behavior="forceReboot" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>
Configuring SQL is quite a complicated job.
I just started working on Wix Packaging recently for my project.
I actually took your configuration to start with and done a few tweaks to the configuration.
I am also handling x86 and x64 packaging based on system type.
You can omit any of them if they are not relevant to you.
Hence, I am publishing a working copy of my configuration, so that it might help you.
<Fragment>
<?define InstanceName = "SQLEXPRESS" ?>
<util:RegistrySearch Id="SQL2012x64InstanceExists"
Variable="SQL2012x64InstanceExists"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
Value="$(var.InstanceName)"
Win64="yes"
Result="exists"/>
<util:RegistrySearch Id="SQL2012x64InstanceKey"
Variable="SQL2012x64InstanceKey"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
Value="$(var.InstanceName)"
Win64="yes"
After="SQL2012x64InstanceExists"
Condition="SQL2012x64InstanceExists" />
<util:RegistrySearch Id="SQL2012x64InstanceInstalled"
Variable="SQL2012x64InstanceInstalled"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SQL2012x64InstanceKey]"
Result="exists"
Win64="yes"
After="SQL2012x64InstanceKey"
Condition="SQL2012x64InstanceExists" />
<util:RegistrySearch Id="SQLx64Version"
Variable="SQLx64Version"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SQL2012x64InstanceKey]\Setup"
Value="Version"
Win64="yes"
After="SQL2012x64InstanceKey"
Condition="SQL2012x64InstanceInstalled" />
<util:RegistrySearch Id="SQL2012x86InstanceExists"
Variable="SQL2012x86InstanceExists"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
Value="$(var.InstanceName)"
Win64="no"
Result="exists"/>
<util:RegistrySearch Id="SQL2012x86InstanceKey"
Variable="SQL2012x86InstanceKey"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
Value="$(var.InstanceName)"
Win64="no"
After="SQL2012x86InstanceExists"
Condition="SQL2012x86InstanceExists" />
<util:RegistrySearch Id="SQL2012x86InstanceInstalled"
Variable="SQL2012x86InstanceInstalled"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SQL2012x86InstanceKey]"
Result="exists"
Win64="no"
After="SQL2012x86InstanceKey"
Condition="SQL2012x86InstanceExists" />
<util:RegistrySearch Id="SQLx86Version"
Variable="SQLx86Version"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SQL2012x86InstanceKey]\Setup"
Value="Version"
Win64="no"
After="SQL2012x86InstanceKey"
Condition="SQL2012x86InstanceInstalled" />
<PackageGroup Id="SQLServer2012Express">
<ExePackage Id="SQL2012Expressx64"
InstallCondition="VersionNT64 AND NOT SQL2012x64InstanceInstalled"
SourceFile="$(var.MyDir)\SQLEXPR_x64_ENU.exe"
DisplayName="Installing Microsoft® SQL Server® 2012 - Express Edition..."
InstallCommand="/ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLENGINE /Q /HIDECONSOLE /SkipRules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms /SQLSVCSTARTUPTYPE=Automatic /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /ASSYSADMINACCOUNTS=BUILTIN\Administrators /SQLSYSADMINACCOUNTS=BUILTIN\Administrators /BROWSERSVCSTARTUPTYPE=Disabled /ADDCURRENTUSERASSQLADMIN=true /TCPENABLED=1"
Permanent="yes"/>
<ExePackage Id="SQL2012Updatex64"
InstallCondition="VersionNT64 AND (SQL2012x64InstanceInstalled AND SQLx64Version < v11.0.0.0)"
DisplayName="Upgrading SQL Server to SQL Server Express 2012..."
InstallCommand='/IACCEPTSQLSERVERLICENSETERMS /HIDECONSOLE /ACTION=Upgrade /QUIET=True /INSTANCENAME=SQLEXPRESS /SkipRules=RebootRequiredCheck'
SourceFile="$(var.MyDir)\SQLEXPR_x64_ENU.exe"
Permanent="yes"/>
<ExePackage Id="SQL2012Expressx86"
InstallCondition="NOT VersionNT64 AND NOT SQL2012x86InstanceInstalled"
SourceFile="$(var.MyDir)\SQLEXPR_x86_ENU.exe"
DisplayName="Installing Microsoft® SQL Server® 2012 - Express Edition..."
InstallCommand="/ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLENGINE /Q /HIDECONSOLE /SkipRules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms /SQLSVCSTARTUPTYPE=Automatic /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /ASSYSADMINACCOUNTS=BUILTIN\Administrators /SQLSYSADMINACCOUNTS=BUILTIN\Administrators /BROWSERSVCSTARTUPTYPE=Disabled /ADDCURRENTUSERASSQLADMIN=true /TCPENABLED=1"
Permanent="yes"/>
<ExePackage Id="SQL2012Updatex86"
InstallCondition="NOT VersionNT64 AND (SQL2012x86InstanceInstalled AND SQLx86Version < v11.0.0.0)"
DisplayName="Upgrading SQL Server to SQL Server Express 2012..."
InstallCommand='/IACCEPTSQLSERVERLICENSETERMS /HIDECONSOLE /ACTION=Upgrade /QUIET=True /INSTANCENAME=SQLEXPRESS /SkipRules=RebootRequiredCheck'
SourceFile="$(var.MyDir)\SQLEXPR_x86_ENU.exe"
Permanent="yes"/>
</PackageGroup>
Hope it helps you.
-- Naga Sreenivas Gupta V
Related
I'm somewhat new to Wix. I created a bootstrapper to check and install .NET version 4 framework if it doesn't exist. In my msi package, I'm using WixUI_minimal installer interface. When I run the bootstrapper.exe, the standard bootstrapper UI shows instead of the WixUI_minimal. Is there a way to have WixUI_minimal present and have .NET framework install in the background without showing the bootstrapper UI? What options do I have here? Any tips would be appreciated. Thanks.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="BootstrapperRedist" Version="1.0.0.0" Manufacturer="Testment Technologies" UpgradeCode="3f40cdd1-640d-4fe6-8edb-17a308d8f227">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<PackageGroupRef Id="NetFx40ClientRedist"/>
<MsiPackage Id="MyApplication" SourceFile="$(var.MicroSynSetupProject.TargetPath)"/>
</Chain>
</Bundle>
<Fragment>
<!-- Check for .NET 4.0 -->
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4x64FullVersion"
Win64="yes" />
<PackageGroup Id="Netfx4Full">
<ExePackage Id="Netfx4Full"
DisplayName="Microsoft .NET Framework 4.0"
DownloadUrl="http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe"
Compressed="no"
Cache="yes"
PerMachine="yes"
Permanent="yes"
Protocol="netfx4"
Vital="yes"
SourceFile=".\dotNetFx40_Full_x86_x64.exe"
InstallCommand="/passive /norestart"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
</Fragment>
</Wix>
I decided to change the bootstrapper application UI to include my license, a logo and a theme. This was done by including the WixBalExtension as a reference. This seems like the simplest way to go for the moment in having one unified install UI. The new bootstrapper listing is below.
<?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">
<!--Version="1.0.0.0"-->
<Bundle Name="BootstrapperRedist"
Version="!(bind.packageVersion.MicroSyn)"
UpgradeCode="3f40cdd1-640d-4fe6-8edb-17a308d8f227"
IconSourceFile=".\MS.ico">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication
LicenseFile=".\license.rtf"
ThemeFile=".\RtfTheme.xml"
LogoFile=".\MS_64x64.bmp"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx40ClientRedist"/>
<MsiPackage Id="MicroSyn"
SourceFile="$(var.MicroSynSetupProject.TargetPath)"
DisplayInternalUI="no"/>
</Chain>
</Bundle>
<Fragment>
<!-- Check for .NET 4.0 -->
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4x64FullVersion"
Win64="yes" />
<PackageGroup Id="Netfx4Full">
<ExePackage Id="Netfx4Full"
DisplayName="Microsoft .NET Framework 4.0"
DownloadUrl="http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe"
Compressed="no"
Cache="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile=".\dotNetFx40_Full_x86_x64.exe"
InstallCommand="/passive /norestart"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)"/>
</PackageGroup>
</Fragment>
</Wix>
On your MSI package you would need to set the attribute DisplaysInternalUI to Yes.
From the documentation:
Specifies whether the bundle will show the UI authored into the msi
package. The default is "no" which means all information is routed to
the bootstrapper application to provide a unified installation
experience. If "yes" is specified the UI authored into the msi package
will be displayed on top of any bootstrapper application UI.
http://wixtoolset.org/documentation/manual/v3/xsd/wix/msipackage.html
I have an application that requires .Net 4.0.3 (link).
I've found this article which tells me where I would find the version of .Net which is installed but all I can find is the list of included properties that the WiX compiler recognises (here).
I've tried following the directions in this article, which tells me to use the following code, but this just installs .Net 4 without the update:
<PropertyRef Id="NETFRAMEWORK40FULL"/>
<Condition Message="This application requires .NET Framework 4.0.3. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK40FULL]]>
</Condition>
How would I go about making WiX check for the specific 4.0.3 update, either through a pre-defined WiX property or checking the registry value myself?
After some reading, I ended up adding a bundle project to my solution that references my main Product in the standard WiX installer project (MyProject.Installer). I then used a RegistrySearch to find the version of the full .Net 4 installation.
<Bundle ....>
<Chain>
<PackageGroupRef Id="Netfx4Full" />
<PackageGroupRef Id="Netfx403Update" />
<MsiPackage Id="MyMsi" SourceFile="$(var.MyProject.Installer.TargetPath)" Compressed="yes" DisplayInternalUI="yes" />
</Chain>
</Bundle>
<Fragment>
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4x64FullVersion"
Win64="yes" />
<PackageGroup Id="Netfx4Full">
<ExePackage Id="Netfx4Full"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="$(var.ProjectDir)dotNetFx40_Full_x86_x64.exe"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
<PackageGroup Id="Netfx403Update">
<ExePackage Id="Netfx403Update"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="$(var.ProjectDir)NDP40-KB2600211-x86-x64.exe"
DetectCondition="Netfx4FullVersion AND (Netfx4FullVersion << "4.0.3" OR Netfx4FullVersion << "4.5")" />
</PackageGroup>
</Fragment>
The condition expands out to Netfx4FullVersion AND (Netfx4FullVersion << "4.0.3" OR Netfx4FullVersion << "4.5") without XML escaping.
The following articles were helpful:
Bundle skeleton code
Bundle package manifest
Defining searches using WiX variables
Chaining packages into a bundle
How to check for .Net versions
Version value within the registry key "SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" will be always 4.0.30319 for .net 4.0 (even if updates have been installed).
Here is the code I have used in my bundle to search if the .net 4.0.3 version was already installed:
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3"
Result="exists"
Variable="Netfx403" />
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3"
Result="exists"
Variable="Netfx403x64"
Win64="yes" />
Then in your ExePackage DetectCondition:
DetectCondition="Netfx403 AND (NOT VersionNT64 OR Netfx403x64)"
i have done a project for outlook add-ins. then i used WIX to create a setup file for this add-ins. But we need resolve the dependencies too, so i made a bootstrappper project using wix, which first check for the dependencies and then install add-ins using the setup file. it works good.
Problem
is there any way to merge these two setup project into single project. ?
here is my code for bootstrapper.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="OutlookReport" Version="1.0.0.0" Manufacturer="Tzunami" UpgradeCode="93597211-ba8c-44f0-9f73-18e7afc47d85">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication LicenseFile="Resource\\EULA.rtf" LogoFile="Resource\\TzunamiLogo.png"
SuppressOptionsUI="yes"/>
</BootstrapperApplicationRef>
<util:ComponentSearch Id="SearchOutlook2010" Guid="CFF13DD8-6EF2-49EB-B265-E3BFC6501C1D" Variable="Outlook2010"/>
<util:ComponentSearch Id="SearchOutlook2010PIA" Guid="1D844339-3DAE-413E-BC13-62D6A52816B2" Variable="Outlook2010PIA"/>
<util:ComponentSearch Id="SearchOutlook2013" Guid="F9F828D5-9F0B-46F9-9E3E-9C59F3C5E136" Variable="Outlook2013"/>
<bal:Condition Message="This Setup need Outlook 2010 or 2013 to be installed">
Outlook2010 OR Outlook2010PIA OR Outlook2013
</bal:Condition>
<util:RegistrySearch Id="VSTORuntimeTest" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="VSTORFeature_CLR40" Variable="VSTORFeature"/>
<util:RegistrySearch Id="VSTORuntimeVersionV4R" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="Version" Variable="VSTORVersionV4R"/>
<util:RegistrySearch Id="VSTORuntimeVersionV4" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="Version" Variable="VSTORVersionV4"/>
<Chain>
<PackageGroupRef Id="NetFx40Web"/>
<ExePackage Id="Downloading_Microsoft_VSTORuntime" SourceFile="Resource\\vstor_redist.exe" Permanent="yes" Vital="yes" Cache="no" Compressed="no"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917"
PerMachine="yes"
InstallCommand="/q /norestart"
DetectCondition="VSTORFeature"
InstallCondition="NOT VSTORFeature OR NOT (VSTORVersionV4R >=v10.0.40303) OR NOT (VSTORVersionV4 >=v10.0.21022)" />
<MsiPackage SourceFile="$(var.SetupOutlookReports.TargetPath)" Vital="yes" Compressed="yes" Id="OutlookReports" />
</Chain>
</Bundle>
</Wix>
You can chain in one bootstrapper inside other. Just modify Compressed="no" to Compressed="yes" in your exepackage, This will embed it in current project.
I am using WiX v3.7
There I have created my own Bootstrapper. Now, I am able to install .NET Framework 4 when it is not installed.
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion" Win64="yes" />
<PackageGroup Id="Netfx4Full">
<ExePackage Id="Netfx4Full" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
SourceFile="..\..\Lib\DotNetFX40\dotNetFx40_Full_x86_x64.exe"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
Now, my application needs .NET Framework 4.0.2. How can I test and install this if it is not available with WiX?
On which way can I test this? - and what does I have to do to install it?
Thanks for your help.
The 4.0.2 update looks to be just another executable. Chain it after your Netfx4Full. You will need to provide all the detection and URL logic for the new 4.0.2 executable
<?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="IPDev" Version="0.6" Manufacturer="MYAPP 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>
<!--checking for matlab 2012a installation-->
<util:RegistrySearch Id="MatlabPath"
Variable="UniqueId"
Root="HKLM"
Key="SOFTWARE\MathWorks\MATLAB\4.17\"
Result="exists"
Win64="yes"
/>
<!--checking for matlab MCR 2012a 64 bit installation-->
<util:RegistrySearch Id="MatlabMCRPath"
Variable="UniqueId"
Root="HKLM"
Key="SOFTWARE\MathWorks\MATLAB Compiler Runtime\7.17\"
Result="exists"
Win64="yes"
/>
<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) OR (NOT MatlabMCRPath)"/>
<MsiPackage Id="IPDev" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="..\SetupProject\bin\Release\IPDevSetup.msi"/>
</PackageGroup>
</Fragment>
</Wix>
here's my code:
my problem is that .NET4.5 is installed only if it exists.
however MATLAB's MCR is installed whether it exists or not.
can you please tell me what's wrong with my condition:
InstallCondition="(NOT MatlabPath) AND (NOT MatlabMCRPath)"
fix after Rob's answer:
DetectCondition="MatlabMCRPathExists OR MatlabPathExists"
this condition should be false in order to install
Here is my final and working code:
this code check's for .NET 4.5 installation.
and for Matlab R2012a or Matlab MCR R2012a.
<?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="IPDev" Version="0.6" Manufacturer="Intel 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>
<!--checking for matlab 2012a installation-->
<util:RegistrySearch Id="MatlabPath"
Variable="MatlabPathExists"
Root="HKLM"
Key="SOFTWARE\MathWorks\MATLAB\4.17"
Result="exists"
Win64="yes" />
<!--checking for matlab MCR 2012a 64 bit installation-->
<util:RegistrySearch Id="MatlabMCRPath"
Variable="MatlabMCRPathExists"
Root="HKLM"
Key="SOFTWARE\MathWorks\MATLAB Compiler Runtime\7.17"
Result="exists"
Win64="yes" />
<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"
DetectCondition="MatlabMCRPathExists OR MatlabPathExists"/>
<MsiPackage Id="IPDev" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="..\SetupProject\bin\Release\IPDevSetup.msi"/>
</PackageGroup>
</Fragment>
</Wix>
The InstallCondition attribute is used to determine whether a package should be installed on the machine. If true, the package is allowed to install. If false, the package is uninstalled. What you want is a DetectCondition attribute to determine whether the package is already present on the machine.
The fix is probably just to change the Matlab ExePackage/#InstallCondition to a ExePackage/#DetectCondition.
You can correct your RegistrySearch call like below:
<!--checking for matlab 2012a installation-->
<util:RegistrySearch Id="MatlabPath"
Variable="MatlabPathExists"
Root="HKLM"
Key="SOFTWARE\MathWorks\MATLAB\4.17\"
Result="exists"/>
<!--checking for matlab MCR 2012a 64 bit installation-->
<util:RegistrySearch Id="MatlabMCRPath"
Variable="MatlabMCRPathExists"
Root="HKLM"
Key="SOFTWARE\MathWworks\MATLAB Compiler Runtime\7.17\"
Result="exists"/>
<PackageGroup Id="Netfx45FullPackage">
This search sets the search result to the variable MatlabPathExists and MatlabMCRPathExists.
Then your condition check should be like following using those variables:
DetectCondition="(NOT MatlabPathExists) OR (NOT MatlabMCRPathExists)"