Jump to content

Checkboxes Installation


careca
 Share

Recommended Posts

This uses radio buttons to choose the applications you want to install, and a start button to install the checked ones.

2 more buttons (Select All and DeSelect All) in case you have a lot of checking to do...

#requireadmin
#include <GuiButton.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Opt ("TrayIconDebug", 1)
Opt ("TrayAutoPause", 0)
Opt ("TrayOnEventMode", 1)
Opt ("ExpandEnvStrings", 1)
Opt ("WinDetectHiddenText", 1)
Local $Msg, $button1, $button2, $button3
$Form1 = GUICreate ("AutoIt Install Menu", 510, 240, 200, 200)
$Label1 = GUICtrlCreateLabel ("Select a Program to install", 10, 10, 126, 17)
GUICtrlCreateGroup ("", 20, 20, 460, 175)
$Radio1 = GUICtrlCreateCheckbox (" YourAppName", 30, 30, 135, 17)
$Radio2 = GUICtrlCreateCheckbox (" YourAppName", 30, 50, 135, 17)
$Radio3 = GUICtrlCreateCheckbox (" YourAppName", 30, 70, 135, 17)
$Radio4 = GUICtrlCreateCheckbox (" YourAppName", 30, 90, 135, 17)
$Radio5 = GUICtrlCreateCheckbox (" YourAppName", 30, 110, 135, 17)
$Radio6 = GUICtrlCreateCheckbox (" YourAppName", 30, 130, 135, 17)
$Radio7 = GUICtrlCreateCheckbox (" YourAppName", 30, 150, 135, 17)
$Radio8 = GUICtrlCreateCheckbox (" YourAppName", 30, 170, 135, 17)
$Radio9 = GUICtrlCreateCheckbox (" YourAppName", 180, 30, 135, 17)
$Radio10 = GUICtrlCreateCheckbox (" YourAppName", 180, 50, 135, 17)
$Radio11 = GUICtrlCreateCheckbox (" YourAppName", 180, 70, 135, 17)
$Radio12 = GUICtrlCreateCheckbox (" YourAppName", 180, 90, 135, 17)
$Radio13 = GUICtrlCreateCheckbox (" YourAppName", 180, 110, 135, 17)
$Radio14 = GUICtrlCreateCheckbox (" YourAppName", 180, 130, 135, 17)
$Radio15 = GUICtrlCreateCheckbox (" YourAppName", 180, 150, 135, 17)
$Radio16 = GUICtrlCreateCheckbox (" YourAppName", 180, 170, 135, 17)
$Radio17 = GUICtrlCreateCheckbox (" YourAppName", 330, 30, 135, 17)
$Radio18 = GUICtrlCreateCheckbox (" YourAppName", 330, 50, 135, 17)
$Radio19 = GUICtrlCreateCheckbox (" YourAppName", 330, 70, 135, 17)
$Radio20 = GUICtrlCreateCheckbox (" YourAppName", 330, 90, 135, 17)
$Radio21 = GUICtrlCreateCheckbox (" YourAppName", 330, 110, 135, 17)
$Radio22 = GUICtrlCreateCheckbox (" YourAppName", 330, 130, 135, 17)
$Radio23 = GUICtrlCreateCheckbox (" YourAppName", 330, 150, 135, 17)
$Radio24 = GUICtrlCreateCheckbox (" YourAppName", 330, 170, 135, 17)
;=========================================================================================
$Button1 = GUICtrlCreateButton ("Start", 30, 200, 129, 25, 0)
GUISetState()
$Button2 = GUICtrlCreateButton ("Select All", 180, 200, 129, 25, 0)
GUISetState()
$Button3 = GUICtrlCreateButton ("UnSelect All", 330, 200, 129, 25, 0)
GUISetState()
While 1
    $Msg = GuiGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
        Exit
        Case $button1
            If BitAND (GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio2), $GUI_CHECKED) = $GUI_CHECKED Then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio3), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio4), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio5), $GUI_CHECKED) = $GUI_CHECKED then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio6), $GUI_CHECKED) = $GUI_CHECKED Then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio7), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio8), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio9), $GUI_CHECKED) = $GUI_CHECKED then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio10), $GUI_CHECKED) = $GUI_CHECKED Then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio11), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio12), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio13), $GUI_CHECKED) = $GUI_CHECKED then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio14), $GUI_CHECKED) = $GUI_CHECKED Then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio15), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio16), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio17), $GUI_CHECKED) = $GUI_CHECKED then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio18), $GUI_CHECKED) = $GUI_CHECKED Then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio19), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio20), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio21), $GUI_CHECKED) = $GUI_CHECKED then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio22), $GUI_CHECKED) = $GUI_CHECKED Then
                RunWait ("YourApp.exe")
   EndIf
            If BitAND (GUICtrlRead($Radio23), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
   If BitAND (GUICtrlRead($Radio24), $GUI_CHECKED) = $GUI_CHECKED Then
    RunWait ("YourApp.exe")
   EndIf
   Exit
    Case $button2
_GUICtrlButton_SetCheck($Radio1, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio2, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio3, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio4, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio5, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio6, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio7, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio8, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio9, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio10, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio11, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio12, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio13, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio14, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio15, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio16, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio17, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio18, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio19, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio20, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio21, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio22, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio23, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio24, $BST_CHECKED)
Case $button3
_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio4, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio5, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio6, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio7, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio8, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio9, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio10, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio11, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio12, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio13, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio14, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio15, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio16, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio17, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio18, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio19, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio20, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio21, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio22, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio23, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio24, $BST_UNCHECKED)
    EndSwitch
