vcredist icon indicating copy to clipboard operation
vcredist copied to clipboard

Dectection issues ConfigMgr VcRedist 2012, 2013, 2019

Open daroy opened this issue 5 years ago • 19 comments

Expected Behavior

VcRedist 2012, 2013, 2019 detected as installed by Config Mgr.

Current Behavior

VcRedist 2008 and 2010 are being installed and detected correctly by Config Mgr. VcRedist 2012, 2013, 2019 are being installed, they show up in Control Panel -> Add remove programs, but Config Mgr isn't detecting them as such. Capture

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. $VcList = Get-VcList
  2. Get-VcRedist -VcList $VcList -Path "C:\Temp\VcRedist"
  3. Import-VcConfigMgrApplication -VcList $VcList -Path "C:\Temp\VcRedist" -CMPath "\myshare" -SMSSiteCode xxx
  4. Deploy Visual C++ Redistributable for Visual Studio 2019 x64 to a collection in Config Mgr

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • VcRedist Version: 2.0.168
  • PowerShell Version: 5.1.17763.1007
  • Operating System: Server 2019 x64 and Windows 10 1909 x64

daroy avatar Apr 02 '20 14:04 daroy

Are the Windows Installer GUIDs not matching what's on the client?

aaronparker avatar Apr 03 '20 00:04 aaronparker

No the GUID that is in the application deployment type in Config Mgr for the 2019 x64 version is {282975d8-55fe-4991-bbbb-06a72581ce58}. I can't find that GUID on my test system at all after the software is installed and showing up in the Programs and features list where it can be repaired or uninstalled manually.

daroy avatar Apr 03 '20 07:04 daroy

There's a new version of the 2019 x86 & x64 VcRedist. I'll release a new version of the module with the updated GUIDs ASAP.

aaronparker avatar Apr 05 '20 23:04 aaronparker

I will wait for the update and try again. Please note the 2012 and 2013 versions weren't detected either.

daroy avatar Apr 06 '20 05:04 daroy

New version should be up on the Gallery in a few minutes.

Could you please check the GUID of the 2012 and 2013 versions on a client and compare to what's in the ConfigMgr app? Not sure why those versions are failing.

aaronparker avatar Apr 06 '20 07:04 aaronparker

From what location do you take the GUID's usually? Just to be sure that I am checking in the right place.

daroy avatar Apr 06 '20 08:04 daroy

HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

aaronparker avatar Apr 06 '20 10:04 aaronparker

I've just been trying to install Visual C++ Redistributable for Visual Studio 2012 Update 4 x64 through Config Mgr. It gets installed but Config Mgr is reporting it as failed as the application won't get discovered.

HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6} is present on the system and is the same GUID as in Config Mgr.

Would there be a change Config Mgr is only looking in HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall? As the GUID is only available in HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall?

Capture

daroy avatar Apr 07 '20 10:04 daroy

I am experiencing detection failures on the majority of the apps however the registry keys exist.

I do no ever use the Win32_Product class, but I did just for testing, and I do not see the GUIDs in there for the apps failing to discover after install.

Apps failing to discover post install:

  • 2019 x64 + x86
  • 2012 x64 + x86
  • 2013 x86

codaamok avatar Apr 17 '20 16:04 codaamok

{65e650ff-30be-469d-b63a-418d71ea1765} 2019 x86 {6913e92a-b64e-41c9-a5e6-cef39207fe89} 2019 x64 {33d1fd90-4274-48a1-9bc1-97e33d9c2d6f} 2012 x86 {ca67548a-5ebe-413a-b50c-4b9ceb6d66c6} 2012 x64 {9dff3540-fc85-4ed5-ac84-9e3c7fd8bece} 2013 x86

The above 100% exist in registry. 100% do not exist in Win32_Product.

This gist may be useful for some inspiration if you're interested in using registry based detection instead: https://gist.github.com/indented-automation/32efb05a5fb67ef9eed02bbb8fe90691 or this utility: https://reg2ps.azurewebsites.net/

