WiX Bootstrapper Include OpenXMLSDK - wix

I have strange situation, it seems that OpenXMLSDK msi which is included in WiX bootraper as prerequisite is not installing on user PC. Bellow is my project structure. Any parameter which should I pass to MsiPackage ?
<Chain>
<PackageGroupRef Id="OpenXMLSDK"/>
<MsiPackage Id="MyProject" SourceFile="$(var.MyProjectInstaller.TargetPath)"/>
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="OpenXMLSDK">
<MsiPackage Id="OpenXMLSDK"
DisplayName="Open XML SDK 2.5 for Microsoft Office"
DownloadUrl="http://download.microsoft.com/download/5/5/3/553C731E-9333-40FB-ADE3-E02DC9643B31/OpenXMLSDKV25.msi"
Compressed="yes"
Cache="yes"
Permanent="yes"
Vital="yes"
SourceFile=".\Prerequisites\OpenXMLSDKV25.msi"
Name ="Prerequisites\OpenXMLSDKV25.msi"/>
</PackageGroup>
</PackageGroup>
</Fragment>
Note: It seems that the OpenXML is actually installing but it is not visible in Control Panel Add/Remove programms

If you want an MsiPackage to be visible in Add/Remove Programs, then you need to set the Visible attribute to yes.

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?

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

Wix Toolset prerequisites: Check for .Net Framework

I have a wix bundle project that I am editing (ver 3.10). I am trying to use the wixnetfxextensions to install .net framework 4.6 if it is not already installed. I created an exepackage that uses the WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED property. I'm guessing I am not using this correctly. Any help on how to use that? Currently the .net framework will not install not matter what.
<Chain>
<PackageGroupRef Id="redist_vc140" />
<PackageGroupRef Id="NetFx461Full" />
<MsiPackage Id="MSI_Installer" SourceFile="C:\Installer.msi"/>
</Chain>
<Fragment>
<PropertyRef Id="WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED"/>
<!-- Install .NET 4.6.1 -->
<PackageGroup Id="NetFx461Full">
<ExePackage Id="NetFx461"
DisplayName="Microsoft .NET Framework 4.6.1"
Compressed="no"
Cache="yes"
PerMachine="yes"
Permanent="yes"
Protocol="netfx4"
Vital="yes"
SourceFile="..\NDP461-KB3102436-x86-x64-AllOS-ENU.exe"
UninstallCommand="/q /norestart"
RepairCommand="/q /norestart"
DetectCondition="NOT WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED" />
</PackageGroup>
</Fragment>
You're doing a lot of extra work to install .net that you don't actually need to do.
To add .net 461 to your installer just include the netfxextension and add
<Bundle>
<PayloadGroup Id="NetFx461RedistPayload">
<Payload Name="redist\NDP461-KB3102436-x86-x64-AllOS-ENU.exe"
SourceFile="C:\path\to\redists\in\repo\NDP461-KB3102436-x86-x64-AllOS-ENU.exe"/>
<PayloadGroup/>
</Bundle>
so that the full installer is included in your bootstrapper. You can ignore this and then the bootstrapper will download the installer but if the customer doesn't have an internet connection they won't be able to install .net.
Then in your chain just add
<PackageGroupRef Id="NetFx461Redist"/>
I used this as a reference and checked the wix source to see what the
name of .net 461 being used is in netfxextension.
Sean Hall mentioned that bundles don't even use properties so what I had written here doesn't apply at all in this situation. (And it was also incorrect)
Did what Brian Sutherland suggested: Added the WxsVariable that compares the .netframework with the determined minimum release number. then make that a detectcondition in the exepackage

WiX - Does Burn support dual-purpose msi packages?

