Jump to content

Run compiled autoit exe file silently - (Moved)


Kajoe
 Share

Recommended Posts

Dear forum,

I have searched days for solutionsot about silent install of compiled autoit exe file. Tried to add compiled "Firefox.exe"  file to SFX with .vbs forsilent installation, but Exe file is not running with SFX. Than I tried to make MSI with EMCO. I made an SFX from .msi file with /qn parameters to install. That works. But these are a lot of steps and I am not sure if all is included in .msi file.

Problem:

When I use scriptwriter and add file in au3 script, it runs automaticly as it should, but with popup screens. I tried to hide the screens with @SW_HIDE, but it is not working.  Is there an easy way to make the scriptwriter part working without popupscreens? Is it possible that someone helps me with attached script to make it working without visible uI screens. Thank you very much.

#NoTrayIcon
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=favicon.ico
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Comment=
#AutoIt3Wrapper_Res_Description=
#AutoIt3Wrapper_Res_LegalCopyright=
#AutoIt3Wrapper_Res_Language=1043
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiStatusbar.au3>
#include <File.au3>
#include <Process.au3>
#NoTrayIcon
; Local include.
#include "_GUIResourcePic.au3"

Opt("TrayIconHide", 1)
Opt("TrayAutoPause", 0)
Opt("TrayIconDebug", 0)
Opt("SendKeyDelay", 50)

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

Sleep(200)

ProcessClose("MSIBuilder.exe")
ProcessClose("Setup Capture.exe")
ProcessClose("Au3Record.exe")
ProcessClose("Au3Record_x64.exe")
ProcessClose("taskmgr.exe")
ProcessClose("advinst.exe")

Local $sfldr1 = "C:\Windows\Temp\"
DirCreate($sfldr1)

FileInstall(".\FirefoxSetup79.0.exe", $sfldr1 & "\FirefoxSetup79.0.exe")

Sleep(2000)

FileSetAttrib($sfldr1, "+SH")

Run('FirefoxSetup79.0.exe')
WinWait("Mozilla Firefox-installatie", "Welkom bij de wizard")
If Not WinActive("Mozilla Firefox-installatie", "Welkom bij de wizard") Then WinActivate("Mozilla Firefox-installatie", "Welkom bij de wizard")
WinWaitActive("Mozilla Firefox-installatie", "Welkom bij de wizard")
Send("{TAB}{TAB}{ENTER}")
WinWait("Mozilla Firefox-installatie", "Installatieonderdele")
If Not WinActive("Mozilla Firefox-installatie", "Installatieonderdele") Then WinActivate("Mozilla Firefox-installatie", "Installatieonderdele")
WinWaitActive("Mozilla Firefox-installatie", "Installatieonderdele")
Send("{ENTER}")
WinWait("Mozilla Firefox-installatie", "Firefox is gereed vo")
If Not WinActive("Mozilla Firefox-installatie", "Firefox is gereed vo") Then WinActivate("Mozilla Firefox-installatie", "Firefox is gereed vo")
WinWaitActive("Mozilla Firefox-installatie", "Firefox is gereed vo")
Send("{ENTER}")
WinWait("Mozilla Firefox-installatie ", "Voltooien van de wiz")
If Not WinActive("Mozilla Firefox-installatie ", "Voltooien van de wiz") Then WinActivate("Mozilla Firefox-installatie ", "Voltooien van de wiz")
WinWaitActive("Mozilla Firefox-installatie ", "Voltooien van de wiz")

Sleep(2000)

ProcessClose("firefox.exe")
ProcessClose("iexplore.exe")
ProcessClose("chrome.exe")
ProcessClose("MicrosoftEdge.exe")

Sleep(2000)             ; sleep 20 seconds

DirRemove($sfldr1, 1)

Sleep(4000)

Firefox.au3

Edited by Jos
Added code in codebox in stead of attachment .....much easier to read!
Link to comment
Share on other sites

  • Developers

@Kajoe, Why aren't you using the silent installer options for FF?   
Most installers have a /S parameter to run it silent.

