abberration

Software Installer

54 posts in this topic

#1 ·  Posted (edited)

I created a software installer for myself a few years ago. I decided to re-do the code to make tabs with categories. Here's how it works: you put all your software in a folder called Software. You configure an ini file with silent switches, software descriptions and which tab you want it to show up in. Then check the boxes for the software you want to install, click the button and it will install your selections silently.

Screenshot:

Posted Image

I am attaching the .au3 file and my own Config.ini file. It should be a good template for you to use. If you want to use the Config.ini file, just rename your installer to match the ini headers. Example: if you download Adobe Reader, the installer may be named something like: AdbeRdr1000_en_US.exe. Rename it to simply Adobe Reader.exe. It makes it easier to read in the list of software.

Software Installer.au3:

#include <GUIConstants.au3>
#include <GuiListView.au3>
#include <Array.au3>
#include <File.au3>

Global $iniFile = @ScriptDir & "Config.ini"
Global $scriptDir = @ScriptDir

; Main GUI
$Form1 = GUICreate("Software Installer", 633, 451)

$Tab1 = GUICtrlCreateTab(16, 8, 601, 377)
$TabSheet1 = GUICtrlCreateTabItem("Audio/Video/Photo")
$ListView1 = GUICtrlCreateListView("Software Name|Description", 24, 40, 582, 334)
_GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES))
GUICtrlSendMsg(-1, 0x101E, 0, 200)
GUICtrlSendMsg(-1, 0x101E, 1, 375)
$TabSheet2 = GUICtrlCreateTabItem("Computer Maintenance")
$ListView2 = GUICtrlCreateListView("Software Name|Description", 24, 40, 578, 334)
_GUICtrlListView_SetExtendedListViewStyle($ListView2, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES))
GUICtrlSendMsg(-1, 0x101E, 0, 200)
GUICtrlSendMsg(-1, 0x101E, 1, 375)
$TabSheet3 = GUICtrlCreateTabItem("Internet")
$ListView3 = GUICtrlCreateListView("Software Name|Description", 24, 40, 578, 334)
_GUICtrlListView_SetExtendedListViewStyle($ListView3, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES))
GUICtrlSendMsg(-1, 0x101E, 0, 200)
GUICtrlSendMsg(-1, 0x101E, 1, 375)
$TabSheet4 = GUICtrlCreateTabItem("Games")
$ListView4 = GUICtrlCreateListView("Software Name|Description", 24, 40, 578, 334)
_GUICtrlListView_SetExtendedListViewStyle($ListView4, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES))
GUICtrlSendMsg(-1, 0x101E, 0, 200)
GUICtrlSendMsg(-1, 0x101E, 1, 375)
$TabSheet5 = GUICtrlCreateTabItem("Miscellaneous")
$ListView5 = GUICtrlCreateListView("Software Name|Description", 24, 40, 578, 334)
_GUICtrlListView_SetExtendedListViewStyle($ListView5, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES))
GUICtrlSendMsg(-1, 0x101E, 0, 200)
GUICtrlSendMsg(-1, 0x101E, 1, 375)
$TabSheet6 = GUICtrlCreateTabItem("Productivity")
$ListView6 = GUICtrlCreateListView("Software Name|Description", 24, 40, 578, 334)
_GUICtrlListView_SetExtendedListViewStyle($ListView6, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES))
GUICtrlSendMsg(-1, 0x101E, 0, 200)
GUICtrlSendMsg(-1, 0x101E, 1, 375)
GUICtrlCreateTabItem("") ; This ends the tab item creation
$Button1 = GUICtrlCreateButton("Install Selected Software", 398, 395, 219, 25, 0)
$MenuItem1 = GUICtrlCreateMenu("File")
$MenuItem2 = GUICtrlCreateMenuItem("Unselect All", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenuItem("Exit", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenu("Help")
$MenuItem5 = GUICtrlCreateMenuItem("Help Topics", $MenuItem4)
$MenuItem6 = GUICtrlCreateMenuItem("About", $MenuItem4)
_Populate()
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            _InstallSelectedSoftware()
        Case $MenuItem2
            _UnselectAll()
        Case $MenuItem3
            Exit
        Case $MenuItem5
            _HelpTopics()
        Case $MenuItem6
            _AboutProject()
    EndSwitch
WEnd

Func _Populate()
    ; Find all files in the Software folder and populate the tabs with the installers.
    $f = FileFindFirstFile("Software/*.*")
    Dim $array[1]
    $i = 0
    Do
        $s = FileFindNextFile($f)
        If Not @error Then
            $array[$i] = $s
            $i += 1
            ReDim $array[$i + 1]
        EndIf
    Until @error
    ReDim $array[$i]

    For $i = 1 To UBound($array) Step 1
        $category = IniRead($iniFile, $array[$i - 1], "Category", "5")
        $desc = IniRead($iniFile, $array[$i - 1], "Desc", "")
        If $category = 1 Then
            GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView1)
        ElseIf $category = 2 Then
            GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView2)
        ElseIf $category = 3 Then
            GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView3)
        ElseIf $category = 4 Then
            GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView4)
        ElseIf $category = 6 Then
            GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView6)
        Else
            GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView5)
        EndIf
    Next
