Sign in to follow this  
Followers 0
attactician

Need help coding multiple app installer

5 posts in this topic

Hello, I'm new to Autoit, but ran through the various tutorials and understand the basics of creating a GUI and installing one application, but I would like to create a GUI with the option to select from a series of buttons, or maybe a list of some kind, then install that particular application. I found tons of custom scripts to install single applications, but not multiple. Can anyone point me in the right direction?

Share this post


Link to post
Share on other sites



Take a look Here for an idea.

Or here's another simple one:

#include <GuiConstants.au3>
#Include <GuiListBox.au3>

$hWnd = GuiCreate("Installer")
GuiCtrlCreateLabel("Click to highlight items to install",5,5)
$hListBox = GUICtrlCreateList("",5,20,150,100,$LBS_MULTIPLESEL)
GUICtrlSetData(-1,"App1|App2|App 3|App4|App 5|App6","")
$hButton = GuiCtrlCreateButton("Install",5,120,50)

GuiSetState()

While 1
    $msg = GuiGetMsg()
    
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $hButton
            $aSelectedItems = _GUICtrlListBox_GetSelItemsText($hListBox)
            If IsArray($aSelectedItems) Then
                For $x = 1 to $aSelectedItems[0]
                    Execute(StringReplace($aSelectedItems[$x]," ","_") & "_Installer()")
                Next
            EndIf
    EndSwitch
    
    Sleep(50)
WEnd

Func App1_Installer()
    msgbox(0,"","Installing App1")
    ;installer code here.
EndFunc

Func App2_Installer()
    msgbox(0,"","Installing App2")
EndFunc

Func App_3_Installer()
    msgbox(0,"","Installing App3")
EndFunc

Func App4_Installer()
    msgbox(0,"","Installing App4")
EndFunc

Func App_5_Installer()
    msgbox(0,"","Installing App5")
EndFunc

Func App6_Installer()
    msgbox(0,"","Installing App6")
EndFunc

Share this post


Link to post
Share on other sites

Thanks, I'll give that a try!

Share this post


Link to post
Share on other sites

I have also made something like this. Do a forum search for: 'Best programs' without the ' of course.

Share this post


Link to post
Share on other sites

I have also made something like this. Do a forum search for: 'Best programs' without the ' of course.

Thanks! One question however, I have a mixture of msi and exe programs, and so far every code I try wants to install all of the programs simultaneously, rather than one after another. Do you know if this is an easy problem to fix? What do I need to add to my code so apps install sequentially? Thanks again for your help.

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