How to build a bundle without embedding the other installers? - wix

This works for me
<ExePackage Id="Netfx35"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
InstallCommand="/q /norestart /lang:ENU"
RepairCommand="/q /norestart /lang:ENU"
UninstallCommand="/q /norestart /lang:ENU"
DetectCondition="DotNetFramework35SPInstallRegValue"
SourceFile="embed\DotNetFX35SP1\dotnetfx35.exe" />
But it embeds the .NET installer into the bundle package. I want to keep it as a separate file. I'm trying to use the Payload tag, but I don't know if it will work.

Replace Compressed="yes" with Compressed="no" on your Bundle authoring.

You need to make use of the Container element:
Type attribute:
Indicates whether the container is "attached" to the bundle executable
or placed external to the bundle executable as "detached". If this
attribute is not specified, the default is to create a detached
container.

Related

Wix bootstrapper and trying to install an exe that has multiple files

I am trying to get Wix to install https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers.zip
It is basically an exe that has multiple files and folders that are required for the installation to work.
I have added this this to Bundle.wxs in the Bootstrapper.
<Fragment>
<PackageGroup Id="WindowsCP210xVCPInstallerx64" >
<ExePackage
Id="WindowsCP210xVCPInstallerx64"
Name="$(var.PackagePath)\CP210xVCPInstaller_x64.exe"
DisplayName="CP210x USB to UART Bridge Virtual COM Port (VCP) drivers"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
InstallCondition="VersionNT64"
InstallCommand="/Q /SW /SE"
RepairCommand="/Q /SW /SE"
UninstallCommand="/U $(var.PackagePath)\CP210x_VCP_Windows\slabvcp.inf /Q"
SourceFile="CP210xVCPInstaller_x64.exe">
</ExePackage>
</PackageGroup>
</Fragment>
However when building I keep getting this error
The system cannot find the file 'CP210xVCPInstaller_x64.exe'.
At present I have just added the entire folder that contains the CP210xVCPInstaller_x64.exe and all the other files it depends on into the project.

.NET 4.5.2 conditions in a Wix bundle

I'm working on a Wix project to learn more about Wix. I'm trying to configure my Wix bundle to detect and install .NET 4.5.2 but I'm a little confused. I've seen a lot of examples where the registry is checked but I wanted to know if I can do something like this:
<Chain>
<PackageGroupRef Id="NetFx452Redist" />
<ExePackage Id="Netfx452"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
InstallCommand="/q /norestart"
SourceFile="$(var.ProjectDir)Resources\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
DetectCondition="NetFx452"
InstallCondition="NOT NetFx452" />
<MsiPackage Id="ShittyMsi"
SourceFile="$(var.MyInstaller.TargetDir)"
Name="$(var.MyInstaller.TargetFileName)" />
</Chain>
If I can't do this and I need to check the registry, how do I know what I need to be looking for in the registry?
You're already using <PackageGroupRef Id="NetFx452Redist" /> so you don't need to check the registry; the package group already takes care of checking the registry and setting the right attributes.

SQL Express 2014 instance not removed on uninstall

I am trying to set up an installation, with sql express 2014 as a prerequisite. The installation itself works fine, but when uninstalling, the instance is not removed. I can still access it through my sql manager and find it in the registry.
This is my Chain:
<Chain>
<ExePackage
Id="Netfx4Full"
Name="dotNetFx40_Full_x86_x64.exe"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="packages\dotNetFx40_Full_x86_x64.exe"
DownloadUrl="https://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe"
DetectCondition="Net4FullVersion AND (NOT VersionNT64 OR Net4x64FullVersion)"
InstallCondition="(VersionNT < v6.0 OR VersionNT64 < v6.0) AND (NOT (Net4FullVersion OR Net4x64FullVersion))">
</ExePackage>
<PackageGroupRef Id="Sql2014Express"/>
<RollbackBoundary />
<MsiPackage Id="MainPackage" SourceFile="MyApplication.msi" DisplayInternalUI="yes" Compressed="yes" Vital="yes" />
</Chain>
This is my ExePackage:
<PackageGroup Id="Sql2014Express">
<ExePackage Id="SQL2014Expressx64"
InstallCondition="VersionNT64 AND NOT SQL2014x64InstanceInstalled"
SourceFile="packages\SQLEXPR_x64_ENU.exe"
DownloadUrl="$(var.SqlWebLink64)"
DisplayName="Installing Microsoft SQL Express 2014"
InstallCommand="/ACTION=Install /INSTANCENAME=$(var.InstanceName) /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"
UninstallCommand="/Action=Uninstall /INSTANCENAME=$(var.InstanceName) /FEATURES=SQLENGINE /Q /HIDECONSOLE"
Cache="yes"
Vital="yes"
Compressed="no"
PerMachine="yes"
Permanent="no"/>
...
</PackageGroup>
From what i understand, the Permanent="no", should take care of removing the package on uninstall. I have even included and UninstallCommand, but this does not remove the instance either.
What am I missing here?
Let me know if any other info is required to solve this. - Thx!
Exe packages require a DetectCondition to be able to verify whether or not the package is installed. If you notice in your .net exepackage you have
DetectCondition="Net4FullVersion AND (NOT VersionNT64 OR Net4x64FullVersion)"
This tells the installer that this package is installed iff the condition is true. You have to do the same thing in your SQL exe package.
DetectCondition is
A condition that determines if the package is present on the target system. This condition can use built-in variables and variables returned by searches. This condition is necessary because Windows doesn't provide a method to detect the presence of an ExePackage. Burn uses this condition to determine how to treat this package during a bundle action; for example, if this condition is false or omitted and the bundle is being installed, Burn will install this package.
You can do this by creating some registry searches which set some variables. Try this registry search
<util:RegistrySearch
Id='MicrosoftSQLInstalledCheck'
Root='HKLM'
Key='SOFTWARE\Microsoft\Microsoft SQL Server\$(var.InstanceName)\Setup'
Win64='yes'
Value='SQLPath'
Result='exists'
Variable='MicrosoftSQLInstalled'/>
Then in your ExePackage for SQL you can put DetectCondition="MicrosoftSQLInstalled" and that will be true if the registry search found the SQLPath registry entry in the key specified.

