Jump to content

Automated Program Installation Project


Recommended Posts

Ok, so I have been working on a project to automate the installation of programs, and I am running into situations that I have not been able to overcome. Posting here has not been too fruitful. So I was wondering if anyone would like to help out with this project as I think it would be very useful to a lot of people.

I want to make it clear that I am not requesting anything. I am just a novice :graduated: trying to make something bigger than my own skills and was wondering if anyone with some time would be willing to help out with some of the more difficult portions.

Current features being worked on (some working, some in process, some partially working):

  • Gui Based (of course :idiot: )
  • Ability to edit all options via GUI (application names, paths, options, ect..)
  • One time application installs (PC already built, just need to install programs w,x,y,z) Select the apps, push a button and walk away.
  • Verify that pc name is available to help prevent issues.
  • Generating ini files that a client version would use to automatically install your chosen applications based on what the name of the PC or IP address was. Refer to next feature----->
  • Automated installation of predetermined applications via sysprepped images or fresh installs. This would be done by putting the client version (an *.exe) in startup or as a runonce. This would execute the previously chosen applications by reading the already generated ini file.
  • Custom buttons to select certain appications with one touch (This would be set in the options)
  • Auto logon for those applications that require reboots.
  • Mapping network shares as drives
Wish List :rambo:
  • Setting order for applications to be installed (app x has order 3 and app y has order 5, thus app x gets installed before app y in any situation)
  • Setting reboot option for application to be installed (app x has a reboot flag on it, so it will be ran last and perform some other things before and after rebooting)
  • Categorizing applications for group selections or individual selection (CD writer apps, system tools, ect..)
  • Possible CD/DVD support for the application sources (use DVD or CD to hold application sources)
  • Customizable skins and buttons (make your favorite jpeg the background or a button)
  • Possible database functionality instead of using ini files (SQL or Access)
  • Possible AD queries to verify users memberships to determine any other required applications based on memberships.
There are some applications out there similar to this, but they do not meet all my requirements and lack some functionality/flexibility I have been looking for. Let me know what you guys think o:)

Here is the code I have thus far:

When executing the "$Autoinstallghost" function and clicking canel, it does not go back to the main window as intented, I get an error in Scite "(790) : ==> Array variable subscript badly formatted.: ". I am not sure how to fix the issue as it runs fine by itself.

#include "GUIConstants.au3"
#include <Array.au3>
#include <file.au3>
Dim $yval
Dim $font                               = "Comic Sans MS"
Dim $Config
Global $serverping                      = "127.0.0.1"
Global $driveletter                         = "X:"
Global $autoconfigfile                  = "myfile.ini"
Global $Serverpath                      = '\\'& @ComputerName & '\Temp';add your PC name here
Dim $Mainwindow
Dim $appwindow
Dim $Config
Dim $EXIT
Dim $Autoinstallghost
Dim $InstallApps
Dim $masterarray
Dim $groupcount
Dim $mastercount
Dim $groupcheck
Dim $grouparray
Dim $groupypos
Dim $groupxpos
Dim $checkgroupsarray
Dim $cancelbutton
Dim $val
Dim $checkgroupsarray
Dim $uncheckbutton
Dim $groupnumber
Dim $checkedarray
Dim $labelarray
Global $child_gui

$Mainwindow = GUICreate("Installer", 600, 450, -1, -1, $WS_SIZEBOX, $WS_EX_APPWINDOW); will create a dialog box that when displayed is centered
GUISetState ()
$Config = GUICtrlCreateButton("Config", 520, 20, 65, 25)
$EXIT = GUICtrlCreateButton("EXIT", 520, 55, 65, 25)
GUICtrlCreateLabel("Network Status:", 400, 20, 80, 20)
GUICtrlCreateLabel("Drive Mapped:", 400, 40, 75, 20)
GUICtrlCreateLabel("Autoconfig File:", 400, 60, 80, 20)

Call ( "netping" )
Call ( "MntDrvX" )
Call ( "VerifyNVfile" )

;GUICtrlSetState(-1, $GUI_DISABLE)
$Autoinstallghost = GUICtrlCreateButton("Autoinstall For Ghost Images", 230, 165, 150, 25)
$InstallApps = GUICtrlCreateButton("Only Install Applications", 230, 200, 150, 25)
;Functon list
Func netping()
    $netvar = Ping($serverping & '', 200);Pings local site to verify network connectivity
    If $netvar Then; also possible:  If @error = 0 Then ...
        GUICtrlCreateLabel("UP", 475, 20, 20, 15, $SS_SUNKEN)
        GUICtrlSetBkColor(-1, 0x00ff00);Green
        GUIGetMsg()
      ;call ("MntDrvX");Mounts network drive that has the ghost images and other automation scripts
    Else
        GUICtrlCreateLabel("DOWN", 475, 20, 40, 15, $SS_SUNKEN)
        GUICtrlSetBkColor(-1, 0xff0000);Red
        GUIGetMsg()
    EndIf
EndFunc ;==>netping 
;Mount drive
Func MntDrvX()
    ;DriveMapAdd($driveletter & '', $Serverpath & '');network share that has the ghost images and other automation scripts
    ;$drivestat = DriveStatus($driveletter & "")
    ;If $drivestat = ("INVALID") Then
        ;MsgBox(4096, "Status", $drivestat)
        ;GUICtrlCreateLabel("DOWN", 475, 40, 40, 15, $SS_SUNKEN);verifies that drive is mapped
        ;GUICtrlSetBkColor(-1, 0xff0000);Red
        ;GUIGetMsg()
   ; Else
        GUICtrlCreateLabel("UP", 475, 40, 20, 15, $SS_SUNKEN)
        GUICtrlSetBkColor(-1, 0x00ff00);Green
        GUIGetMsg()
      ;gives an error message that drive is not mapped
    ;EndIf
