I want my install to fail if a previous version of the application is already installed.
I am trying to search the UpgradeCode in RegEdit file. The Value Name of the Upgrade Code is "BundleUpgradeCode". However even if there is no entry in regedit the log for the Bootstrap returns condition value as true. I am not sure what is going wrong.
<util:RegistrySearchRef Id="SearchForInstaller" />
<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\v4R\" Value="Version" Variable="VSTORVersionV4"/>
<util:RegistrySearch Id="DotNetTest" Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Client" Value="Install" Variable="DotNetInstall"/>
<util:RegistrySearch Id="DotNetVersion" Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Client" Value="Version" Variable="DotNetVersion"/>
<Chain>
<ExePackage Id="dotNetFx40_Client_x86_x64" SourceFile="$(var.PreReqPath)\DotNetFX40Client\dotNetFx40_Client_x86_x64.exe" PerMachine="yes" Cache="no"
Compressed="no"
DownloadUrl="http://download.microsoft.com/download/7/B/6/7B629E05-399A-4A92-B5BC-484C74B5124B/dotNetFx40_Client_setup.exe"
Permanent="yes"
InstallCommand="/q /norestart"
DetectCondition="NOT DotNetInstall"
InstallCondition="NOT DotNetInstall OR NOT (DotNetVersion >=v4.0.30319)" />
<ExePackage Id="VSTORuntime" SourceFile="$(var.PreReqPath)\VSTOR40\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)" />
<MsiPackage SourceFile="$(var.AEMSetup.TargetPath)" Vital="yes" Compressed="no" Id="WordAddIns" DisplayInternalUI="yes"/>
</Chain>
</Bundle>
<Fragment>
<util:RegistrySearch Id="SearchForInstaller" Variable ="BundleUpgradeCode" Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\Windows" Result="exists" />
<bal:Condition Message="Another version of this product is already installed. Installation of version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs in Control Panel." >BundleUpgradeCode</bal:Condition>
</Fragment>
[0E98:0390][2013-06-18T13:22:49]i000: Setting string variable
'WixBundleName' to value 'Avanade Estimation Model - v3.4.3'
[0E98:0390][2013-06-18T13:22:49]i100: Detect begin, 3 packages
[0E98:0390][2013-06-18T13:22:49]i000: Setting string variable
'DotNetInstall' to value '1' [0E98:0390][2013-06-18T13:22:49]i000:
Setting string variable 'DotNetVersion' to value '4.5.50709'
[0E98:0390][2013-06-18T13:22:49]i000: Setting numeric variable
'BundleUpgradeCode' to value 1 [0E98:0390][2013-06-18T13:22:49]i000:
Setting string variable 'VSTORFeature' to value '1'
[0E98:0390][2013-06-18T13:22:49]i000: Setting string variable
'VSTORVersionV4' to value '10.0.40303'
[0E98:0390][2013-06-18T13:22:49]i000: Setting string variable
'VSTORVersionV4R' to value '10.0.40303'
[0E98:0390][2013-06-18T13:22:49]i102: Detected related bundle:
{4edb6855-8f5b-438b-9a6b-4598e7083cd7}, type: Upgrade, scope:
PerMachine, version: 3.4.2.0, operation: MajorUpgrade
[0E98:0390][2013-06-18T13:22:49]i052: Condition 'NOT DotNetInstall'
evaluates to false. [0E98:0390][2013-06-18T13:22:49]i052: Condition
'VSTORFeature' evaluates to true.
[0E98:0390][2013-06-18T13:22:49]i101: Detected package:
dotNetFx40_Client_x86_x64, state: Absent, cached: None
[0E98:0390][2013-06-18T13:22:49]i101: Detected package: VSTORuntime,
state: Present, cached: None [0E98:0390][2013-06-18T13:22:49]i101:
Detected package: WordAddIns, state: Present, cached: Complete
[0E98:0390][2013-06-18T13:22:49]i052: Condition 'BundleUpgradeCode'
evaluates to true. [0E98:0390][2013-06-18T13:22:49]i199: Detect
complete, result: 0x0
Any help would be appreciated. Thanks in Advance.
BundleUpgradeCode variable returns 1 from the RegistrySearch, if the registry entry is available. As per my understood we can consider previous version is installed, if the registry entry is available. In that case you need to set
(BundleUpgradeCode=0) or Not (BundleUpgradeCode=1)
to evaluate the condition false. So that the installer will fails and show the Condition message.
<bal:Condition Message="Another version of this product is already installed. Installation of version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs in Control Panel." >Not (BundleUpgradeCode=1)</bal:Condition>
I suspect your registry search condition is not correct. Why you used the Wow6432Node, since the RegistrySearch has the attribute “Win64”
Try Searching for SOFTWARE\Microsoft\Windows Instead of SOFTWARE\Wow6432Node\Microsoft\Windows. You need not to give WOW6432Node in this case
Related
I am trying to use a registry search in a WiX bundle to detect if the Microsoft Access Database Engine is installed and then conditionally install it based on the result:
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine" Result="exists" Variable="AccessDbInstalled" />
<PackageGroup Id="AccessDb">
<ExePackage
Id="AccessDb14"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="Prereqs\AccessDatabaseEngine_X64.exe"
InstallCommand="/quiet /norestart"
InstallCondition="NOT AccessDbInstalled">
</ExePackage>
</PackageGroup>
However the log shows the registry search as always failing, even though I can plainly see the key in the registry:
[77E4:51D8][2021-10-14T16:45:11]i000: Registry key not found. Key = 'SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine'
[77E4:51D8][2021-10-14T16:45:11]i000: Setting numeric variable 'AccessDbInstalled' to value 0
I have other registry searches that work fine, just not this one?!
Add Win64="yes". The search defaults to the 32-bit registry hive. You need to tell Burn you want the 64-bit registry.
I have a WIX installer bundle that has QuickTime as a prereq. I trying to check a registry key to determine if it's already installed but it always comes back false.
The log shows...
[08B4:040C][2015-07-06T10:50:14]i000: Registry key not found. Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Media\QuickTime'
[08B4:040C][2015-07-06T10:50:14]i000: Setting numeric variable 'QuickTimeFound64' to value 0
[08B4:040C][2015-07-06T10:50:14]i000: Registry key not found. Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Media\QuickTime'
The registry is ...
The code is ...
<util:RegistrySearch Root="HKLM" Key="HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Media\QuickTime" Result="exists" Variable="QuickTimeFound64" Win64="yes" />
<util:RegistrySearch Root="HKLM" Key="HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Media\QuickTime" Result="exists" Variable="QuickTimeFound32" Win64="no" />
<Chain>
<PackageGroupRef Id="PackageGroup_NetFx35Redist"/>
<PackageGroupRef Id="PackageGroup_NetFx40Redist"/>
<PackageGroupRef Id="PackageGroup_SQLServer2012"/>
<ExePackage Id="Package_QuickTime" Cache="no" Compressed="$(var.Compressed)"
Description="Apple QuickTime 7" DownloadUrl="$(var.GuruDownloadRepo)/{2}"
SourceFile="..\Prerequisites\QuickTimeInstaller.exe"
Name="Prerequisites\QuickTimeInstaller.exe"
Permanent="yes" DisplayName="Apple QuickTime 7"
DetectCondition="QuickTimeFound64 AND QuickTimeFound32" />
I have tried including "Wow6432Node" in the 64bit path but it didn't make any difference.
Can anyone tell me why both of the searches are coming back as false?
Use
SOFTWARE\Clients\Media\QuickTime
instead of
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Media\QuickTime
because HKEY_LOCAL_MACHINE is specified in the Root attribute.
I'm taking over this project and don't have access to the person who set it up initially. Currently the bundle has .net4 included. The desire is to remove the file and make the end user download .net manually. I'm trying to set the bundle up to check the installed .net version (if any), display a details message with a download link if it doesn't meet the reqs then abort the install and close.
Every time I try to remove the variables that point to the .net package I get build errors. This is what I have so far.
<Chain>
<PackageGroupRef Id='Netfx4Full' />
<MsiPackage SourceFile="$(var.TargetDir)Client.msi" Id="Client" Cache="no" Visible="no" ForcePerMachine="yes">
<MsiProperty Name="INSTALLDIR" Value="[InstallFolder]"/>
</MsiPackage>
</Chain>
</Bundle>
<Fragment>
<PropertyRef Id="NETFRAMEWORK40FULL"/>
<Variable Name="InstallationPath" bal:Overridable="yes" />
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
<Variable Name="DisplayVersion" Value="$(var.BundleVersion)" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion" Win64="yes" />
<Condition Message="This application requires .NET Framework 4.0. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK40]]>
</Condition>
<PackageGroup Id="Netfx4Full">
<ExePackage Id="Netfx4Full" Cache="no" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="no"
SourceFile="DotNetInstallers/dotnetfx40_full_x86_x64.exe"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
DetectCondition="Netfx4FullVersion OR Netfx4x64FullVersion">
</ExePackage>
</PackageGroup>
</Fragment>
Any help would be appreciated.
Based on these lines, it looks like you're using the ManagedBootstrapperApplicationHost.
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
The ManagedBootstrapperApplicationHost is the builtin way in WiX to use a custom BootstrapperApplication built in .NET (a managed BA, or MBA). The MBAHost requires you to package .NET in your bundle. If you're concerned about the size of your bundle, then you can use the NetFx4Web package in the WixNetFxExtension. This will make the bundle download the web installer at runtime. You can customize the user interface that appears while installing .NET using mbapreq.thm and mbapreq.wxl.
I have an application that requires .Net 4.0.3 (link).
I've found this article which tells me where I would find the version of .Net which is installed but all I can find is the list of included properties that the WiX compiler recognises (here).
I've tried following the directions in this article, which tells me to use the following code, but this just installs .Net 4 without the update:
<PropertyRef Id="NETFRAMEWORK40FULL"/>
<Condition Message="This application requires .NET Framework 4.0.3. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK40FULL]]>
</Condition>
How would I go about making WiX check for the specific 4.0.3 update, either through a pre-defined WiX property or checking the registry value myself?
After some reading, I ended up adding a bundle project to my solution that references my main Product in the standard WiX installer project (MyProject.Installer). I then used a RegistrySearch to find the version of the full .Net 4 installation.
<Bundle ....>
<Chain>
<PackageGroupRef Id="Netfx4Full" />
<PackageGroupRef Id="Netfx403Update" />
<MsiPackage Id="MyMsi" SourceFile="$(var.MyProject.Installer.TargetPath)" Compressed="yes" DisplayInternalUI="yes" />
</Chain>
</Bundle>
<Fragment>
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4x64FullVersion"
Win64="yes" />
<PackageGroup Id="Netfx4Full">
<ExePackage Id="Netfx4Full"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="$(var.ProjectDir)dotNetFx40_Full_x86_x64.exe"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
<PackageGroup Id="Netfx403Update">
<ExePackage Id="Netfx403Update"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="$(var.ProjectDir)NDP40-KB2600211-x86-x64.exe"
DetectCondition="Netfx4FullVersion AND (Netfx4FullVersion << "4.0.3" OR Netfx4FullVersion << "4.5")" />
</PackageGroup>
</Fragment>
The condition expands out to Netfx4FullVersion AND (Netfx4FullVersion << "4.0.3" OR Netfx4FullVersion << "4.5") without XML escaping.
The following articles were helpful:
Bundle skeleton code
Bundle package manifest
Defining searches using WiX variables
Chaining packages into a bundle
How to check for .Net versions
Version value within the registry key "SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" will be always 4.0.30319 for .net 4.0 (even if updates have been installed).
Here is the code I have used in my bundle to search if the .net 4.0.3 version was already installed:
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3"
Result="exists"
Variable="Netfx403" />
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3"
Result="exists"
Variable="Netfx403x64"
Win64="yes" />
Then in your ExePackage DetectCondition:
DetectCondition="Netfx403 AND (NOT VersionNT64 OR Netfx403x64)"
I'm using WIX 3.6 Bundle to install an application. It requires some prerequisites. How can I set up the package, so that the bootstrapper automatically download the file from the internet?
I know that WIX setup itself does exactly that. But I can't find the difference. Here's my fragment for the .NET Framework 3.5:
<Fragment>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v3.5" Value="Version" Variable="NetFX35Version" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v3.5" Value="Version" Variable="NetFX35x64Version" Win64="yes" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v3.5" Value="SP" Variable="NetFX35SP" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v3.5" Value="SP" Variable="NetFX35x64SP" Win64="yes" />
<PackageGroup Id="NetFX35">
<ExePackage Id="NetFX35" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes"
SourceFile="$(var.TargetDir)dotnetfx35setup.exe"
DownloadUrl="http://download.microsoft.com/download/0/6/1/061F001C-8752-4600-A198-53214C69B51F/dotnetfx35setup.exe"
DetectCondition="(NetFX35Version AND NetFX35SP >= 1) AND (NOT VersionNT64 OR (NetFX35x64Version AND NetFX35x64SP >= 1))" />
</PackageGroup>
</Fragment>
When I use this fragment and the dotnetfx35setup.exe is not present, the Bootstrapper shows a message box, asking if it should download the file. But it should do that automatically.
UPDATE:
I'm using WixStandardBootstrapperApplication. Does the managed bootstrapper application behave different?
WixStdBA always prompts before downloading. I'd suggest filing a feature request to make it something you can suppress. There isn't currently a managed bootstrapper application; ManagedBootstrapperApplicationHost is the infrastructure to support your own managed-code BA.