EndFunc   ;==>_Populate

Func _InstallSelectedSoftware()
    Dim $sArray[1]

    ; Find which items were selected by user on all six tabs
    $count = _GUICtrlListView_GetItemCount($ListView1)
    $aCount = 0
    For $i = 1 To $count Step 1
        If _GUICtrlListView_GetItemChecked($ListView1, $i - 1) = True Then
            $sArray[$aCount] = _GUICtrlListView_GetItemText($ListView1, $i - 1)
            ReDim $sArray[UBound($sArray) + 1]
            $aCount += 1
        EndIf
    Next

    $count = _GUICtrlListView_GetItemCount($ListView2)
    For $i = 1 To $count Step 1
        If _GUICtrlListView_GetItemChecked($ListView2, $i - 1) = True Then
            $sArray[$aCount] = _GUICtrlListView_GetItemText($ListView2, $i - 1)
            ReDim $sArray[UBound($sArray) + 1]
            $aCount += 1
        EndIf
    Next

    $count = _GUICtrlListView_GetItemCount($ListView3)
    For $i = 1 To $count Step 1
        If _GUICtrlListView_GetItemChecked($ListView3, $i - 1) = True Then
            $sArray[$aCount] = _GUICtrlListView_GetItemText($ListView3, $i - 1)
            ReDim $sArray[UBound($sArray) + 1]
            $aCount += 1
        EndIf
    Next

    $count = _GUICtrlListView_GetItemCount($ListView4)
    For $i = 1 To $count Step 1
        If _GUICtrlListView_GetItemChecked($ListView4, $i - 1) = True Then
            $sArray[$aCount] = _GUICtrlListView_GetItemText($ListView4, $i - 1)
            ReDim $sArray[UBound($sArray) + 1]
            $aCount += 1
        EndIf
    Next

    $count = _GUICtrlListView_GetItemCount($ListView5)
    For $i = 1 To $count Step 1
        If _GUICtrlListView_GetItemChecked($ListView5, $i - 1) = True Then
            $sArray[$aCount] = _GUICtrlListView_GetItemText($ListView5, $i - 1)
            ReDim $sArray[UBound($sArray) + 1]
            $aCount += 1
        EndIf
    Next

    $count = _GUICtrlListView_GetItemCount($ListView6)
    For $i = 1 To $count Step 1
        If _GUICtrlListView_GetItemChecked($ListView6, $i - 1) = True Then
            $sArray[$aCount] = _GUICtrlListView_GetItemText($ListView6, $i - 1)
            ReDim $sArray[UBound($sArray) + 1]
            $aCount += 1
        EndIf
    Next

    ; Begin installing selected software
    ProgressOn("Software Installer", "Installing", "", -1, -1, 16)
    For $i = 1 To UBound($sArray) - 1 Step 1
        $fileName = $sArray[$i - 1]
        $switch = IniRead($iniFile, $fileName, "Switch", "")
        Local $szDrive, $szDir, $szFName, $szExt
        $extension = StringRight($fileName, 3)
        If $extension = "msi" Then
            Run("msiexec /i " & '"' & $scriptDir & "Software" & $fileName & '" ' & $switch) ; For MSI type installers
        Else
            RunWait('"' & $scriptDir & "Software" & $fileName & '"' & " " & $switch) ; For EXE installers
        EndIf
        ProgressSet($i / (UBound($sArray) - 1) * 100, Round($i / (UBound($sArray) - 1) * 100, 0) & "%", "Installing " & $i & " of " & UBound($sArray) - 1)
    Next
    ProgressOff()
