Jump to content

all the help i can get


evil
 Share

Recommended Posts

hi.

Iv used autoit many years ago so don't remember much.

 

I am after creating a huge script/s to install a big bunch of software, something i can just plug in to a PC with a usb drive and just click go, as far as iv researched so far (the past 15hrs), i am still none the wiser.

There is a few i have questions for, that i can really find a good explanation for, like the scrip to auto detect the drive letter, and to run scripts thats on different paths to the installers, also for each of the installed items to be customized, as in changing the installation-path, also to run silent.

 

I get the basic idea from the "WinZip" tutorial & some tutorials i viewed online, i believe i also need to make some .ini files so the script can find the install media.

 

if some one can point me in the right direction it will be great.

 

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

Maybe you are looking for the Vollatran installation tool:

You set up an Ini -file with the programs to install. The rest gets done by the tool.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

There are many ways of doing what you want, you can do it without the ini too.

Example:

#requireadmin
#Include <WinAPI.au3>
#include <GuiEdit.au3>
#include <GuiButton.au3>
#Include <Constants.au3>
#include <GuiStatusBar.au3>
#include <GUIConstants.au3>
#include <GuiImageList.au3>
#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt ("TrayMenuMode", 1)
Opt ("TrayIconHide", 1)
Opt ("GUIResizeMode", 1)
Opt ("TrayIconDebug", 1)
Opt ("TrayAutoPause", 0)
Opt ("MouseCoordMode", 2)
Opt ("GUIOnEventMode", 0)
Opt ("MustDeclareVars", 0)
Opt ("GUIEventOptions", 1)
Opt ("TrayOnEventMode", 1)
Opt ("ExpandEnvStrings", 1)
Opt ("WinDetectHiddenText", 1)

TraySetIcon("IMG\g73jh.ico")

SplashImageOn ("ASUS", "IMG\g73jh.jpg", -1, -1, -1, -1, 1)
Sleep (1000)
SplashOff()

$hGUI = GUICreate("AutoIt Install Menu", 570, 280, 200, 200)
$hlabel = GUICtrlCreateLabel("Select a Program to install", 30, 10, 126, 17)
$hButton1 = GUICtrlCreateButton("Start", 30, 200)
$hButton2 = GUICtrlCreateButton("Select All", 70, 200)
$hButton3 = GUICtrlCreateButton("UnSelect All", 140, 200)

$totray = TrayCreateItem("Tray")
TrayItemSetOnEvent ($totray,"ToTray")

$restore = TrayCreateItem("Restore")
TrayItemSetOnEvent ($restore,"Restore")

$exititem = TrayCreateItem("Close")
TrayItemSetOnEvent ($exititem,"Quit")

GUISetState()

; Declare arrays
Global $aRadio[24]
Global $aApps[24] [24]
Global $aApps[24] [24]

