Jump to content

Recommended Posts

Posted (edited)

Good day,

I have the following 2 scripts - one for install, and one for removal:

Spoiler
; -----------------------------------------------
#include <AutoItConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
Global $iTimeOut = 100
; ---------------------
Global $sSrcAppInstallPathInstRegGR5 = "D:\App_Install\Digital_Audio\2_GR5\Apps\NI_InstReg_GR5.exe"
Global $sSrcAppInstallPathGR5 = "D:\App_Install\Digital_Audio\2_GR5\Apps\GuitarRig5\Setup.exe"
; -----------------------------------------------
Install_GR5()
; -----------------------------------------------
Func Install_GR5()
    Local $sSrcPath1 = $sSrcAppInstallPathInstRegGR5
    Local $sSrcPath2 = $sSrcAppInstallPathGR5
    ; -----------------------------------------------
    ; Navigate through the dialogs
    Run($sSrcPath1)
    WinWaitActive("NI InstReg Guitar Rig 5 Setup")
    Send("{TAB}Sleep($iTimeOut){ENTER}")
    ; ---------------------
    Sleep($iTimeOut)
    Run($sSrcPath2)
    WinWaitActive("Native Instruments Guitar Rig 5 - InstallAware Wizard")
    Send("{ENTER 4}")
    ; ---------------------
    Sleep($iTimeOut)
    Send("{ALTDOWN}")
    Send("a")
    Send("{ALTUP}")
    Send("{ENTER}")
    ; ---------------------
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 776, 490, 1, 0)
    Send("{DOWN 2}{ENTER 2}")
    ; ---------------------
    ; Installation is now executed!
    Sleep($iTimeOut)
    Send("{TAB}{ENTER}{ENTER}")
    ; ---------------------
    ; Finish
    Sleep(17000)
    WinWaitActive("Native Instruments Guitar Rig 5 - InstallAware Wizard")
    Send("{ENTER}")
EndFunc   ;==>Install_GR5
; -----------------------------------------------

 

Spoiler
; -----------------------------------------------
#include <AutoItConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
RemoveApps()
; -----------------------------------------------
Func RemoveApps()
    RemoveGR5()
EndFunc   ;==>RemoveApps
; -----------------------------------------------
Func RemoveGR5()
    Local $sSrcPath = "C:\ProgramData\{DA31E3B5-AD7E-4759-A162-75CF964B70AC}\Setup.exe REMOVE = True MODIFY = FALSE"
    ; ---------------------
    Run($sSrcPath)
    Sleep(2000)
    Send("{ENTER}")
    Sleep(3000)
    Send("{ENTER}")
EndFunc   ;==>RemoveGR5
; -----------------------------------------------

 

My primary issue of concern is that I have to set "timers" for various sections, and during the removal script the final 'Finish" button is never clicked?!?

What am I doing wrong? Is ControlSend() preferred over Send()? Most of the applications that I am installing do require the focus!

As always...any assistance in this matter would be greatly appreciated!

Thank you all for your time!

Edited by mr-es335

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
×
×
  • Create New...