WIX Bundle "This installation package could not be opened." - wix

Alright, so I've been working with the WIX installer and I'm working on building a bundle for bootstrapping the .NET framework. After a lot of reading the official material I've had issues with getting any bundle to start. I finally decided to strip it down to the minimum to try to figure out what's wrong. Here's my code:
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Version="1.0.0.0" UpgradeCode="{0e0055fe-ce30-4b84-8b98-6a73128ff93d}">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
<Chain>
<MsiPackage Id="NewPackage" SourceFile="C:\TestInstall.msi"/>
</Chain>
</Bundle>
</Wix>
It builds successfully, but when I run it I get the message "This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package."
I'm guessing I'm missing some basic piece, but for the life of me I can't figure out what it is. What else do I need to add for the created MSI to run properly?
EDIT: Found the answer. Visual Studio 2012 doesn't compile Bundles properly with WIX 3.6.

Related

How to resolve BootstrapperApplicationRef in Wix Toolset 3.11?

I get error messages related to my BootstrapperApplicationRef which I do not understand as these come from examples based on the well known wix book and also this example. Maybe it is because I use version 3.11 of the toolset (the book is based on 3.6)? My installer needs to install some software to download.
Here is my wxs:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Awesome Software"
Version="1.0.0.0"
Manufacturer="Awesome Company"
UpgradeCode="c352f5c7-1dbe-416c-820d-685b058270d5">
<BootstrapperApplicationRef
Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<ExePackage Id="DymoLabelSoftware"
SourceFile="DLS8Setup.8.5.1.exe"
DownloadUrl="http://download.dymo.com/dymo/Software/Win/DLS8Setup.8.5.1.exe" />
</Chain>
</Bundle>
</Wix>
Compiling results in the following error message:
Unresolved reference to symbol
'WixBootstrapperApplication:WixStandardBootstrapperApplication.RtfLicense'
Changing this element as described here, results in the following message:
Unresolved reference to symbol
'WixBootstrapperApplication:WixNetFxExtension'
Removing the BootstrapperApplicationRef results in another error message:
Unresolved reference to symbol
'WixBootstrapperApplication:WixNetFxExtension'
I can understand that something is unresolved but the found examples to resolve it simply do not work. How can I fix this? How to resolve this reference without getting an error message?
Update 1
I tried to make this work with a bootstrapper project instead. That partially solved my problem.
I just get another error message.
The system cannot find the file 'DLS8Setup.8.5.1.exe'.
This is really strange. The compiler should not try to find it at compile time. It is something to be downloaded at runtime.
I tried making this work by adding a dummy DLS8Setup.8.5.1.exe.
However, when looking up my result in my bin\Debug folder, I get an application that, when double clicking, does not show a user interface. This approach does not really solve my problems, it changes my problem.
It just want to have an installer that shows some user interface when starting and does execute a download. That's all.
Update 2
Using the other example to download just give other errors too.
So here's working sample based on your updates:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="DLS8SetupBootstrapper" Version="1.0.0.0" Manufacturer="me" UpgradeCode="ada71964-11c8-4877-9544-f72fe65579c0">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<ExePackage Id="DymoLabelSoftware"
Name="DLS8Setup.8.5.1.exe"
Compressed="no"
DownloadUrl="http://download.dymo.com/dymo/Software/Win/DLS8Setup.8.5.1.exe">
<RemotePayload Description="MyRemoteApp" ProductName="DLS8Setup.8.5.1.exe" Size="119087088" Version="8.5.1.0" Hash="204ecb5296290527418693f3a464b59a8801808f"/>
</ExePackage>
</Chain>
</Bundle>
</Wix>
Note that you need to know size in bytes and sha1 hash of your file. Also "Name" is important attribute.
To check hash I used this resource
Haven't found how to get size online so here's C# sample:
var sizeInBytes = new FileInfo("D:\\DLS8Setup.8.5.1.exe").Length;
So just update that variables for your file and you'll get your installer.
P.S. It will show that DLS8Setup installer GUI. If you need do it silent it will depend on every installer. As I get you want to use your own, not that one from example, so I can't do anything without your file.

WiX standard bootstrapper: launch application after install

