Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Using AutoIT to Uninstall

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,47459
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Using AutoIT to Uninstall
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Using AutoIT to Uninstall - 5/23/2007 2:41:47 AM   
  fferrel

 

Posts: 10
Score: 0
Joined: 5/21/2007
Status: offline
OK I've been crunching through this for a week now and I finally think I'm getting somewhere.  I want to uninstall a game using a vbscript and hopefully AutoIt can get me through the uninstall without any user interaction.  My current code is...


      

I ran AutoIt Window Finder.

Title:  Mario Forever 4.0 Uninstall
Class:  #32770

Class: Button
Instance: 1

Which is a [yes] command

Title:  Mario Forever 4.0 Uninstall
Class:  #32770

Class: Button
Instance: 1

Which is an [ok] command

I've read through http://tiger.la.asu.edu/Quick_Ref/AutoIt_quickref.pdf  and http://www.visualbasicscript.com/m_43807/mpage_1/key_autoit/tm.htm#43891 which is a similar post.

With the information given above, along with my code, how can I accomplish this with?

Thank you,

_____________________________

Frank -
 
 
Post #: 1
 
 RE: Using AutoIT to Uninstall - 5/23/2007 6:07:07 AM   
  fferrel

 

Posts: 10
Score: 0
Joined: 5/21/2007
Status: offline
Just an update.  I am using the following code and it seems to be working.  Thank you AutoIt!


      

_____________________________

Frank -

(in reply to fferrel)
 
 
Post #: 2
 
 RE: Using AutoIT to Uninstall - 5/23/2007 1:04:32 PM   
  dm_4ever


Posts: 2174
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
AutoIT must be installed on the PC's you intend to run this on.

A probable better solution is to build it completely with AutoIT and package it into an EXE which it allows you to do...this way it is self contained.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to fferrel)
 
 
Post #: 3
 
 RE: Using AutoIT to Uninstall - 5/24/2007 1:03:40 AM   
  fferrel

 

Posts: 10
Score: 0
Joined: 5/21/2007
Status: offline
What would be the most efficient way to loop this incase only 1 of the 4 games are installed?  This was done solely with AutoIt.  I plan to have the .exe stored on a mapped drive and initiate it through a .vbs script.


      

_____________________________

Frank -

(in reply to dm_4ever)
 
 
Post #: 4
 
 RE: Using AutoIT to Uninstall - 5/24/2007 1:27:15 AM  1 votes
  dm_4ever


Posts: 2174
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
This really isn't an AutoIT forum and I hardly use it, but looking at the docs there's a FileExists function

Before you try to execute the unistall...check to see if it is there...i.e.

If FileExists("C:\Program Files\LittleFighter2\LF2_v1.9c\uninst.exe") Then
   Run("C:\Program Files\LittleFighter2\LF2_v1.9c\uninst.exe")
EndIf

Sleep(3000)

If FileExists("C:\WINDOWS\MarioForever_Toolbar_Uninstaller_6484.exe") Then
   Run("C:\WINDOWS\MarioForever_Toolbar_Uninstaller_6484.exe")
   WinWaitActive("Mario Forever Toolbar Uninstaller")
   Send("!n")
   Sleep(1000)
   WinWaitActive("Mario Forever Toolbar Uninstaller")
   Send("!u")
   Sleep(4000)
   WinWaitActive("Mario Forever Toolbar Uninstaller")
   Send("!f")
EndIf
.....code

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to fferrel)
 
 
Post #: 5
 
 RE: Using AutoIT to Uninstall - 5/24/2007 1:37:57 AM   
  fferrel

 

Posts: 10
Score: 0
Joined: 5/21/2007
Status: offline
I apologize for posting an AutoIt question.

The FileExist function does work.  Thank you for all of your help.

_____________________________

Frank -

(in reply to dm_4ever)
 
 
Post #: 6
 
 RE: Using AutoIT to Uninstall - 5/24/2007 4:25:34 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Do not worry about asking questions here if it isn't a VBscript question, some but not all of us use AutoIT.  But since it isn't a VBscript question, this will be moved to the other languages forum, or what ever it is called.

With that out of the way, one question I have is, since it seems that the window titles are the same, might there be text in the window that would be different?  This way if your first send keys might have failed (i.e. sent to the wrong window) it will be certain to be on the correct window.

For example: (I only undated 1, and added DM's suggestion for using FileExists)

      

If you notice, I changed your winwaitactive to WinWait and then added a WinActivate.  My reasons for this are: WinWaitActive waits for the window to become active, move to the front of everything) and if that never happens your script would hang.  Using WinWait in it's place causes your script to wait till the window exists, does not have to be active, then it will activate the window and sendkeys to it.  Additionally, using WinWait you should not need to sleep as much, so I lowered those times.

With all that said, I have not tested this and have not worked with the uninstall for the apps, so you would be better to tell if the above will work or not.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to fferrel)
 
 
Post #: 7
 
 RE: Using AutoIT to Uninstall - 5/24/2007 5:25:51 AM   
  fferrel

 

Posts: 10
Score: 0
Joined: 5/21/2007
Status: offline
Thank you for the info on WinWait and WinActivate.  The above code does work however I added an If Then to the first game.

_____________________________

Frank -

(in reply to mbouchard)
 
 
Post #: 8
 
 RE: Using AutoIT to Uninstall - 5/24/2007 5:29:46 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Glad to help.  One last thing, with AutoIT you can display a non-modal message to warn people not to mess with the mouse and keyboard while you do the uninstall.  Take a look at SplashTextOn

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to fferrel)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Using AutoIT to Uninstall Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts