Hello,

I am creating a package to uninstall Spybot unattended. I have several versions of spybot to remove off machines. When i run the script i get the Windows Installer pop up. Any help would be greatly appreciated.
This is my script.
Christa

On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set WshShell = CreateObject("wscript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
strDisplayName = WshShell.RegRead ("HKLM\" & strKeyPath & "\" & subkey & "\DisplayName")
If strDisplayName = "Spybot - Search & Destroy" Then
WshShell.Run "msiexec.exe /norestart /X " & SubKey & " /qn", 7, True
End If
If strDisplayName = "Spybot - Search & Destroy 1.2" Then
WshShell.Run "msiexec.exe /norestart /X " & SubKey & " /qn", 7, True
End If
If strDisplayName = "Spybot - Search & Destroy 1.3" Then
WshShell.Run "msiexec.exe /norestart /X " & SubKey & " /qn", 7, True
End If
If strDisplayName = "Spybot - Search & Destroy 1.4" Then
WshShell.Run "msiexec.exe /norestart /X " & SubKey & " /qn", 7, True
End If
If strDisplayName = "Spybot - Search & Destroy 1.5.2.20" Then
WshShell.Run "msiexec.exe /norestart /X " & SubKey & " /qn", 7, True
End If
If strDisplayName = "Spybot - Search & Destroy 1.6.2" Then
WshShell.Run "msiexec.exe /norestart /X " & SubKey & " /qn", 7, True
End If
Next
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
When i run the script i get the Windows Installer pop up. What "Windows Installer pop up"?
Answered 04/14/2009 by: VBScab
Red Belt

Please log in to comment
0
Hey Christa...

You are getting the subkey name directly, maybe you need to take the UninstallString into this subkey... Perhaps the UninstallString is set to call a different productkey than the subkey or call a .exe to uninstall the package!
Answered 04/14/2009 by: clyrigham
Orange Belt

Please log in to comment
0
You are getting the subkey name directly, maybe you need to take the UninstallString into this subkey... Perhaps the UninstallString is set to call a different productkey than the subkey or call a .exe to uninstall the package!The EXE note is a good call but, for MSIs, I defy you to find a sub-key whose name was not in the uninstall string: a ProductCode is a ProductCode is a ProductCode.
Answered 04/15/2009 by: VBScab
Red Belt

Please log in to comment
0
Ok, did you not get a package made/digged by another person who made a s**t in that? So, I did... to your surprise the productcode was different and it uninstalled 2 applications in one time!

Otherthing: this is a forum to help other people, not to show who knows more than another Sir.


-- No cursing please -Bob
Answered 04/15/2009 by: clyrigham
Orange Belt

Please log in to comment
0
First, let me deal with the ProductCode. Please explain how - exactly - the Windows Installer engine uninstalled the product with the incorrect ProductCode. The packed GUID which is used to match features and components to that product would not match up so nothing would get uninstalled. Indeed, I'd expect the engine to present the message "This action is only valid for installed products." when the uninstall was attempted.

Second, whilst I am generally scathing about vendor packages, I rather fancy that, given the above i.e. a product which can't be uninstalled, a vendor would hastily release a package with no such error. If you're talking about internal packages, well, the author hopefully wouldn't last long enough to release more than one such package.

Lastly, let me deal with your attitude. No, on second thoughts, I don't think I'll bother.
Answered 04/15/2009 by: VBScab
Red Belt

Please log in to comment
0
Thanks for the explanation dude. But really I already knew about it

I know that package I mentioned in my last package was great error from the vendor (sorry if I do not remember what is the package, I think it was a internal software from a small company I worked, and I was responsable to replace that guy...)

When I wrote about the productcode may be different from the uninstallstring is because I lived this experience, sorry if I was stupid with you, but I was thinking your attitude to defy me was unnecessary. Sometimes in this forum I feel the members aren't friends to collaborate with others...

Stay in peace my friend!

Kind Regards,
Answered 04/15/2009 by: clyrigham
Orange Belt

Please log in to comment
0
Windows Installer V4.5.6001.22159
Answered 04/15/2009 by: christa.little
Yellow Belt

Please log in to comment
0
I get it, I get it....you get no installation, but a screen displaying the various arguments that you need to pass to MSIExec.EXE, right?

It's because you have an error of some kind in the command line. MSIExec can't interpret the whole line and thus abandons the whole exercise.
Answered 04/15/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity