Jump to content


fj40ratt

Application install fails because dependency already exists

Recommended Posts

I'm trying to deploy an application that has multiple dependencies.  One of the dependencies is Visual C.  The application deployment fails because it states that Visual C already exists and it must be uninstalled through control panel for the deployment to succeed.  Is there a way during application deployment to bypass a dependency if it already exists on the target computer?  Thanks in advance.

Share this post


Link to post
Share on other sites

When the application starts it  evaluates the detection (presence) of your dependency apps.

Maybe you need to add an extra detection method on your dependency app to skip installation of the new C++ when a certain version is found 

OR create in your installation program an uninstall first of the previous version.

 

 

 

Share this post


Link to post
Share on other sites

@fj40ratt Is that dependency MS Visual C++ Redist 2015 or higher by any chance?

The older versions just install older/newer versions next to each other as far as I've seen till now, but the 2015 and later was giving me a bit of a pain. This is mostly because MS has now made a bundle of the whole 2015-2019 C++ Redist.

If a newer versions is installed -> Big fat error code, install failed and all that. So I was in need of a different detection method because each version has a different (MSI) GUID in the Uninstall hive of the registry (or used with the MSI detection).

In the end I came up with this Powershell dection and it has been working well until now for us:
 

 $software = 'Microsoft Visual C*2015*Redistributable (x86)*';
$minimalversion = 14.0.24212
$installed  = $null
$installed = (Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -like $software }) -ne $null
$Result = "Not Installed"

If($installed) {
	$AppVersion = $null
	$AppVersion = (Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -like $software })
	If($AppVersion.DisplayVersion -ge $minimalversion) {
		$Result = "Installed"
    }
}

$Installed = $null
$installed = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -like $software }) -ne $null

If($installed) {
	$AppVersion = $null
	$AppVersion = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -like $software })
    
	If($AppVersion.DisplayVersion -ge $minimalversion) {
		$Result = "Installed"
        	}
}

Write-Host $Result 

Change the (x86) to (x64) if you need the other one.

I'm looking on both WOW6432Node and the "normal" Uninstall registry because it seems MS made a boo-boo with their current Redists 2015-2019, no matter of the architecture x86/x64, the registration always ends up in WOW6432Node, and I wanted to be sure that I got it covered if/when they wise up.

Hope it helps you out a bit, or gives you an Idea of direction.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.