Will AutoHotKey or AutoIt help during program installers>

Products and tips

Moderator: Site Mods

Post Reply
Gary M. Mugford
Bronze Member
Bronze Member
Posts: 150
Joined: 2009 Oct 14, 00:54
Location: Brampton ON Canada

Will AutoHotKey or AutoIt help during program installers>

Post by Gary M. Mugford »

Hi all, but 'specially you Kilmatead,

 I have an ungodly number of programs installed on my computer. With very, very few exceptions, NONE are installed in the default Microsoft Program Files sub-system. No, they get installed into F:\apps, where gawd (that would be ME) intended all MY programs to be installed. So, with each install or update, i have to check/uncheck boxes and eventually tell too many of the programs to install into F:\apps\Utils or F:\apps\Grafx or whereever, NOT to some location on C:.

 I've nibbled around with Ketarin, PatchMyPC and Ninite. And each does some things to ease my Sunday night burden of doing the updates. But it's the bloody need to manually do the same thing week in, week out that gnaws at me. So i went looking and found Silent Install Builder. http://silentinstall.org/

 Now, THAT is what I wanted. It runs as a side process and you form a 'script' by recording your actions. Then, I assume, it compiles into some executable that first loads the installer file and then silently installs it, making changes as you go along. I say assume because I haven't been able to get questions answered successfully by the author and dealing with Plimus has finally convinced me to no longer buy any product from them. And trial does not allow compiling. But the scripts DO work, mostly, from inside the IDE.

 But there ARE issues. I emailed him about recording a script for the installation of WireShark. At one point, the installer has some checkboxes, two of which I wish to change, inside a group control (I'm using Delphi terms, the actual term might be different). The recording script only acknowledges clicking on that parental control. No way could I get it to record the changed state for the checkboxes. OTHER checkboxes that resided directly on the paged installer would record, but not the child checkboxes. He, the author, never replied to me after a couple of exchanges earlier asking about Plimus.

 Plimus. They no longer accept Paypal for THIS account. A fact that required blind emails to support to ascertain. I called seven times in all to three different support numbers, one of which to actually ORDER the product (warts and all) and got HUNG UP ON somewhere between the second and seventh reminder that the company did value my business before going back to elevator music. I'm slow to learn, but I finally figured out they don't actually value my business. But now I know. I won't bother them EVER AGAIN.

 On the subject of automated credit card orders, I use an affiliate card for on-line purchases with a low limit and the verification process (that EXTRA password) is not available for affiliate cards. So, I prefer PayPal.

 So, the question is (What you thought I was never going to get to the point? This IS a message I hope Kilmatead has some fun with), is it possible to write the kind of checkbox clicking, field contents replacing AutoHotKey of AutoIt script that will let me do it once and forget about it until the installer writer changes the installer sequence on me?

 If so, then I will commence getting down and dirty with AutoHotKey. But I'd appreciate a head's up if I would be wasting my time.

 Thanks (and REALLY Thanks for reading so far!!). Regards, GM
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Will AutoHotKey or AutoIt help during program installers

Post by Kilmatead »

Gary M. Mugford wrote:This IS a message I hope Kilmatead has some fun with), is it possible to write the kind of checkbox clicking, field contents replacing AutoHotKey of AutoIt script that will let me do it once and forget about it until the installer writer changes the installer sequence on me?
I sort of "had fun" with your other post about EBook junkies, so this one gets the "lesser answer".

To be honest, I'm not entirely sure what you're trying to do (automate the automater you found, or create one yourself?)  In short though, the answer is Yes - virtually any field in any control in any window can be identified and "forced" into whatever state you may wish via scripting (checkboxes checked, radios radioed, input controls force-fed bespoke text, etc).  I suggest starting small, at first, find a programme with a few harmless controls in it, then figure out how to attach to the window handle, and manipulate the stuff inside.  It may take awhile to get the hang of it - but once you've done it successfully, any subsequent windows will be rather simple - just tedious, as you may have to manually identify the necessary controls one by one (both AutoIt and AHK supply a simple tool for this).