; Fill this array with the paths to your apps
$aApps[0][0] = "ICO"
$aApps[0][1] = "ICO.exe"
$aApps[0][2] = "IMG\ICO.ico"
$aApps[1][0] = "VLC"
$aApps[1][1] = "IMG\vlc.ico"
$aApps[1][2] = "IMG\vlc.ico"
$aApps[2][0] = "Java"
$aApps[2][1] = "AutoIt Java.exe"
$aApps[2][2] = "IMG\java.ico"
$aApps[3][0] = "Fraps"
$aApps[3][1] = "AutoIt Fraps.exe"
$aApps[3][2] = "IMG\fraps.ico"
$aApps[4][0] = "DX9c"
$aApps[4][1] = "AutoIt DX9c.exe"
$aApps[4][2] = "IMG\dx9c.ico"
$aApps[5][0] = "Nightly"
$aApps[5][1] = "AutoIt Nightly.exe"
$aApps[5][2] = "IMG\nightly.ico"
$aApps[6][0] = "GP+LS"
$aApps[6][1] = "AutoIt GP W8 x64.exe"
$aApps[6][2] = "IMG\gpls.ico"
$aApps[7][0] = "PowerCfg"
$aApps[7][1] = "PowerCfg.exe"
$aApps[7][2] = "IMG\power.ico"
$aApps[8][0] = "NirCmdVol"
$aApps[8][1] = "AutoIt NirCmdVol.exe"
$aApps[8][2] = "IMG\nircmd.ico"
$aApps[9][0] = "FlashPlayer"
$aApps[9][1] = "AutoIt FlashPlayer.exe"
$aApps[9][2] = "IMG\flashplayer.ico"
$aApps[10][0] = "WinRar x64"
$aApps[10][1] = "AutoIt WinRar x64.exe"
$aApps[10][2] = "IMG\winrar.ico"
$aApps[11][0] = "Foxit Reader"
$aApps[11][1] = "FoxitReaderPortable.exe"
$aApps[11][2] = "IMG\foxit.ico"
$aApps[12][0] = "Realtek R266"
$aApps[12][1] = "AutoIt RLTK 266 x64.exe"
$aApps[12][2] = "IMG\realtek.ico"
$aApps[13][0] = "ATK Package"
$aApps[13][1] = "AutoIt ATK Package.exe"
$aApps[13][2] = "IMG\atk.ico"
$aApps[14][0] = "AutoIt v3.3.6.1"
$aApps[14][1] = "AutoIt Auto v3.3.6.1.exe"
$aApps[14][2] = "IMG\autoit.ico"
$aApps[15][0] = "PhysX 9.11.1107"
$aApps[15][1] = "AutoIt PhysX.exe"
$aApps[15][2] = "IMG\physx.ico"
$aApps[16][0] = "Notepad ++5.9.3"
$aApps[16][1] = "Notepad ++ 5.9.3 SFX.exe"
$aApps[16][2] = "IMG\notepad.ico"
$aApps[17][0] = "Logitech SetPoint"
$aApps[17][1] = "AutoIt Logitech SetPoint.exe"
$aApps[17][2] = "IMG\logitech.ico"
$aApps[18][0] = "AIMP 3.00.950 rc1"
$aApps[18][1] = "AIMP 3.00.950 rc1.exe"
$aApps[18][2] = "IMG\aimp.ico"
$aApps[19][0] = "Chipset 9.2.0.1030"
$aApps[19][1] = "AutoIt Intel Chipset 9.2.0.1030.exe"
$aApps[19][2] = "IMG\intel.ico"
$aApps[20][0] = "MPCHC 1523456"
$aApps[20][1] = "MPC HC 1.5.2.3456 x64.exe"
$aApps[20][2] = "IMG\mplayer.ico"
$aApps[21][0] = "Synaptics v15220C"
$aApps[21][1] = "Synaptics v15.2.20.C x64\Silent.bat"
$aApps[21][2] = "IMG\synaptics.ico"
$aApps[22][0] = "Synchronicity 6.0"
$aApps[22][1] = "Create Synchronicity 6.0.exe"
$aApps[22][2] = "IMG\sync.ico"
$aApps[23][0] = "Catalyst Mobility"
$aApps[23][1] = "AMD Catalyst Mobility Unattended.bat"
$aApps[23][2] = "IMG\amd.ico"

For $i = 0 To 2
    For $j = 0 To 7
        $sName = ($aApps[($i * 8) + $j][0])
        GUICtrlCreateIcon($aApps[($i * 8) + $j][2], -2, 30 + ($i * 160), 30 + ($j * 20), 17, 17)
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 50 + ($i * 160), 30 + ($j * 20), 140, 20)
    Next
Next

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            ; You can loop through arrays like this - easier than using 24 similar statements
            For $i = 0 To 23
                If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) = $GUI_CHECKED Then
                    If NOT FileExists ($aApps[$i][1]) Then
                    MsgBox (64, "File not found!", $aApps[$i][1], 0)
                    EndIf
                    ShellExecuteWait($aApps[$i][1])
                    ConsoleWrite("Running: " & $aApps[$i][0] & @CRLF) ; Just to show that you will run the correct app
                EndIf
            Next
            Exit
        Case $hButton2
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_CHECKED)
            Next
        Case $hButton3
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_UNCHECKED)
            Next
    EndSwitch
WEnd

Func ToTray()
TrayItemSetState ($totray,$TRAY_UNCHECKED)
GUISetState(@SW_HIDE)
EndFunc

Func Restore()
TrayItemSetState ($restore,$TRAY_UNCHECKED)
GUISetState(@SW_SHOW)
EndFunc

Func Quit()
Exit
EndFunc

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

2 minutes ago, careca said:

you can do it without the ini too.

I see benefit in using an external file (ini, txt, dat, what-have-you).  It allows easy changes to the software list without having to re-code/compile/deploy the master script.  

Even cooler would be a dynamic generation of the installers list at run-time, but some complexities may still be inescapable depending on the install mechanism.  

Just my two cents.

Link to comment
Share on other sites

I agree. I like to provide options to the OP, so he can choose what he feels like it's best for him.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...