wklw2005 Posted November 30, 2012 Share Posted November 30, 2012 (edited) I need to remove some software from a few machines. I was going to use the uninstall string key in the registry but I am having issues and the strange thing is the uninstall string in different on other machines. Since I know the software is installed on all machines I thought I could work backwards. Execute the exe and write the script to just remove the software, reg keys, and directories.I was hoping someone could show me a way to add an IF statement. If the app is not there for some reason, I would like the script to skip and continue with the process. All together I have 10 apps to remove. Thanks for all the past support and the furture support! RunWait("ServenamepwxploreSetup.exe") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2)","Welcome to the Setup Wizard for ProjectWise Explorer V8i (SELECTseries 2)") Sleep (6000) Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","") send("{down}") send("{down}") Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","You have chosen to remove the program.") Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","Setup Wizard Completed") Send("{ENTER}") RegDelete('HKLMSoftwarebentleyprojectwise') RegDelete('HKLMSoftwarebentleyprojectwise Explorer') RegDelete('HKLMSoftwarebentleyProjectWise iDesktop Integration') RegDelete('HKLMSoftwarebentleyProjectWise Explorer Spatial Extension') DirRemove('C:Program FilesBentleyProjectWise' ,1) dirremove('C:ProgramDataBentleyProjectWise' , 1) DirRemove(@AppDataDir &"BentleyProjectWise",1) DirRemove('C:ProgramDataMicrosoftWindowsStart MenuProgramsBentleyProjectWise V8i (SELECTseries 2)', 1) RunWait("servernameBentley Installspwclt081107443enDependencyServicesetup.exe") WinWaitActive("ProjectWise Dependency Service V8i (SELECTseries 2)","") send("{tab}") send("{down}") Send("{ENTER}") WinWaitActive("ProjectWise Dependency Service V8i (SELECTseries 2)","Installation Complete") Send("{ENTER}") Edited November 30, 2012 by wklw2005 Link to comment Share on other sites More sharing options...
Gotemp Posted November 30, 2012 Share Posted November 30, 2012 (edited) I believe what you need is FileExists, also if it was me i would put each program into a function just to make it easier but maybe someone knows different example:func prog1() If FileExists("ServenamepwxploreSetup.exe]") Then <runs code> Else prog2() endif endfunc Func prog2 <see example above> endfuncFileExists: http://www.autoitscript.com/autoit3/docs/functions/FileExists.htm Edited November 30, 2012 by Gotemp Link to comment Share on other sites More sharing options...
wklw2005 Posted November 30, 2012 Author Share Posted November 30, 2012 something like this? I tried this but it did not work. func prog1() If FileExists ('C:\BentleyDownloads\pwclt081107443en') Then RunWait("C:\BentleyDownloads\pwclt081107443en") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2)","Welcome to the Setup Wizard for ProjectWise Explorer V8i (SELECTseries 2)") Sleep (6000) Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","") send("{down}") send("{down}") Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","You have chosen to remove the program.") Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","Setup Wizard Completed") Send("{ENTER}") Else endif endfunc Link to comment Share on other sites More sharing options...
Gotemp Posted November 30, 2012 Share Posted November 30, 2012 Close yes, you just need to add prog2() between "else" and "endif" then do program 2 in prog2 and follow suite. Im not sure if this is the best way but im sure someone will say when they check the thread im still learning myself. Link to comment Share on other sites More sharing options...
Chimaera Posted November 30, 2012 Share Posted November 30, 2012 It also has uninstall switches i belive have a look herehttp://communities.bentley.com/products/projectwise/content_management/w/wiki/5497.aspxspecifically this bit Un-install of existing ProjectWise modules can be first accomplished by using the following example: msiexec /x <full path>pwxplore.msi /qn Where /x = uninstall, and /qn = quiet, with no user input If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
wklw2005 Posted November 30, 2012 Author Share Posted November 30, 2012 Thank you so much for the support. I was able to get this to work. I owe somebody a Rum and coke muttley If FileExists ('C:\BentleyDownloads\pwclt081107443en') Then RunWait("C:\BentleyDownloads\pwclt081107443en") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2)","Welcome to the Setup Wizard for ProjectWise Explorer V8i (SELECTseries 2)") Sleep (6000) Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","") send("{down}") send("{down}") Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","You have chosen to remove the program.") Send("{ENTER}") WinWaitActive("ProjectWise Explorer V8i (SELECTseries 2) - Setup Wizard","Setup Wizard Completed") Send("{ENTER}") Else endif Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now