By the way: Does the Run actually work as it doesn't include the path, so how would it know where to find it?

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

Hi Jos;

Thank you for very quick reply. The exe files runs perfectly. 

Firefox is just a try out example for me, because it is a simple short install. That is why I was trying Scriptwriter with Firefox. But I need Scriptwriter for bigger programs. This is just as example. I need a solution for the scriptwriter part in the au3, or an option to run autoit compiled exe files to run silently. You know what I mean?

Link to comment
Share on other sites

  • Developers

I assume with scriptwriter you mean the output generated by a utility that recorded your actions? (not the way to go really!)
So try to avoid the Send() commands and use as much as possible to Control???() commands as they send the WindowsMessage to the appropriate window/control combination.  

Use au3info to get the appropriate window/control information and work from there.

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

Yes,  scriptrwriter to output generated by a utitlity that recorded the actions.

Is it maybe possible to write an example of what you mean with "avoid the Send() commands and use as much as possible to Control???() commands"? In my script part. If I see it visual is it clearly for me.

Run('FirefoxSetup79.0.exe')
WinWait("Mozilla Firefox-installatie","Welkom bij de wizard")
WinSetState("Mozilla Firefox-installatie","Welkom bij de wizard","",@SW_HIDE)
If Not WinActive("Mozilla Firefox-installatie","Welkom bij de wizard") Then WinActivate("Mozilla Firefox-installatie","Welkom bij de wizard")
WinWaitActive("Mozilla Firefox-installatie","Welkom bij de wizard")
Send("{TAB}{TAB}{ENTER}")
WinWait("Mozilla Firefox-installatie","Installatieonderdele")
WinSetState("Mozilla Firefox-installatie","Installatieonderdele","",@SW_HIDE)
If Not WinActive("Mozilla Firefox-installatie","Installatieonderdele") Then WinActivate("Mozilla Firefox-installatie","Installatieonderdele")
WinWaitActive("Mozilla Firefox-installatie","Installatieonderdele")
Send("{ENTER}")
WinWait("Mozilla Firefox-installatie","Firefox is gereed vo")
WinSetState("Mozilla Firefox-installatie","Firefox is gereed vo","",@SW_HIDE)
If Not WinActive("Mozilla Firefox-installatie","Firefox is gereed vo") Then WinActivate("Mozilla Firefox-installatie","Firefox is gereed vo")
WinWaitActive("Mozilla Firefox-installatie","Firefox is gereed vo")
Send("{ENTER}")
WinWait("Mozilla Firefox-installatie ","Voltooien van de wiz")
WinSetState("Mozilla Firefox-installatie ","Voltooien van de wiz","",@SW_HIDE)
If Not WinActive("Mozilla Firefox-installatie ","Voltooien van de wiz") Then WinActivate("Mozilla Firefox-installatie ","Voltooien van de wiz")
WinWaitActive("Mozilla Firefox-installatie ","Voltooien van de wiz")

 

Link to comment
Share on other sites

  • Developers
4 minutes ago, Kajoe said:

Is it maybe possible to write an example of what you mean with "avoid the Send() commands and use as much as possible to Control???() commands"?

The helpfile/forum and Wiki are stuffed with examples so just:

  1. open SciTE
  2. Open your script
  3. Start au3info and Ctrl+Alt+f (toggle freeze/unfreeze information)
  4. Start the installer and point the mousepointer at the button to click or field to fill and toggle au3info 
  5. Record the information of the control and insert the appropriate Controlxxx() function.
  6. etc etc

You will see it isn't that difficult. ;) 

Groet 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

Hi Jos, Here I am again. Now I saw what je mean with au3.info. But that is only for the controls. I am seeking for an option to hide the UI screen popups. The script works fully automatic. But not with @SW_HIDE. After I removed al that lines, script works good. But when running script the UI screens of installation from FIrefox setup are stil visible. I want to hide them fully. Or maybe there is an option to run a compiled AUTOIT.EXE file with a hiding command. The Exe is not running when I put the AUTOIT.EXE in an SFX file.

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