EndFunc   ;==>_InstallSelectedSoftware

Func _UnselectAll()
    $count = _GUICtrlListView_GetItemCount($ListView1)
    For $i = 1 To $count Step 1
        _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    Next

    $count = _GUICtrlListView_GetItemCount($ListView2)
    For $i = 1 To $count Step 1
        _GUICtrlListView_SetItemChecked($ListView2, $i - 1, False)
    Next

    $count = _GUICtrlListView_GetItemCount($ListView3)
    For $i = 1 To $count Step 1
        _GUICtrlListView_SetItemChecked($ListView3, $i - 1, False)
    Next

    $count = _GUICtrlListView_GetItemCount($ListView4)
    For $i = 1 To $count Step 1
        _GUICtrlListView_SetItemChecked($ListView4, $i - 1, False)
    Next

    $count = _GUICtrlListView_GetItemCount($ListView5)
    For $i = 1 To $count Step 1
        _GUICtrlListView_SetItemChecked($ListView5, $i - 1, False)
    Next

    $count = _GUICtrlListView_GetItemCount($ListView6)
    For $i = 1 To $count Step 1
        _GUICtrlListView_SetItemChecked($ListView6, $i - 1, False)
    Next
EndFunc   ;==>_UnselectAll

Func _HelpTopics()
    $Form2 = GUICreate("Help Topics", 633, 447)
    $Label1 = GUICtrlCreateLabel("", 8, 16, 612, 425)
    GUICtrlSetData(-1, "This program uses silent switches to install software without user interaction. To use this functionality, you can edit the Config.ini file to add software and their switches. Example: " & @CRLF & @CRLF & "[7zip.exe]" & @CRLF & "Switch=/S" & @CRLF & "Desc=A zip file utility" & @CRLF & "Category=5" & @CRLF & @CRLF & "The name of the file is the first line in the brackets. The line with Switch= is the section for the unattended switch. The Desc= is the description for the program. The Category= is the tab you want the program to show up on the interface." & @CRLF & @CRLF & "Here are some common switches for various installers:" & @CRLF & @CRLF & "/silent used for Inno Setup installers" & @CRLF & "/verysilent used for Inno Setup installers" & @CRLF & "/S used for Nullsoft (aka NSIS) installers" & @CRLF & "/s used for Wise installers" & @CRLF & "-s used for Ghost installers" & @CRLF & "-ms used for Mozilla installers" & @CRLF & "/quiet used for Microsoft installers" & @CRLF & "/qb used for Microsoft installers" & @CRLF & "/qn used for Microsoft installers" & @CRLF & "/passive used for Microsoft installers" & @CRLF & "/Q used for Microsoft installers" & @CRLF & @CRLF & "Note: Some installers are case sensitive (Ghost and Nullsoft for sure).")
    GUISetState(@SW_SHOW)

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                GUIDelete($Form2)
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>_HelpTopics

Func _AboutProject()
    $Form3 = GUICreate("About", 413, 196)
    $Label1a = GUICtrlCreateLabel("", 24, 64, 364, 113)
    $Label2a = GUICtrlCreateLabel("Software Installer 1.0", 24, 8, 375, 41)
    GUICtrlSetFont(-1, 24, 800, 2, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x000080)
    GUISetState(@SW_SHOW)
    $aboutData = "This program was written|in a programming language called Autoit||Brought to you by abberration"
    $sData = StringSplit($aboutData, "|", 2)
    $string = ""
    For $i = 1 To UBound($sData) Step 1
        $string = $string & @CRLF & $sData[$i - 1] & @CRLF
        GUICtrlSetData($Label1a, $string)
        Sleep(1000)
    Next

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                GUIDelete($Form3)
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>_AboutProject

Config.ini:

[7zip.exe]
Switch=/S
Desc=A zip file utility
Category=5

[Adobe Reader.exe]
Desc=A free PDF viewer
switch=-ai
Category=6

[CCleaner.exe]
Switch=/S
Desc=Clean up junk on your computer
Category=2

[Adobe Flash (for IE).exe]
Switch=-install
Desc=View animated web content
Category=3

[Adobe Flash (non-IE).exe]
Switch=-install
Desc=View animated web content
Category=3

[Combined Community Codec Pack.exe]
Switch=/verysilent
Desc=Large collection of codecs
Category=1

