I have a wix Windows Installer for my C# application. Things are working, I am able to install and uninstall the application. But I have few Prerequisites and other 3rd party applications that I want to install with my application.
Prerequisites:
- Microsoft .NET Framework 4 (x86 and x64) - dotNetFx40_Full_x86_x64.exe
- SQL Server 2008 Express
- SQLEXPR_x64_ENU.EXE
- SQLEXPR32_x86_ENU.EXE
- SQL Server Compact 3.5 SP2
- SSCERuntime-ENU.msi
- SSCERuntime-ENU-x64.msi
3rd Party Application:
- TeamViewer - TeamViewer_Setup.exe
So of-course I am not looking for complete guidelines for all the Prerequisites and 3rd party applications. I just need you folks help on figuring out on how exactly I can embed these exe
and msi
setups to be a part of my wix
installation.
Also, some are for x64
and some are for x86
, so it should be capable enough to handle the OS version and architecture. How will this be accomplished with wix.
I have been searching on internet for a while now and nothing concrete seems to be working for me.
I need to make sure that if these applications are not installed then the software should also not install. Along with that if any of the prerequisite or 3rd party application is already installed then it should not install again.
I guess this can be done using some wix tools but I am not able to get any concrete instructions on howto.
EDIT 1
Ok I have got the Microsoft .NET Framework 4 (x86 and x64)
installed, and the problem which I am facing now is I am unable to install SQL Server Compact 3.5 SP2
. I am doing things one by one to make things more clear to me. Here under I am sharing my code so that you people can review:
<?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="Bootstrapper" Version="1.0.0.0" Manufacturer="Billy"
UpgradeCode="PUT-GUID-HERE">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<PackageGroupRef Id="Netfx4Full"/>
<PackageGroupRef Id="SQLExpressCE"/>
<!-- Install Application -->
<MsiPackage Id="MyApplication" SourceFile="$(var.Installer.TargetPath)"/>
</Chain>
</Bundle>
<Fragment>
<!-- Check for .NET 4.0 -->
<util:RegistrySearch Root="HKLM"
Key="SOFTWAREMicrosoftNet Framework SetupNDPv4Full"
Value="Version"
Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM"
Key="SOFTWAREMicrosoftNet Framework SetupNDPv4Full"
Value="Version"
Variable="Netfx4x64FullVersion"
Win64="yes" />
<!-- Install .NEt 4.0 -->
<PackageGroup Id="Netfx4Full">
<ExePackage Id="Netfx4Full"
DisplayName="Microsoft .NET Framework 4.0"
Compressed="no"
Cache="yes"
PerMachine="yes"
Permanent="yes"
Protocol="netfx4"
Vital="yes"
SourceFile=".prerequisitesdotNetFx40_Full_x86_x64.exe"
InstallCommand="/passive /norestart"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
<!-- Install SQL Server CE -->
<PackageGroup Id="SQLExpressCE">
<MsiPackage
Cache="no"
Compressed="no"
ForcePerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile=".prerequisitesSSCERuntime-ENU.msi"
InstallCondition="NOT VersionNT64 AND SqlInstance AND SqlServerInstalled AND SQLServer2008R2Installed" />
<MsiPackage
Cache="no"
Compressed="no"
ForcePerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile=".prerequisitesSSCERuntime-ENU-x64.msi"
InstallCondition="VersionNT64 AND NOT SqlInstance AND SqlServerInstalled AND SQLServer2008R2Installed" />
</PackageGroup>
</Fragment>
</Wix>
NOTE: The above code installs .NET Framework
, its not installing SQL Server Compact 3.5 SP2
EDIT -2
After Referring Tom Blodget
answer I have reached to this far, however I am unable to understand how to give the Install Command for my SQL Exe package and same for my MSI package. I have also gone through this answer https://stackoverflow.com/a/19010097/1182021 of Mr. Neil Sleightholm
but this one is for SQL 2012
, how can I do this same thing with SQL 2008 Server
and CE
(The conditions and steps)
<PackageGroup Id="SQLExpressCE">
<ExePackage
Cache="no"
Compressed="no"
Permanent="no"
Vital="yes"
InstallCommand="/QS /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITYNetwork Service" /SQLSYSADMINACCOUNTS="BUILTINADMINISTRATORS" /AGTSVCACCOUNT="NT AUTHORITYNetwork Service" /SECURITYMODE=SQL /SAPWD="wegamed""
SourceFile=".prerequisitesSQLEXPR32_x86_ENU.EXE"
DownloadUrl="http://download.microsoft.com/download/D/1/8/D1869DEC-2638-4854-81B7-0F37455F35EA/SQLEXPR_x86_ENU.exe"
InstallCondition="NOT SQLServer2008R2Installed AND NOT SQLServerInstalled" />
<ExePackage DetectCondition="VersionNT64"
Cache="no"
Compressed="no"
Permanent="no"
Vital="yes"
InstallCommand="/QS /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITYNetwork Service" /SQLSYSADMINACCOUNTS="BUILTINADMINISTRATORS" /AGTSVCACCOUNT="NT AUTHORITYNetwork Service" /SECURITYMODE=SQL /SAPWD="wegamed""
SourceFile=".prerequisitesSQLEXPR_x64_ENU.EXE"
DownloadUrl="http://download.microsoft.com/download/D/1/8/D1869DEC-2638-4854-81B7-0F37455F35EA/SQLEXPR_x86_ENU.exe"
InstallCondition="NOT SQLServer2008R2Installed AND NOT SQLServerInstalled" />
</PackageGroup>
But Setup is unable to complete. I guess it is because of the install commands as it works till accept licence agreement.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…