Jump to content

AutoIT compiled exe in an SCCM Task Sequence


 Share

Recommended Posts

I have a program that I can not package into an MSI for SCCM deployment so I was trying to script the install with AutoIT. We are using SCCM 2007 and need to put this application into a Task Sequence so that it installs during the image process of a new computer.

I compiled the script into an EXE. The script works and installs the application while I am logged into the computer but hangs and timeouts in the Task Sequence. I have found a few threads on this and tried adding an EXIT command to the end of the script and also set the option in the SCCM Package to "Allow users to interact with this program". Neither option helped. Here is my code.

; Script Start
Run("fh7ewks.exe")
WinWaitActive("FIREHOUSE Software 7.3","Welcome to FIREHOUSE Software 7.3")
Send("{SPACE}!n")
WinWaitActive("FIREHOUSE Software 7.3","Welcome to the FIREHOUSE Software 7.3 Setup Program.")
Send("!n")
WinWaitActive("FIREHOUSE Software 7.3","Setup will install FIREHOUSE Software in the following folder.")
Send("!n")
WinWaitActive("FIREHOUSE Software 7.3","Registration Information")
Send("City & Cpunty of Denver{TAB}Denver Fire Department{TAB}{TAB}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}!n")
WinWaitActive("FIREHOUSE Software 7.3","Confirm Registration Information")
Send("!n")
WinWaitActive("FIREHOUSE Software 7.3","Backup Replaced Files")
Send("!o!n")
WinWaitActive("FIREHOUSE Software 7.3","Additional Installation Options")
Send("!n")
WinWaitActive("FIREHOUSE Software 7.3","Connect to Database")
Send("!n")
WinWaitActive("FIREHOUSE Software 7.3","Configuration Location")
Send("!n")
WinWaitActive("FIREHOUSE Software 7.3","Start Installation")
Send("!n")
WinWaitActive("Remote Configuration - FIREHOUSE Software")
WinClose("Remote Configuration - FIREHOUSE Software")
;Send("{TAB}{TAB}w{TAB}firehouse{TAB}FH!l")
Sleep(5000)
;Send("{TAB}{TAB}dan{TAB}12345678{TAB}{SPACE}{TAB}{ENTER}")
WinWaitActive("Installation Complete")
Send("{SPACE}!f")
ShellExecuteWait(".\Utilities\FHPerm.bat")
Exit
Link to comment
Share on other sites

Maybe this is true for your situation as well.

So use WinExists() and ControlSend().

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I am learning how to use the ControlSend and so far it is working but I can not get the WinExists to work.

If I use the WinWaitActive with the ControlSend as below the Script will put a check in the correct box and hit the Next button to go to the next screen.

Run("fh7ewks.exe")
WinWaitActive("[CLASS:GLBSWizard]")
ControlSend("FIREHOUSE Software 7.3","Welcome to FIREHOUSE Software 7.3","[CLASSNN:Button1]", "{SPACE}!n")

But if I use the WinExists in the same manner it will not check the box or hit the next button so the script just stalls.

WinExists("[CLASS:GLBSWizard]")
ControlSend("FIREHOUSE Software 7.3","Welcome to FIREHOUSE Software 7.3","[CLASSNN:Button1]", "{SPACE}!n")
Link to comment
Share on other sites

in an if statement?

If WinExists("[CLASS:GLBSWizard]") Then

ControlSend("FIREHOUSE Software 7.3","Welcome to FIREHOUSE Software 7.3","[CLASSNN:Button1]", "{SPACE}!n")

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

I am going to try ControlClicks tomorrow and will post the results. I'm not so sure those are the problem. I think the problem is that there is not a normal user logged into the computer when the application is installing so the WinWaitActive might be the wrong command. Is there a way to install programs using ControlClick and ControlSend when no user is logged into to Windows?

Link to comment
Share on other sites

I tried an IF statement with ControlClick but I still can not get the WinExists to work. Here is the code. It seems like it is fairly easy to use but maybe I am missing something.

If WinExists("[CLASS:GLBSWizard]") Then
ControlClick("FIREHOUSE Software 7.3","Welcome to FIREHOUSE Software 7.3","[CLASSNN:Button1]")
EndIf

Here is what the AutoIT windo info gives me. Maybe I need to ues something else. I tried the Title and some of the text.

>>>> Window <<<<

Title: FIREHOUSE Software 7.3

Class: GLBSWizard

Position: 284, 122

Size: 500, 387

Style: 0x94C80080

ExStyle: 0x00000101

Handle: 0x00050240

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

Name:

Advanced (Class):

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle:

>>>> Mouse <<<<

Position: 553, 135

Cursor ID: 2

Color: 0x0055E7

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

New Installation

Update Existing Installation

Skip automatic search for existing installations

&Next >

Cancel

This option will allow you to install FIREHOUSE Software for the first time on this workstation or install additional instances on this workstation. You will not be given the option to update an existing installation.

This option will update an existing installation of FIREHOUSE Software on this workstation. The local hard drive will be searched for existing installation locations. This search may take several minutes. If you would prefer to skip the search and specify the location manually, place a check mark in the box below.

Welcome to FIREHOUSE Software 7.3

To proceed, please select the type of setup to perform...

>>>> Hidden Text <<<<

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