Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Detect Slack x64 MSI Installer
- ' "Machine-wide" install - SYSTEM / "all users" style
- ' I'm confused about other MSI "versions".
- ' This one is named something like "slack-standalone-4.9.0.0_x64.msi"
- ' The per-user version needs you to be admin and writes to program files?
- ' Am I missing something here?
- ' -JT
- ' =-=-=-=-=-=
- ' let's call this 1.1? - JT
- ' This is designed for a MEMCM detection rule
- ' If an app with a matching name is found, it will spit out the name.
- ' If not... there is no output.
- ' To narrow by architecture, you can exclude or include the appropriate hive.
- ' This is meant to do exact matches.
- ' case sensitive
- MyAppName = "Slack Machine-Wide"
- HKEY_LOCAL_MACHINE = &H80000002
- HKEY_CURRENT_USER = &H80000001
- UninstallNative = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
- UninstallWow32 = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
- ProductsNative = "Software\Microsoft\Installer\Products\"
- ProductsSystem = "SOFTWARE\Classes\Installer\Products\"
- Set Reg = GetObject("winmgmts://./root/default:StdRegProv")
- ' Define the function, to be repeated for each key base
- Function FindApp (Hive, KeyBase)
- Reg.EnumKey Hive, KeyBase, Results
- ' look for ProductName instead of displayname - JT
- For Each Key in Results
- Reg.GetStringValue Hive, KeyBase & Key, "DisplayName", FoundAppName
- If (FoundAppName = MyAppName) Then
- wscript.echo FoundAppName
- End If
- Next
- End Function
- ' now run the function
- ' per user product search
- FindApp HKEY_LOCAL_MACHINE, UninstallNative
Add Comment
Please, Sign In to add comment