Sign in to follow this  
Followers 0
YoMarK

Software Distribution, ControlSend and Sleep

6 posts in this topic

I've found out about AutoIT a few days ago, and i think it's great! ;)

I'm trying to use AutoIt for software distribution(SMS 2003), using SMS and made the following script to install logitech's setpoint unattended and hidden.

run("SetPoint240nld.exe")
Sleep(10000)
ControlSend("SetPoint - InstallShield Wizard", "", "Button1", "{ENTER}")
Sleep(1000)
ControlClick("SetPoint - InstallShield Wizard", "", "Button5")
Sleep(1000)
ControlSend("SetPoint - InstallShield Wizard", "", "Button2", "{ENTER}")
Sleep(1000)
ControlSend("SetPoint - InstallShield Wizard", "", "Button1", "{ENTER}")
Sleep(1000)
ControlSend("SetPoint - InstallShield Wizard", "", "Button6", "{ENTER}")
Sleep(1000)
ControlSend("SetPoint - InstallShield Wizard", "", "Button1", "{ENTER}")
Sleep(90000)
ControlClick("SetPoint - InstallShield Wizard", "", "Button2")
Sleep(1000)
ControlSend("SetPoint - InstallShield Wizard", "", "Button5", "{ENTER}")

It works fine, but i'm not really that happy with the Sleep() functions that are necessary for ControlSend to work. I don's want the make them to long, and on a slow computer the delay can be to short(not sure).

I cannot use "normal" Send and something like WinWaitActive because( I think :P ) the installer/script is running in the background thus there are no Active Windows to send to.

Is there another way for the above script to work, without using delays ?

Thanks!!!

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Look into WinWait and WinWaitActive

WinWaitActive doesn't work(see my first post).

I've tried WinWait now, unfortuanally it also does not work.

run("SetPoint240nld.exe")
WinWait("SetPoint - InstallShield Wizard", "Welkom bij de InstallShield Wizard voor Logitech SetPoint")
ControlSend("SetPoint - InstallShield Wizard", "", "Button1", "{ENTER}")
WinWait("SetPoint - InstallShield Wizard", "Licentieovereenkomst")
ControlClick("SetPoint - InstallShield Wizard", "", "Button5")
Sleep(100)
ControlSend("SetPoint - InstallShield Wizard", "", "Button2", "{ENTER}")
WinWait("SetPoint - InstallShield Wizard", "Doellocatie selecteren")
ControlSend("SetPoint - InstallShield Wizard", "", "Button1", "{ENTER}")
WinWait("SetPoint - InstallShield Wizard", "Opties selecteren")
ControlSend("SetPoint - InstallShield Wizard", "", "Button6", "{ENTER}")
WinWait("SetPoint - InstallShield Wizard", "Gereed om het programma te installeren")
ControlSend("SetPoint - InstallShield Wizard", "", "Button1", "{ENTER}")
WinWait("SetPoint - InstallShield Wizard", "InstallShield Wizard voltooid")
ControlClick("SetPoint - InstallShield Wizard", "", "Button2")
Sleep(100)
ControlSend("SetPoint - InstallShield Wizard", "", "Button5", "{ENTER}")

I've compiled the code above into an .exe, en put it into SMS, where it will be distributed and then run under the Windows "System" account on the workstations.

The result is that two processes with the name SetPoint240nld.exe run in the background(doing nothing/hanging).

(The code in my first post however works fine.)

So it seems that WinWaitactive and WinWait do not work when run under the system account, which has no "normal" desktop.

Sleep() function however works fine, but I cannot rely on that because it will probably fail(delay to short) if a workstation is heavily used by a user.

Is there any other way ?

Edited by YoMarK

Share this post


Link to post
Share on other sites

As this is a InstallShield program, why don't you use a silent install with a response file?

See Installshield

You simply run "SetPoint240nld.exe -r" to record the installation and then "SetPoint240nld.exe -s" to replay the installation using the recorded data from the iss file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thank you guys(setpoint works great now)! ;)

Still I'm interested in doing something like this with AutoIT, because we want to install all our(new) software using software distribution(and many vendors are not using Wise or Installshield).

Something like a WinWait that works on hidden Windows ?

Share this post


Link to post
Share on other sites

Still I'm interested in doing something like this with AutoIT, because we want to install all our(new) software using software distribution(and many vendors are not using Wise or Installshield).

Hi,

we are using Software Distibution here as well (Empirum made by Matrix42 for about 1200 PCs and Notebooks). More than 95 percent of our Software uses MSI, Installshield or other installers that allow a silent install.

I would use the installers wherever possible because this is the supported way by SMS or whatever you use. For the rest of the SW we use a snapshot installation.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0