[Defraggler.exe]
Switch=/S
Desc=Defrag your hard drive
Category=2

[Faststone Capture.exe]
Switch=/S
Desc=Screen capture program
Category=1

[GFI Backup.exe]
Switch=/silent
Desc=Scheduled backups of files & folders
Category=6

[KeePass.exe]
Switch=/verysilent
Desc=Password management program
Category=6

[Firefox.exe]
Switch=-ms
Desc=Fast, secure web browser
Category=3

[Office 2007 Compatibility Pack.exe]
Switch=/quiet
Desc=Open newer Office files with older versions
Category=6

[PhotoFiltre.exe]
Switch=/verysilent
Desc=Photo editing program
Category=1

[Sunbird.exe]
Switch=-ms
Desc=Calendar/management program
Category=6

[Thunderbird.exe]
Switch=-ms
Desc=Email client
Category=6

[System Information for Windows.exe]
Switch=/verysilent
Desc=Lists all information about your computer
Category=2

[TrueCrypt.exe]
Switch=/verysilent
Desc=A very strong encryption program
Category=5

[uTorrent.exe]
Switch=/PERFORMINSTALL 6
Desc=A lightweight torrent downloader
Category=3

[DVD Shrink.exe]
Switch=/verysilent
Desc=Rip & burn DVDs
Category=1

[Filezilla.exe]
Switch=/S
Desc=FTP client
Category=3

[Exact Audio Copy.exe]
Switch=/S
Desc=An accurate CD ripping program
Category=5

[RocketDock.exe]
Switch=/verysilent
Desc=Quick launcher similar to the Mac's
Category=5

[Open Office.exe]
Switch=/S
Desc=The free version of Microsoft's Office
Category=6

[File Shredder.exe]
Switch=/verysilent
Desc=Doesn't just delete files - it shreds them
Category=5

[VLC Media Player.exe]
Switch=/S
Desc=Media player that comes with own codecs
Category=1

[Free Audio Editor.exe]
Switch=/silent
Desc=Edit audio tracks
Category=1

[Rainlendar.exe]
Switch=/S
Desc=Slick desktop calendar & reminder
Category=6

[XPlorer.exe]
Switch=/S
Desc=Alternative to Windows' Explorer
Category=5

[Any Video Converter.exe]
Switch=/verysilent
Desc=Converts video to different formats
Category=1

[TheSage.exe]
Switch=/verysilent
Desc=Dictionary and Thesaurus
Category=6

[BurnAware.exe]
Switch=/verysilent
Desc=CD/DVD/Blu-ray Disc burning software
Category=5

[FolderSize.exe]
Switch=/verysilent
Desc=Graphically lists folders by size
Category=2

[TagScanner.exe]
Switch=/verysilent
Desc=Edit the hidden tags in your MP3s
Category=1

[Personal Video Database.exe]
Switch=/verysilent
Desc=Manage your movie collection
Category=1

[Radio Sure.exe]
Switch=/verysilent
Desc=Stream music from online stations
Category=1

[WeatherMate.msi]
Switch=/qn
Desc=Desktop weather station
Category=5

[Kompozer.exe]
Switch=/verysilent
Desc=HTML creator/editor
Category=6

[Free Download Manager.exe]
Switch=/verysilent
Desc=An efficient way to download files
Category=3

[Miranda IM.exe]
Switch=/S
Desc=Instant messenger works with others IMs
Category=3

[Phoner.exe]
Switch=/verysilent
Desc=Make VOIP calls for free
Category=3

[Essential PIM.exe]
Switch=/S
Desc=Personal information manager
Category=6

[CrystalDiskInfo.exe]
Switch=/verysilent
Desc=Hard drive information utility
Category=2

[eMule.exe]
Switch=/S
Desc=P2P files sharing client
Category=3

[VirtualBox.exe]
Switch=
Desc=Run different OSes in your computer
Category=5

[Daylight Savings Time Patch (XP).exe]
Switch=/quiet
Desc=Patches XP for the correct DST date
Category=5

[EASEUS Todo Backup.exe]
Switch=/SP- /verysilent /norestart
Desc=Back up your entire computer
Category=6

[EASEUS Partition Manager.exe]
Switch=/verysilent
Desc=Create, delete or resize partitions on your hard drive
Category=2

