Developers Jos Posted September 16, 2018 Developers Posted September 16, 2018 Hey, I was just kidding. I am not in this place to make money, just to have some sort of fun without commitments. rakesh2804 and FrancescoDiMuro 1 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
FrancescoDiMuro Posted September 16, 2018 Posted September 16, 2018 By the way, @rakesh2804, here there are a lot of people which is trying to help you, and some others already did it Is there something that you are not managing to do with all the scripts gently provided from some users? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Subz Posted September 17, 2018 Posted September 17, 2018 Don't have any time to comment this but here is a another dynamic version (only requires ini file updated) with radio buttons and checkboxes. Save following as: Software.ini. expandcollapse popup[Departments] All = Department Finance = Department HR = Department IT = Department Operation = Department Procurement = Department Projects = Department [Department: All] Microsoft Office = 2013 Adobe Flash = 17 Java Runtime = 18 [Department: Finance] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: HR] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: IT] Microsoft Office = 2010 Adobe Flash = 17 Java Runtime = 18 [Department: Operation] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: Procurement] Microsoft Office = 2013 Adobe Flash = 17 Java Runtime = 18 [Department: Projects] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Software: Microsoft Office] 2010 = @ScriptDir@\Microsoft\Office\2010\Setup.exe 2013 = @ScriptDir@\Microsoft\Office\2013\Setup.exe 2016 = @ScriptDir@\Microsoft\Office\2016\Setup.exe [Software: Adobe Flash] 16 = @ScriptDir@\Adobe\Flash\16\Setup.exe 17 = @ScriptDir@\Adobe\Flash\17\Setup.exe 18 = @ScriptDir@\Adobe\Flash\18\Setup.exe [Software: Java Runtime] 16 = @ScriptDir@\Oracle\JavaRT\16\Setup.exe 17 = @ScriptDir@\Oracle\JavaRT\17\Setup.exe 18 = @ScriptDir@\oracle\JavaRT\18\Setup.exe In the same folder run the following script: expandcollapse popup#include <Array.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> Opt("ExpandVarStrings", 1) Global $g_sInifilepath = @ScriptDir & "\Software.ini" Global $g_aSoftware, $g_sDepartment Global $aDepartments = IniReadSection($g_sInifilepath, "Departments") If @error Then Exit _ArrayDelete($aDepartments, 0) _SelectDeparment() Func _SelectDeparment() Local $hGuiDepartment, $idDepartmentNext Local $yDepartments = 25 * UBound($aDepartments) + 45 Local $yDepartments = 45 $hGuiDepartment = GUICreate("Department", 165, 90 + (25 * UBound($aDepartments))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Department", 15, 15, 135, 20) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) For $i = 0 To UBound($aDepartments) - 1 Assign(StringStripWS($aDepartments[$i][0], 8), GUICtrlCreateRadio($aDepartments[$i][0], 15, $yDepartments, 135, 20)) GUICtrlSetFont(-1, 10, 800, 0, "Calibri") GUICtrlSetColor(-1, 0xFF0000) $yDepartments += 25 Next $idDepartmentNext = GUICtrlCreateButton("Next", 75, $yDepartments + 5, 75, 25) GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idDepartmentNext For $i = 0 To UBound($aDepartments) - 1 ;~ Check which department is checked ;~ If no department is checked then continue displaying department selection dialogue If BitAND(GUICtrlRead(Eval($aDepartments[$i][0])), $GUI_CHECKED) = $GUI_CHECKED Then ;~ Check Ini file for "Department: <Department name>" to capture software assigned to this group. $g_aSoftware = IniReadSection($g_sInifilepath, "Department: " & GUICtrlRead(Eval($aDepartments[$i][0]), 1)) If @error Then MsgBox(16, "Department Error", 'Unable to find section "Department: ' & GUICtrlRead(Eval($aDepartments[$i][0]), 1)) ContinueLoop EndIf _ArrayDelete($g_aSoftware, 0) $g_sDepartment = GUICtrlRead(Eval($aDepartments[$i][0]), 1) GUIDelete($hGuiDepartment) _SelectSoftware() ExitLoop 2 EndIf Next EndSwitch WEnd EndFunc Func _SelectSoftware() Local $hSoftwareGui = GUICreate("Department: " & $g_sDepartment & " - Software", 330, 90 + (50 * UBound($g_aSoftware))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Software", 15, 15, 135, 20) GUICtrlSetFont(-1, 14, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) Local $ySoftware = 45, $xVersions = 25, $yVersions = 65 For $i = 0 To UBound($g_aSoftware) - 1 $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop _ArrayDelete($aVersions, 0) Assign(StringStripWS($g_aSoftware[$i][0], 8), GUICtrlCreateCheckbox($g_aSoftware[$i][0], 15, $ySoftware, 135, 20)) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetState(-1, $GUI_CHECKED) GUIStartGroup() For $j = 0 To UBound($aVersions) - 1 Assign(StringStripWS($g_aSoftware[$i][0] & $aVersions[$j][0], 8), GUICtrlCreateRadio($aVersions[$j][0], $xVersions, $yVersions, 115, 20)) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) If $g_aSoftware[$i][1] = $aVersions[$j][0] Then GUICtrlSetState(-1, $GUI_CHECKED) $xVersions += 115 Next $xVersions = 25 $yVersions += 50 $ySoftware += 50 Next $idInstall = GUICtrlCreateButton("Install", 330 - 90, $yVersions - 15, 75, 25) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idInstall For $i = 0 To UBound($g_aSoftware) - 1 If BitAND(GUICtrlRead(Eval(StringStripWS($g_aSoftware[$i][0], 8))), $GUI_CHECKED) = $GUI_CHECKED Then $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop For $j = 0 To UBound($aVersions) - 1 If BitAND(GUICtrlRead(Eval(StringStripWS($g_aSoftware[$i][0] & $aVersions[$j][0], 8))), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(4096, $g_aSoftware[$i][0] & " - " & $aVersions[$j][0], "Install " & $g_aSoftware[$i][0] & ":" & $aVersions[$j][0] & " using the following command line" & @CRLF & $aVersions[$j][1]) EndIf Next EndIf Next EndSwitch WEnd EndFunc rakesh2804 1
rakesh2804 Posted September 19, 2018 Author Posted September 19, 2018 On 9/16/2018 at 7:07 PM, Jos said: Hey, I was just kidding. I am not in this place to make money, just to have some sort of fun without commitments. LOL! . I had that coming anyway. But jokes aside, in a parallel universe, i would definitely would like to buy you guys a drink.
rakesh2804 Posted September 19, 2018 Author Posted September 19, 2018 On 9/16/2018 at 10:44 PM, FrancescoDiMuro said: By the way, @rakesh2804, here there are a lot of people which is trying to help you, and some others already did it Is there something that you are not managing to do with all the scripts gently provided from some users? The only problem that I am facing is that I am not having much time to learn and understand how the code works. Which is the reason why I am asking the community to completely code it for me. Since I am a fresher into corporate world and my job profile is only towards the hardware part, its difficult for me to try to understand how the code works, even if I use the "help" part which is integrated in the software. Don't get me wrong but I am actually fascinated by the fact that people here code it as if its a child's play, but for me it looks like a work or a wizard or a brilliant scientist from NASA. Just wanted to know, 1. Are there any pre requisite in order to understand Auto IT programming 2. How long does it take to master coding like you guys? Thanks
rakesh2804 Posted September 19, 2018 Author Posted September 19, 2018 On 9/17/2018 at 6:16 AM, Subz said: Don't have any time to comment this but here is a another dynamic version (only requires ini file updated) with radio buttons and checkboxes. Save following as: Software.ini. expandcollapse popup[Departments] All = Department Finance = Department HR = Department IT = Department Operation = Department Procurement = Department Projects = Department [Department: All] Microsoft Office = 2013 Adobe Flash = 17 Java Runtime = 18 [Department: Finance] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: HR] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: IT] Microsoft Office = 2010 Adobe Flash = 17 Java Runtime = 18 [Department: Operation] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: Procurement] Microsoft Office = 2013 Adobe Flash = 17 Java Runtime = 18 [Department: Projects] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Software: Microsoft Office] 2010 = @ScriptDir@\Microsoft\Office\2010\Setup.exe 2013 = @ScriptDir@\Microsoft\Office\2013\Setup.exe 2016 = @ScriptDir@\Microsoft\Office\2016\Setup.exe [Software: Adobe Flash] 16 = @ScriptDir@\Adobe\Flash\16\Setup.exe 17 = @ScriptDir@\Adobe\Flash\17\Setup.exe 18 = @ScriptDir@\Adobe\Flash\18\Setup.exe [Software: Java Runtime] 16 = @ScriptDir@\Oracle\JavaRT\16\Setup.exe 17 = @ScriptDir@\Oracle\JavaRT\17\Setup.exe 18 = @ScriptDir@\oracle\JavaRT\18\Setup.exe In the same folder run the following script: expandcollapse popup#include <Array.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> Opt("ExpandVarStrings", 1) Global $g_sInifilepath = @ScriptDir & "\Software.ini" Global $g_aSoftware, $g_sDepartment Global $aDepartments = IniReadSection($g_sInifilepath, "Departments") If @error Then Exit _ArrayDelete($aDepartments, 0) _SelectDeparment() Func _SelectDeparment() Local $hGuiDepartment, $idDepartmentNext Local $yDepartments = 25 * UBound($aDepartments) + 45 Local $yDepartments = 45 $hGuiDepartment = GUICreate("Department", 165, 90 + (25 * UBound($aDepartments))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Department", 15, 15, 135, 20) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) For $i = 0 To UBound($aDepartments) - 1 Assign(StringStripWS($aDepartments[$i][0], 8), GUICtrlCreateRadio($aDepartments[$i][0], 15, $yDepartments, 135, 20)) GUICtrlSetFont(-1, 10, 800, 0, "Calibri") GUICtrlSetColor(-1, 0xFF0000) $yDepartments += 25 Next $idDepartmentNext = GUICtrlCreateButton("Next", 75, $yDepartments + 5, 75, 25) GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idDepartmentNext For $i = 0 To UBound($aDepartments) - 1 ;~ Check which department is checked ;~ If no department is checked then continue displaying department selection dialogue If BitAND(GUICtrlRead(Eval($aDepartments[$i][0])), $GUI_CHECKED) = $GUI_CHECKED Then ;~ Check Ini file for "Department: <Department name>" to capture software assigned to this group. $g_aSoftware = IniReadSection($g_sInifilepath, "Department: " & GUICtrlRead(Eval($aDepartments[$i][0]), 1)) If @error Then MsgBox(16, "Department Error", 'Unable to find section "Department: ' & GUICtrlRead(Eval($aDepartments[$i][0]), 1)) ContinueLoop EndIf _ArrayDelete($g_aSoftware, 0) $g_sDepartment = GUICtrlRead(Eval($aDepartments[$i][0]), 1) GUIDelete($hGuiDepartment) _SelectSoftware() ExitLoop 2 EndIf Next EndSwitch WEnd EndFunc Func _SelectSoftware() Local $hSoftwareGui = GUICreate("Department: " & $g_sDepartment & " - Software", 330, 90 + (50 * UBound($g_aSoftware))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Software", 15, 15, 135, 20) GUICtrlSetFont(-1, 14, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) Local $ySoftware = 45, $xVersions = 25, $yVersions = 65 For $i = 0 To UBound($g_aSoftware) - 1 $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop _ArrayDelete($aVersions, 0) Assign(StringStripWS($g_aSoftware[$i][0], 8), GUICtrlCreateCheckbox($g_aSoftware[$i][0], 15, $ySoftware, 135, 20)) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetState(-1, $GUI_CHECKED) GUIStartGroup() For $j = 0 To UBound($aVersions) - 1 Assign(StringStripWS($g_aSoftware[$i][0] & $aVersions[$j][0], 8), GUICtrlCreateRadio($aVersions[$j][0], $xVersions, $yVersions, 115, 20)) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) If $g_aSoftware[$i][1] = $aVersions[$j][0] Then GUICtrlSetState(-1, $GUI_CHECKED) $xVersions += 115 Next $xVersions = 25 $yVersions += 50 $ySoftware += 50 Next $idInstall = GUICtrlCreateButton("Install", 330 - 90, $yVersions - 15, 75, 25) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idInstall For $i = 0 To UBound($g_aSoftware) - 1 If BitAND(GUICtrlRead(Eval(StringStripWS($g_aSoftware[$i][0], 8))), $GUI_CHECKED) = $GUI_CHECKED Then $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop For $j = 0 To UBound($aVersions) - 1 If BitAND(GUICtrlRead(Eval(StringStripWS($g_aSoftware[$i][0] & $aVersions[$j][0], 8))), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(4096, $g_aSoftware[$i][0] & " - " & $aVersions[$j][0], "Install " & $g_aSoftware[$i][0] & ":" & $aVersions[$j][0] & " using the following command line" & @CRLF & $aVersions[$j][1]) EndIf Next EndIf Next EndSwitch WEnd EndFunc Thanks @Subz. I will try the code and revert back to you soon. Thanks again.
FrancescoDiMuro Posted September 19, 2018 Posted September 19, 2018 @rakesh2804 Thanks for the kind reply Someone could code for you, but, less than someone has some spare time ( most of the users here have a work ), you have to know that he would like to be paid for his work. Some users here gave you little/big hints, but they can't code for you "just for fun", since when you ask for a working application, the fun goes "back" the seriousness of the work, and so, the time spent to think and to program couldn't be "unpaid". This is my opinion. By the way, coding becomes "child's play" when you get into it, studying how things work, and how you can do just one thing in a million ways, even better. Since AutoIt is a BASIC-like language, you can start from learning a bit of VBA, and C++. There are a lot of concepts which came from both of those programming languages. Help file is, and always be the "best friend" of the programmer, since you can find in it examples, and detailed information about the use of the functions, and basic concepts about AutoIt. I hope you'll have the time to learn AutoIt, since it is a fun programming language, and it is extremly powerful ( even thanks to this community ). So, best wishes to you, and happy programming Best Regards. rakesh2804 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
rakesh2804 Posted September 19, 2018 Author Posted September 19, 2018 4 hours ago, FrancescoDiMuro said: @rakesh2804 Thanks for the kind reply Someone could code for you, but, less than someone has some spare time ( most of the users here have a work ), you have to know that he would like to be paid for his work. Some users here gave you little/big hints, but they can't code for you "just for fun", since when you ask for a working application, the fun goes "back" the seriousness of the work, and so, the time spent to think and to program couldn't be "unpaid". This is my opinion. By the way, coding becomes "child's play" when you get into it, studying how things work, and how you can do just one thing in a million ways, even better. Since AutoIt is a BASIC-like language, you can start from learning a bit of VBA, and C++. There are a lot of concepts which came from both of those programming languages. Help file is, and always be the "best friend" of the programmer, since you can find in it examples, and detailed information about the use of the functions, and basic concepts about AutoIt. I hope you'll have the time to learn AutoIt, since it is a fun programming language, and it is extremly powerful ( even thanks to this community ). So, best wishes to you, and happy programming Best Regards. Thanks FrancescoDiMuro Right now i needed this motivation. I completely agree with you. It would be unfair if the work goes unpaid. IMHO, you and most guys here have been helpful here despite me creating all this drama. Helpfulness sets apart this community when compared to a lot others. So I will start with VBA and I have a basic knowledge on C++. Hopefully on day I can code with my eyes closed. Thanks a lot.
rakesh2804 Posted September 19, 2018 Author Posted September 19, 2018 On 9/17/2018 at 6:16 AM, Subz said: Don't have any time to comment this but here is a another dynamic version (only requires ini file updated) with radio buttons and checkboxes. Save following as: Software.ini. expandcollapse popup[Departments] All = Department Finance = Department HR = Department IT = Department Operation = Department Procurement = Department Projects = Department [Department: All] Microsoft Office = 2013 Adobe Flash = 17 Java Runtime = 18 [Department: Finance] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: HR] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: IT] Microsoft Office = 2010 Adobe Flash = 17 Java Runtime = 18 [Department: Operation] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Department: Procurement] Microsoft Office = 2013 Adobe Flash = 17 Java Runtime = 18 [Department: Projects] Microsoft Office = 2016 Adobe Flash = 17 Java Runtime = 18 [Software: Microsoft Office] 2010 = @ScriptDir@\Microsoft\Office\2010\Setup.exe 2013 = @ScriptDir@\Microsoft\Office\2013\Setup.exe 2016 = @ScriptDir@\Microsoft\Office\2016\Setup.exe [Software: Adobe Flash] 16 = @ScriptDir@\Adobe\Flash\16\Setup.exe 17 = @ScriptDir@\Adobe\Flash\17\Setup.exe 18 = @ScriptDir@\Adobe\Flash\18\Setup.exe [Software: Java Runtime] 16 = @ScriptDir@\Oracle\JavaRT\16\Setup.exe 17 = @ScriptDir@\Oracle\JavaRT\17\Setup.exe 18 = @ScriptDir@\oracle\JavaRT\18\Setup.exe In the same folder run the following script: expandcollapse popup#include <Array.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> Opt("ExpandVarStrings", 1) Global $g_sInifilepath = @ScriptDir & "\Software.ini" Global $g_aSoftware, $g_sDepartment Global $aDepartments = IniReadSection($g_sInifilepath, "Departments") If @error Then Exit _ArrayDelete($aDepartments, 0) _SelectDeparment() Func _SelectDeparment() Local $hGuiDepartment, $idDepartmentNext Local $yDepartments = 25 * UBound($aDepartments) + 45 Local $yDepartments = 45 $hGuiDepartment = GUICreate("Department", 165, 90 + (25 * UBound($aDepartments))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Department", 15, 15, 135, 20) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) For $i = 0 To UBound($aDepartments) - 1 Assign(StringStripWS($aDepartments[$i][0], 8), GUICtrlCreateRadio($aDepartments[$i][0], 15, $yDepartments, 135, 20)) GUICtrlSetFont(-1, 10, 800, 0, "Calibri") GUICtrlSetColor(-1, 0xFF0000) $yDepartments += 25 Next $idDepartmentNext = GUICtrlCreateButton("Next", 75, $yDepartments + 5, 75, 25) GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idDepartmentNext For $i = 0 To UBound($aDepartments) - 1 ;~ Check which department is checked ;~ If no department is checked then continue displaying department selection dialogue If BitAND(GUICtrlRead(Eval($aDepartments[$i][0])), $GUI_CHECKED) = $GUI_CHECKED Then ;~ Check Ini file for "Department: <Department name>" to capture software assigned to this group. $g_aSoftware = IniReadSection($g_sInifilepath, "Department: " & GUICtrlRead(Eval($aDepartments[$i][0]), 1)) If @error Then MsgBox(16, "Department Error", 'Unable to find section "Department: ' & GUICtrlRead(Eval($aDepartments[$i][0]), 1)) ContinueLoop EndIf _ArrayDelete($g_aSoftware, 0) $g_sDepartment = GUICtrlRead(Eval($aDepartments[$i][0]), 1) GUIDelete($hGuiDepartment) _SelectSoftware() ExitLoop 2 EndIf Next EndSwitch WEnd EndFunc Func _SelectSoftware() Local $hSoftwareGui = GUICreate("Department: " & $g_sDepartment & " - Software", 330, 90 + (50 * UBound($g_aSoftware))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Software", 15, 15, 135, 20) GUICtrlSetFont(-1, 14, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) Local $ySoftware = 45, $xVersions = 25, $yVersions = 65 For $i = 0 To UBound($g_aSoftware) - 1 $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop _ArrayDelete($aVersions, 0) Assign(StringStripWS($g_aSoftware[$i][0], 8), GUICtrlCreateCheckbox($g_aSoftware[$i][0], 15, $ySoftware, 135, 20)) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetState(-1, $GUI_CHECKED) GUIStartGroup() For $j = 0 To UBound($aVersions) - 1 Assign(StringStripWS($g_aSoftware[$i][0] & $aVersions[$j][0], 8), GUICtrlCreateRadio($aVersions[$j][0], $xVersions, $yVersions, 115, 20)) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) If $g_aSoftware[$i][1] = $aVersions[$j][0] Then GUICtrlSetState(-1, $GUI_CHECKED) $xVersions += 115 Next $xVersions = 25 $yVersions += 50 $ySoftware += 50 Next $idInstall = GUICtrlCreateButton("Install", 330 - 90, $yVersions - 15, 75, 25) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idInstall For $i = 0 To UBound($g_aSoftware) - 1 If BitAND(GUICtrlRead(Eval(StringStripWS($g_aSoftware[$i][0], 8))), $GUI_CHECKED) = $GUI_CHECKED Then $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop For $j = 0 To UBound($aVersions) - 1 If BitAND(GUICtrlRead(Eval(StringStripWS($g_aSoftware[$i][0] & $aVersions[$j][0], 8))), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(4096, $g_aSoftware[$i][0] & " - " & $aVersions[$j][0], "Install " & $g_aSoftware[$i][0] & ":" & $aVersions[$j][0] & " using the following command line" & @CRLF & $aVersions[$j][1]) EndIf Next EndIf Next EndSwitch WEnd EndFunc Hi @Subz, Sorry, but may I know where I can put up the AU3info to automate software installation through mouse clicks. Like the one which I had worked here to install mozilla automatically. WinWait('Mozilla Firefox Setup') WinActivate('Mozilla Firefox Setup') MouseClick('primary', 360, 367, 1, 0) WinWait('Mozilla Firefox Setup') WinActivate('Mozilla Firefox Setup') MouseClick('primary', 32, 194, 1, 0) MouseClick('primary', 351, 362, 1, 0) WinWait('Mozilla Firefox Setup') WinActivate('Mozilla Firefox Setup') MouseClick('primary', 360, 364, 1, 0) WinWait('Mozilla Firefox Setup') WinActivate('Mozilla Firefox Setup') MouseClick('primary', 32, 150, 1, 0) MouseClick('primary', 360, 364, 1, 0) ElseIf $t = 7 Then EndIf
FrancescoDiMuro Posted September 19, 2018 Posted September 19, 2018 8 minutes ago, rakesh2804 said: Sorry, but may I know where I can put up the AU3info to automate software installation through mouse clicks. Like the one which I had worked here to install mozilla automatically. Sorry @Subz for replying. Instead of using mouse clicks, you could use Control* functions to automate your software installation It is better than using mouse clicks. Through the AutoItWindowInfoTool, you can see the information required in the Control* functions rakesh2804 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Subz Posted September 19, 2018 Posted September 19, 2018 You should use silent install switches for software packages, MouseClick or ControlClick is highly discouraged for example for Firefox: Download Latest Firefox ESR version found here: https://www.mozilla.org/en-US/firefox/organizations/all/ Save the file to a subfolder where ever your ini/au3 file is located for example: C:\Software\Firefox\Firefox Setup 60.2.0esr.exe Save the following file to C:\Software\Firefox\Setup.ini expandcollapse popup[Install] ; Remove the semicolon (;) to un-comment a line. ; ; The name of the directory where the application will be installed in the ; system's program files directory. The security ; context the installer is running in must have write access to the ; installation directory. Also, the directory must not exist or if it exists ; it must be a directory and not a file. If any of these conditions are not met ; the installer will abort the installation with an error level of 2. If this ; value is specified then InstallDirectoryPath will be ignored. ; InstallDirectoryName=Mozilla Firefox ; The full path to the directory to install the application. The security ; context the installer is running in must have write access to the ; installation directory. Also, the directory must not exist or if it exists ; it must be a directory and not a file. If any of these conditions are not met ; the installer will abort the installation with an error level of 2. ; InstallDirectoryPath=c:\firefox\ ; By default all of the following shortcuts are created. To prevent the ; creation of a shortcut specify false for the shortcut you don't want created. ; Create a shortcut for the application in the current user's QuickLaunch ; directory. QuickLaunchShortcut=false ; Create a shortcut for the application on the taskbar. TaskbarShortcut=false ; Create a shortcut for the application on the desktop. This will create the ; shortcut in the All Users Desktop directory and if that fails this will ; attempt to create the shortcuts in the current user's Start Menu directory. DesktopShortcut=false ; Create shortcuts for the application in the Start Menu. This will create the ; shortcuts in the All Users Start Menu directory and if that fails this will ; attempt to create the shortcuts in the current user's Start Menu directory. ; StartMenuShortcuts=false ; The directory name to use for the StartMenu folder (not available with ; Firefox 4.0 and above - see note below). ; note: if StartMenuShortcuts=false is specified then this will be ignored. ; StartMenuDirectoryName=Mozilla Firefox ; The MozillaMaintenance service is used for silent updates and may be used ; for other maintenance related tasks. It is an optional component. ; This option can be used in Firefox 16 or later to skip installing the service. MaintenanceService=false ; Starts with Firefox 60, it's possible to mark all or some of the extensions ; bundled within a partner distribution as optional. ; Set this option to false to opt-out installtion of any optional extensions. OptionalExtensions=false Save the following Script to C:\Software\Software.au3 expandcollapse popup#RequireAdmin #include <Array.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <ProgressConstants.au3> Opt("ExpandVarStrings", 1) Global $g_sInifilepath = @ScriptDir & "\Software.ini" Global $g_aSoftware, $g_sDepartment Global $aDepartments = IniReadSection($g_sInifilepath, "Departments") If @error Then Exit _ArrayDelete($aDepartments, 0) _SelectDeparment() Func _SelectDeparment() Local $hGuiDepartment, $idDepartmentNext Local $yDepartments = 25 * UBound($aDepartments) + 45 Local $yDepartments = 45 $hGuiDepartment = GUICreate("Department", 165, 90 + (25 * UBound($aDepartments))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Department", 15, 15, 135, 20) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) For $i = 0 To UBound($aDepartments) - 1 Assign(_VarString($aDepartments[$i][0]), GUICtrlCreateRadio($aDepartments[$i][0], 15, $yDepartments, 135, 20)) GUICtrlSetFont(-1, 10, 800, 0, "Calibri") GUICtrlSetColor(-1, 0xFF0000) $yDepartments += 25 Next $idDepartmentNext = GUICtrlCreateButton("Next", 75, $yDepartments + 5, 75, 25) GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idDepartmentNext For $i = 0 To UBound($aDepartments) - 1 ;~ Check which department is checked ;~ If no department is checked then continue displaying department selection dialogue If BitAND(GUICtrlRead(Eval(_VarString($aDepartments[$i][0]))), $GUI_CHECKED) = $GUI_CHECKED Then ;~ Check Ini file for "Department: <Department name>" to capture software assigned to this group. $g_aSoftware = IniReadSection($g_sInifilepath, "Department: " & GUICtrlRead(Eval(_VarString($aDepartments[$i][0])), 1)) If @error Then MsgBox(16, "Department Error", 'Unable to find section "Department: ' & GUICtrlRead(Eval(_VarString($aDepartments[$i][0])), 1)) ContinueLoop EndIf _ArrayDelete($g_aSoftware, 0) $g_sDepartment = GUICtrlRead(Eval(_VarString($aDepartments[$i][0])), 1) GUIDelete($hGuiDepartment) _SelectSoftware() ExitLoop 2 EndIf Next EndSwitch WEnd EndFunc Func _SelectSoftware() Local $hSoftwareGui = GUICreate("Department: " & $g_sDepartment & " - Software", 330, 90 + (50 * UBound($g_aSoftware))) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Select Software", 15, 15, 135, 20) GUICtrlSetFont(-1, 14, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) Local $ySoftware = 45, $xVersions = 25, $yVersions = 65 For $i = 0 To UBound($g_aSoftware) - 1 $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop _ArrayDelete($aVersions, 0) Assign(_VarString($g_aSoftware[$i][0]), GUICtrlCreateCheckbox($g_aSoftware[$i][0], 15, $ySoftware, 135, 20)) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUICtrlSetState(-1, $GUI_CHECKED) GUIStartGroup() For $j = 0 To UBound($aVersions) - 1 Assign(_VarString($g_aSoftware[$i][0] & $aVersions[$j][0]), GUICtrlCreateRadio($aVersions[$j][0], $xVersions, $yVersions, 115, 20)) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) If $g_aSoftware[$i][1] = $aVersions[$j][0] Then GUICtrlSetState(-1, $GUI_CHECKED) $xVersions += 115 Next $xVersions = 25 $yVersions += 50 $ySoftware += 50 Next $idProgress = GUICtrlCreateProgress(15, $yVersions - 15, 330-120, 25, BitOR($PBS_SMOOTH, $PBS_MARQUEE)) $idInstall = GUICtrlCreateButton("Install", 330 - 90, $yVersions - 15, 75, 25) GUICtrlSetFont(-1, 11, 800, 0, "Calibri") GUICtrlSetBkColor(-1, 0xA6CAF0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idInstall If GUICtrlRead($idInstall) = "Complete" Then Exit For $i = 0 To UBound($g_aSoftware) - 1 If BitAND(GUICtrlRead(Eval(_VarString($g_aSoftware[$i][0]))), $GUI_CHECKED) = $GUI_CHECKED Then $aVersions = IniReadSection($g_sInifilepath, "Software: " & $g_aSoftware[$i][0]) If @error Then ContinueLoop For $j = 1 To $aVersions[0][0] If BitAND(GUICtrlRead(Eval(_VarString($g_aSoftware[$i][0] & $aVersions[$j][0]))), $GUI_CHECKED) = $GUI_CHECKED Then GUICtrlSetData($idInstall, "Installing...") GUICtrlSendMsg($idProgress, $PBM_SETMARQUEE, 1, 50) Execute($aVersions[$j][1]) GUICtrlSendMsg($idProgress, $PBM_SETMARQUEE, 0, 50) GUICtrlSetStyle($idProgress, $PBS_MARQUEE) EndIf Next GUICtrlSetData($idInstall, "Complete") EndIf Next EndSwitch WEnd EndFunc Func _VarString($_sVarString) Local $sVarString = StringRegExpReplace($_sVarString, "[^[:alnum:]]", "") Return $sVarString EndFunc Save the following to C:\Software\Software.ini [Departments] All = Department IT = Department [Department: All] Firefox = 60.2 [Department: IT] Firefox = 60.2 Java Runtime = 18 [Software: Firefox] 60.2 = RunWait('"@ScriptDir@\Firefox\Firefox Setup 60.2.0esr.exe" /INI="@ScriptDir@\Firefox\Setup.ini"') [Software: Java Runtime] 18 = MsgBox(4096, "", "@ScriptDir@\Oracle\JavaRT\18\Setup.exe") Run Software.au3 and it should install Firefox completely silently, if you select IT Department you will also get a popup showing you Java Runtime, this is for example purposes only. You should really learn how to create the silent installers first, most software will have a silent switch, those that don't I would usually repackage so that it can be installed silently.
water Posted September 19, 2018 Posted September 19, 2018 @rakesh2804 Could you please stop quoting the whole post of the user you reply to? This just clutters the thread and makes it hard to read. The user knows what he has written. If you want to refer to a specific user, please use his name in your answer. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted September 19, 2018 Posted September 19, 2018 Another idea: Have a look at those solutions that already exist. You can extend them if needed. Example: My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted September 19, 2018 Posted September 19, 2018 Or the ultimate installer My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
rakesh2804 Posted September 20, 2018 Author Posted September 20, 2018 20 hours ago, water said: @rakesh2804 Could you please stop quoting the whole post of the user you reply to? This just clutters the thread and makes it hard to read. The user knows what he has written. If you want to refer to a specific user, please use his name in your answer. Hi @water, Noted. Thanks.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now