Personally, as you are already familiar with coding, I suggest you look at AutoIt as the syntax will come a bit more naturally - AHK syntax is like squatting and letting loose a thin gruel from the wrong end of a Sunday, if you know what I mean.  However, both languages can do effectively the same thing in the end when it comes to manipulating window behaviour - as that is, essentially, exactly what they were designed for in the first place.
Gary M. Mugford
Bronze Member
Bronze Member
Posts: 150
Joined: 2009 Oct 14, 00:54
Location: Brampton ON Canada

Post by Gary M. Mugford »

Kilmatead,

 Okay, so that I know there is promise in the land ahead, the rough idea is to use Ketarin to download the latest version of the programs into an UPDATES folder, using same name each time, rather than saving it a name that includes version number. I would then use the run after downloading feature of Ketarin to execute either the AHK or AU script.

 That script would shell out to run the setup.exe (or whatever name I use). WHILE that setup.exe is running, it would watch for window handles to do each of my changes. i.e.
 If window.handle.number = 2
   then begin
     click control.name.text = 'Install Toolbar' // click OFF
     click control.name.text = 'Create Desktop icon' // click OFF
     end;
 if window.handle.number = 4
   then settext control.name.text.selected = 'C:\Program Files\Whatever'
                     'F:\apps\Utils\Whatever';

 etc.

 So, running the script subsequent to creating it, should do the equivalent of a silent, unattended install using MY preferred options, including the alternative target folder. The trick is to get the window handle if it isn't consistent and, if the handle is the same through out the process, getting the tab page that is current (if only to click the NEXT/OK/FINISH button). I AM assuming I can execute the setup from within the file. I AM right on that?

 All joking aside, especially over at that OTHER answer, we in the x2 community and me in particular, really do appreciate the work you put in helping us out. Thanks. A lot.

 GM
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

The operative terms here are pertinent - "unattended" is fairly easy, "silent" (in the traditional sense) on the other hand is not so simple - you can experiment with the windows created by installers, but sometimes they become uncommunicative if forcibly hidden, and so on, though you might expect that.

The simplest means of getting window handles is literally from the Titlebars of the windows themselves, for instance, at its simplest to check if Notepad is running you'd simply do something like this (taken directly from the help file):

If WinExists("[CLASS:Notepad]") Then
   MsgBox(0, "", "Window exists")
EndIf

There are other ways as well, basing the test upon the precise window title. or a portion therein, and so on.  Once the condition is true, you can then send whatever commands you like to specific controls.  You may find this interesting to read, as it more or less deals with what you want to do.

If you search hard enough, I wouldn't be surprised if you didn't find something similar to what you want already done as an opensource project with either AutoIt or AHK - you may not need to reinvent the world, or battle with Plimus - check out their forums, and see what you find.  (They help people who help themselves, so don't just jump in saying "I wanna do this - make it do this" - just browse around before your ask anything - I can almost guarantee you'll find installer handlers, as people always seem to be asking about those actions.)

If you have specific questions feel free to PM me, I'm happy to help, but keep in mind that automating windows is not my strong-point, though I do understand the basic theory - the help file is your best friend. :D
Gary M. Mugford
Bronze Member
Bronze Member
Posts: 150
Joined: 2009 Oct 14, 00:54
Location: Brampton ON Canada

Post by Gary M. Mugford »

Kilmatead,

 Thanks. Forums lead to forums. In an ever tightening circle, I hope. But being the laziest man alive, I'm actually looking forward to this little issue. My only issue, guessing ahead, is that the installers won't be so much a series of separate windows with specific names, as a series of notebook pages within the same window. That is how I do my own installers through InstallShield.

 But it should be entertaining and learning is afoot. Thanks for the encouragement and I will certainly report the results. And if successful, share them.

 Regards, GM
Post Reply