Sign in to follow this  
Followers 0
Grantson

UAC & Installing apps

14 posts in this topic

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]")

Share this post


Link to post
Share on other sites



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 believe

Chimaera

Share this post


Link to post
Share on other sites

#RequireAdmin only works on an uncompiled script i believe

Nope, it is just as effective on a compiled script. :unsure:

-smartee

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Chimaera

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I also suffer from this problem who can help us.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
Share on other sites

#9 ·  Posted (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. :unsure:

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 by MHz

Share this post


Link to post
Share on other sites

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. :unsure:

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

Share this post


Link to post
Share on other sites

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 !!!

Share this post


Link to post
Share on other sites

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 !!!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0