Jump to content

Scripting MSI Uninstall


ZThurlow
 Share

Recommended Posts

I know this is something that should be much easier... but it's crazy. When I run this command from command prompt: MsiExec.exe /X {5B51E040-91DA-11E7-A3C5-54EE755D74E2} /qn

Everything uninstalls perfectly... no prompts, no notifications, program gone. But using the same parameters in AutoIT... it either does not run or I get prompts to approve the uninstall. Hope that makes sense.

Link to comment
Share on other sites

It's going to be deployed in a GPO on several computers that don't have local admin rights. We'd like to run this as a domain administrator for that reason. When I add the "#requireadmin" at the top of the script, I get a prompt when I run it asking if I want to allow AutIT to run. By the way this compiled script is going to be run on only Windows 10 machines.

Link to comment
Share on other sites

You should be running it in the Startup or Log On part of the GPO under User settings, then you won't have to worry about permissions.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

should be #RequireAdmin    sorry ;)

you probably also need to use run() or shellexecute() in that case.

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Good thinking, I am a dumby and should have thought of that. So, I have striped everything down in the script to this:

Run ("MsiExec.exe /x {5B51E040-91DA-11E7-A3C5-54EE755D74E2} /qn")

 

It says it has finished... but nothing uninstalls still....

Link to comment
Share on other sites

  • Developers

try:

Run (@comspec & " /k  MsiExec.exe /x {5B51E040-91DA-11E7-A3C5-54EE755D74E2} /qn")

This should open a CMD window and stay open to be able to see errors.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

... and there is no msi process running?

We used RUN() so it isn't wainting for it to finish!

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Yes.. when I run the script 3 msiexec.exe processes appear. After a few seconds only one remains and the other two processes disappear. This is a pretty small program, so when I run the uninstall command from an elevated CMD for example...it takes about 10 seconds or less to uninstall.

Link to comment
Share on other sites

  • Developers

Is there no LOG generate by the MSI processes you can check for errors, as it seems the shelling of the program works fine?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

ok, just tested the installer in a vm. looks like /qn works for me. it takes a while though. It's not instant.give it a minute and check for it.

try, but change the first three parameters to your specs

RunAsWait ("username", "domain", "password", 4, "MsiExec.exe /x {5B51E040-91DA-11E7-A3C5-54EE755D74E2} /qn")

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...