I'm trying to deploy an Excel plug-in to the mass market. The plug-in requires VSTO runtime (vstor_redist.exe) and .NET 4.5 (for 64 bit OS) or .NET 4.0 (for 32 bit OS). I'm willing to assume that potential users already have at least .NET 2.0. Currently my setup consists of:
- Separate 32 bit and 64 bit WIX .msi installers which install the plug-in in per-user mode.
Separate 32 bit and 64 bit bootstrapper bundles which wrap each .msi and install VSTO runtime and .NET as shown in the code below:
<util:RegistrySearch Id="VSTORuntimeTest" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="VSTORFeature_CLR40" Variable="VSTORFeature"/> <util:RegistrySearch Id="VSTORuntimeVersionV4R" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="Version" Variable="VSTORVersionV4R"/> <util:RegistrySearch Id="VSTORuntimeVersionV4" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4\" Value="Version" Variable="VSTORVersionV4"/> <Chain> <!-- Install .Net 4.0 or 4.5, depending on build --> <?ifdef x64?> <PackageGroupRef Id="NetFx45Web" /> <?endif ?> <?ifdef x86?> <PackageGroupRef Id="NetFx40Web" /> <?endif ?> <RollbackBoundary /> <!-- Install VSTO runtime --> <ExePackage Id="VSTORuntime" SourceFile="..\resources\vstor_redist.exe" Permanent="yes" Vital="yes" Cache="no" Compressed="no" DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917" PerMachine="yes" InstallCommand="/q /norestart" DetectCondition="VSTORFeature" InstallCondition="NOT VSTORFeature OR NOT (VSTORVersionV4R >=v10.0.40303) OR NOT (VSTORVersionV4 >=v10.0.21022)" /> <RollbackBoundary /> <?ifdef x64?> <MsiPackage Id="nx_msi_package_version" SourceFile="..\My 64 bit Setup.msi" Compressed="yes" Vital="yes" /> <?endif ?> <?ifdef x86?> <MsiPackage Id="nx_msi_package_version" SourceFile="..\My 32 bit Setup.msi" Compressed="yes" Vital="yes" /> <?endif ?> </Chain>
A .NET 2.0 wrapper which includes both the bootstrappers as embedded resources and deploys & runs the correct bootstrapper for the client OS. (Essentially Yochai Timmer's answer in Single MSI to install correct 32 or 64 bit c# application)
The whole thing feels like a turducken, but it works nicely for both silent upgrades and for fresh installs when the user has admin credentials. But if the user is not an admin and does not yet have both VSTO and the appropriate .NET installed, it fails ungracefully with the error: "0x8007051b - This security ID may not be assigned as the owner of the object" after a long download process.
What I would like to do is check in advance whether the user needs to ask an administrator to intervene and install VTSO and/or .NET for them, and display a message, ideally with website link(s), when this is the case. This check could be in the bootstrapper, or in my .NET 2.0 wrapper. Any recommendation on how best to do this?
Thanks, Eric