Jump to content
Sign in to follow this  
neiro

Beginners trouble with script

Recommended Posts

neiro

Hello. I'm building software packages for use with a new sccm enviroment and ran into trouble.

Specificly, some software we use doesn't have support for silent installation, and rather than making an msi for each system type I opted to try out this new fancy autoit thing I googled earlier this week.

My problem is - my scripts work locally, but they do not work over sccm!

The problem at hand, is that I know nothing about autoit, so I just steal from the examples that followed. And almost all google searches lead me to autoits front page.

I used the waitwinactive and passing keypresses to the setup program to install. And when needed monitored for process exiting. This works as long as the program is run in interactive mode. But in sccm it is not. It's run under the local system account, and judging from the task manager my autoit scripts never find the setup window (suppose it can't be 'active' without a gui)

How would I go about solving this? is it even possible?

Here are a few examples of my scripts:

pcs10.1 to 11 upgrade:

Run("setup.exe")

WinWaitActive("Setup - PC|SCHEMATIC Automation Skole","InstUpd")

Send("{ENTER}")

WinWaitActive("Setup - PC|SCHEMATIC Automation Skole","licens rettigheder")

Send("!j")

WinWaitActive("Setup - PC|SCHEMATIC Automation Skole","Whereto")

Send("{ENTER}")

WinWaitActive("Har fundet et ""PC|SCHEMATIC Automation Skole"" systembibliotek ")

Send("!j")

WinWaitActive("Setup - PC|SCHEMATIC Automation Skole")

Send("!n")

WinWaitActive("Setup - PC|SCHEMATIC Automation Skole","confirm")

Send("!n")

WinWaitActive("Setup - PC|SCHEMATIC Automation Skole","infopage")

ProcessWaitClose("PCSELCAD.EXE")

Send("!o")

ProcessWaitClose("SETUPDPS.EXE")

elkat:

Run("setup.exe")

WinWaitActive("Velkommen")

Send("{ENTER}")

WinWaitActive("Oplysninger")

Send("{ENTER}")

WinWaitActive("Vælg komponenter")

Send("{TAB}{TAB}{ENTER}")

WinWaitActive("Vælg komponenter","Vælg installtype for katalog")

Send("{DOWN}{ENTER}")

WinWaitActive("Oplysninger")

Send("{ENTER}")

WinWaitActive("Installation udført ")

Send("{ENTER}")

ProcessWaitClose("_isdel.exe")

Anyone able to help me change the scripts to something that'd work?

Regards

Share this post


Link to post
Share on other sites
blckpythn

Are you using Run Advertised Programs?

This is more of a collections thing I think.

We run over SCCM fine.

Share this post


Link to post
Share on other sites
neiro

You mean from the control panel addin? Yes that's what I do.

The software that I install using installshield scripts or msi switches work, but those where I meant to use autoit to do key presses don't.

I can see the processes start, and even after an hour the memory usage of the setup hasn't changed. So I am guessing the autoit program doesn't ever get to press any keys in the window.

Edit: Could I perhaps borrow a couple of your scripts to see if I could learn something from them?

Edited by neiro

Share this post


Link to post
Share on other sites
neiro

Hey I think I solved my problem!

Sadly means I'll have to rerun all the installs to get the right control id's but it works. At least with the one program I tested (they all use the same custom installer)

How my script looks now: (disregard the file write - that was just to have some debugging info)

Run("setup.exe")

WinWait("Velkommen")

ControlClick("Velkommen","","[CLASSNN:TRadioButton1]")

FileWriteLine("c:\temp\unidoc.log","Velkommen installer")

ControlClick("Velkommen","","[CLASSNN:TButton2]")

FileWriteLine("c:\temp\unidoc.log","Velkommen naeste")

WinWait("Vælg drev/sti")

ControlClick("Vælg drev/sti","","[CLASSNN:TButton3]")

FileWriteLine("c:\temp\unidoc.log","Sti")

WinWait("Installer")

ControlClick("Installer","","[CLASSNN:TButton3]")

FileWriteLine("c:\temp\unidoc.log","Installer")

WinWait("Opretter program grupper og ikoner")

ControlClick("Opretter program grupper og ikoner","","[CLASSNN:TButton3]")

FileWriteLine("c:\temp\unidoc.log","Ikoner ja")

WinWait("Kald af eksterne setup programmer")

ControlClick("Kald af eksterne setup programmer","","[CLASSNN:TButton2]")

FileWriteLine("c:\temp\unidoc.log","bde nej")

WinWait("Færdig")

ControlClick("Færdig","","[CLASSNN:TButton4]")

FileWriteLine("c:\temp\unidoc.log","venter paa process slut")

ProcessWaitClose("SETUPDPS.EXE")

FileWriteLine("c:\temp\unidoc.log","faerdig")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.