Jump to content

Recommended Posts

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 :)

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

Global $ListView7
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
   if $i = 0 Then Return 0
    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
Edited by SWB
Link to post
Share on other sites
  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Software Installer Version: 2.0 It's been been a long year, but I finally got some time to rework this project. I re-wrote everything from scratch because the old version was getting too com

Its a nice piece of code and a usefull tool Many Thanks

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.

Posted Images

The code worked just fine on my 64-bit Win7, but on my 32-bit it needed a litte more:

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

Hope this help :)

Thanks, It works great!
Link to post
Share on other sites
  • 3 weeks later...
  • 2 months later...
  • 2 months later...

I have changed as per my requirements.I am not getting softwares list.

Config.ini



[MetalScrollSetup_1.0.11.exe]
Switch=/S
Desc=Meta scroll Setup
Category=1

[SonicFileFinder2.3.msi]
Switch=/qn
Desc=Desktop weather station
Category=1
#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("Software Tools")
$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)

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

    ; 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

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

I am unable to paste the clipboard .

Please let me know why it is not populating the software lists.. I have these 2 files and software folder in the same directory.

Edited by Tulip
Link to post
Share on other sites

I am able to get the softwares listed. I forgot to compile it as I am very new to AutoIt. I have understood the script to major extent.

I am facing the problem in installing the software at the lines

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

it is not installing the softwares for me, it just pops up the progress bar and gets closed..

I tried using msiexe.exe program too for msi intaller, it is not working.. Can anyone let me know what could be the problem...

Link to post
Share on other sites
  • 3 weeks later...

Great script i registered just to ask one question.

Is it possible to get a logging out of the installed applications. I'm new to autoit so i was looking at filewritelog but still couldn't really find how to implement that.

And once more thank you for the script it is awesome and works great ! :)

Link to post
Share on other sites
  • 1 month later...

Great script!!!

How could I set another variable on the ini file and set the checkbox according what it reads?

i.e. Config.ini

[7zip.exe]
Switch=/S
Desc=7 Zip Utility
Category=1
Default=False

[Filezilla.exe]
Switch=/S
Desc=FTP Utility
Category=1
Default=True

And I would like the script to put a checkbox when it populates the software according the "Default" variable. I've tried this but it does not seem to work:

For $i = 1 To UBound($array) Step 1
        $category = IniRead($iniFile, $array[$i - 1], "Category", "5")
        $desc = IniRead($iniFile, $array[$i - 1], "Desc", "")
        $Checked = IniRead($iniFile,$array[$i - 1],"Default", "")
        If $category = 1 Then
            GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView1)
        _GUICtrlListView_SetItemChecked($ListView1, $array ,$Checked) ;does not work, however if I put a MsgBox it throws $Checked for each item
Link to post
Share on other sites
  • 2 weeks later...

That is called a magic number and corresponds to this $LVM_SETCOLUMNWIDTH = ($LVM_FIRST + 30), $LVM_FIRST = 0x1000, so 0x1000 + 30 = 0x101E

Which is why you shouldn't use hardcoded numbers like this in a script for public usage, as then no one knows what you're referring to. Use the constants that are there to help with this.

Edited by BrewManNH

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

Link to post
Share on other sites

Or at least have the decency to document what the value is representing.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to post
Share on other sites

OK, that makes more sense  so this would do the same thing?

GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 200)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 375)

 

I was also searching for a list of available messages for at least the listview and hopefully the below link has all the answers I need.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb761163%28v=vs.85%29.aspx

Link to post
Share on other sites

Look in the GUIListView.au3 file for the appropriate ListView functions and the messages being sent inside those functions.

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

Link to post
Share on other sites
  • 3 weeks later...

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

is there a reason that run() is used for MSI installs vs using runwait?

Edited by kgreer
Link to post
Share on other sites
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

is there a reason that run() is used for MSI installs vs using runwait?

I changed that for myself to RunWait as well for msiexec since when I have 2 MSI installers it wouldn't install the second one or the script would finish earlier and the msiexec will be still on the task manager.