is it possible to automatically download Prerequisites using wix bootstrapper

I have created a setup using wix and have even created customized dialogs too.Now i need mySetup to auto download the Prerequisites for my application.Seems it can be done through bootstrapper only.I have even created a bootstrapper file too,but I don't want to attach Prerequisites setup (ie) .exe files in bootstrapper for installing the Prerequisites .Instead i need to download the directly from web and need to install automatically when my setup runs.
is it possible with wix ?? Am new to wix and if its possible please share me some source ??
Thanks in Advance
Simply use SourceFile to avoid any inconvenience.
<ExePackage
Id="InstallJava"
DetectCondition='NOT Installed AND JAVACURRENTVERSION>="1.6"'
InstallCondition='NOT VersionNT64'
SourceFile="..\dep\jre-7u55-windows-i586.exe"
InstallCommand='/s'
Compressed="no"
Permanent="yes"
PerMachine="yes"
Vital="no"
DownloadUrl="http://javadl.sun.com/webapps/download/AutoDL?BundleId=86895"
/>
Download the prereq.exe and use SourceFile attribute to refer it. WiX will automatically calculate the Hashcode, etc.
But if you are more inclined toward using RemotePayLoad then use heat.exe to harvest this data.
<wix-folder>/bin/heat payload d:\prereq.exe -out d:\remote.xml
EXEPACKAGE - you can make use of the DownloadUrl attribute.
DownloadUrl - The URL to use to download the package. The following
substitutions are supported: {0} is replaced by the package Id. {1} is
replaced by the payload Id. {2} is replaced by the payload file name.
RemotePayload - Describes information about a remote file payload
that is not available at the time of building the bundle. The parent
must specify DownloadUrl and must not specify SourceFile when using
this element.
For example:
<PackageGroup
Id="Netfx4Full">
<ExePackage
Id="Netfx4Full"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="yes"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193/dotNetFx40_Full_x86_x64.exe" >
<RemotePayload
ProductName="dotNetFx40_Full_x86_x64.exe"
Description="Dotnet 4.0"
Size="3961856"
Version="4.0.5022.0" />
</ExePackage>
</PackageGroup>

Referencing a compressed payload for the managed bootstrapper application prerequisite eula

I'm building a setup bundle which needs to work in a non-internet connected environment, so I am including the .NET 4.0 framework installer, and its corresponding eula in the bundle. I copied the source from wix37-sources\src\ext\NetFxExtension\wixlib\NetFx4.wxs but with some modifications so that the package is compressed instead of a remote payload.
However, I haven't been able to figure out how to make the eula link load the payload from the bundle. I always get:
[0930:0BDC][2013-08-22T16:02:37]e000: Error 0x80070002: Failed to launch URL to EULA.
Here's the wix source:
<!-- Referencing the NetFx40Full package will cause these WixVariables to be defined -->
<!-- which indicates to the bootstrapper engine what the MBA dependency is -->
<WixVariable Id="WixMbaPrereqPackageId" Value="NetFx40Full"/>
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetFX_4_all_FINAL_RTM.rtf"/>
<PackageGroup Id="NetFx40Full">
<ExePackage
Id="NetFx40Full"
InstallCommand="/q /norestart /ChainingPackage "[WixBundleName]""
RepairCommand="/q /norestart /repair /ChainingPackage "[WixBundleName]""
UninstallCommand="/uninstall /q /norestart /ChainingPackage "[WixBundleName]""
PerMachine="yes"
DetectCondition="NETFRAMEWORK40"
Vital="yes"
Permanent="yes"
Protocol="netfx4"
SourceFile="$(var.SourceRoot)\Deployment\Packages\.NET Framework 4.0\dotNetFx40_Full_x86_x64.exe"
Compressed="yes">
<Payload SourceFile="$(var.SourceRoot)\Deployment\Packages\.NET Framework 4.0\NetFX_4_all_FINAL_RTM.rtf"
Compressed="yes"/>
</ExePackage>
</PackageGroup>
Is this actually possible?