[Audacity.exe]
Switch=/verysilent
Desc=A sound editing program
Category=1

[Family Tree Pilot.exe]
Switch=/verysilent
Desc=Geneology software
Category=6

[FileZilla (client).exe]
Switch=/S
Desc=FTP client
Category=3

[Free ISO Creator.exe]
Switch=/sp- /verysilent
Desc=Easily create ISO images
Category=5

[Google Chrome.exe]
Switch=/S
Desc=A very fast internet browser
Category=3

[Jaangle.exe]
Switch=/S
Desc=Media organizer
Category=1

[MagicDisc.exe]
Switch=/S
Desc=Lets you mount image files as virtual drives
Category=5

[Opera.msi]
Switch=/qn
Desc=A good internet browser
Category=3

[RadioSure.exe]
Switch=/verysilent
Desc=Stream music from online stations
Category=1

[Speccy.exe]
Switch=/S
Desc=Lists all information about your computer
Category=2

[WeatherMate.msi]
Switch=/qn
Desc=Desktop weather station
Category=5

[XMedia Recode.exe]
Switch=/S
Desc=Re-encode music and video
Category=1

[StreamTransport.exe]
Switch=/verysilent
Desc=Best SWF & Flash downloader of all
Category=3

[Adolix Split And Merge PDF.exe]
Switch=/verysilent
Desc=Very simple way to split or merge PDFs
Category=

[Dia.exe]
Switch=/S
Desc=Draw structured diagrams such as flow charts
Category=6

[Everything.exe]
Switch=/verysilent
Desc=Super fast file searching utility
Category=2

[EULAlyzer.exe]
Switch=/verysilent
Desc=Quickly scan EULAs for distessing statements
Category=6

[Glary Utilities.exe]
Switch=/verysilent
Desc=Fix errors, speed up and secure your computer
Category=2

[Malwarebytes Antimalware.exe]
Switch=/verysilent
Desc=Get rid of adware, spyware & trojans
Category=5

[Pencil.exe]
Switch=/verysilent
Desc=Makes freehand drawing easy to do
Category=6

[Avast Antivirus.exe]
Switch=/VERYSILENT /NORESTART /SP-
Desc=Powerful free antivirus
Category=5

[streamWriter.exe]
Switch=/verysilent
Desc=Save online radio streams to your computer
Category=6

[PhotoScape.exe]
Switch=/S
Desc=A fun and easy photo editing software
Category=1

Note that Category is the tab number that the software will show up on. Therefore, 1 is the first tab (left side) and 6 is the last tab (right side).

Edit: updated code to make the Miscellaneous category be default in case the software is not listed in the ini file. Also fixed the "Unselect All" function to not be offset by one number.

Edited by abberration
3 people like this

RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites



is it possible to place the *.exe in the folders? for example, some programs require different files that can be reproduced (eg some files *. ini)?

That could be done so that every program was in a separate file in the software?

eg

AdobeReader -> Software1

FineReader -> Software2

etc.?

Share this post


Link to post
Share on other sites

nice job, but can you add an detection of 32 or 64bit windows and

automatically only show the fitting version of the software?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

From playing with it i came up with this for 64/32 bit

I added an extra line to the .ini file for each product like this

[install_adobe.exe]

Desc=Adobe Reader X

switch= /sPB /rs /rps

Category=1

Arch=3264

Arch =

either

32 (32 bit installers)

or

64 (64 bit installers)

or

3264 (32 &64 bit installers in one file)

And changed the function populate like this, which appears to work

Func _Populate()
$OsArch = @OSArch
; Find all files in the Software folder and populate the tabs with the installers.
$f = FileFindFirstFile("Software/*.*")
Dim $array[1]
$i = 0
Do
$s = FileFindNextFile($f)
If Not @error Then
$array[$i] = $s
$i += 1
ReDim $array[$i + 1]
EndIf
Until @error
ReDim $array[$i]

