Jump to content

Help creatinv silent installer with autoit


kappakai

Recommended Posts

I watched the video tutorial and have also tried following a text tutorial explaining how to use Scite and both ways I've gotten the same result on multiple programs now. First when I opened the compiled exe it would just continue to open over and over again so I then added a script to stop that, but when I open the exe the autoit icon appears in the tray and nothing happens. Here is what I've got

;Script to silently install TTPack
$SF_1 = "TTPack.exe"

If WinExists ( $SF_1 ) Then Exit
AutoItWinSetTitle ( $SF_1)

Run("TTpack.exe")

; Welcome
WinWaitActive ("TTPack Setup" , "Welcome")
ControlClick ("TTPack Setup" , "Button2")

; Components
WinWaitActive ("TTPack Setup" , "Components")
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{SPACE}")
ControlClick ("TTPack Setup" , "Button2")

; Destination Location
WinWaitActive ("TTPack Setup" , "Destination Location")
Send ( @ProgramFilesDir & "\TTPack" )
ControlClick ("TTPack Setup" , "Button2")

; RealLite Options
WinWaitActive ("TTPack Setup" , "RealLite Options")
Send ("C:\Program Files\Media Player Classic\mplayerc.exe")
ControlClick ("TTPack Setup" , "Button2")

; Browser Options
WinWaitActive ("TTPack Setup" , "Browser Options")
ControlClick ("TTPack Setup" , "Button2")

; Start Menu
WinWaitActive ("TTPack Setup" , "Start Menu Options")
Send ("{TAB}")
Send ("{TAB}")
Send ("{SPACE}")
ControlClick ("TTPack Setup" , "Button2")

; Installation Complete
WinWaitActive ("TTPack Setup" , "Installation Complete")
ControlClick ("TTPack Setup" , "Button2")

; Completing Setup
WinWaitActive ("TTPack Setup" , "Completing Setup")
ControlClick ("TTPack Setup" , "Button2")

Could someone please help me? What am I doing wrong?

Edited by kappakai
Link to comment
Share on other sites


I'm no expert in AutoIt. I have made a few scripts using the scrip writer that comes with scite. The only thing i do is uncheck record mouse, check record windows title and then i run the setup file and install the program using nothing but the keyboard (i recommend using alt+letter for installers that support shortcuts).

When I'm done. I save the script but i change the path to the setup file and only leave this: setup.exe and i put the compiled script along with the file setup.exe. I install about 5 apps or so in my unattended install and i never had a problem.

Hope this helps you.

Link to comment
Share on other sites