WEnd

post-68092-0-04548500-1319996789_thumb.p

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

Welcome to the AutoIt forum. :D

Might I suggest reading the Arrays tutorial in the Wiki - you might find you can shorten your script quite a bit if you use arrays: :rip:

#RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

; Declare arrays
Global $aRadio[24]
Global $aApps[24]

; Fill this array with the paths to your apps
$aApps[0] = "The\Path\To\Your_App_0.exe"
$aApps[1] = "The\Path\To\Your_App_1.exe"
$aApps[2] = "The\Path\To\Your_App_2.exe"
$aApps[3] = "The\Path\To\Your_App_3.exe"
$aApps[4] = "The\Path\To\Your_App_4.exe"
$aApps[5] = "The\Path\To\Your_App_5.exe"
$aApps[6] = "The\Path\To\Your_App_6.exe"
$aApps[7] = "The\Path\To\Your_App_7.exe"
$aApps[8] = "The\Path\To\Your_App_8.exe"
$aApps[9] = "The\Path\To\Your_App_9.exe"
$aApps[10] = "The\Path\To\Your_App_10.exe"
$aApps[11] = "The\Path\To\Your_App_11.exe"
$aApps[12] = "The\Path\To\Your_App_12.exe"
$aApps[13] = "The\Path\To\Your_App_13.exe"
$aApps[14] = "The\Path\To\Your_App_14.exe"
$aApps[15] = "The\Path\To\Your_App_15.exe"
$aApps[16] = "The\Path\To\Your_App_16.exe"
$aApps[17] = "The\Path\To\Your_App_17.exe"
$aApps[18] = "The\Path\To\Your_App_18.exe"
$aApps[19] = "The\Path\To\Your_App_19.exe"
$aApps[20] = "The\Path\To\Your_App_20.exe"
$aApps[21] = "The\Path\To\Your_App_21.exe"
$aApps[22] = "The\Path\To\Your_App_22.exe"
$aApps[23] = "The\Path\To\Your_App_23.exe"

$hGUI = GUICreate("AutoIt Install Menu", 510, 240, 200, 200)
GUICtrlCreateLabel("Select a Program to install", 10, 10, 126, 17)

GUICtrlCreateGroup("", 20, 20, 460, 175)

For $i = 0 To 2
    For $j = 0 To 7
        ; Extract the name of the app from the path
        $sName = StringRegExpReplace($aApps[($i * 8) + $j], "^.*\\|\..*$", "")
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

$hButton1 = GUICtrlCreateButton("Start", 30, 200, 129, 25, 0)
$hButton2 = GUICtrlCreateButton("Select All", 180, 200, 129, 25, 0)
$hButton3 = GUICtrlCreateButton("UnSelect All", 330, 200, 129, 25, 0)

GUISetState() ; You only need this once

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            ; You can loop through arrays like this - easier than using 24 similar statements 
            For $i = 0 To 23
                If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) = $GUI_CHECKED Then
                    ;RunWait($aApps[$i])
                    ConsoleWrite("Running: " & $aApps[$i] & @CRLF) ; Just to show that you will run the correct app
                EndIf
            Next
            Exit
        Case $hButton2
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_CHECKED)
            Next
        Case $hButton3
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_UNCHECKED)
            Next
    EndSwitch
WEnd

Saves a lot of wear on the typing fingers. :)

Please ask if you have any questions. :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thanks ppl, what an awesome modification! it did shorten the script a lot.

