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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Hi is it possible to add "switches" to the complied exe file ex: "software_installer.exe /all" (install all the software in the program) and "software_installer.exe /cat1" installs all from the first category?

Share this post


Link to post
Share on other sites

Hi

Very nice tool. I am using it and modifying as per my project.

I still have not tried by default where the software gets installed. I want the softwares to be installed in specific directory ? How would I do that?

Thanks in Advance...

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

 

I'm struggling to understand what GUICtrlSendMsg() does and why it is used in this script.  Could someone give me an explanation?

GUICtrlSendMsg(-1, 0x101E, 0, 200)
GUICtrlSendMsg(-1, 0x101E, 1, 375)

It corresponds to the width of the columns of each tab. The first column has a width of 200 (Software) and the second one 375 (Description)

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


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

Share this post


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

Share this post


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?

Edited by kgreer

Share this post


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.

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • 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.
       
×
×
  • Create New...