Jump to content

Looking for installation script


Recommended Posts

All you can do is use a combination of WinWaitActive, MouseClick, and keyboard commands line Send("!n") for Next to go through the program. Also research the programs and find if they have a /silent or similar command line parameter.

Edited by Lance75tx
Link to comment
Share on other sites

This is one I wrote to install Just Excel from Office XP, and then run the update script next.

You would just have to use the AutoIT Window Info tool to find out what you need to click and so on.

CODE
Run(@ScriptDir&"\Setup.exe")

;User Information

WinWaitActive("Microsoft Office XP Setup","User information")

ControlClick("Microsoft Office XP Setup","User information",4159)

WinWaitActive("Microsoft Office XP Setup","")

ControlClick("Microsoft Office XP Setup","Choose the type of installation you need",4225)

ControlClick("Microsoft Office XP Setup","Choose the type of installation you need",4159)

WinWaitActive("Microsoft Office XP Setup","Select the Office XP applications you would like installed:")

;remove MS Word

ControlClick("Microsoft Office XP Setup","Select the Office XP applications you would like installed:",447)

;Remove Powerpoint

ControlClick("Microsoft Office XP Setup","Select the Office XP applications you would like installed:",446)

;remove Outlook

ControlClick("Microsoft Office XP Setup","Select the Office XP applications you would like installed:",445)

;Continue on

ControlClick("Microsoft Office XP Setup","Select the Office XP applications you would like installed:",4159)

WinWaitActive("Microsoft Office XP Setup","Begin installation")

ControlClick("Microsoft Office XP Setup","",4246)

Run(@ScriptDir&"\sp3update.exe")

Another thing that you could do is to create the individual installers and one install all script with runwait commands

RunWait(@scriptdir&"\OfficexpExcel.exe")

RunWait(@scriptdir&"\sp3update.exe")

Runwait(@scriptdir&"\nextscript.exe")

Edited by Kerros

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

I've searched in Example scripts and the internet and I know this is probably child's play for some of you. But can anyone share an installation script? For example:

I want to be able to install Adobe Reader, Flash, Shockwave, QuickTime and Java in just one script. I've tried writing a batch, but they end up installing at the same time and it crashes some machines. I would like it to install Adobe Reader, then when it's finished, move on to the next application and so forth. Maybe even check the system to see if it already has a version and then skip the installation.

I'm a network administrator and I setup lots of workstations for new employees and need to install these programs, but I don't like doing them one by one as I walk off and tend to other needs. So that's where the script would come in handy. Any help would be appreciated. Thanks <_<

All you can do is use a combination of WinWaitActive, MouseClick, and keyboard commands line Send("!n") for Next to go through the program. Also research the programs and find if they have a /silent or similar command line parameter. Then it is simple: All you need to do is
ShellExecute("YourProgram.exe", "/silent")

Here is an example I use for VCOM's FixIt 7 (used at my work)

PS: $title is declared in an earlier part of the script. This is simply an include.

#include-once
Func _fixit()
    $remove = ""
    If FileExists("C:\Program Files\VCOM\Fix-It\Fix-It.exe") Then
        $remove = MsgBox(4, $title, "Fix-It 7 Already Installed. Remove?")
        If $remove = 6 Then
            ShellExecute(@ScriptDir & "\Tools\Other\FixIt7.exe")
            WinWaitActive("Fix-It", "Select the maintenance")
            Send("!e")
            Sleep(10)
            Send("!n")
            WinWaitActive("Fix-It", "This will remove")
            Send("!n")
            WinWaitActive("Fix-It", "&Finish")
            Send("!f")
            $win = WinWaitActive("Installer Information", "You must restart", 5)
            If $win = 1 Then Send("!n")
        Else
            ShellExecute("C:\Program Files\VCOM\Fix-It\Fix-It.exe")
        EndIf
    Else
        TrayTip($title, "Beginning automated installation of Fix-It 7", 10, 1)
        ShellExecute(@ScriptDir & "\Tools\Other\FixIt7.exe")
        WinWaitActive("Fix-It", "&Next")
        Send("!n")
        WinWaitActive("Fix-It", "I &do not accept the license agreement")
        Send("!a")
        Sleep(10)
        Send("!n")
        WinWaitActive("Fix-It", "&Full Name:")
        Send("user")
        Sleep(10)
        Send("{TAB}")
        Sleep(10)
        Send("company")
        Sleep(10)
        Send("!n")
        WinWaitActive("Fix-It", "&Complete")
        Send("!c")
        Sleep(10)
        Send("!n")
        WinWaitActive("Fix-It", "Destination Folder")
        Send("!n")
        Do
            Sleep(100)
        Until WinActive("Fix-It", "Files that need to be updated") Or WinActive("Fix-It", "Configuration Options")
        If WinActive("Fix-It", "Files that need to be updated") Then Send("!i")
        WinWaitActive("Fix-It", "Configuration Options")
        MouseClick("left", 48, 158, 1, 1)
        MouseClick("left", 50, 257, 1, 1)
        MouseClick("left", 52, 290, 1, 1)
        Sleep(10)
        Send("!n")
        WinWaitActive("Fix-It", "&Finish")
        Send("!f")
        $win = WinWaitActive("Installer Information", "You must restart", 5)
        If $win = 1 Then Send("!n")
        ShellExecute("C:\Program Files\VCOM\Fix-It\Fix-It.exe")
        TrayTip("kill", "", 0)
    EndIf
EndFunc
Edited by koresho
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...