Never used arrays, got a bit confused about:

For $i = 0 To 2
    For $j = 0 To 7
        ; Extract the name of the app from the path
        $sName = StringRegExpReplace($aApps[($i * 8) + $j], "^.*\\|\..*$", "")
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

Gonna read the wiki.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

You know where we are if you get stuck. :D

M23

P.S. And StringRegExpReplace is one of the most complicated functions in AutoIt so do NOT get discouraged if you do not understand it straight away. :oops:

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Ok, thanks, got a problem, in the older script, the one i posted, i could set a name to the app, but now the .exe is the name, is there a way to set a name for a specific .exe? say, i got a exe "onetwothree.exe" and i would like to call it simply "1 2 3" can i do it?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

can i do it?

Certainly - and you could do it either of 2 ways. :D

- 1. You could have 2 arrays like this:

Global $aApps[24], $aPaths[24]

; Fill this array with the paths to your apps
$aApps[0] = "Your_App_Name"
$aPaths[0] = "The\Path\To\Your_App.exe"
;[...]

and then adjust the code to read from the relevant array when needed.

- 2. Or you could have a single 2D array which holds both path and name:

Global $aApps[24][2]

; Fill this array with the paths to your apps and their names
$aApps[0][0] = "Your_App"
$aApps[0][1] = "The\Path\To\Your_App.exe"
;[...]

and amend the code to call the correct element of the array when needed.

It is a question of personal choice which one you use. I would go for the first if you are unused to working with arrays, although I would consider the second more a elegant solution. :rip:

And in either case you avoid the need to use StringRegExp which is a good idea when strting out in AutoIt! :)

M23

P.S. I am away for the next couple of days but I am sure others will help in my absence. I am also going to ask for this thread to be moved to the "General Help" part of the forum as we seem to be doing more "Help" than "Example" at the moment. :oops:

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thanks man.

Decided to try the more elegant way you sugested, and according to what i understood, i changed the code:

; Fill this array with the paths to your apps
$aApps[0][0] = "ICO"
$aApps[0][1] = "ICO.exe"
$aApps[1][0] = "PowerCfg"
$aApps[1][1] = "PowerCfg.exe"
$aApps[2][0] = "DX9c"
$aApps[2][1] = "AutoIt DX9c.exe"
$aApps[3][0] = "Fraps"
$aApps[3][1] = "AutoIt Fraps.exe"
$aApps[4][0] = "GP+LS x64"
$aApps[4][1] = "AutoIt GP+LS x64.exe"
$aApps[5][0] = "Java"
$aApps[5][1] = "AutoIt Java.exe"
$aApps[6][0] = "Synaptics 14.0.3 x64"
$aApps[6][1] = "AutoIt Synaptics 14.0.3 x64.exe"
$aApps[7][0] = "AutoIt v3.3.6.1"
$aApps[7][1] = "AutoIt Auto v3.3.6.1.exe"
$aApps[8][0] = "PhysX 9.11.0621"
$aApps[8][1] = "PhysX 9.11.0621\Silent.bat"
$aApps[9][0] = "NirCmdVol"
$aApps[9][1] = "AutoIt NirCmdVol.exe"
$aApps[10][0] = "Realtek R266"
$aApps[10][1] = "Realtek R266\Silent.bat"
$aApps[11][0] = "Create Synchronicity 5.2.1"
$aApps[11][1] = "Create Synchronicity 5.2.1.exe"
$aApps[12][0] = "Logitech SetPoint"
$aApps[12][1] = "AutoIt Logitech SetPoint.exe"
$aApps[13][0] = "WinRar x64"
$aApps[13][1] = "AutoIt WinRar x64.exe"
$aApps[14][0] = "Foxit Reader"
$aApps[14][1] = "FoxitReaderPortable.exe"
$aApps[15][0] = "Intel Chipset 9.1.1.1025"
$aApps[15][1] = "AutoIt Intel Chipset 9.1.1.1025.exe"
$aApps[16][0] = "Nightly"
$aApps[16][1] = "AutoIt Nightly.exe"
$aApps[17][0] = "Notepad ++ 5.9.3"
$aApps[17][1] = "Notepad ++ 5.9.3 SFX.exe"
$aApps[18][0] = "MPC HC 1.5.0.2827 x64"
$aApps[18][1] = "MPC HC 1.5.0.2827 x64.exe"
$aApps[19][0] = "ATK Package"
$aApps[19][1] = "AutoIt ATK Package.exe"
$aApps[20][0] = "FlashPlayer"
$aApps[20][1] = "AutoIt FlashPlayer.exe"
$aApps[21][0] = "AIMP 3.00.934b5"
$aApps[21][1] = "AIMP 3.00.934b5.exe"
$aApps[22][0] = "Reserved"
$aApps[22][1] = ""
$aApps[23][0] = "Reserved"
$aApps[23][1] = ""
For $i = 0 To 2
    For $j = 0 To 7
        ; Extract the name of the app from the path
        $sName = ($aApps[*][0])
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

