Jump to content

Problems trying to emulate a silent install


Recommended Posts

Hi,

 

I'm wondering if I could get some help.   We are trying to automate some of our installs of server software in AWS (using cloud formation)and the one I'm having problems with right now is log360 from ManageEngine.    Their installer does not have a silent option and I wanted to be able to use AutoIt to trigger this install via a cloud formation script?

 

So far, I have something like this written:

----

RunAs("Administrator", "domain", "password",0,'C:\Temp\ManageEngine_Log360_64bit.exe',"",@SW_HIDE)
WinWaitActive("Log360 5.5 setup","This wizard will ins")
Send("{Enter}")
WinWaitActive("Log360 5.5 setup","Press the PAGE DOWN ")
Send("{Enter}")
WinWaitActive("Log360 5.5 setup","Click Next to instal")
Send("{Enter}")
WinWaitActive("Log360 5.5 setup","Setup has enough inf")
Send("{Enter}")
WinWaitActive("Components Installer","")
Send("{Enter}")
WinWaitActive("Log360 5.5 setup","Registration for Tec")
Send("!n")
WinWaitActive("Log360 5.5 setup","Yes, I want to view ")
Send("{Enter}")

--

(domain, password is properly populated)

and am trying to trigger this when the server is built by having the name of the file as manageengine.au3 and in the cloud formation script its called as:

 

c:\s3-downloads\scripts\autoit.exe c:\s3-downloads\scripts\manageengine.au3

 

where autoit.exe is the autoit3_x64.exe version of the binary.

 

When I look at taskmanager (this is running on a windows 2012R2 server) , I can see it triggers the script  and launches the installer as the proper domain user from Manageengine, but it doesn't seem to progress.

Is there someone that could give me some advise on how to fix this?

Also, if I run this script from an active screen, it works fine.

Thanks in advance.

Link to comment
Share on other sites

let me look into it. look at the zip source files. it's working for me. this is the way you do it, never use Send, too unreliable. my udf allows you to wait forever for the desired control. to run remote, you may need to compile this to an exe for remote use purposes. Others will probably chime in, I hope

Installer.zip

once again, my awesome installer pattern working flawlessly. the zip has all the stuff you need except the installer itself

#AutoIt3Wrapper_Compression=3
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#RequireAdmin

#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#include 'log4a.au3'
#include 'WaitForControls.au3'

Const $TD_BTN_NEXT = '&Next >'
Const $TD_BTN_INSTALL = '&Install'
Const $TD_BTN_INSTALL2 = 'Install'
Const $TD_BTN_FINISH = 'Finish'
Const $TD_BTN_CANCEL = 'Cancel'
Const $TD_BTN_IAGREE = "I &accept the terms in the license agreement"
Const $TD_BTN_ALTFINISH = '&Finish'
Const $TD_BTN_ALLOW_ACCESS = '&Allow access'
Const $TD_BTN_REMOVE = '&Remove'
Const $TD_BTN_YES = '&Yes'
Const $TD_BTN_OK = 'OK'
Const $TD_BTN_TYPICAL = '&Typical'
Const $TD_EDIT_DATA = '99999'
Const $TD_TREE_NAME = 'Tree1'
Const $TD_BTN_SKIP = 'Skip'

Const $text = "Log360 5.1.0 setup"
Const $class = "[CLASS:#32770]"
Const $button1 = "[CLASS:Button; INSTANCE:1]"
Const $button2 = "[CLASS:Button; INSTANCE:2]"
Const $button3 = "[CLASS:Button; INSTANCE:3]"
Const $button4 = "[CLASS:Button; INSTANCE:4]"
Const $button5 = "[CLASS:Button; INSTANCE:5]"

#Region ;**** Logging ****
; Enable logging and don't write to stderr
_log4a_SetEnable()
; Write to stderr, set min level to warn, customize message format
_log4a_SetErrorStream()
_log4a_SetCompiledOutput($LOG4A_OUTPUT_FILE)
_log4a_SetMinLevel($LOG4A_LEVEL_DEBUG)
; If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled
_log4a_SetFormat("${date} | ${host} | ${level} | ${message}")
#EndRegion ;**** Logging ****

ShellExecute("ManageEngine_Log360_64bit.exe")

Func Install()

    _log4a_Info('Begin Install()')
    _checkClickCtrl($class, $text, $button1, $TD_BTN_NEXT, 0)
    _checkClickCtrl($class, $text, $button2, $TD_BTN_YES, 0)
    _checkClickCtrl($class, $text, $button1, $TD_BTN_NEXT, 0)
    _checkClickCtrl($class, $text, $button1, $TD_BTN_NEXT, 0)
    _checkClickCtrl($class, $text, $button4, $TD_BTN_SKIP, 0)
    _checkClickCtrl($class, $text, $button4, $TD_BTN_FINISH, 0)
    _log4a_Info('End Install()')

EndFunc   ;==>Install

Install()

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Hi,

 

Thank you for your help on this.  I've tried this plus tried a compiled version also, and it still seems to hang.  I've run this also from a console and it doesn't get past the launch of the Installer.

 

Any suggestions?   

 

Thanks.

 

Steve

 

Link to comment
Share on other sites

On 6/13/2019 at 7:32 PM, Steve_I said:

WinWaitActive

Also, if I run this script from an active screen, it works fine.

That's your problem.  Any of the Active or Activate functions can only be used if there is an active desktop for the user the app is running from.

Link to comment
Share on other sites

I don’t believe you’ve run my code at all. It creates a log file or displays log messages in the console. It works for me

Telling us it doesn’t work with no data don’t help

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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