Jump to content
Sign in to follow this  
MikeDub

Installer Automation

Recommended Posts

MikeDub

I've been searching the help files, browsing the forums here and all and still after three days can't get this (what I thought would be easy) install script to work.

Here's my issue:

At a 'Select Components' screen, I'm faced with a bunch of components to select (and unselect for some (it's SysTreeView32)). Now on some computers it seems that there are different required components already selected (as can be seen within the attachment (the shot on the left shows a component as a required default, the shot on the right shows the same component being an optional). Basically all I need 'checked' are the checkboxes you can see within the attachment.

How in the world can I iterate through all the checkboxes and select only what I need, other than what is already considered as a default requirement by the installer itself?

Any help deeply appreciated

Info tool shows this:

Class SysTreeView32

Instance 1

ClassnameNN SysTreeView321

Name

Advanced Mode [CLASS:SysTreeView32; INSTANCE:1]

ID 1000

Text Tree1

Position 26, 98

Size 270,161

ControlClick Coords 167,93

Style 0x50211007

ExStyle 0x00000204

Handle 0x001108CA

post-44988-0-21857300-1313174450_thumb.j

Share this post


Link to post
Share on other sites
storme

Here's my issue:

At a 'Select Components' screen, I'm faced with a bunch of components to select (and unselect for some (it's SysTreeView32)). Now on some computers it seems that there are different required components already selected (as can be seen within the attachment (the shot on the left shows a component as a required default, the shot on the right shows the same component being an optional). Basically all I need 'checked' are the checkboxes you can see within the attachment.

How in the world can I iterate through all the checkboxes and select only what I need, other than what is already considered as a default requirement by the installer itself?

Hi Mike

I just spent quite a while working out how to navigate Treeview so have a look at my code

It should be reasonably easy to get what you need from there.

My Guess is you won't need to worry about navigating down branches like I did so _GUICtrlTreeView_GetNext and _GUICtrlTreeView_GetText will be the heart of your code. Oh and of course the check and uncheck but they are all in the help file.

See what you can come up with and post if you are having any trouble.

Just remember to post the solution when you get it so others can learn from what you've done.

Good Luck

John Morrison

Share this post


Link to post
Share on other sites
sleepydvdr

Since that is an InstallShield installer, it may support the -r switch to record all the options you want to select. To test if that particular installer supports this option, create a batch file and in it write this:

start CodeDeSys_Installer.exe -r

I was guessing at the name of the installer, of course (CodeDeSys_Installer.exe). Replace that with its real name. If the record switch is supported, it will create a file in your Windows directory called setup.iss (c:\windows\setup.iss). Take that file and use it in conjunction with a -s switch to create a silent install with all the options you chose during your record session.

More information on how to do it:

http://www.appdeploy.com/tips/detail.asp?id=18


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
somdcomputerguy

How in the world can I iterate through all the checkboxes and select only what I need, other than what is already considered as a default requirement by the installer itself?

Maybe the ControlCommand() function (with the IsChecked, Check, and UnCheck command parameters) can be used here. Probably a For..Next loop will be helpful, use the Info tool to get the ID's or ClassnameNN's for all the checkbox buttons.

Here's some code I'm using to show you what I mean to say, and I'll insert a screenshot of the program I'm using the script for. Note that I'm not using ControlCommand in the For..Next loop, because I don't need it that way, but it could be if needed.

For $BSClassNN = 13 to 15
    $BScount += ControlGetText("Forum Spam List Checker", "", "Static" & $BSClassNN)
    For $FSClassNN = 18 To 20
        $FScount += ControlGetText("Forum Spam List Checker", "", "Static" & $FSClassNN)
        For $SFSClassNN = 23 to 25
            $SFScount += ControlGetText("Forum Spam List Checker", "", "Static" & $SFSClassNN)
        Next
    Next
Next

If $BScount > 0 Or $FScount > 0 Or $SFScount > 0 Then
    $Submittable  = ControlCommand("Forum Spam List Checker", "", "Button3", "IsChecked")
    $Submittable &= ControlCommand("Forum Spam List Checker", "", "Button4", "IsChecked")
    Switch $Submittable
        Case 00
            $SubmitTo = ""
        Case 01
            $SubmitTo = "Submit to Botscout?"
        Case 10
            $SubmitTo = "Submit to StopForumSpam?"
        Case 11
            $SubmitTo = "Submit to StopForumSpam and Botscout?"
    EndSwitch
    If $Submittable <> 00 And MsgBox(36, StringTrimRight(@ScriptName, 4), $SubmitTo) = 6 Then ControlCommand("Forum Spam List Checker", "", "Button5", "Check") ;Clicks the Submit button
EndIf

Posted Image


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
MikeDub

OK, I've finally been able to come back to my little project here.

Thanks for those who've replied; however, I'm still stuck.

Yes, this is an InstallShield app to start with; however, the -r switch does not work; no command line support at all (GRRRR).

I've tried the ControlCommand; however, I must be doing that wrong the whole way around.

Storme, yours is the best luck I've had (other than using the recorder; however, I can't simply do that (too many variables to face).

I was able to get the text of the first item and have it display correctly in a MsgBox; however, I cannot get the text of the next item. I tried GUICtrlTreeView_GetFirstItem($HWND) but that did't give me the text I was looking for.

Local $HWND = ControlGetHandle("InstallShield Wizard", "", "[CLASS:SysTreeView32; INSTANCE:1]")
Local $hCurrentItem = _GUICtrlTreeView_GetFirstItem($HWND)
$first = _GUICtrlTreeView_GetText($HWND, $hCurrentItem)
MsgBox(64,"Test",$first)

Now, after playing with the vendor's installer itself, I find myself faced with even a different issue.

If I were to manually install this application - after going through some of the prompts you find yourself at the 'select components' screen I show in that attachment.

Now, there are twelve components. When I run the installer on my system - only 11 of the 12 are selected by default; however, if I go to another machine and run the installer all 12 are chosen, a different machine again and only 9.... As you can see on that left image in the attachment some of the options are changeable and some are not...Now, if I uncheck one of the changeable checkboxes, that makes it so I can uncheck another..

For Example

The 12 components are (I'm using X to indicate an unchangeable state):

X CoDeSys V2.3

X CoDeSys base component

X 3S Licensing Manager

CoDeSys SoftMotion

CoDeSys HMI

X Communication modules

-----X CoDeSys Gateway Server (child of comm module)

------ CoDeSys OPC Server (child of comm module)

CoDeSys ENI Server

CoDeSys SP RTE

CoDeSys SP PLCWinNT

CoDeSys WebServer

Now, when I first run the vendor installer the component '3S Licensing Manager' is unchangeable - I cannot remove the checkmark. However, remove the checkmarks from all of the other 'changeable' checkboxes, it opens up the '3S Licensing Manager' so I can then uncheck that....

All I want checked are CoDeSys V2.3, CoDeSys base component, Communication modules, and CoDeSys Gateway Server.

I'm at a total loss here, especially with the how to start at the bottom of the tree and work my way up to check the current status and change it if needed

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.