Now where is: "$sName = ($aApps[*][0])" it gets stuck because something is obviously wrong, my objective was to make it read all the variables ending in [0]. (used * like a wildcard)

This didnt work, but if i set "$sName = ($aApps[22][0])" it works and everything gets the corresponding name "Reserved".

Im gonna read some more, and try to understand how can i solve this, meanwhile if anyone has the solution feel free to help! :D

Greetz

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

You need to use the loop count variable to address the array elements - that is why you have it: :oops:

For $i = 0 To 2
    For $j = 0 To 7
        ; Extract the name of the app from the path
        $sName = ($aApps[$i][0]) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

All clear? :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hello, thanks for the fast answer, but, funny thing happened,

it now displays 3 rows of the first 3 variables, that is,

1st row all items are called ICO,

2nd PowerCfg,

3rd DX9c.

using $sName = ($aApps[$i][0])

just makes the function use

$sName = ($aApps[0][0]) for the 1st column

$sName = ($aApps[1][0]) for the 2nd column

$sName = ($aApps[2][0]) for the 3rd column

Similar thing happen with $j, but shows 3 columns with the same 7 names.

$i and $j are used to create the radio buttons and boxes.

From my understanding those work like this in this case:

$i = 30 distance horizontally from left to first column + 150 of distance for each of the next 2 columns

$j = 30 distance vertically from top to first item + 20 of distance for each of the next 6 items

this combined gives all items right? this means if i use one of those variables,

it will display either 3 rows with 3 different names or 3 columns with same 7 names.

What now? :S

Just realised the obvious working function is [($i * 8) + $j] and it works fine, now its obvious, was in front of my face lol.

$aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)

[($i * 8) + $j] gives all points to create the radio buttons, so, thats what i must use to make the names apear in all those points.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

Sorry a bit of a brain-fart in the last post. :D

You need to use the loop variables to determine the actual value like this - look for the <<<<<<<<<<< lines:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

; Declare arrays
Global $aRadio[24]
Global $aApps[24][2]

; Fill this array with the paths to your apps
$aApps[0][0] = "ICO"
$aApps[0][1] = "ICO.exe"
$aApps[1][0] = "PowerCfg"
$aApps[1][1] = "PowerCfg.exe"
$aApps[2][0] = "DX9c"
$aApps[2][1] = "AutoIt DX9c.exe"
$aApps[3][0] = "Fraps"
$aApps[3][1] = "AutoIt Fraps.exe"
$aApps[4][0] = "GP+LS x64"
$aApps[4][1] = "AutoIt GP+LS x64.exe"
$aApps[5][0] = "Java"
$aApps[5][1] = "AutoIt Java.exe"
$aApps[6][0] = "Synaptics 14.0.3 x64"
$aApps[6][1] = "AutoIt Synaptics 14.0.3 x64.exe"
$aApps[7][0] = "AutoIt v3.3.6.1"
$aApps[7][1] = "AutoIt Auto v3.3.6.1.exe"
$aApps[8][0] = "PhysX 9.11.0621"
$aApps[8][1] = "PhysX 9.11.0621\Silent.bat"
$aApps[9][0] = "NirCmdVol"
$aApps[9][1] = "AutoIt NirCmdVol.exe"
$aApps[10][0] = "Realtek R266"
$aApps[10][1] = "Realtek R266\Silent.bat"
$aApps[11][0] = "Create Synchronicity 5.2.1"
$aApps[11][1] = "Create Synchronicity 5.2.1.exe"
$aApps[12][0] = "Logitech SetPoint"
$aApps[12][1] = "AutoIt Logitech SetPoint.exe"
$aApps[13][0] = "WinRar x64"
$aApps[13][1] = "AutoIt WinRar x64.exe"
$aApps[14][0] = "Foxit Reader"
$aApps[14][1] = "FoxitReaderPortable.exe"
$aApps[15][0] = "Intel Chipset 9.1.1.1025"
$aApps[15][1] = "AutoIt Intel Chipset 9.1.1.1025.exe"
$aApps[16][0] = "Nightly"
$aApps[16][1] = "AutoIt Nightly.exe"
$aApps[17][0] = "Notepad ++ 5.9.3"
$aApps[17][1] = "Notepad ++ 5.9.3 SFX.exe"
$aApps[18][0] = "MPC HC 1.5.0.2827 x64"
$aApps[18][1] = "MPC HC 1.5.0.2827 x64.exe"
$aApps[19][0] = "ATK Package"
$aApps[19][1] = "AutoIt ATK Package.exe"
$aApps[20][0] = "FlashPlayer"
$aApps[20][1] = "AutoIt FlashPlayer.exe"
$aApps[21][0] = "AIMP 3.00.934b5"
$aApps[21][1] = "AIMP 3.00.934b5.exe"
$aApps[22][0] = "Reserved"
$aApps[22][1] = ""
$aApps[23][0] = "Reserved"
$aApps[23][1] = ""


