Aldrinn Posted February 24, 2010 Share Posted February 24, 2010 Dear all, I have make a window where you can see what you are installing and how far it is. Now i'd like to check or uncheck programs what you can install. And to make my screen larger. ProgressOn('Installatie van Programmas', 'main', 'sub') ProgressSet(00, 'Installeren Programma 1 van 5', 'Diskdefrag') RunWait ("\\brainnas1\software\autoit\installers\diskdefrag.exe" ) Sleep(1000) ProgressSet(20, 'Installeren Programma 2 van 5', 'Foxit') RunWait ("\\brainnas1\software\autoit\installers\foxit.exe") ProgressSet(40, 'Installeren Programma 3 van 5', 'Realvnc 4.1.3') Sleep(1000) RunWait ("\\brainnas1\software\autoit\installers\realvnc 4.1.3.exe") ProgressSet(60, 'Installeren Programma 4 van 5', 'TuneUp') Sleep(1000) RunWait ("\\brainnas1\software\autoit\installers\TuneUp.exe") ProgressSet(80, 'Installeren Programma 5 van 5', 'Malwarebytes') Sleep(1000) RunWait ("\\brainnas1\software\autoit\installers\malware.exe") ProgressSet(100, 'Installeren Compleet', '') Sleep(1000) ProgressOff() naamloos.bmp I hope you can help my. Greet, Aldrinn Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2010 Moderators Share Posted February 24, 2010 Aldrinn,You need to create your own GUI if you want to change the size and use checkboxes. Here is a very basic script to show how you might go about it:expandcollapse popup#include <GUIConstantsEx.au3> ; Array to hold paths and names of the apps to install Global $aApps[5][2] = [["App1.exe", "App 1"], _ ["App2.exe", "App 2"], _ ["App3.exe", "App 3"], _ ["App4.exe", "App 4"], _ ["App5.exe", "App 5"]] ; Array to hold ControlIDs if the checkboxes Global $aChecks[5] $hGUI = GUICreate("Test", 500, 500) ; Create the checkboxes For $i = 0 To 4 $aChecks[$i] = GUICtrlCreateCheckbox($aApps[$i][1], 10, 10 + (20 * $i), 200, 20) Next $hButton = GUICtrlCreateButton("Install", 10, 120, 80, 30) $hlabel = GUICtrlCreateLabel("", 10, 180, 200, 20) $hProgress = GUICtrlCreateProgress(10, 200, 480, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton _Install() EndSwitch WEnd Func _Install() ; See how many apps to install - determines how far progress bar moves each time Local $iCount = 0 For $i = $aChecks[0] To $aChecks[4] If GUICtrlRead($i) = 1 Then $iCount += 1 Next If $iCount = 0 Then Return ; This will be increased for each app be install $iProgress = 0 ; Run through checkboxes to see which apps to install For $i = 0 To 4 If GUICtrlRead($aChecks[$i]) = 1 Then GUICtrlSetData($hlabel, "Installing " & $aApps[$i][1]) ; Simulate install ;RunWait($aApps[$i][0]) Sleep(5000) $iProgress += 100/$iCount GUICtrlSetData($hProgress, $iProgress) EndIf Next ; We have finished GUICtrlSetData($hlabel, "All installed") EndFuncYou will see I have used For...Next loops to shorten the code - but this means using arrays to hold the data so it can be accessed in the loops. If you are unsure on arrays, there is a very good tutorial in the Wiki.Ask if anything is unclear (after you have read the tutorial if it is about arrays!) M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now