I am creating a Bundle installer, using WiX standard bootstrapper in order to install .NET Framework 4.5 (if not yet installed) and my application in the user's computer. The bundle installer also allows the user to set the installation path for the application, and uses WiX standard bootstrapper's UI only (no other installers' interfaces are shown to the user).
Right now I'm struggling to allow the user to launch my application at the end of the installation.
Closest related anwers I could find use a variable named LaunchTarget, which causes WiX standard bootstrapper to display a "Launch" button in the end of the installation.
Given solutions and why I wasn't able to use them follow:
Answer "A" suggests setting the LaunchTarget variable to the exact folder inside "Program Files" folder where the application should be installed. This doesn't work for me, because I want to allow the user to specify the target installation folder (application can be installed outside of the "Program Files" folder).
Answer "B" suggests setting the LaunchTarget variable by using the InstallFolder variable to determine where the user configured the standard bootstrapper to install the software to. This seemed perfect for my case, but after setting the LaunchTarget value simply to "[InstallFolder]" I verified that pressing the "Launch" button in the standard bootstrapper's UI actually opens the folder where the installer is running, and not the folder where the user chose to install the software, as I expected. (is that a bug?)
Question is: how can I correctly set the LaunchTarget variable to the right path, considering that the user can modify the installation folder through WiX standard bootstrapper's UI?
The code for the Bunde follows.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="My Game Trainer" Manufacturer="MY_MANUFACTURER_ID_HERE" UpgradeCode="MY_GUID_HERE" Version="!(bind.packageVersion.TrainerMsiPackage)" DisableModify="yes">
<Variable Name="LaunchTarget" Value="[InstallFolder]" />
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLargeLicense">
<bal:WixStandardBootstrapperApplication ShowVersion="yes" LicenseFile="PATH_TO_MY_LICENSE.rtf" />
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<MsiPackage Id="TrainerMsiPackage" SourceFile="$(var.SetupMSI.TargetPath)" DisplayInternalUI="no">
<MsiProperty Name="TRAINER_INSTALL_DIR" Value="[InstallFolder]"/>
</MsiPackage>
</Chain>
</Bundle>
</Wix>
Using WiX Toolset v3.11.1 (+Visual Studio 2017 Extension).

Wix v3.10 Boostrapper crashes on Windows 7 RTM

On a 32 or 64 bit Windows 7 Pro (just RTM no updates), I create a bundle with the WiX Toolset (Visual Studio WIX Bootstrapper project) v3.10.0.1823 that outputs an executable.
If I install SP1, the bootstrapper works as intended.
If I install the custom MSI with my application (without dependencies) it works on RTM.
This was in the application event log:
Windows cannot access the file for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program because of this error.
Program:
File:
The error value is listed in the Additional Data section.
User Action
1. Open the file again. This situation might be a temporary problem that corrects itself when the program runs again.
2. If the file still cannot be accessed and
- It is on the network, your network administrator should verify that there is not a problem with the network and that the server can be contacted.
- It is on a removable disk, for example, a floppy disk or CD-ROM, verify that the disk is fully inserted into the computer.
3. Check and repair the file system by running CHKDSK. To run CHKDSK, click Start, click Run, type CMD, and then click OK. At the command prompt, type CHKDSK /F, and then press ENTER.
4. If the problem persists, restore the file from a backup copy.
5. Determine whether other files on the same disk can be opened. If not, the disk might be damaged. If it is a hard disk, contact your administrator or computer hardware vendor for further assistance.
Additional Data
Error value: 00000000
Disk type: 0
Any thoughts on how I can the bootstrapper running on blank install of Windows 7 RTM?
Update:
Tried an empty Bootstrapper just referencing the package (MSI) for my application. I can run the package for my application just fine standalone, just can't launch thru the bootstrap:
Is there a log file or something I can look at to provide more info? To get around this, I'm going to try creating a MSI that does an OS check (requiring SP1 of Win 7) that wraps the Bootstrapper.exe.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="d94220ca-b99f-4d1d-acec-024cfc65c898">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="MyPackage" SourceFile="<path to my package>" Name="MyPackage" Cache="no" Compressed="yes" Permanent="yes" Vital="yes" DisplayInternalUI="no" InstallCondition="VersionNT" Visible ="yes" />
</Chain>
</Bundle>
Works for me. I created a WiX Bootstrapper Project in a new solution in VS2015, built it, and was able to install and uninstall it on a Win7 x64 Pro RTM VM with no updates.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="ff6c5879-f9b6-4941-a769-3c51bca2a070">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="NetFx451Redist" SourceFile="path\to\testing.msi" />
</Chain>
</Bundle>

How to check in WiX, if IIS-Feature is installed?

I have programmed a Bootstrapper-project with WiX 3.8, in which i'm installing IIS Express 8.0 and activating some IIS-Features.
The activation lies in a seperate WXS-file - including a lot of ExePackages - like that:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id='ActivateIisFeatures'>
<ExePackage Id='IIS_WebserverRole'
DisplayName='Installing IIS: IIS-WebServerRole'
PerMachine='yes'
SourceFile='.\Resources\Dism.exe'
InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServerRole'>
</ExePackage>
...
</PackageGroup>
...
</Fragment>
</Wix>
Now my problem is, that by this way, the ExePackages will be installed and the features activated everytime, the setup is installed or repaired.
So i tried the DetectCondition-Property.
You know, if the DetectCondition returns false, the Bootstrapper plans to install the ExePackage.
But the following edit does still install the ExePackages everytime, even when the features are active.
What have i to do, that the IIS-features will only installed/activated, when they are not active?
Thanks in advance!
Okay, i have found it out myself.
It's really simple.
DetectCondition doesn't work here.
We have to search for the registrykey and check the result in the Installcondition of the ExePackage.
Most of the keys are lying in the folder "HKLM\SOFTWARE\Microsoft\InetStp\Components".
And there is a list on the iis-site, but it's old and not complete:
http://www.iis.net/learn/install/installing-iis-7/discover-installed-components
Per example:
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\InetStp\Components"
Value="W3SVC"
Variable="WebServer"/>
<ExePackage Id='IIS_WebServer'
DisplayName='Installing IIS: IIS-WebServer'
PerMachine='yes'
SourceFile='.\Resources\Dism.exe'
InstallCondition='NOT WebServer'
InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServer'>
</ExePackage>
By this way, once a features was activated, it doesn't happen anymore while reinstalling or repairing the setup.

RemotePayload: The system cannot find the file '' with type ''

Moving to WiX 3.6, I'm trying to make use of burn features to ease potential download/install of required pieces, such as a specific VC++ runtime.
I started small with just some "test.wxs", see below, which is OK for candle.exe:
$ candle test.wxs
Windows Installer Xml Compiler version 3.6.3303.0
Copyright (C) Outercurve Foundation. All rights reserved.
test.wxs
But light.exe chokes on it:
$ light test.wixobj -ext WixBalExtension
Windows Installer Xml Linker version 3.6.3303.0
Copyright (C) Outercurve Foundation. All rights reserved.
light.exe : error LGHT0103 : The system cannot find the file '' with type ''.
Could someone help with this (rather cryptic) error message?
It seems related to RemotePayload, since a modified version with local file works correctly. However, I'd like to save on package size and leave the downloading on the target machine if so needed.
Full content of "test.wxs" was:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Version="1.0.0.0"
UpgradeCode="e349236d-6638-48c5-8d8b-db47682b9aeb">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<!-- C++ Runtime -->
<ExePackage Name="vcredist_x64.exe"
DownloadUrl="http://www.microsoft.com/en-us/download/confirmation.aspx?id=2092" >
<RemotePayload CertificatePublicKey="F321408E7C51F8544B98E517D76A8334052E26E8"
CertificateThumbprint="D57FAC60F1A8D34877AEB350E83F46F6EFC9E5F1"
Description="Microsoft Visual C++ 2008 Redistributable Setup"
Hash="13674C43652B941DAFD2049989AFCE63CB7C517B"
ProductName="Microsoft Visual C++ 2008 Redistributable"
Size="4961800"
Version="9.0.30729.17" />
</ExePackage>
</Chain>
</Bundle>
</Wix>
Partial answer to my own question:
The error message disappears if I add the attribute Compressed="no" to the ExePackage element.
Documentation about "Compressed" attribute says: "Whether the package payload should be embedded in a container or left as an external payload" and its value can be "yes", "no", or "default".
Using "yes" or "default" triggers the error message. Using "no" doesn't.
I had the same trouble with another package (the .NET framework) and Wix 3.7. I used the Wix source code to find the appropriate package names and registry keys to test, and then pasted the relevant bits into my installer. Then, I intentionally set 'Compressed="yes"' because I wanted to embed the file in my installer instead of having it downloaded.
There was a report similar to yours posted in this mailing list thread:
Benjamin Mayrargue: If an ExePackage has a DownloadUrl and Compressed is set to yes, light failed with error LGHT0103: The system cannot find the file '' with type ''.
Markus Wehrle: Ok, I see. If you want to have the ExePackage compressed into your bootstrapper.exe (compressed="yes") you need to specify it using "Source" attribute. Cause it will be compressed into your boostrapper during compile time, you must not declare a DownloadUrl. If you specifiy compressed="no" your ExePackage gets downloaded from the DownloadUrl during the installation of your boostrapper.
Rob Mensching: More specifically, you cannot use RemotePayload element and Compressed='yes' on the ExePackage element together. That doesn't make sense and the bug here is that the compiler didn't give you an error message here saying that.
So yes, you've correctly identified the same fix to the problem.
The Compressed attribute, by the way, specifies 'Whether the package payload should be embedded in a container or left as an external payload.' That external payload can either be a RemotePayload or another file on the disk, but the typical setup is a single bootloader with all the resources embedded into it.
Using yes for the Compression attribute will allow your application and the VC++ runtime to be installed even if the user has a slow or nonexistent Internet connection. Remove the DownloadUrl and RemotePayload from your installer, and replace them with just Compressed="yes" like this:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Version="1.0.0.0"
UpgradeCode="e349236d-6638-48c5-8d8b-db47682b9aeb">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<!-- C++ Runtime -->
<ExePackage Name="vcredist_x64.exe"
Compressed="yes">
</ExePackage>
</Chain>
</Bundle>
</Wix>
Then download the vcredist_x64.exe file (yourself, once) and place it adjacent to your test.wxs file. Adjust 'Name' if you want it in a different location. Note that this will increase the size of your resulting bootstrapper by about the size of vcredist_x64.exe, so it's not a good idea if your users will be downloading your installer.
In my case the error was thrown because the filename/directory path was over 255 characters. The file exist yet the compiler is stating that the file doesn't exist.