I’ve been banging my head against a wall with this, and it’s probably something simple I don’t see. Hopefully someone can help me (I know Jason Walker has been very helpful in the past).
I’m doing an if exists statement to see if I can match the existence of VC++ Redistributable installs listed in the registry on a Windows system before I uninstall them. This is all done in action script, not relevancy) since I’m looking for an uninstalling all older VC++ Redistributes from 2008 to 2013. I can easily do this in PowerShell, but I’m trying to force myself to use Action Script more with my tasks. I researched this till my nose bleeds and found many different ways to construct the if exists statement as well as the msiexec command, so I’ll list different ways I have found, and hopefully one will work with some tweaking. I’ve also been using the Fixlet Debugger to help, but it only goes so granular when debugging (by line not character/command/reserved word). In the debugger I keep seeing pop up messages when running my test actions about"completed but “pending a restart” (not sure why?) and then “expression contained a character which is not allowed” when adding curly brackets for relevancy.
if {exists value "DisplayName" whose (it as string = "Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022") of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)}
waithidden msiexec.exe /x {name of key whose (exists values "DisplayName" whose(it as string = "Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022") of it) of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)} /qn
endif
I’ve tried…
if exists (value "DisplayName" of it as string starts with "Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022") of keys of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)
if {exists (value "DisplayName" of it as string = "Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022") of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)}
…and many more. I’m using version 9.0.21022 of the 2008 redistribute, but I’ve used others in my testing and confirmed that they actually exist in the registry on the target system or on my own system when testing with Fixlet Debugger. I’ve even tested for installs listed in “HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall” as well. I’ve tried registry, native registry, x32 and x64 registry references, the curly brackets for relevancy statements, and more. Hopefully you guys can steer me in the right direction.
Note: I’m mostly going off of registry values from this helpful blog article: https://zzz.buzz/notes/vc-redist-packages-and-related-registry-entries/