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

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.

Related

Wix bootstrapper webinstaller does not download msi-file

In my bootstrapper I want to install one package as a webinstallation. Therefore I added the following MsiPackage to the Bundle´s Chain
<MsiPackage DisplayInternalUI="yes" Visible="yes" Id="NodeJs"
Compressed="no"
ForcePerMachine="yes"
SourceFile="node-v0.10.32-x86.msi"
DownloadUrl="https://nodejs.org/dist/v0.10.32/node-v0.10.32-x86.msi">
<MsiProperty Name="INSTALLFOLDER" Value="[Global_InstallFolder]\NodeJs" />
However, the installation only works as expected when the to-download-msi-file is in the same directory as the bootstrapper-exe.
In other words, it does not download the msi-file.
What am I doing wrong?

Web download of vcruntime140 with wix burn

I want to use the WiX bootstrapper burn to automatically download and install the vcruntime140 package (Visual C++ Redistributable for Visual Studio 2015) if it is required.
It's trivially easy to do this for the .NET frameworks:
<Chain>
<PackageGroupRef Id="NetFx452Web"/>
...
</Chain>
but I can't find an equivalent for the vcruntime packages. (Is that because there isn't one, or am I just typing the wrong keywords into Google?)
Just to be clear: I do not want to include the package with my installer. It must be a web download.
There is no PackageGroupRef for the redist as for .net.
But there is 3 other options:
Add a redist exe in your chain. (Not good for you)
Use a redist c++ merge module inside one of your msi's.
Try to write your own web download as .net does. Here is a sample of the .net web download. The full file can be found in the source code of wix by the name "NetFx46.wxs"
<Fragment>
<PropertyRef Id="WIXNETFX4RELEASEINSTALLED" />
<Property Id="WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED" Secure="yes" />
<SetProperty Id="WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED" Value="1" After="AppSearch">
WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx46MinRelease)"
</SetProperty>
</Fragment>
<Fragment>
<util:RegistrySearchRef Id="NETFRAMEWORK45"/>
<WixVariable Id="WixMbaPrereqPackageId" Value="NetFx46Web" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="http://go.microsoft.com/fwlink/?LinkID=558772" />
<WixVariable Id="NetFx46WebDetectCondition" Value="NETFRAMEWORK45 >= $(var.NetFx46MinRelease)" Overridable="yes" />
<WixVariable Id="NetFx46WebInstallCondition" Value="" Overridable="yes" />
<WixVariable Id="NetFx46WebPackageDirectory" Value="redist\" Overridable="yes" />
<PackageGroup Id="NetFx46Web">
<ExePackage
InstallCommand="/q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx46FullLog].html""
RepairCommand="/q /norestart /repair /ChainingPackage "[WixBundleName]" /log "[NetFx46FullLog].html""
UninstallCommand="/uninstall /q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx46FullLog].html""
PerMachine="yes"
DetectCondition="!(wix.NetFx46WebDetectCondition)"
InstallCondition="!(wix.NetFx46WebInstallCondition)"
Id="NetFx46Web"
Vital="yes"
Permanent="yes"
Protocol="netfx4"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=560371"
LogPathVariable="NetFx46FullLog"
Compressed="no"
Name="!(wix.NetFx46WebPackageDirectory)NDP46-KB3045557-x86-x64-AllOS-ENU.exe">
<RemotePayload
CertificatePublicKey="52868DFCA6E3AF2632389E6C1EE7D0468D3797D0"
CertificateThumbprint="3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"
Description="Microsoft .NET Framework 4.6 Setup"
Hash="480CA134B9E3F2437DF10719D5A8C77DDEC0A4F1"
ProductName="Microsoft .NET Framework 4.6"
Size="1497400"
Version="4.6.81.0" />
</ExePackage>
</PackageGroup>
Just for the record, here's my final solution.
Right-click on the bootstrapper project References in Visual Studio and add a reference to WixUtilExtension.
Add xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" as an attribute to the top level Wix element.
Add to the <Chain> element:
<PackageGroupRef Id="vcredist_vc140"/>
Add as a child of the <Wix> element:
<Fragment>
<!-- vcredist 2015 x86 -->
<util:ProductSearch
Id="VCREDIST_140_x86"
UpgradeCode="65E5BD06-6392-3027-8C26-853107D3CF1A"
Result="version"
Variable="VCREDIST_140_x86"/>
<PackageGroup Id="vcredist_vc140">
<ExePackage
Id="vc140"
Cache="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
Compressed="no"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkID=615459"
Name="vcredist_vc140"
InstallCommand="/quiet /norestart"
DetectCondition="(VCREIST_140_x86 >= v14.0.24215)">
<RemotePayload
Description="Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24215"
ProductName="Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24215"
Size="14456872"
Version="14.0.24215.1"
Hash="72211BD2E7DFC91EA7C8FAC549C49C0543BA791B" />
</ExePackage>
</PackageGroup>
</Fragment>
UpgradeCode came from this answer and is specific to v14.0.24215 of the vcredist installer. This is how the bootstrapper decides whether it is already installed.
Compressed="no" tells the installer not to include the file in the installer itself (since we want to download it from the web).
DownloadUrl is a direct URL to the downloadable installer from this answer.
RemotePayload Description is the text of the installer's Description resource and likewise ProductName. (It appears that the text does not have to match the text in the resources. ProductName is the description shown in the bootstrapper's progress dialog.)
Size is the size in bytes.
Hash is found with the Powershell command get-filehash -algorithm SHA1 .\vc_redist.x86.exe.
I hope this helps someone.

.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.

How to add a dependent folder for a Wix burn bootstrapper exepackage

I am new to Wix burn bootstrapper so pardon my ignorance.I have a requirement where i need to install a pre-requisite using burn bootstrapper.
The prerequisite is a setup.exe(third-party) which has dependency on files and a folder(containing couple of files).All these need to exists in the root of setup.exe for the setup.exe to run successfully.
example structure--
setup.exe
samplefile.rsp
files(this is a folder which contains files needed by setup.exe)
Data1.cab
Clientruntime.msi
anotherfile
Here is what i got so far.
<ExePackage Id="Ingres_Client"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="setup.exe"
InstallCommand="/r sampleCR.rsp"
InstallCondition="(VersionNT > v5.1 OR VersionNT64 > v5.1)"
DetectCondition="Ingres">
</ExePackage>
I tried to include the nesessary files using PayLoad.But i cant figure out how to add a folder('files' folder) as it is as a requirement for the setup.exe
Any help is appreciated.
Use the Name attribute of child Payload elements.
<ExePackage SourceFile="setup.exe">
<Payload SourceFile="samplefile.rsp" />
<Payload SourceFile="anotherfile" />
<Payload Name="files\data1.cab" SourceFile="files\data1.cab" />
<Payload Name="files\clientruntime.msi" SourceFile="files\clientruntime.msi" />
</ExePackage>
If there are lots and lots of files, it's probably better to just make a self extracting zip archive.

How to build a bundle without embedding the other installers?

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.