Link to post
Share on other sites
  • abberration changed the title to Software Installer

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Iraj
      Greetings!
      I am trying to pass parameters using Send () function as below
      $sFilePath = @ScriptDir & "\config.ini" Local $hFileOpen = FileOpen($sFilePath, $FO_READ) Local $sURLUsername = FileReadLine($hFileOpen, 1) Local $sURLPassword = FileReadLine($hFileOpen, 2) Local $sAutomation = FileReadLine($hFileOpen, 3) Run("chrome facebook.com") Sleep(5000) Send($sAutomation) FileClose($hFileOpen) The config.ini file contains below lines
      abcd wxyz $sURLUsername{TAB}$sURLPassword{ENTER} While running,  I am getting $sURLUsername & $sURLPassword in the username & password field instead of abcd & wxyz as provided.
      Refer image below:

       
      Where am I going wrong? Any suggestions or assistance will be grateful. 
    • By Jemboy
      Recently I was working on a script with icons using GuiCtrkCreatIcon.
      I decided to change the sub folder name of the icons to a more meaning name, however made a typo.

      I tested the .exe on my test computer and it worked flawlessly (because both icon folder where on my test computer) 😁
      But after I installed the script on the intended computers , I got chaos!😵
      Zooming into the problem, I discovered, that because the icons could not be found, the ControlID were returned with a value of 0
      and thus played havoc within the GuiGetMsg() switch/case statement.
      I have been able to reproduce this  (see example)
      #include <GUIConstantsEx.au3> ;============================================================================================================ ; PLEASE, do not save this example in the example folder: C:\Program Files (x86)\AutoIt3\Examples\Helpfile ;============================================================================================================ Example() Func Example() GUICreate(" My GUI Icons", 250, 250) $Icon1 = GUICtrlCreateIcon("shell32.dll", 10, 20, 20) $Icon2 = GUICtrlCreateIcon(@ScriptDir & '\Extras\horse.ani', -1, 20, 40, 32, 32) $Icon3 = GUICtrlCreateIcon("shell32.dll", 7, 20, 75, 32, 32) GUISetState(@SW_SHOW) ;$Icon2 = -1 ; ==> When this line is uncommented the script "works", so -1 could be a potential fix. ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Icon2 Beep (500,500) EndSwitch WEnd GUIDelete() EndFunc ;==>Example If you save the above script outside the Autoit example folder and run it, it will keep beeping because GuiCtrlCreatIcon did not find horse.ani and return $Icon2=0.
      At the moment GUICtrlCreateIcon () only returns the conntrolID on success and 0 on failure.
      I would like to propose a return of -1 on failure, so a existing and working script won't go awry when the icon can not be found.
       
    • By rcmaehl
      A UDF to connect and control Five9 on the Local Network via it's provided HTTP API
       
      THIS UDF IS STILL IN TESTING
       
      Current Features:
      Agent Ready
      * Contains most functions needed to control Agent Status  
      PLANNED Features:
      Heavyweight
      * Control most Five9 API functions
      * Full Control over own Status as well as Supervisor functionality
        Helpful Premade Examples Files
      * Examples for almost every function
      * Premade CUI and GUI clients
        Ready for all users, beginner and up
      * Detailed Error Reporting to help pin-point problems
      * Thorough parameter checking to prevent accidental script crashes  
      Support:
      Support for this UDF can be obtained in my Discord Server
    • By rcmaehl
      A UDF to connect and control Cisco Finesse on the Local Network via it's provided HTTP API
       
      Current Features:
      Heavyweight
      * Large feature set, containing most Finesse Desktop API functions  
      PLANNED Features:
      Heavyweight
      * Control over own Status as well as Supervisor functionality
        Helpful Premade Examples Files
      * Examples for almost every function
      * Premade CUI and GUI clients 
        Ready for all users, beginner and up
      * Detailed Error Reporting to help pin-point problems
      * Thorough parameter checking to prevent accidental script crashes  
      Support:
      Support for this UDF can be obtained in my Discord Server
    • By WindIt
      Hi, 
      I have a set of excel docs 1& 2
      1) In Excel 1 i have a fixed column called dimensionId that contains list of dimensionid's with in between empty cells.
      Here, For each dimesionId, i need to check corresponding columns of L,M,N ,O(senior, mid, junior, student) & check If they contain letter Y (Open excel 2) and if empty ignore,check next.
      I need to loop through the entire column of dimensionId one by one, please help me proceed with the logic.
      2) If letter Y exists, open excel 2 and check if same dimesionId exists in column A.
      New to autoit excel automation, Help me with logic to execute this.
      #include <Excel.au3>
      Global $oExcel = _Excel_Open()
      Global $oWorkbook = _Excel_BookOpen($oExcel, "D:\yta\Trial concept dimensions list.xlsx")
      Local $read1 = _Excel_RangeRead ($oWorkbook,Default,"C3")
      MsgBox(0,"",$read1)
      Attached exce 1 doc.
       
       
      exl1.xlsx exl2.xlsx
×
×
  • Create New...