EndFunc ;==>MntDrvX 
;Verify that file exists
Func VerifyNVfile();Verfies existence of the autoconfig file
    ;If FileExists($Serverpath & '\' & $autoconfigfile) Then
        GUICtrlCreateLabel("UP", 475, 60, 20, 15, $SS_SUNKEN)
        GUICtrlSetBkColor(-1, 0x00ff00);Green
        ;GUIGetMsg()
    ;Else
        ;GUICtrlCreateLabel("DOWN", 475, 60, 40, 15, $SS_SUNKEN)
        ;GUICtrlSetBkColor(-1, 0xff0000); Red
        ;GUIGetMsg()
    ;EndIf
EndFunc ;==>VerifyNVfile 
Func Checkgroup ($groupnumber)


$mastercount = 2

do

    if $checkgroupsarray [$groupnumber] [$mastercount] = 1 then
        GuiCtrlSetState($groupcheck[$mastercount], $GUI_CHECKED)
    endif
    
    $mastercount = $mastercount + 1

until $mastercount = UBound($masterarray)


EndFunc



Func Uncheckall()
;===========================================================================
;Function - Uncheck all boxes
;===========================================================================

$mastercount = 2

do

    GuiCtrlSetState($groupcheck[$mastercount], $GUI_UNCHECKED)
    $mastercount = $mastercount + 1

until $mastercount = UBound($groupcheck)



EndFunc

Func UserAppSelection ();linked to the Create User Button
    GUISetState(@SW_HIDE, $Mainwindow);disables the main window 
    $appwindow = GUICreate("MYCOMPANYNAME - User Software Loader", 920, 600)
;Create Groups
GuiCtrlCreateGroup("License-Managed Applications", 5, 150, 300, 400)
GuiCtrlCreateGroup("Unmanaged Applications", 315, 150, 300, 400)
GuiCtrlCreateGroup("Utilities and Tweaks", 625, 150, 290, 400)

;Create Buttons
$cancelbutton = GUICtrlCreateButton("&Cancel", 430, 560, 70, 30)
$okbutton = GUICtrlCreateButton("&Install", 350, 560, 70, 30)
GUICtrlSetFont ($okbutton, 9 , 600,0,"MS Dialog Light")

$uncheckbutton = GUICtrlCreateButton("&Uncheck All", 510, 560, 70, 30)

$rebootcheck = GUICtrlCreateCheckbox ("Reboot after install?", 600, 560, 120, 20)
    
    
GUISetState()




While 1


    $msg = GUIGetMsg()
Select

Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton
                GUISetState(@SW_SHOW, $Mainwindow)
                GUIDelete($appwindow)
                ExitLoop
    Case $msg = $uncheckbutton
        ;call ( "UnCheckAll")
    Case $msg = $okbutton
         EndSelect


Wend


  
EndFunc



Func Setconfigdata()
    GUISetState(@SW_DISABLE, $Mainwindow)
    If FileExists ( "C:\Programs Files\nStaller\config.ini") Then
        ;MsgBox(4096, "", "D: exists.")
            Else
        ;MsgBox(4096,"", "D: does not exist.")
    EndIf
    $appname = IniRead ( "C:\program files\nStaller\config.ini", "Applications", "name", "Not Found")
    $apppath = IniRead ( "C:\program files\nStaller\config.ini", "Applications", "path", "Not Found")
    $appcategory = IniRead ( "C:\program files\nStaller\config.ini", "Applications", "Category", "Not Found")
    $apporder = IniRead ( "C:\program files\nStaller\config.ini", "Applications", "order", "Not Found")
    $appreboot = IniRead ( "C:\program files\nStaller\config.ini", "Applications", "reboot", "Not Found")
    $child_gui = GUICreate("Installer Config", 600, 600, 550, 180)
    
    $tabcreate = GUICtrlCreateTab (10,10, 580,560)

    $tab1=GUICtrlCreateTabitem ("Defaults")
    GUICtrlSetState(-1,$GUI_SHOW)   ; will be display first
    $configapply = GUICtrlCreateButton("Save", 30, 575, 60, 20)
    $configcancel = GUICtrlCreateButton("Cancel", 100, 575, 60, 20)
    GUICtrlCreateLabel("Server to Ping:", 15, 40, 80, 20)
    GUICtrlCreateLabel("Location of User Files:", 15, 65, 150, 20)
    GUICtrlCreateLabel("Drive Letter to Map:", 15, 90, 150, 20)
    GUICtrlCreateLabel("Server Path:", 15, 115, 150, 20)
   
    $Changeserverping = GUICtrlCreateButton ( $serverping &"", 150, 35, 130, 20)
    $changeautoconfigfile = GUICtrlCreateButton ( $autoconfigfile &"", 150, 60, 130, 20)
    $Changedriveletter = GUICtrlCreateButton ( $driveletter &"", 150, 85, 130, 20)
    $Changeserverpath = GUICtrlCreateButton ( $serverpath &"", 150, 110, 130, 20)
    $tab2=GUICtrlCreateTabitem ("Users")
    $tab3=GUICtrlCreateTabitem ("Applications")
    $buttonapp1 = GUICtrlCreateButton (""& $appname, 15, 50, 120, 20)
    
    $tab3a=GUICtrlCreateTabitem ("Std/Dev/Arch")
    $app1 = GUICtrlCreateCheckbox ("Application 1", 15, 50, 120, 20)
    $app2 = GUICtrlCreateCheckbox ("Application 2", 15, 70, 120, 20)
    $app3 = GUICtrlCreateCheckbox ("Application 3", 15, 90, 120, 20)
    $app4 = GUICtrlCreateCheckbox ("Application 4", 15, 110, 120, 20)
    $app5 = GUICtrlCreateCheckbox ("Application 5", 15, 130, 120, 20)
    $app6 = GUICtrlCreateCheckbox ("Application 6", 15, 150, 120, 20)
    $app7 = GUICtrlCreateCheckbox ("Application 7", 15, 170, 120, 20)
    $app8 = GUICtrlCreateCheckbox ("Application 8", 15, 190, 120, 20)
    $app9 = GUICtrlCreateCheckbox ("Application 9", 15, 210, 120, 20)
    $app10 = GUICtrlCreateCheckbox ("Application 10", 15, 230, 120, 20)
    $app11 = GUICtrlCreateCheckbox ("Application 11", 15, 250, 120, 20)
    $app12 = GUICtrlCreateCheckbox ("Application 12", 15, 270, 120, 20)
    $app13 = GUICtrlCreateCheckbox ("Application 13", 15, 290, 120, 20)
    $app14 = GUICtrlCreateCheckbox ("Application 14", 15, 310, 120, 20)
    $app15 = GUICtrlCreateCheckbox ("Application 15", 15, 330, 120, 20)
    $app16 = GUICtrlCreateCheckbox ("Application 16", 15, 350, 120, 20)
    $app17 = GUICtrlCreateCheckbox ("Application 17", 15, 370, 120, 20)
    $app18 = GUICtrlCreateCheckbox ("Application 18", 15, 390, 120, 20)
    $app19 = GUICtrlCreateCheckbox ("Application 19", 15, 410, 120, 20)
    $app20 = GUICtrlCreateCheckbox ("Application 20", 15, 430, 120, 20)
    $app21 = GUICtrlCreateCheckbox ("Application 21", 15, 450, 120, 20)
    $app22 = GUICtrlCreateCheckbox ("Application 22", 15, 470, 120, 20)
    $app23 = GUICtrlCreateCheckbox ("Application 23", 15, 490, 120, 20)
    $app24 = GUICtrlCreateCheckbox ("Application 24", 15, 510, 120, 20)
    $app25 = GUICtrlCreateCheckbox ("Application 25", 15, 530, 120, 20)
    $app26 = GUICtrlCreateCheckbox ("Application 26", 300, 50, 120, 20)
    $app27 = GUICtrlCreateCheckbox ("Application 27", 300, 70, 120, 20)
    $app28 = GUICtrlCreateCheckbox ("Application 28", 300, 90, 120, 20)
    $app29 = GUICtrlCreateCheckbox ("Application 29", 300, 110, 120, 20)
    $app30 = GUICtrlCreateCheckbox ("Application 30", 300, 130, 120, 20)
    $app31 = GUICtrlCreateCheckbox ("Application 31", 300, 150, 120, 20)
    $app32 = GUICtrlCreateCheckbox ("Application 32", 300, 170, 120, 20)
    $app33 = GUICtrlCreateCheckbox ("Application 33", 300, 190, 120, 20)
    $app34 = GUICtrlCreateCheckbox ("Application 34", 300, 210, 120, 20)
    $app35 = GUICtrlCreateCheckbox ("Application 35", 300, 230, 120, 20)
    $app36 = GUICtrlCreateCheckbox ("Application 36", 300, 250, 120, 20)
    $app37 = GUICtrlCreateCheckbox ("Application 37", 300, 270, 120, 20)
    $app38 = GUICtrlCreateCheckbox ("Application 38", 300, 290, 120, 20)
    $app39 = GUICtrlCreateCheckbox ("Application 39", 300, 310, 120, 20)
    $app40 = GUICtrlCreateCheckbox ("Application 40", 300, 330, 120, 20)
    $app41 = GUICtrlCreateCheckbox ("Application 41", 300, 350, 120, 20)
    $app42 = GUICtrlCreateCheckbox ("Application 42", 300, 370, 120, 20)
    $app43 = GUICtrlCreateCheckbox ("Application 43", 300, 390, 120, 20)
    $app44 = GUICtrlCreateCheckbox ("Application 44", 300, 410, 120, 20)
    $app45 = GUICtrlCreateCheckbox ("Application 45", 300, 430, 120, 20)    
    $app46 = GUICtrlCreateCheckbox ("Application 46", 300, 450, 120, 20)
    $app47 = GUICtrlCreateCheckbox ("Application 47", 300, 470, 120, 20)
    $app48 = GUICtrlCreateCheckbox ("Application 48", 300, 490, 120, 20)
    $app49 = GUICtrlCreateCheckbox ("Application 49", 300, 510, 120, 20)
    $app50 = GUICtrlCreateCheckbox ("Application 50", 300, 530, 120, 20)

    
    $tab3b=GUICtrlCreateTabitem ("Custom1")
    $app1 = GUICtrlCreateCheckbox ("Application 1", 15, 50, 120, 20)
    $app2 = GUICtrlCreateCheckbox ("Application 2", 15, 70, 120, 20)
    $app3 = GUICtrlCreateCheckbox ("Application 3", 15, 90, 120, 20)
    $app4 = GUICtrlCreateCheckbox ("Application 4", 15, 110, 120, 20)
    $app5 = GUICtrlCreateCheckbox ("Application 5", 15, 130, 120, 20)
    $app6 = GUICtrlCreateCheckbox ("Application 6", 15, 150, 120, 20)
    $app7 = GUICtrlCreateCheckbox ("Application 7", 15, 170, 120, 20)
    $app8 = GUICtrlCreateCheckbox ("Application 8", 15, 190, 120, 20)
    $app9 = GUICtrlCreateCheckbox ("Application 9", 15, 210, 120, 20)
    $app10 = GUICtrlCreateCheckbox ("Application 10", 15, 230, 120, 20)
    $app11 = GUICtrlCreateCheckbox ("Application 11", 15, 250, 120, 20)
    $app12 = GUICtrlCreateCheckbox ("Application 12", 15, 270, 120, 20)
    $app13 = GUICtrlCreateCheckbox ("Application 13", 15, 290, 120, 20)
    $app14 = GUICtrlCreateCheckbox ("Application 14", 15, 310, 120, 20)
    $app15 = GUICtrlCreateCheckbox ("Application 15", 15, 330, 120, 20)
    $app16 = GUICtrlCreateCheckbox ("Application 16", 15, 350, 120, 20)
    $app17 = GUICtrlCreateCheckbox ("Application 17", 15, 370, 120, 20)
    $app18 = GUICtrlCreateCheckbox ("Application 18", 15, 390, 120, 20)
    $app19 = GUICtrlCreateCheckbox ("Application 19", 15, 410, 120, 20)
    $app20 = GUICtrlCreateCheckbox ("Application 20", 15, 430, 120, 20)
    $app21 = GUICtrlCreateCheckbox ("Application 21", 15, 450, 120, 20)
    $app22 = GUICtrlCreateCheckbox ("Application 22", 15, 470, 120, 20)
    $app23 = GUICtrlCreateCheckbox ("Application 23", 15, 490, 120, 20)
    $app24 = GUICtrlCreateCheckbox ("Application 24", 15, 510, 120, 20)
    $app25 = GUICtrlCreateCheckbox ("Application 25", 15, 530, 120, 20)
    $app26 = GUICtrlCreateCheckbox ("Application 26", 300, 50, 120, 20)
    $app27 = GUICtrlCreateCheckbox ("Application 27", 300, 70, 120, 20)
    $app28 = GUICtrlCreateCheckbox ("Application 28", 300, 90, 120, 20)
    $app29 = GUICtrlCreateCheckbox ("Application 29", 300, 110, 120, 20)
    $app30 = GUICtrlCreateCheckbox ("Application 30", 300, 130, 120, 20)
    $app31 = GUICtrlCreateCheckbox ("Application 31", 300, 150, 120, 20)
    $app32 = GUICtrlCreateCheckbox ("Application 32", 300, 170, 120, 20)
    $app33 = GUICtrlCreateCheckbox ("Application 33", 300, 190, 120, 20)
    $app34 = GUICtrlCreateCheckbox ("Application 34", 300, 210, 120, 20)
    $app35 = GUICtrlCreateCheckbox ("Application 35", 300, 230, 120, 20)
    $app36 = GUICtrlCreateCheckbox ("Application 36", 300, 250, 120, 20)
    $app37 = GUICtrlCreateCheckbox ("Application 37", 300, 270, 120, 20)
    $app38 = GUICtrlCreateCheckbox ("Application 38", 300, 290, 120, 20)
    $app39 = GUICtrlCreateCheckbox ("Application 39", 300, 310, 120, 20)
    $app40 = GUICtrlCreateCheckbox ("Application 40", 300, 330, 120, 20)
    $app41 = GUICtrlCreateCheckbox ("Application 41", 300, 350, 120, 20)
    $app42 = GUICtrlCreateCheckbox ("Application 42", 300, 370, 120, 20)
    $app43 = GUICtrlCreateCheckbox ("Application 43", 300, 390, 120, 20)
    $app44 = GUICtrlCreateCheckbox ("Application 44", 300, 410, 120, 20)
    $app45 = GUICtrlCreateCheckbox ("Application 45", 300, 430, 120, 20)    
    $app46 = GUICtrlCreateCheckbox ("Application 46", 300, 450, 120, 20)
    $app47 = GUICtrlCreateCheckbox ("Application 47", 300, 470, 120, 20)
    $app48 = GUICtrlCreateCheckbox ("Application 48", 300, 490, 120, 20)
    $app49 = GUICtrlCreateCheckbox ("Application 49", 300, 510, 120, 20)
    $app50 = GUICtrlCreateCheckbox ("Application 50", 300, 530, 120, 20)

    $tab3c=GUICtrlCreateTabitem ("Custom2")
    $app1 = GUICtrlCreateCheckbox ("Application 1", 15, 50, 120, 20)
    $app2 = GUICtrlCreateCheckbox ("Application 2", 15, 70, 120, 20)
    $app3 = GUICtrlCreateCheckbox ("Application 3", 15, 90, 120, 20)
    $app4 = GUICtrlCreateCheckbox ("Application 4", 15, 110, 120, 20)
    $app5 = GUICtrlCreateCheckbox ("Application 5", 15, 130, 120, 20)
    $app6 = GUICtrlCreateCheckbox ("Application 6", 15, 150, 120, 20)
    $app7 = GUICtrlCreateCheckbox ("Application 7", 15, 170, 120, 20)
    $app8 = GUICtrlCreateCheckbox ("Application 8", 15, 190, 120, 20)
    $app9 = GUICtrlCreateCheckbox ("Application 9", 15, 210, 120, 20)
    $app10 = GUICtrlCreateCheckbox ("Application 10", 15, 230, 120, 20)
    $app11 = GUICtrlCreateCheckbox ("Application 11", 15, 250, 120, 20)
    $app12 = GUICtrlCreateCheckbox ("Application 12", 15, 270, 120, 20)
    $app13 = GUICtrlCreateCheckbox ("Application 13", 15, 290, 120, 20)
    $app14 = GUICtrlCreateCheckbox ("Application 14", 15, 310, 120, 20)
    $app15 = GUICtrlCreateCheckbox ("Application 15", 15, 330, 120, 20)
    $app16 = GUICtrlCreateCheckbox ("Application 16", 15, 350, 120, 20)
    $app17 = GUICtrlCreateCheckbox ("Application 17", 15, 370, 120, 20)
    $app18 = GUICtrlCreateCheckbox ("Application 18", 15, 390, 120, 20)
    $app19 = GUICtrlCreateCheckbox ("Application 19", 15, 410, 120, 20)
    $app20 = GUICtrlCreateCheckbox ("Application 20", 15, 430, 120, 20)
    $app21 = GUICtrlCreateCheckbox ("Application 21", 15, 450, 120, 20)
    $app22 = GUICtrlCreateCheckbox ("Application 22", 15, 470, 120, 20)
    $app23 = GUICtrlCreateCheckbox ("Application 23", 15, 490, 120, 20)
    $app24 = GUICtrlCreateCheckbox ("Application 24", 15, 510, 120, 20)
    $app25 = GUICtrlCreateCheckbox ("Application 25", 15, 530, 120, 20)
    $app26 = GUICtrlCreateCheckbox ("Application 26", 300, 50, 120, 20)
    $app27 = GUICtrlCreateCheckbox ("Application 27", 300, 70, 120, 20)
    $app28 = GUICtrlCreateCheckbox ("Application 28", 300, 90, 120, 20)
    $app29 = GUICtrlCreateCheckbox ("Application 29", 300, 110, 120, 20)
    $app30 = GUICtrlCreateCheckbox ("Application 30", 300, 130, 120, 20)
    $app31 = GUICtrlCreateCheckbox ("Application 31", 300, 150, 120, 20)
    $app32 = GUICtrlCreateCheckbox ("Application 32", 300, 170, 120, 20)
    $app33 = GUICtrlCreateCheckbox ("Application 33", 300, 190, 120, 20)
    $app34 = GUICtrlCreateCheckbox ("Application 34", 300, 210, 120, 20)
    $app35 = GUICtrlCreateCheckbox ("Application 35", 300, 230, 120, 20)
    $app36 = GUICtrlCreateCheckbox ("Application 36", 300, 250, 120, 20)
    $app37 = GUICtrlCreateCheckbox ("Application 37", 300, 270, 120, 20)
    $app38 = GUICtrlCreateCheckbox ("Application 38", 300, 290, 120, 20)
    $app39 = GUICtrlCreateCheckbox ("Application 39", 300, 310, 120, 20)
    $app40 = GUICtrlCreateCheckbox ("Application 40", 300, 330, 120, 20)
    $app41 = GUICtrlCreateCheckbox ("Application 41", 300, 350, 120, 20)
    $app42 = GUICtrlCreateCheckbox ("Application 42", 300, 370, 120, 20)
    $app43 = GUICtrlCreateCheckbox ("Application 43", 300, 390, 120, 20)
    $app44 = GUICtrlCreateCheckbox ("Application 44", 300, 410, 120, 20)
    $app45 = GUICtrlCreateCheckbox ("Application 45", 300, 430, 120, 20)    
    $app46 = GUICtrlCreateCheckbox ("Application 46", 300, 450, 120, 20)
    $app47 = GUICtrlCreateCheckbox ("Application 47", 300, 470, 120, 20)
    $app48 = GUICtrlCreateCheckbox ("Application 48", 300, 490, 120, 20)
    $app49 = GUICtrlCreateCheckbox ("Application 49", 300, 510, 120, 20)
    $app50 = GUICtrlCreateCheckbox ("Application 50", 300, 530, 120, 20)

    GUICtrlCreateTabitem ("")   ; end tabitem definition
    
    
    GUISetState()
    
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $buttonapp1
                GUICreate ( "Change Application", 550, 200, 500, 300)
                GUISetBkColor(0xb7d245); Green
                GUICtrlCreateLabel ("Application Name:", 10, 10, 100, 20)
                GUICtrlCreateLabel ("Application Category:", 10, 30, 100, 20)
                GUICtrlCreateLabel ("Autoinstall File Path:", 10, 50, 100, 20)
                GUICtrlCreateLabel ("Application Order:", 10, 70, 100, 20)
                GUICtrlCreateLabel ("Reboot Required:", 10, 90, 100, 20)
                GUICtrlCreateInput (""& $appname, 120, 10, 200, 20)
                GUICtrlCreateInput (""& $appcategory, 120, 30, 200, 20)
                GUICtrlCreateInput (""& $apppath, 120, 50, 380, 20)
                GUICtrlCreateInput (""& $apporder, 120, 70, 50, 20)
                GUICtrlCreateInput ( ""& $appreboot, 120, 90, 50, 20)
                GUISetState()
            Case $msg = $configapply
                MsgBox(0, "", "Saved")
            Case $msg = $Changeserverping
                MsgBox(0, "", "Serverping changed")
            Case $msg = $Changeautoconfigfile
                MsgBox(0, "", "File Changed")
            Case $msg = $Changedriveletter
                MsgBox(0, "", "Driveletter changed")
            Case $msg = $Changeserverpath
                MsgBox(0, "", "Serverpath Changed")
            Case $msg = $GUI_EVENT_CLOSE Or $msg = $configcancel
                GUISetState(@SW_ENABLE, $Mainwindow)
                GUIDelete($child_gui)
                ExitLoop
                
        EndSelect
    WEnd
    
    
    
EndFunc ;==>Setconfigdata 
Func AppInstall ()
GUISetState(@SW_HIDE, $Mainwindow);Hides the main window    

if not Fileexists( "config.ini" ) then
    MsgBox(0, "Config.ini Error!", "Config.ini not found!")
    Exit
Endif


;==========================================================================
;Create and sort $masterarray, contains names of sections in ini file
;Create and sort $grouparray, contains names of sw groups
;==========================================================================


$groups = IniReadSection("config.ini","Groups")

if @error then
    MsgBox(0, "Config.ini Error!", "[Groups] section not found! You must have a [Groups] section at the top of config.ini!")
    Exit
Endif

Dim $masterarray

$masterarray = IniReadSectionNames("config.ini")
;_ArrayDisplay ( $Masterarray, "masterarray" )




$groupcount = 0

Dim $grouparray[UBound($groups)]

do

    $grouparray [$groupcount] = $groups [$groupcount] [1]
    $groupcount = $groupcount + 1

until $groupcount = UBound ($groups)



    


;===========================================================================
;INI Check for errors
;===========================================================================


$groupcount=2

do
    $val = IniRead("config.ini",$masterarray[$groupcount],"Location","UHOHNOTHINGHERE")
    if $val = "UHOHNOTHINGHERE" then
        MsgBox(0, "Config.ini Error!", "Location not found in config.ini: " & $masterarray[$groupcount] & Chr(13) & "All programs must have a location!")
        Exit
    Elseif not FileExists( $val ) then
        MsgBox(0, "Config.ini Error!", "File for " & $masterarray[$groupcount] & " not found at" & $val)
        Exit
    Else
        $groupcount = $groupcount + 1
    Endif
Until $groupcount = UBound ( $masterarray )


$groupcount = 2


do
    $val = IniRead("config.ini",$masterarray[$groupcount],"Type","UHOHNOTHINGHERE")
    if $val = "UHOHNOTHINGHERE" then
        MsgBox(0, "Config.ini Error!", "Type not found in config.ini: " & $masterarray[$groupcount] & Chr(13) & "All programs must have a type! (Managed, Unmanaged, or Utilities & Tweaks)")
        Exit
    Elseif StringLower($val) = "managed" or StringLower($val) = "unmanaged" or StringLower($val) = "Utilities & Tweaks" then
        $groupcount = $groupcount + 1
    Else
        MsgBox(0, "Config.ini Error!", 'Type for: ' & $masterarray[$groupcount] & ' must be "Managed", "Unmanaged", or "Utilities & Tweaks"!')
        Exit

    Endif
Until $groupcount = UBound ( $masterarray )


;===========================================================================
;Create $checkgroupsarray for groups
;===========================================================================


Dim $checkgroupsarray [Ubound($grouparray)] [Ubound($masterarray)]


$mastercount = 2

$groupcount = 1


do

do
    If StringLower(IniRead ("config.ini",$masterarray[$mastercount],$grouparray[$groupcount],"No")) = "yes" then
        $checkgroupsarray[$groupcount][$mastercount] = 1
    Endif
    $groupcount = $groupcount + 1
until $groupcount = UBound ($grouparray)

$groupcount = 1
$mastercount = $mastercount + 1

until $mastercount = UBound ($masterarray)






;===========================================================================
;Create GUI
;===========================================================================

    $appwindow = GUICreate("MYCOMPANYNAME - Software Loader", 920, 600)
;Create Groups
GuiCtrlCreateGroup("License-Managed Applications", 5, 150, 300, 400)
GuiCtrlCreateGroup("Unmanaged Applications", 315, 150, 300, 400)
GuiCtrlCreateGroup("Utilities and Tweaks", 625, 150, 290, 400)

;Create Buttons
$cancelbutton = GUICtrlCreateButton("&Cancel", 430, 560, 70, 30)
$okbutton = GUICtrlCreateButton("&Install", 350, 560, 70, 30)
GUICtrlSetFont ($okbutton, 9 , 600,0,"MS Dialog Light")

$uncheckbutton = GUICtrlCreateButton("&Uncheck All", 510, 560, 70, 30)

$rebootcheck = GUICtrlCreateCheckbox ("Reboot after install?", 600, 560, 120, 20)
    
    
GUISetState()
;==============================================
;Create Radio Button group and radio buttons
;==============================================


GuiCtrlCreateGroup("Software Profiles:", 20, 40, 170, 105)

$groupcount = 1
$groupypos = 60
$groupxpos = 30
Dim $groupradio[Ubound($grouparray)]
$groupradio[0] = "hi"

    do 
    
    $groupradio[$groupcount] = GUICtrlCreateRadio ($grouparray[$groupcount], $groupxpos, $groupypos, 140, 20)
    $groupcount = $groupcount+1
    $groupypos = $groupypos + 20

    if $groupypos > 120 then
        $groupypos = 60 
        $groupxpos = $groupxpos + 145
    Endif

    until $groupcount = Ubound($grouparray) or $groupcount = 25


GUICtrlCreateGroup ("",-99,-99,1,1)



;==============================================
;Create checkboxes
;==============================================


Dim $groupcheck[Ubound($masterarray)]
$groupcheck[0] = "hi"
$groupcheck[1] = "hi"

;==========
;Managed
;==========

$groupcount = 2
$groupypos = 180
$groupxpos = 10

do

    if IniRead ( "config.ini", $masterarray[$groupcount], "Type", "0" ) = "Managed" then
        $groupcheck[$groupcount] = GUICtrlCreateCheckbox ($masterarray[$groupcount], $groupxpos, $groupypos, 140, 20)
        $groupypos = $groupypos + 20
    Endif


    if $groupypos > 520 then
        $groupypos = 180    
        $groupxpos = $groupxpos + 140
    Endif


    $groupcount = $groupcount + 1   

until $groupcount = Ubound($masterarray)


;==========
;Unmanaged
;==========

$groupcount = 2
$groupypos = 180
$groupxpos = 320



do

    if IniRead ( "config.ini", $masterarray[$groupcount], "Type", "0" ) = "Unmanaged" then
        $groupcheck[$groupcount] = GUICtrlCreateCheckbox ($masterarray[$groupcount], $groupxpos, $groupypos, 140, 20)
        $groupypos = $groupypos + 20
    Endif

    if $groupypos > 520 then
        $groupypos = 180    
        $groupxpos = $groupxpos + 145
    Endif


    $groupcount = $groupcount + 1   

until $groupcount = Ubound($masterarray)



;==========
;Utilities & Tweaks
;==========


$groupcount = 2
$groupypos = 180
$groupxpos = 630



do

    if IniRead ( "config.ini", $masterarray[$groupcount], "Type", "0" ) = "Utilities & Tweaks" then
        $groupcheck[$groupcount] = GUICtrlCreateCheckbox ($masterarray[$groupcount], $groupxpos, $groupypos, 135, 20)
        $groupypos = $groupypos + 20
    Endif

    if $groupypos > 520 then
        $groupypos = 180    
        $groupxpos = $groupxpos + 145
    Endif


    $groupcount = $groupcount + 1   

until $groupcount = Ubound($masterarray)




While 1


    $msg = GUIGetMsg()
Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton
                GUISwitch($mainwindow)
                GUISetState(@SW_SHOW, $Mainwindow)
                GUIDelete($appwindow)
                ExitLoop
    Case $msg = $uncheckbutton
        call ( "UnCheckAll")
    Case $msg = $okbutton

    ;====================================
    ;"Install" was pressed, create $checkedarray (contains a 1 for each checked box)


        Dim $checkedarray[UBound ($masterarray)]
        $groupcount = 2
        
        
        do
        
            $val = GUICtrlRead($groupcheck[$groupcount])
            if $val = $GUI_CHECKED then
            $checkedarray[$groupcount] = 1
            else 
            $checkedarray[$groupcount] = 0
            endif
        
            $groupcount = $groupcount + 1
        
        until $groupcount = UBound ($groupcheck)



        $groupcount = 2
        $checkedtotal = 0


        
        do
            $checkedtotal = $checkedtotal + $checkedarray[$groupcount]
            $groupcount = $groupcount + 1
        
        until $groupcount = UBound ($checkedarray)
        
        $yval = 60 + (20 * $checkedtotal)
        
    dim $test
    dim $endofline = 47

    
        ;Complain if nothing is checked
        
        if $checkedtotal = 0 then
            MsgBox(0, "No entries selected!", "Nothing selected for installation!")
        else
            if GUICtrlRead($rebootcheck) = $GUI_CHECKED then
            $reboot = 1
            else 
            $reboot = 0
            endif
            ExitLoop
        endif

    ;Back to the loop
    ;====================================

    Case Else

    $groupcount=1

    do

        if $msg = $groupradio[$groupcount] then
        UncheckAll()
        Checkgroup ($groupcount)
        ExitLoop
        else
        $groupcount = $groupcount+1
        Endif

    until $groupcount = Ubound($groupradio) or $groupcount = 21



    EndSelect


Wend





GuiDelete() ;get rid of GUI



;===========================================================================
;Create list window
;===========================================================================


;Create window, yval was calculated when install was pressed

GUICreate("Installing...", 200, $yval, 50 ,50 , $WS_EX_STATICEDGE, $WS_EX_TOPMOST)


;Create labels

$groupcount = 2
$yval = 10

Dim $labelarray [UBound($checkedarray)]

do

    if $checkedarray[$groupcount] = 1 then
    $labelarray[$groupcount] = GUICtrlCreateLabel($masterarray[$groupcount], 10, $yval, 290)
    $yval = $yval + 20
    endif

    $groupcount = $groupcount + 1


until $groupcount = UBound($checkedarray)

_ArrayDisplay ( $labelarray, "Labelarray" )
;create reboot label if reboot was requested

if $reboot = 1 then 
$rebootlabel = GUICtrlCreateLabel("-Reboot-", 10, $yval, 290)
endif


GUISetState()



;===========================================================================
;Do the installation
;===========================================================================



$groupcount = 2


do

    if $checkedarray[$groupcount] = 1 then
    GUICtrlSetFont ($labelarray[$groupcount], 9 , 600,0,"MS Dialog Light")
    RunWait (IniRead ("config.ini",$masterarray[$groupcount],"Location","error"))
    ;Sleep(3000)
    GUICtrlSetFont ($labelarray[$groupcount], 9 , 400,0,"MS Dialog Light")
    endif
    
    $groupcount = $groupcount + 1

until $groupcount = UBound ($masterarray)


;======================
;Reboot if requested
;======================



if $reboot = 1 then 
GUICtrlSetFont ($rebootlabel, 9 , 600,0,"MS Dialog Light")
Sleep (5000)
Shutdown (6)
endif



GuiDelete() 
Exit



;===========================================================================
;Poll GUI for events
;===========================================================================



; Show GUI, and wait for OK to be pressed

GUISetState()




While 1


    $msg = GUIGetMsg()
    Select
    Case $msg = $okbutton
        ;====================================
    ;"Install" was pressed, create $checkedarray (contains a 1 for each checked box)


        Dim $checkedarray[UBound ($masterarray)]
        $groupcount = 2
        
        
        do
        
            $val = GUICtrlRead($groupcheck[$groupcount])
            if $val = $GUI_CHECKED then
            $checkedarray[$groupcount] = 1
            else 
            $checkedarray[$groupcount] = 0
            endif
        
            $groupcount = $groupcount + 1
        
        until $groupcount = UBound ($groupcheck)



        $groupcount = 2
        $checkedtotal = 0


        
        do
            $checkedtotal = $checkedtotal + $checkedarray[$groupcount]
            $groupcount = $groupcount + 1
        
        until $groupcount = UBound ($checkedarray)
        
        $yval = 60 + (20 * $checkedtotal)
        
        
        
        ;Complain if nothing is checked
        
        if $checkedtotal = 0 then
            MsgBox(0, "No entries selected!", "Nothing selected for installation!")
        else
            if GUICtrlRead($rebootcheck) = $GUI_CHECKED then
            $reboot = 1
            else 
            $reboot = 0
            endif
            ExitLoop
        endif

    ;Back to the loop
    ;====================================


    Case Else

    $groupcount=1

    do

        if $msg = $groupradio[$groupcount] then
        UncheckAll()
        Checkgroup ($groupcount)
        ExitLoop
        else
        $groupcount = $groupcount+1
        Endif

    until $groupcount = Ubound($groupradio) or $groupcount = 21



    EndSelect


Wend





GuiDelete() ;get rid of GUI



;===========================================================================
;Create list window
;===========================================================================


;Create window, yval was calculated when install was pressed

GUICreate("Installing...", 200, $yval, 50 ,50 , $WS_EX_STATICEDGE, $WS_EX_TOPMOST)


;Create labels

$groupcount = 2
$yval = 10
Dim $labelarray[UBound($checkedarray)]

do

    if $checkedarray[$groupcount] = 1 then
    $labelarray[$groupcount] = GUICtrlCreateLabel($masterarray[$groupcount], 10, $yval, 290)
    $yval = $yval + 20
    endif

    $groupcount = $groupcount + 1


until $groupcount = UBound($checkedarray)


;create reboot label if reboot was requested

if $reboot = 1 then 
$rebootlabel = GUICtrlCreateLabel("-Reboot-", 10, $yval, 290)
endif


GUISetState()



;===========================================================================
;Do the installation
;===========================================================================



$groupcount = 2


do

    if $checkedarray[$groupcount] = 1 then
    GUICtrlSetFont ($labelarray[$groupcount], 9 , 600,0,"MS Dialog Light")
    RunWait (IniRead ("config.ini",$masterarray[$groupcount],"Location","error"))
    ;Sleep(3000)
    GUICtrlSetFont ($labelarray[$groupcount], 9 , 400,0,"MS Dialog Light")
    endif
    
    $groupcount = $groupcount + 1

until $groupcount = UBound ($masterarray)


;======================
;Reboot if requested
;======================



if $reboot = 1 then 
GUICtrlSetFont ($rebootlabel, 9 , 600,0,"MS Dialog Light")
Sleep (5000)
Shutdown (6)
endif



GuiDelete() 
Exit
    
EndFunc

While 1
    $msg = GUIGetMsg(1)    
    Select
        Case $msg[0] = $InstallApps and $msg[1] = $Mainwindow
            Call ("AppInstall")
        Case $msg[0] = $Config and $msg[1] = $Mainwindow
            Call("Setconfigdata")            
        Case $msg[0] = $Autoinstallghost and $msg[1] = $Mainwindow
            Call("UserAppSelection")
        Case $msg[0] = $GUI_EVENT_CLOSE or $msg[0] = $EXIT and $msg[1] = $Mainwindow
            Exit
    EndSelect
WEnd
Edited by joshiieeii
Link to comment
Share on other sites

*Bump it up*

:D

I suspect you will have to post some of the specific items you are having trouble with, along with the code, to get much response.

Ravenlark-----------------------------------------------------when you find yourself with the majority, its time to pause and reflect - Mark Twain

Link to comment
Share on other sites

Hi!

I already scripted a tool called "Install-O-Matic 2" for the Germany "PC Magazin".

http://www.pcmagazin.de

I could post some screens if wished. It has scripts for the most common freeware toools in there and a quite powerful manager which can be used to include Programs in the structure. Even import of not copy protected CDs is possible.

All you need is a AutoIt-Script doing the install itself. My script is responsible for starting all the install scripts of the programs selected. The Manager can also create ISO-Image for direct burning.

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Hi!

I already scripted a tool called "Install-O-Matic 2" for the Germany "PC Magazin".

http://www.pcmagazin.de

I could post some screens if wished. It has scripts for the most common freeware toools in there and a quite powerful manager which can be used to include Programs in the structure. Even import of not copy protected CDs is possible.

All you need is a AutoIt-Script doing the install itself. My script is responsible for starting all the install scripts of the programs selected. The Manager can also create ISO-Image for direct burning.

peethebee

Very Interesting Peethebee, I went to the site, but alas my German is not very good, but thank goodness for Google translator. I am thinking that this does a bit more than I am wanting and not exactly what I hoping it could do.

I am basically trying to make an application that has Zero touch after the OS is built Or install applications manually but still automated.

I will see if I can find your tool and try it out.

Edited by joshiieeii
Link to comment
Share on other sites

Nice wish list. I use a software deployment script, though without selection etc like yours has for unattended installs.

I see your script has so much manual creation while you could look inside a folder and dynamically create the checkboxes for each. No need for any fixed options as within script or in ini files to select software from. Use an Au3 file for installing each instance of software and use FileFindFirstFile() to set each Au3 file to locate. Once your main script is setup, then further changes of it would not be needed.

Link to comment
Share on other sites

Nice wish list. I use a software deployment script, though without selection etc like yours has for unattended installs.

I see your script has so much manual creation while you could look inside a folder and dynamically create the checkboxes for each. No need for any fixed options as within script or in ini files to select software from. Use an Au3 file for installing each instance of software and use FileFindFirstFile() to set each Au3 file to locate. Once your main script is setup, then further changes of it would not be needed.

Hmm...Thats not a bad idea...I am going to look into that. One benefit that the ini has over the folder way is that you can set pre-requisites and have logic for installs. Although I guess I could just put a 00,01 in front of the names of the *.Au3 files so that it installs them based on the numerical order and just put the pre-requisites near the top.
Link to comment
Share on other sites

This is a project that I start working with Vollyman a few months ago, at the end of the page is the source code. Look at it may be help you on your project. For the last few months I been too busy at work and haven't be able to continue working on that project.

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

This is a project that I start working with Vollyman a few months ago, at the end of the page is the source code. Look at it may be help you on your project. For the last few months I been too busy at work and haven't be able to continue working on that project.

Thanks Danny35d! :D

I will comb this over and see if I can incorporate any of your ideas into my project.

Edited by joshiieeii
Link to comment
Share on other sites

Maybe my Prepsys program would help. The source is avalible to download

http://www.autoitscript.com/forum/index.ph...&hl=Prepsys

I was thinking about adding a joindomain section....so i would be interested in finding out how to see if the computer name is avalible

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Link to comment
Share on other sites

I use Nlite to create unattended install CD's/DVD with integrated drivers.

Right now I am working on AutoIT scripts to automatically install about 60-75 applications which will go on one DVD. I got 25 automatied. Learning a lot along the way.

To create a menu for those scripts I use Windows Post Installer. I it presets a menu and lets you select which applications you with to run/install. You can organize software into groups, force application x to be installed before y, only allow application z to be selected if x and y are also selecte ....

It will run off of disc, a network drive or a hard drive.

You can customize the visual apperace, add thumbnails, pop descriptions...

----

I also plan on also adding configuration scripts, to create user accounts, setup the folder view settings, network settings ... basically if its something I do 90% of the time I do a clean install I will write a script for it.

I also plan on creating on WPI menu for drivers, one for application, and one for configuration settins and registry tweaks.

I will also include the latest version of XP Autopatcher so I can install all the security fixes and updated in one pass. (Actually it only gets updated once a month so I still need to go to windows update for a couple items).

Then again I may find another technology to learn, after I finish automating the 70 some apps and creating the WPI menu for them.

---

But I would recommed you use a 3rd party program to manage your menu, dependencies, install order ....

Windows Post Installer is just one of several free utlities that already have such features. Don't create extra work for yourself.

Link to comment
Share on other sites

I use Nlite to create unattended install CD's/DVD with integrated drivers.

Right now I am working on AutoIT scripts to automatically install about 60-75 applications which will go on one DVD. I got 25 automatied. Learning a lot along the way.

To create a menu for those scripts I use Windows Post Installer. I it presets a menu and lets you select which applications you with to run/install. You can organize software into groups, force application x to be installed before y, only allow application z to be selected if x and y are also selecte ....

It will run off of disc, a network drive or a hard drive.

You can customize the visual apperace, add thumbnails, pop descriptions...

----

I also plan on also adding configuration scripts, to create user accounts, setup the folder view settings, network settings ... basically if its something I do 90% of the time I do a clean install I will write a script for it.

I also plan on creating on WPI menu for drivers, one for application, and one for configuration settins and registry tweaks.

I will also include the latest version of XP Autopatcher so I can install all the security fixes and updated in one pass. (Actually it only gets updated once a month so I still need to go to windows update for a couple items).

Then again I may find another technology to learn, after I finish automating the 70 some apps and creating the WPI menu for them.

---

But I would recommed you use a 3rd party program to manage your menu, dependencies, install order ....

Windows Post Installer is just one of several free utlities that already have such features. Don't create extra work for yourself.

Yes, i realize that there are some 3rd party apps out there that can do similar stuff, but most have limitations and are not customizable at all. Plus where would the fun be... :D

I wanted to create this 1) so its customizable 2) to learn more about Autoit 3) to meet some needs that the other did not have.

Either way, it is going to be a good project...

Link to comment
Share on other sites

Maybe my Prepsys program would help. The source is avalible to download

http://www.autoitscript.com/forum/index.ph...&hl=Prepsys

I was thinking about adding a joindomain section....so i would be interested in finding out how to see if the computer name is avalible

That would be interesting....I took a look at your work, it's really nice! I will have to see about possible integration.

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...