Jump to content

Basic problem on Win7


rhd
 Share

Recommended Posts

Hi, I'm a new guy in here.

1. How should I run a exe file if it has spaces in it? For example "mozilla firfox setup.exe".

2. Sometimes I get User Account Control window and I can't get passed that,

    I do

WinWaitActive("User Account Control")
Send("!y")

but it doesn't pass. Any ideas? 

Link to comment
Share on other sites

  • Developers

1. Should work fine. Just specify the correct name.

2. UAC serves a purpose so when your script doesn't run in Admin level, the UAC prompt will be shown when required for the shelled installer and the user will have to allow it before your script continues.

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

That defeats the purpose of automating it though.

What if I run it as an admin and launch consecutive exe files, that won't ask pop up

the UAC each time right?

How about any other workaround?

Thanks you for the prompt response.

Edited by rhd
Link to comment
Share on other sites

  • Developers

That defeats the purpose of automating it though.

Correct, but wouldn't a possibility to automate it defeat the purpose of the UAC?

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

I agree, what if I run it as an admin initially and then run multiple exe files, will I have to give permission to each one?

When you run the Script with

#RequireAdmin

or, when you have the full SciTE4AutoIt3 installled, add the below to have the compiled script manifest updated to run on Admin level:

#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator

..then all processes shelled by the script should just run without an UAC prompt.

Jos

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

If you don't mind me asking, what software are you trying to install?  Quite a few installers have silent command line options, so you do not need to automate the installer windows themselves.  You could then install each application with the Run or RunWait commands, and look at return codes for success or failure.  

 

Adam

Link to comment
Share on other sites

I was trying to automate the installation of Firefox. I am attempting to see whether I can use Auto It or whether I might need to resort to python to do GUI automation. How do you check for return codes? I guess you might also iterate over all the installed programs in Win7 and if the program is there then it's success.

Link to comment
Share on other sites

You do not need to do a GUI automation to install Firefox.  To install Firefox silently, download the full installer from here, not the stub version from the main page.  If you want to do a straight silent install, then just execute with "-ms" command line switch.

 

 Here is an example script.  

#RequireAdmin

Global $sInstallDir = @TempDir & "\InstallFirefox"
DirCreate($sInstallDir) ;Create Install Directory

;Extract Firefox install File.
FileInstall("Firefox Setup 26.0.exe", $sInstallDir & "\", 1)

;Install Firefox.
$iReturn = RunWait('"' & $sInstallDir & '\Firefox Setup 26.0.exe" -ms', $sInstallDir, @SW_HIDE)

;Delete the install directory.
DirRemove($sInstallDir, 1)

;Exit the script, if error during installation, and return error code.
If $iReturn <> 0 Then Exit $iReturn

;Delete the icon from the Desktop. 
Global $sFirefoxDesktopShorcut = @DesktopCommonDir & "\Mozilla Firefox.lnk" 
If FileExists($sFirefoxDesktopShorcut) Then FileDelete($sFirefoxDesktopShorcut)
 

If you need custom settings, then that requires some additional configuration files.  If you have questions, please let me know.

 

 

Adam

Edited by AdamUL
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...