Select
Case $OsArch = "X64"
For $i = 1 To UBound($array) Step 1
$category = IniRead($iniFile, $array[$i - 1], "Category", "6")
$desc = IniRead($iniFile, $array[$i - 1], "Desc", "")
$IniArch = IniRead($iniFile, $array[$i - 1], "Arch", "")
If $category = 1 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView1)
ElseIf $category = 2 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView2)
ElseIf $category = 3 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView3)
ElseIf $category = 4 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView4)
ElseIf $category = 5 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView5)
ElseIf $category = 6 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView6)
Else
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView7)
EndIf
Next
Case $OsArch = "X86"
For $i = 1 To UBound($array) Step 1
$category = IniRead($iniFile, $array[$i - 1], "Category", "6")
$desc = IniRead($iniFile, $array[$i - 1], "Desc", "")
$IniArch = IniRead($iniFile, $array[$i - 1], "Arch", "")
If $category = 1 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView1)
ElseIf $category = 2 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView2)
ElseIf $category = 3 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView3)
ElseIf $category = 4 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView4)
ElseIf $category = 5 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView5)
ElseIf $category = 6 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView6)
Else
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView7)
EndIf
Next
EndSelect
EndFunc ;==>_Populate

The only downside with this method is you have to add the Arch for each product.

But im sure there are many other ways

Edited by Chimaera

Share this post


Link to post
Share on other sites

I get an Error:

...installer.au3 (108) : ==> Variable used without being declared.:

GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView7)

GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, ^ ERROR

when trying to execute/compile your script

Share this post


Link to post
Share on other sites

thanks for shering.

little fix.

if the software folder is empty your code crash with this error:

Software Installer.au3 (86) : ==> Array variable subscript badly formatted.:

ReDim $array[$i]

ReDim $array[^ ERROR

to fix that add this line before line 86:

if $i = 0 Then Return 0

thanks again

Share this post


Link to post
Share on other sites

I cannot get it to read the config.ini?

any help greatly appreciated..

Share this post


Link to post
Share on other sites

Is it possible to use this for some installation without silent switch?

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Is it possible to use this for some installation without silent switch?

Yes just omit the switch in the ini file

[install_adobe.exe]
Desc=Adobe Reader X
switch= /sPB /rs /rps ;==> becomes switch=
Category=1

it will still check but there is nothing to add

Edited by Chimaera

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Hi, i was wondering two things:

1) is it possible to check for software in multiple location?

2) is it possible to check for software published to a ftp path?

BTW: This is an awesome script :)

Edited by Copyrigth

Share this post


Link to post
Share on other sites

I cannot get it to read the config.ini?

any help greatly appreciated..

I hadd the same problem, but when i added "." before the path it worked. (for me, atleast)

Share this post


Link to post
Share on other sites

Maybe I'am to stupid or there is a wrong default on my pc.

There are many missing backslashes or am I wrong?

Global $iniFile = @ScriptDir & "Config.ini"

Run("msiexec /i " & '"' & $scriptDir & "Software" & $fileName & '" ' & $switch)

RunWait('"' & $scriptDir & "Software" & $fileName & '"' & " " & $switch)

Share this post


Link to post
Share on other sites

It's more than likely the forum software ate the backslashes when the script was posted or edited. Unfortunately it's a too common experience, so you'll have to reinsert them where they belong.

1 person likes this

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Maybe I'am to stupid or there is a wrong default on my pc.

There are many missing backslashes or am I wrong?

Mine look like this, works like a charm :)

Global $iniFile = @ScriptDir & ".\Config.ini"

Share this post


Link to post
Share on other sites

Please i do all of this work but it is not working.please someone attach a zip file with full workable script.please please please

Share this post


Link to post
Share on other sites

habib64,

First, welcome to the AutoIt forum. :)

I suggest you post your code - and the associated ini file - so that we can see where you might have gone wrong. When you post your script please use Code tags - put [autoit] before and [/autoit] after your posted code. Then you get a scrolling box and syntax colouring which makes it easier to read. :)

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Run("msiexec /i " & '"' & $scriptDir & "Software" & $fileName & '" ' & $switch) ; For MSI type installers

RunWait('"' & $scriptDir & "Software" & $fileName & '"' & " " & $switch) ; For EXE installers

These 2 lines don't seem to work as written, when executed a box just flashes real fast and nothing happens.

Can anybody see whats wrong with this, stumped.

Share this post


Link to post
Share on other sites

SWB,

There is nothing wrog there if your files is in a katalog kalled "Software" in the same katalog you run the script from.

If that is the case try posting the hole function :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • techguy86
      By techguy86
      Trying to perform a nearly silent install of Splashtop Business. (www.splashtop.com) Need to embed an executable into AutoIt and add command line parameters upon execution.
      Here are my thoughts/ideas, but it won't run.