Hello members,
I need to install a scientific application that is packaged with WISE, across about 100 workstations in a Windows Active Directory environment. As a sysadmin I'm used to using scripts, etc to automate such processes but this particular software needed baby sitting to apply a registration key. So my usual vbScript, batch, PowerShell etc did not address the "baby sitting" task.
I have now used AutoIT pretty successfully so far to automate the installation and apply the registration keys. So far so good!
What I would now like to do is launch this script (compiled to an exe) from a group policy. My first thought was to launch it from a computer startup policy (i.e. when the workstation boots up, it announces itself to Active Directory and AD runs policies to it. The AutoIT compiled script was one of those.) This way, with suitable testing to see if the installation had already taken place, all my users had to do was turn on their workstations and wait a bit longer than usual that first time, while the installer ran. Nirvana!
I had the (scientific programme) installer set to "silently" install the programme using its /s switch and fired off by a Run command within my AutoIT script. Much of the process actually ran, but it would never apply the registration keystrokes. I worked out that this was because AutoIT was dependent on a "canvas" where it would expect to see "windows" appearing :-)
Okay, so what about running it from a user logon policy - when any user logs on, this would be one of the policies applied and there would be a desktop (a "canvas") on which the windows would appear, and AutoIT could detect them and proceed with poking out the registration keystrokes. Well, it worked but intermittently. Some workstations completed fine, others "hung" with the rego screen on display but obviously not recognised by my AutoIT script. I suspect this is due to these (hung) workstation's desktops not having settled down before the (scientific software) registration-step window appeared.
I could manually complete the rego screen tasks and the software got installed okay, but the AutoIT compiled script never went to completion presumably because it was still looking for what it thought of as a "missing" window.
I coded in several WinWaits and Sleeps and WinActivates in an effort to let it be more stable but I think there might be a way to detect "stability" in the desktop, or maybe you experienced folks have a better method to propose for cases.
My ideal of course would be to do it at computer boot time, but the lack of a "canvas" would seem to be a killer :-) The only way I can see that the WISE installer can communicate is via a windowed environment (no, the application has not been packaged for command-line installation! If it had, I would probably have remained an AutoIT spectator :-))
Worst comes to worst I could build in a huge time delay which should guarantee desktop stability, but that seems a kludge to me.
Kind regards,
Denis
P.S.
Hmmm... I wonder if I used the "timeout" parameter in WinWait and a loop to keep on waiting for success?? Maybe that would be more successful in a dynamic desktop environment? I.e....
Do
Sleep (1000)
Until (WinWait("Window title",, 1) <> 0)
My logic being that it would keep trying every second to detect the sought-after window, with a 1-second timeout (2 seconds overall loop timing.) Is that worth a try?