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.
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 am in the process of learning how to develop a custom managed bootstrapper for wix-burn. Up to my knowlege there are no official tutorials, unofficial tutorials are always filled with WPF stuff which I'm not interested in and most people on forums do not do much more than saying that you must create a class that inherits from BootstrapperApplication and overrides the Run() method.
I did that, created the config file, added the payloads to the xml markup. The resulting installer did nothing, actually it ran forever, only killing it stopped it. I sincerely expected that calling base.Run() would give me some basic default GUI-less behavior. But that is only an abstract method. Eventually I learned that I must call some Engine.functions() to actually do some work. So I wrote this to test:
protected override void Run()
{
Engine.Detect();
Engine.Plan(LaunchAction.Install);
Engine.Apply(IntPtr.Zero);
Engine.Quit(0);
}
I successfully compiled a package that actually installed, the problem is that it can not be uninstalled. My question is, what can I do to purge it from my system? What registry keys must I erase, what cached packages must I delete, and what else must I do to get rid of it?
First, the registry key will be in one of the two locations listed below -- and it's probably the first one since the second is for 32-bit applications installed on a 64-bit OS.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
Second, you can use the registry key to determine where the executable is cached for uninstall, which is probably in a folder that looks like C:\ProgramData\Package Cache.
If this were an .msi installation, there's another registry key and the file is cached in a different location as mentioned here.
Other links:
https://superuser.com/questions/401511/how-to-remove-a-broken-program-from-the-programs-and-features-list-in-windows-7
https://support.microsoft.com/en-us/kb/247501
Ufff, you've got yourself into a hell. :) I'll help you as much as I can.
How did you installed that package?
dlls that you can find interesting:
BootstrapperCore.dll (included with the WiX SDK)
Microsoft.Deployment.WindowsInstaller.dll (included with the WiX SDK)
WindowsBase.dll (for threading)
And, one of XML files should be like this, so you can see what exactly is up there.
<?xml version="1.0" encoding="UTF-8"?>
<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 Name="My Test Application" Version="1.0.0.0" Manufacturer="Bryan" UpgradeCode="PUT-GUID-HERE">
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<Payload SourceFile="..\TestBA\BootstrapperCore.config"/>
<Payload SourceFile="..\TestBA\bin\Release\TestBA.dll"/>
<Payload SourceFile="..\TestBA\bin\Release\GalaSoft.MvvmLight.WPF4.dll"/>
<Payload SourceFile="C:\Program Files\WiX Toolset v3.6\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id='Netfx4Full' />
<MsiPackage SourceFile="..\DummyInstaller\bin\Release\DummyInstaller.msi" Id="DummyInstallationPackageId" Cache="yes" Visible="no"/>
</Chain>
</Bundle>
<Fragment>
<!-- Managed bootstrapper requires .NET as a dependency, since it was written in .NET.
WiX provides a Bootstrapper for the bootstrapper. The fragment below includes .NET.
For more information or examples see Heath Stewart's blog or the WiX source:
http://blogs.msdn.com/b/heaths/archive/2011/10/28/introducing-managed-bootstrapper-applications.aspx
-->
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
<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="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\DotNetFX40\dotNetFx40_Full_x86_x64.exe"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
</Fragment>
</Wix>
Note: your registry search and conditions are a little different from
what is used in the WiX toolset to detect NETFX. The following is the
detection for NETFX the WiX toolset uses:
<util:RegistrySearch
Id="NETFRAMEWORK40"
Variable="NETFRAMEWORK40"
Root="HKLM"
Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
Value="Install"
Result="value" />
Next solution can be this:
Include a PackageGroupRef element in your Chain:
<Bundle>
<Chain>
<PackageGroupRef Id="NetFx452" />
<MsiPackage ... />
</Chain>
</Bundle>
Download the Microsoft .NET Framework 4.5.2 (Offline Installer), and add it to your Bootstrapper Project. (I put it in a folder called "Resource".)
Add the following Fragment:
<Fragment>
<util:RegistrySearchRef Id="NETFRAMEWORK45"/>
<PackageGroup Id="NetFx452">
<ExePackage Id="NetFx452"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
Name="NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
SourceFile="Resource\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
DetectCondition="NETFRAMEWORK45"
InstallCommand="/q /norestart" />
</PackageGroup>
</Fragment>
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 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
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.