codaamok avatar Apr 17 '20 16:04 codaamok

Example snippet generated from Roger Zander's tool

# Reg2CI (c) 2020 by Roger Zander
try {
	if(-NOT (Test-Path -LiteralPath "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{65e650ff-30be-469d-b63a-418d71ea1765}")){ return $false };
	if((Get-ItemPropertyValue -LiteralPath 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{65e650ff-30be-469d-b63a-418d71ea1765}' -Name 'DisplayVersion' -ea SilentlyContinue) -eq '14.25.28508.3') {  } else { return $false };
}
catch { return $false }
return $true

codaamok avatar Apr 17 '20 16:04 codaamok

I can feel the urge to give a huge middle finger to Microsoft right now.

I feel your pain.

codaamok avatar Apr 17 '20 16:04 codaamok

I am also struggling with this I see 3 reg keys for the current 2019 x64

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
{EEA66967-97E2-4561-A999-5C22E3CDE428} Microsoft Visual C++ 2019 X64 Minimum Runtime - 14.25.28508
{7D0B74C2-C3F8-4AF1-940F-CD79AB4B2DCE} Microsoft Visual C++ 2019 X64 Additional Runtime - 14.25.28508

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
{6913e92a-b64e-41c9-a5e6-cef39207fe89} Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.25.28508

NathanTheGr8 avatar Apr 17 '20 20:04 NathanTheGr8

I ended up just using a PowerShell detection method. The GUID detection was not working for the current executable. Note this will detect any version of c++ 2015-2019 x64. If you only want to detect a specific version modify the regex variable to include a version number.

#addapted from https://blog.niemalsnever.de/sccm-detection-script-for-the-visual-c-redistributable-s/

& {
    Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*
    Get-ChildItem HKLM:\SOFTWARE\WoW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
} | ForEach-Object { 
    $CurDisplayName = $_.GetValue("DisplayName") # Get DisplayName
    # Check if Display Name matches the regex
    $Regex = "^Microsoft Visual C\+\+ 2015-2019 Redistributable \(x64\).*"
    if( $CurDisplayName -match $Regex ) {
        Write-Host "Installed"
    }
}

NathanTheGr8 avatar Apr 21 '20 18:04 NathanTheGr8

@aaronparker perhaps re-open this so folks can easily see this and this thread?

codaamok avatar May 07 '20 11:05 codaamok

Good idea.

aaronparker avatar May 07 '20 11:05 aaronparker

I need to double check all product codes in the manifest; however, this detection method looks to work:

  • Registry
  • Hive: HKEY_LOCAL_MACHINE
  • Key: SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{65e650ff-30be-469d-b63a-418d71ea1765}
  • Value: DisplayVersion
  • Data Type: Version
  • Operator: Greater than or equal to or Equals
  • Value: 14.25.28508.3

aaronparker avatar Jun 24 '20 08:06 aaronparker

Just a note we're up to 14.28.29325.2 now and the method immediately above me does not work with this one unfortunately.

I ended up using this script myself which worked wonders.

https://github.com/aaronparker/VcRedist/issues/58#issuecomment-617332000

rlabrecque avatar Jan 19 '21 20:01 rlabrecque

I've added some changes to version 2.0.231 - see 7f592a8f0cc0853b852943e92e484cdf5ee17b86. This makes the following changes:

  • Creates a new application for every version - likely to only affect 2017 and 2019 as previous versions aren't typically updated any more
  • Uses a registry detection method for the appropriate ProductCode in the 32-bit or 64-bit UninstallKey (e.g. HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{33d1fd90-4274-48a1-9bc1-97e33d9c2d6f}) - I need to complete some more testing here in ConfigMgr, but the same approach with in Intune

Screenshots:

VcRedist1

VcRedist2

aaronparker avatar Mar 17 '21 12:03 aaronparker