Does Burn support dual-purpose (per-user or per-machine) MSI packages which were prepared according to these Microsoft guidelines?
I tried to prepare such a package, but it looks like bootstrapper created with Burn doesn't uninstall MSI package, which was installed per-machine after raising UAC privileges by End-User.
The source code for Burn is:
<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">
<Bundle Version="1.0"
Name="AppNameHere"
UpgradeCode="GuidHere">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense" >
<bal:WixStandardBootstrapperApplication LicenseUrl=""
SuppressOptionsUI="yes"
ThemeFile="Customization\Theme.xml"
LocalizationFile="Customization\LangHere.wxl"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="WindowsInstaller45"/>
<PackageGroupRef Id="NetFx40ClientRedist"/> <!-- Uzywa rozszerzenia WixNetfxExtension do zainstalowania .net -->
<PackageGroupRef Id="vcredist"/>
<MsiPackage Compressed="yes"
SourceFile="MsiFileNameHere"
DisplayInternalUI="yes">
<MsiProperty Name="UPDATEDIR" Value="[UninstallPath]"/>
<MsiProperty Name="WIXBUNDLEKEY" Value="[WixBundleProviderKey]"/>
</MsiPackage>
</Chain>
</Bundle>
<Fragment>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" Value="Installed" Variable="vcredistkeyx86" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" Value="Installed" Variable="vcredistkeyx64" />
<PackageGroup Id="vcredist">
<ExePackage Id="vcredist_x86"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="Components\vcredist_x86.exe"
DetectCondition="(vcredistkeyx86 AND (vcredistkeyx86 >= 1)) OR (vcredistkeyx64 AND (vcredistkeyx64 >= 1))" />
</PackageGroup>
<PackageGroup Id="WindowsInstaller45">
<ExePackage Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="Components\WindowsXP-KB942288-v3-x86.exe"
InstallCondition="VersionNT=v5.1 AND NOT VersionNT64 AND VersionMsi < v4.5"
InstallCommand="/quiet /norestart">
<ExitCode Behavior="forceReboot"/>
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>
As of WIX V3.9 the answer is a qualified "No" - Burn doesn't currently support dual-purpose per-user or per-machine MSI package.
A dual-purpose MSI package has the ALLUSERS property set to "2". When you build a WIX bootstrapper project referencing this type of MSI package you should see this type of warning:
2>D:\Robert\Documents\Visual Studio 2013\Projects\BurnTest\Bootstrapper\Bundle.wxs(18,0): warning LGHT1133: Bundles require a package to be either per-machine or per-user. The MSI 'D:\Robert\Documents\Visual Studio 2013\Projects\BurnTest\SetupProject\bin\Release\SetupProject.msi' ALLUSERS Property is set to '2' which may change from per-user to per-machine at install time. The Bundle will assume the package is per-machine and will not work correctly if that changes. If possible, remove the Property with Id='ALLUSERS' and use Package/#InstallScope attribute instead.
The build process for a WIX bootstrapper project will try and work out from the chained packages what type of burn installation to create (per-user or per-machine). The logic is convoluted because of the different places you can declare a preference for per-user or per-machine, and the potential conflicts between chained packages. But the general idea is the burn compiler will generate a per-machine installation, unless one of the chained packages is per-user, which will flip the burn installation into per-user mode. The key point is the decision to create a per-user or per-machine package is made at build time. To properly support dual-purpose MSI packages that decision would need to be moved to install time.

Prevent Burn from uninstalling .NET package

I'm using a WiX bootstrapper to install .NET and my application. The .NET installation is specified in a chain using the statement
<PackageGroupRef Id="NetFx40Redist">
When I uninstall using the bootstrapper, the .NET package is also uninstalled. How can I modify the above statement to tell the bootstrapper not to remove the .NET package?
EDIT: Following is the code I ended up writing to do this. Comments are welcome if there is anything I should do differently.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="appName" Version="$(var.Version)" Manufacturer="mfr" UpgradeCode="your-GUID"
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]mfrName\appName" />
<Chain>
<PackageGroupRef Id="Net4Redist"/>
<MsiPackage
Id="MsiInstaller"
Compressed="yes"
SourceFile="$(var.SolutionDir)\appName_Installer\bin\$(var.Configuration)\appName_Installer.msi"
Permanent="no"
Vital="yes">
<MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
</MsiPackage>
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="Net4Redist">
<ExePackage Id="Netfx40Xxx" Cache="no" Compressed="yes" PerMachine="yes"
Permanent="yes" Vital="yes" InstallCommand="/q"
SourceFile="$(var.SolutionDir)\Bootstrapper\redist\dotNetFx40_Full_x86_x64.exe"
InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0)"/>
</PackageGroup>
</Fragment>
</Wix>
Did you try using the "Permanent" attribute in the EXEPackage element?
EXEPackage
Glad you solved your issue but, as you mentioned, you do not have any detect condition setup so that is probably why you are seeing .NET processing every time you run your installer. If you add the following registry search and detect condition to your example you should not see that anymore:
<Fragment>
<util:RegistrySearchRef Id="NETFRAMEWORK40"/>
<PackageGroup Id="Net4Redist">
<ExePackage Id="Netfx40Xxx" Cache="no" Compressed="yes" PerMachine="yes"
Permanent="yes" Vital="yes" InstallCommand="/q"
SourceFile="$(var.SolutionDir)\Bootstrapper\redist\dotNetFx40_Full_x86_x64.exe"
DetectCondition="NETFRAMEWORK40"
InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0)"/>
</PackageGroup>
</Fragment>