Link to home
Start Free TrialLog in
Avatar of ThinkPaper
ThinkPaperFlag for United States of America

asked on

Unattended Uninstall Script - command line equiv to Add/Remove button or better approach?

Hey guys
Got a problem. I need to create a script that automatically uninstalls ICS Viewer 6.0. I need help on how to tackle this.
After some research, turns out PureEdge does not support quiet uninstall string via MSIEXEC (which is what I normally use - thru ConfigureSoft). So I though, ok I'll just create an exe using Winbatch and just kick off the uninstall and have it automatically click the "yes/no" buttons to allow it to uninstall by itself. But my problem is, how to kick off the uninstall command?

I tried..
1)  RunDll32 C:\Program Files\Common Files\InstallShield\Engine\6\Intel 32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{E0000600-0600-0600-0600-000000000600}\setup.exe" -l0x9  -uninst
which (according to ConfigureSoft) is the uninstall string, but I tried it via command line and nothing happened.

2)  msiexec /x{E0000600-0600-0600-0600-000000000600}  (which is the uninstall key for ICS Viewer)
First a "Windows Installer" window popped up asking to continue. After the "yes" click, an error pops up saying that it's only valid for products that are currently installed, which doesnt make sense since the key is correct and it IS installed?!?!

What confuses me though is when I pull up Add/Remove Programs and scroll to ICS Viewer and click "Add/Remove" that way, it seems to uninstall fine. So my question is, is there a way to access this button via command line so I can kick off the uninstall? Is there a command line equivalent to this?

I know that appwiz.cpl is the command to run the Add/Remove Programs, but what is the command that actually runs when you click that Add/Remove button??! Is there a way to include parameters with it?

Or is there a better way to do this that I'm completely missing? Shouldn't msiexe /x work??!

Any help is appreciated, thanks!
ASKER CERTIFIED SOLUTION
Avatar of Ron Malmstead
Ron Malmstead
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That .vbs script will take care of it for you....  
PLEASE NOTE THAT ALL OF THIS SHOULD BE ONE LINE >>  ICSUNINSTALL = WshShell.Run("CMD /C RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup" & " c:\progra~1\Instal~1\{E0000600-0600-0600-0600-000000000600}\Setup.exe" & " -l0x9" &  " -uninst") <<
msiexec /x should work.  How did you get the product code?  You should be able to find it under here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
Avatar of ThinkPaper

ASKER

Thanks for the quick and helpful post! It was actually more info than I was expecting! (I sort of had an idea how to do the button trigger part)
Initially I ran your script, and it looked like it ran, but then I checked and it was still there. I found out that the script went thru the motions of uninstalling it but when it came to the actual uninstall part... it was like it faked it. =O
Then I realized, it was probably a permissions thing.. I wasn't running it under admin (doh!) and that seemed to be the fix =).
Now I just need to figure how to incorporate this into ConfigureSoft.
aleinss - thanks, I know where the uninstall key's located. I double checked just to make sure I had the right key. I think it's just that ICS Viewer doesn't play well with msiexec.. I've read that it's not really a standard so it's up to the vendors whether they want to use msiexec  (and it's switches) for their install/uninstall.