If you remove everything after Run("TTpack.exe") what happens? (i.e. make sure the executable you're running and the script are in the same directory). All the stuff you have before this line isn't necessary either, you should focus on debugging instead of a workaround, especially since this is a pretty simple script.

Maybe double-check the window titles/text too. I don't know what version you're using, but a lot of them don't match up with the version I downloaded (2.2.0.3). The text for components/location both start with Choose, options is RealLite's (not RealLite), browers options starts with Alternative, start menu starts with Choose, etc. Use window info to double-check.

The installer I downloaded also began with a prompt for choosing the installer language. If you have installed it on your system before, there's a chance that this prompt won't come up when resintalling, so you may want to check for anything that's lingering in %AppData%.

Link to comment
Share on other sites

Here you have the script for TTPack 2.2.0.3 (works in Windows XP 64bit too):

Opt("TrayIconDebug", 1)
Opt("SendKeyDelay", 200)
; Executable file name
$EXECUTABLE = "TTPack 2.2.0.3.exe"
; Detect the Operating System type (32 bit or 64 bit)
$OS = _OSBit()

If $OS = 32 Then
; Installation folder
    $INSTALLLOCATION = @ProgramFilesDir & "\TTPack"
; Real Lite options
; Media Player (Optional)
    $MediaPlayer = @ProgramFilesDir & "\Media Player Classic\mplayerc.exe"
  ; Alternative Browsers' Options
  ; Plugins' Folder
    $PluginsFolder = $INSTALLLOCATION & "\Browser\Plugins"
  ; Components' Folder
    $ComponentsFolder = $INSTALLLOCATION & "\Browser\Components"
; Start Menu folder
    $StartMenuFolder = "TTPack"
        If FileExists($INSTALLLOCATION & "\uninstall.exe") Then
        MsgBox(0x40010, @ScriptName, "Please uninstall previous version of TTPack before using this script", 4)
        Exit
    EndIf
    ; Run the installer
    Run($EXECUTABLE)

  ; Please select a language.
    WinWait("Installer Language", "Please select a language.")
    WinActivate("Installer Language", "Please select a language.")
    ControlClick("Installer Language", "", "Button1")

  ; Welcome to the TTPack Setup Wizard
    WinWait("TTPack Setup", "Welcome to the TTPack Setup Wizard")
    WinActivate("TTPack Setup", "Welcome to the TTPack Setup Wizard")
    ControlClick("TTPack Setup", "", "Button2")

  ; Choose Components
    WinWait("TTPack Setup", "Choose Components")
    WinActivate("TTPack Setup", "Choose Components")
    Send("{SPACE}")
    Send("{DOWN}")
    Send("{SPACE}")
    Send("{DOWN}")
    Send("{SPACE}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{SPACE}")
    ControlClick("TTPack Setup", "", "Button2")

  ; Choose Install Location
    WinWait("TTPack Setup ", "Choose Install Location")
    WinActivate("TTPack Setup ", "Choose Install Location")
    ControlSetText("TTPack Setup ", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup ", "", "Edit1", $INSTALLLOCATION)
    ControlClick("TTPack Setup ", "", "Button2")

  ; ReaLite's Options
    WinWait("TTPack Setup", "ReaLite's Options")
    WinActivate("TTPack Setup", "ReaLite's Options")
    ControlSetText("TTPack Setup ", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup ", "", "Edit1", $MediaPlayer)
    ControlClick("TTPack Setup", "", "Button2")

  ; Alternative Browsers' Options
    WinWait("TTPack Setup", "Alternative Browsers' Options")
    WinActivate("TTPack Setup", "Alternative Browsers' Options")
    ControlSetText("TTPack Setup", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup", "", "Edit1", $PluginsFolder)
    ControlSetText("TTPack Setup", "", "Edit2", "")
    Sleep(1000)
    ControlSetText("TTPack Setup", "", "Edit2", $ComponentsFolder)
    ControlClick("TTPack Setup", "", "Button2")

  ; Choose Start Menu Folder
    WinWait("TTPack Setup ", "Choose Start Menu Folder")
    WinActivate("TTPack Setup ", "Choose Start Menu Folder")
    ControlSetText("TTPack Setup", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup", "", "Edit1", $StartMenuFolder)
    ControlClick("TTPack Setup ", "", "Button2")

  ; Installation Complete
    WinWait("TTPack Setup ", "Installation Complete")
    WinActivate("TTPack Setup ", "Installation Complete")
    ControlClick("TTPack Setup ", "", "Button2")

  ; Completing the TTPack Setup Wizard
    WinWait("TTPack Setup ", "Completing the TTPack Setup Wizard")
    WinActivate("TTPack Setup ", "Completing the TTPack Setup Wizard")
    ControlClick("TTPack Setup ", "", "Button2")
EndIf

If $OS = 64 Then
; Installation folder
    $INSTALLLOCATION = @HomeDrive & "\Program Files (x86)\TTPack"
; Real Lite options
; Media Player (Optional)
    $MediaPlayer = @HomeDrive & "\Program Files (x86)\Media Player Classic\mplayerc.exe"
  ; Alternative Browsers' Options
  ; Plugins' Folder
    $PluginsFolder = $INSTALLLOCATION & "\Browser\Plugins"
  ; Components' Folder
    $ComponentsFolder = $INSTALLLOCATION & "\Browser\Components"
; Start Menu folder
    $StartMenuFolder = "TTPack"
        If FileExists($INSTALLLOCATION & "\uninstall.exe") Then
        MsgBox(0x40010, @ScriptName, "Please uninstall previous version of TTPack before using this script", 4)
        Exit
    EndIf
    ; Run the installer
    Run($EXECUTABLE)

  ; Please select a language.
    WinWait("Installer Language", "Please select a language.")
    WinActivate("Installer Language", "Please select a language.")
    ControlClick("Installer Language", "", "Button1")

  ; Welcome to the TTPack Setup Wizard
    WinWait("TTPack Setup", "Welcome to the TTPack Setup Wizard")
    WinActivate("TTPack Setup", "Welcome to the TTPack Setup Wizard")
    ControlClick("TTPack Setup", "", "Button2")

  ; Choose Components
    WinWait("TTPack Setup", "Choose Components")
    WinActivate("TTPack Setup", "Choose Components")
    Send("{SPACE}")
    Send("{DOWN}")
    Send("{SPACE}")
    Send("{DOWN}")
    Send("{SPACE}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{DOWN}")
    Send("{SPACE}")
    ControlClick("TTPack Setup", "", "Button2")

  ; Choose Install Location
    WinWait("TTPack Setup ", "Choose Install Location")
    WinActivate("TTPack Setup ", "Choose Install Location")
    ControlSetText("TTPack Setup ", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup ", "", "Edit1", $INSTALLLOCATION)
    ControlClick("TTPack Setup ", "", "Button2")

  ; ReaLite's Options
    WinWait("TTPack Setup", "ReaLite's Options")
    WinActivate("TTPack Setup", "ReaLite's Options")
    ControlSetText("TTPack Setup ", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup ", "", "Edit1", $MediaPlayer)
    ControlClick("TTPack Setup", "", "Button2")

  ; Alternative Browsers' Options
    WinWait("TTPack Setup", "Alternative Browsers' Options")
    WinActivate("TTPack Setup", "Alternative Browsers' Options")
    ControlSetText("TTPack Setup", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup", "", "Edit1", $PluginsFolder)
    ControlSetText("TTPack Setup", "", "Edit2", "")
    Sleep(1000)
    ControlSetText("TTPack Setup", "", "Edit2", $ComponentsFolder)
    ControlClick("TTPack Setup", "", "Button2")

  ; Choose Start Menu Folder
    WinWait("TTPack Setup ", "Choose Start Menu Folder")
    WinActivate("TTPack Setup ", "Choose Start Menu Folder")
    ControlSetText("TTPack Setup", "", "Edit1", "")
    Sleep(1000)
    ControlSetText("TTPack Setup", "", "Edit1", $StartMenuFolder)
    ControlClick("TTPack Setup ", "", "Button2")

  ; Installation Complete
    WinWait("TTPack Setup ", "Installation Complete")
    WinActivate("TTPack Setup ", "Installation Complete")
    ControlClick("TTPack Setup ", "", "Button2")

  ; Completing the TTPack Setup Wizard
    WinWait("TTPack Setup ", "Completing the TTPack Setup Wizard")
    WinActivate("TTPack Setup ", "Completing the TTPack Setup Wizard")
    ControlClick("TTPack Setup ", "", "Button2")
EndIf

Func _OSBit()
    Local $tOS = DllStructCreate("char[256]")
    Local $aGSWD = DllCall("Kernel32.dll", "int", "GetSystemWow64Directory", "ptr", DllStructGetPtr($tOS), "int", 256)
    If IsArray($aGSWD) And DllStructGetData($tOS, 1) Then Return 64
    Return 32
EndFunc

Read it and learn.

Cheers.

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

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