$hGUI = GUICreate("AutoIt Install Menu", 510, 240, 200, 200)
GUICtrlCreateLabel("Select a Program to install", 10, 10, 126, 17)

GUICtrlCreateGroup("", 20, 20, 460, 175)

For $i = 0 To 2
    For $j = 0 To 7
        ; Read the name of the app from the array
        $sName = $aApps[($i * 8) + $j][0] ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

$hButton1 = GUICtrlCreateButton("Start", 30, 200, 129, 25, 0)
$hButton2 = GUICtrlCreateButton("Select All", 180, 200, 129, 25, 0)
$hButton3 = GUICtrlCreateButton("UnSelect All", 330, 200, 129, 25, 0)

GUISetState() ; You only need this once

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            ; You can loop through arrays like this - easier than using 24 similar statements
            For $i = 0 To 23
                If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) = $GUI_CHECKED Then
                    ;RunWait($aApps[$i])
                    ; And here we read the other element of the array <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                    ConsoleWrite("Running: " & $aApps[$i][1] & @CRLF) ; Just to show that you will run the correct app
                EndIf
            Next
            Exit
        Case $hButton2
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_CHECKED)
            Next
        Case $hButton3
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_UNCHECKED)
            Next
    EndSwitch
WEnd

$i and $j are used to create the radio buttons and boxes

Correct, but they are also used to access the name/path array as shown above. :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

LooL, Thanks man, check my post, for sure you were writing and couldnt see my edit.

:D

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

Looks like you got there yourself - always more satisfying that way. :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thanks a lot man, gonna check your sig, StringSize - Automatically size controls to fit text. seems nice :D

BTW do you know how to add icons before/next each radio button?

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

Use GUICtrlCreateIcon like this:

For $i = 0 To 2
    For $j = 0 To 7
        ; Extract the name of the app from the array
        $sName = $aApps[($i * 8) + $j][0]
        ; Create the icon
        GUICtrlCreateIcon($aApps[($i * 8) + $j][1], -1, 10 + ($i * 150), 30 + ($j * 20), 16, 16)
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

You will probably have to adjust the positions and/or size of the GUI and controls to fit everything in. :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Nice, but nothing happened, i noticed it is pointing to an already used array right?

GUICtrlCreateIcon($aApps[($i * 8) + $j][1], -1, 10 + ($i * 150), 30 + ($j * 20), 16, 16)

meaning

$aApps[*][1]

meaning that it points to an exe, does it read the exe's icon?

anyway, it wasnt working so i modified like this;

$aApps[0][0] = "ICO"

$aApps[0][1] = "ICO.exe"

$aApps[0][2] = "ICO.ico"

and

GUICtrlCreateIcon($aApps[($i * 8) + $j][2], -1, 10 + ($i * 150), 30 + ($j * 20), 16, 16)

All is good, thanks man! :D

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

meaning that it points to an exe, does it read the exe's icon?

Yes it should and indeed did when I tested. I notice you do not have the full paths to the executables listed in that array - that might be why it did not work for you and did for me. :oops:

But your way is fine if it works. :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Yeah, it works, and u see, i have this app pointing to other autoit auto installers, inside the same folder, but now i have this script in desktop, so it doesnt reach out to the exe's, meaning it didnt gave me any icon, its good to know it works with the exes, but in this case, it would have lots of the same autoit icons, so i rather have the icons i want, and have the script pointing out to them.

Starting to really like this array stuff, hehe :D

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Hi,

This script is great. However how to modify it to run/install applications one by one?

Once I select applications all of them run at the same time.

In my case the selected application calls and run autoit.exe + script file.au3.

Thanks for sharing the script

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...