Grantson Posted May 20, 2011 Share Posted May 20, 2011 Hi Guys I have written a small script to install Adobe Reader, ghostscript converter and CutePDF Adobe will run once i agree to the UAC box the converter.exe setup launches then nothing happens if I close it and launch it manually, again agreeing to uac the script kicks back in until the install is finished then stops I have run into this before where a script running with admin rights wont interact with applications running as user is there any way around this? #RequireAdmin RunWait("AdbeRdr.exe /sPB") RunWait("converter.exe") winwaitactive("WinZip Self-Extractor - converter.exe") ControlClick("WinZip Self-Extractor - converter.exe","","[ID:1]") RunWait("CuteWriter.exe") winwaitactive("Setup - CutePDF Writer") ControlClick("Setup - CutePDF Writer","","[ID:591008]") ControlClick("Setup - CutePDF Writer","","[ID:199138]") ControlClick("Setup - CutePDF Writer","","[ID:591008]") ControlClick("Setup - CutePDF Writer","","[ID:591008]") Link to comment Share on other sites More sharing options...
Chimaera Posted May 20, 2011 Share Posted May 20, 2011 If you compile your script to an .exe you need to put at the top#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator#RequireAdmin only works on an uncompiled script i believeChimaera 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...
smartee Posted May 20, 2011 Share Posted May 20, 2011 #RequireAdmin only works on an uncompiled script i believeNope, it is just as effective on a compiled script. -smartee Link to comment Share on other sites More sharing options...
Chimaera Posted May 21, 2011 Share Posted May 21, 2011 (edited) Thats odd I remember seeing it on a post quite a while ago, which is why i mentioned it And since i read it i always add both, sort of belt and braces ;o) Thanks for the correction Edited May 21, 2011 by Chimaera 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...
martin Posted May 21, 2011 Share Posted May 21, 2011 Hi Guys I have written a small script to install Adobe Reader, ghostscript converter and CutePDF Adobe will run once i agree to the UAC box the converter.exe setup launches then nothing happens if I close it and launch it manually, again agreeing to uac the script kicks back in until the install is finished then stops I have run into this before where a script running with admin rights wont interact with applications running as user is there any way around this? #RequireAdmin RunWait("AdbeRdr.exe /sPB") RunWait("converter.exe") winwaitactive("WinZip Self-Extractor - converter.exe") ControlClick("WinZip Self-Extractor - converter.exe","","[ID:1]") RunWait("CuteWriter.exe") winwaitactive("Setup - CutePDF Writer") ControlClick("Setup - CutePDF Writer","","[ID:591008]") ControlClick("Setup - CutePDF Writer","","[ID:199138]") ControlClick("Setup - CutePDF Writer","","[ID:591008]") ControlClick("Setup - CutePDF Writer","","[ID:591008]") Have you tried RunAsWait("Converter.exe") ? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
vietnamit Posted May 21, 2011 Share Posted May 21, 2011 I also suffer from this problem who can help us. Link to comment Share on other sites More sharing options...
MHz Posted May 21, 2011 Share Posted May 21, 2011 converter.exe is a rather primative type of setup package and the setup.exe inside it does not function well. A manual install shows problems and you may get a prompt from Windows that it may have not installed correct.Perhaps you can try the gs902w32.exe (32bit) or the gs902w64.exe (64bit) installer which is a NSIS based setup package. Look at the bottom of this page for the setup packages. You can install it with the parameter "/S". Note capital "S" as NSIS does not like lowercase parameters. CutePDF boasts that the latest version of GhostScript works with it so hopefully it will work fine. Link to comment Share on other sites More sharing options...
Grantson Posted May 23, 2011 Author Share Posted May 23, 2011 Downloaded the 2 versions of Gs mentioned in the above post and updated the script Ive temporarily removed cute PDF remains invisible to the script so i remporarily removed it and added in flash player again I still have the same issue, Reader installs Converter installs flash setup launches and then nothing happens, close flash, relaunch choosing run as administrator and the script picks up again from there, Link to comment Share on other sites More sharing options...
MHz Posted May 23, 2011 Share Posted May 23, 2011 (edited) You may need to define same issue. Your script posted for the topic uses RunWait() and then follows with WinWaitActive(). The WinWaitActive() will not happen until the process of RunWait() completes. You state that Flash does nothing and then you close Flash. Are you using RunWait() and WinWaitActive() again? If you are going to automate the GUI of an installer then Run() is perhaps more appropiate so the following WinWaitActive() can do it's magic while the process exists. Using WinActivate() before any use of WinWaitActive() is a good idea for unattended installs as well. Edit: The last line I mentioned should probably state the use of WinWait(), then WinActivate() and then WinWaitActive in the sequence of handling a window. I usually do a WinWait() and then use the Control*() functions which handle most tasks without needing windows to be active. Edited May 23, 2011 by MHz Link to comment Share on other sites More sharing options...
Grantson Posted May 23, 2011 Author Share Posted May 23, 2011 You may need to define same issue. Your script posted for the topic uses RunWait() and then follows with WinWaitActive(). The WinWaitActive() will not happen until the process of RunWait() completes. You state that Flash does nothing and then you close Flash. Are you using RunWait() and WinWaitActive() again? If you are going to automate the GUI of an installer then Run() is perhaps more appropiate so the following WinWaitActive() can do it's magic while the process exists. Using WinActivate() before any use of WinWaitActive() is a good idea for unattended installs as well. Edit:The last line I mentioned should probably state the use of WinWait(), then WinActivate() and then WinWaitActive in the sequence of handling a window. I usually do a WinWait() and then use the Control*() functions which handle most tasks without needing windows to be active.of course I used runwait at the top for the silent install of adobe reader then just copied and pasted the lines changing the exe's which was the 1st version should have remembered to remove them when i started coding the functionality *FAIL* lol - off to remove/retest Link to comment Share on other sites More sharing options...
roofninja Posted May 23, 2011 Share Posted May 23, 2011 Here are two points of advise... 1. Read up on switches for the command line. Many exe's have built-in switches for silent/passive/quite installs. Others have commands to tell the program to say yes for the agreement. You may not need the control clicks in the program. I have built many installers this way with the use of progress bar. 2. Try hand type running each program in the command line to see what error message that you may be getting. It could be stuck on something. RUN . . . Slide . . . TAG . . . Your out . . . PAINTBALL !!! Link to comment Share on other sites More sharing options...
Administrators Jon Posted May 23, 2011 Administrators Share Posted May 23, 2011 Um, RunWait() - as in it won't move to the next line until the exe has closed? Don't think that's what you want. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
roofninja Posted May 23, 2011 Share Posted May 23, 2011 Using this example: To silently install Firefox 4 you would use "Firefox Setup 4.0.exe -ms". To silently install Firefox 4 with an "ini" file you would use "Firefox Setup 4.0.exe /INI=ff.ini". Many pre-built exe's come with ways to make it easier to work with. Better? RUN . . . Slide . . . TAG . . . Your out . . . PAINTBALL !!! Link to comment Share on other sites More sharing options...
Grantson Posted June 6, 2011 Author Share Posted June 6, 2011 Thanks guys taking out the run waits did the trick for the most part Adobe reader installs using the /sPB switch then the new version of ghostscript (mentioned above)installs the appropriate version for x86 or x64 then the cute PDF Installer kicks off & is ignored, Flash IE & standalone installers kick off and run Shockwave installs i need to manually tell it not to install ask toolbar/norton, but this may be because i've not added the controls yet (couldn't find any commandline switches /? just launches the installer) Java installs fine I guess ill just need to jiggle the order leave cute PDF till last and do it manually 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