Jump to content

AutoIT .msi unattended install issues (script inside)


Recommended Posts

Hey Guys, I am trying to write a script that will run a couple of .msi and .exe files. I have gone through and compiled all of the keystrokes. I converted the .au3 script to .exe to install on multiple laptops. The only thing the script does is open the Windows Installer which gives me the different switches I can use. The script is below:

 

Run("msiexec.exe 'C:\DATA\NEW Endpoint Encryption Framework Client v 8.2.0.msi'")
WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "will install symantec") 
Send("{ENTER}")
WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Next to install this folder")
Send("!N")
WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Click Install to begin")
Send("!I")
WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "has successfully installed")
Send("!F")
WinWaitActive("Symantec Endpoint Encryption Framework Client", "must restart your system")
Send("{TAB}")
Send("{ENTER}")

 

I was also hoping to compile multiple installs into one .au3 that I can convert into an .exe. I am new to all of this scripting stuff

Link to comment
Share on other sites


I have an .exe that seems to run fine using the same style of key strokes up until it gets to the windows security popup. I wish there was a way around this without having to find the certificate and installing it before hand. I am hoping to just image the laptop with the current image then run an .exe that installs the necessary software.

 

Run ("C:\DATA\NetMotion_client_Win7.exe")
WinWaitActive("NetMotion Mobility XE Client Setup", "strongly recommended")
Send("!N")
WinWaitActive("NetMotion Mobility XE Client Setup", "NETMOTION WIRELESS")
Send("!a")
Send("!N")
WinWaitActive("NetMotion Mobility XE Client Setup", "Setup will install")
Send("!N")
WinWaitActive("NetMotion Mobility XE Client Setup", "must know")
Send("{Tab}")
Send("domain address")
Send("{TAB}")
Send("{ENTER}")
WinWaitActive("NetMotion Mobility XE Client Setup", "not compatible")
Send("!N")
WinWaitActive("Windows Security", "Would you like to install")
Send("!A")
Send("!I")
WinWaitActive("NetMotion Mobility XE Client Setup", "Click the Finish")
Send("!F")
WinWaitActive("NetMotion Mobility XE Client Setup", "must restart")
Send("!N")

 

 

Link to comment
Share on other sites

Give this a try with you 2 posted scripts. Hopefully I made no mistakes.

#RequireAdminOpt('TrayIconDebug', 1)$pid = Run('msiexec.exe /i "C:\DATA\NEW Endpoint Encryption Framework Client v 8.2.0.msi"')If Not @error Then	WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "will install symantec") ; wait	WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "will install symantec") ; force activate	WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "will install symantec") ; wait til active	Send("{ENTER}")	;	WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Next to install this folder")	WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Next to install this folder")	WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Next to install this folder")	Send("!N")	;	WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Click Install to begin")	WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Click Install to begin")	WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Click Install to begin")	Send("!I")	;	WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "has successfully installed")	WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "has successfully installed")	WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "has successfully installed")	Send("!F")	;	WinWait("Symantec Endpoint Encryption Framework Client", "must restart your system")	WinActivate("Symantec Endpoint Encryption Framework Client", "must restart your system")	WinWaitActive("Symantec Endpoint Encryption Framework Client", "must restart your system")	Send("{TAB}")	Send("{ENTER}")	;	ProcessWaitClose($pid)EndIf$pid = Run ("C:\DATA\NetMotion_client_Win7.exe")If Not @error Then	WinWait("NetMotion Mobility XE Client Setup", "strongly recommended")	WinActivate("NetMotion Mobility XE Client Setup", "strongly recommended")	WinWaitActive("NetMotion Mobility XE Client Setup", "strongly recommended")	Send("!N")	;	WinWait("NetMotion Mobility XE Client Setup", "NETMOTION WIRELESS")	WinActivate("NetMotion Mobility XE Client Setup", "NETMOTION WIRELESS")	WinWaitActive("NetMotion Mobility XE Client Setup", "NETMOTION WIRELESS")	Send("!A")	Send("!N")	;	WinWait("NetMotion Mobility XE Client Setup", "Setup will install")	WinActivate("NetMotion Mobility XE Client Setup", "Setup will install")	WinWaitActive("NetMotion Mobility XE Client Setup", "Setup will install")	Send("!N")	;	WinWait("NetMotion Mobility XE Client Setup", "must know")	WinActivate("NetMotion Mobility XE Client Setup", "must know")	WinWaitActive("NetMotion Mobility XE Client Setup", "must know")	Send("{Tab}")	Send("domain address")	Send("{TAB}")	Send("{ENTER}")	;	WinWait("NetMotion Mobility XE Client Setup", "not compatible")	WinActivate("NetMotion Mobility XE Client Setup", "not compatible")	WinWaitActive("NetMotion Mobility XE Client Setup", "not compatible")	Send("!N")	;	WinWait("Windows Security", "Would you like to install")	WinActivate("Windows Security", "Would you like to install")	WinWaitActive("Windows Security", "Would you like to install")	Send("!A")	Send("!I")	;	WinWait("NetMotion Mobility XE Client Setup", "Click the Finish")	WinActivate("NetMotion Mobility XE Client Setup", "Click the Finish")	WinWaitActive("NetMotion Mobility XE Client Setup", "Click the Finish")	Send("!F")	;	WinWait("NetMotion Mobility XE Client Setup", "must restart")	WinActivate("NetMotion Mobility XE Client Setup", "must restart")	WinWaitActive("NetMotion Mobility XE Client Setup", "must restart")	Send("!N")	;	ProcessWaitClose($pid)EndIf

Pass /i to msiexec to invoke an install. ;)

 

Edit: I guess the security prompt you get is a unsigned driver install? You may need to change a Windows setting to allow that.

Edited by MHz
Link to comment
Share on other sites

Give this a try with you 2 posted scripts. Hopefully I made no mistakes.

Pass /i to msiexec to invoke an install. ;)

 

Edit: I guess the security prompt you get is a unsigned driver install? You may need to change a Windows setting to allow that.

 

Tahnk you for your resonse MHz. Unfortunately, it doesn't run like I intended it to. However, your input has greatly helped. I wasn't aware of the /I switch when running a .msi. When it attempts to run Symantec framework, it gets hung up on the very first screen. It looks like a window very quickly pops up and goes away, which is where the install goes away. However, there is a USSF that is supposed to work. how would I initiate:

 

msiexec.exe /i "NEW Endpoint Encryption Framework Client_x64  v 8.2.0.msi" /qb

Link to comment
Share on other sites

Upon another review, it looks like your text parameters are perhaps trimmed shorter from the right side of a string. AutoIt reads from the left.

 

i.e. a complete text string from the window

Do you want to begin install

.

This should work OK

Do you want

.

This I expect not to work

to begin install

You can choose any visible text line as a parameter though it needs to start from the left side.

 

You want to pass a switch. That would be more reliable IMO. Adding the switch is as easy as putting it behind the last double quote in the command string. I will change the Run to RunWait as you do not need to interact with any windows. Run returns the Process ID in $pid while RunWait returns an exitcode in $pid.

$pid = RunWait('msiexec.exe /i "C:\DATA\NEW Endpoint Encryption Framework Client v 8.2.0.msi" /qb')

So it is the same as your command string but just with single quotes around the whole string. ;)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...