Jump to content

Installrite25 And Installwatchpro25


Recommended Posts

Hi these wonder if some one could please help out ive done two scripts using AU3Recorder to install InstallRite25 and InstallWatchPro25 but the scripts just pause and i have to exit them in the taskbar and continue with installations manually these are used in a Unattended cd running from GuiRunOnce would also like if possible to run them from RunOnceEx also, can compiled scripts be run for RunOnceEx when using AU4Recorder to make script but also capturing mouse movement

;
; Script Function:(InstallWatchPro25) Setup
;   Template AutoIt script.
;
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
; End User Var's
; ----------------------------------------------------------------------------
$SF_1 = "InstallWatchPro25.exe" ;         Setup  File Name

; ----------------------------------------------------------------------------
; Prevent Duplicates From Running
; ----------------------------------------------------------------------------

If WinExists(@ScriptName) Then Exit
AutoItWinSetTitle(@ScriptName)

; ----------------------------------------------------------------------------
; Script Defaults
; ----------------------------------------------------------------------------

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------

; Execute Installer
If FileExists   ( @ScriptDir & "\" & $SF_1 ) Then
    Run ( @ScriptDir & "\" & $SF_1 )
Else
    Exit
EndIf
; ----------------------------------------------------------------------------
; Your Script Here From Here Onwards

WinWait("Welcome","Welcome to the Insta")
If Not WinActive("Welcome","Welcome to the Insta") Then WinActivate("Welcome","Welcome to the Insta")
WinWaitActive("Welcome","Welcome to the Insta")
Send("n")
Sleep(100)
WinWait("Freeware Status","CutWinName")
If Not WinActive("Freeware Status","CutWinName") Then WinActivate("Freeware Status","CutWinName")
WinWaitActive("Freeware Status","CutWinName")
Send("n")
Sleep(100)
WinWait("Software License Agreement","Please read the foll")
If Not WinActive("Software License Agreement","Please read the foll") Then WinActivate("Software License Agreement","Please read the foll")
WinWaitActive("Software License Agreement","Please read the foll")
Send("{ALTDOWN}y{ALTUP}")
Sleep(100)
WinWait("Information","CutWinName")
If Not WinActive("Information","CutWinName") Then WinActivate("Information","CutWinName")
WinWaitActive("Information","CutWinName")
Send("n")
Sleep(100)
WinWait("Choose Destination Location","Setup will install I")
If Not WinActive("Choose Destination Location","Setup will install I") Then WinActivate("Choose Destination Location","Setup will install I")
WinWaitActive("Choose Destination Location","Setup will install I")
Send("n")
Sleep(100)
WinWait("Setup Type","Click the type of Se")
If Not WinActive("Setup Type","Click the type of Se") Then WinActivate("Setup Type","Click the type of Se")
WinWaitActive("Setup Type","Click the type of Se")
Send("{ALTDOWN}n{ALTUP}")
Sleep(100)
WinWait("Select Program Folder","Setup will add progr")
If Not WinActive("Select Program Folder","Setup will add progr") Then WinActivate("Select Program Folder","Setup will add progr")
WinWaitActive("Select Program Folder","Setup will add progr")
Send("{ALTDOWN}n{ALTUP}")
Sleep(100)
WinWait("Setup Complete","Place InstallWatch i")
If Not WinActive("Setup Complete","Place InstallWatch i") Then WinActivate("Setup Complete","Place InstallWatch i")
WinWaitActive("Setup Complete","Place InstallWatch i")
Send("{SPACE}{TAB}{SPACE}{TAB}{ENTER}")
Sleep(100)

Exit

; ----------------------------------------------------------------------------

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
;Run("InstallRite25.exe")
$SF_1 = "InstallRite25.exe" ;         Setup File Name
; Execute Installer
If FileExists   ( @ScriptDir & "\" & $SF_1 ) Then   
    Run ( $SF_1 )
Else
    Exit
EndIf


WinWait("Welcome","Welcome to the Insta")
If Not WinActive("Welcome","Welcome to the Insta") Then WinActivate("Welcome","Welcome to the Insta")
WinWaitActive("Welcome","Welcome to the Insta")
Send("{ENTER}")
WinWait("Freeware Status","CutWinName")
If Not WinActive("Freeware Status","CutWinName") Then WinActivate("Freeware Status","CutWinName")
WinWaitActive("Freeware Status","CutWinName")
Send("{ENTER}")
WinWait("Software License Agreement","Please read the foll")
If Not WinActive("Software License Agreement","Please read the foll") Then WinActivate("Software License Agreement","Please read the foll")
WinWaitActive("Software License Agreement","Please read the foll")
Send("{ENTER}")
WinWait("Information","CutWinName")
If Not WinActive("Information","CutWinName") Then WinActivate("Information","CutWinName")
WinWaitActive("Information","CutWinName")
Send("{ENTER}")
WinWait("Choose Destination Location","Setup will install I")
If Not WinActive("Choose Destination Location","Setup will install I") Then WinActivate("Choose Destination Location","Setup will install I")
WinWaitActive("Choose Destination Location","Setup will install I")
Send("{ENTER}")
WinWait("Setup Type","Click the type of Se")
If Not WinActive("Setup Type","Click the type of Se") Then WinActivate("Setup Type","Click the type of Se")
WinWaitActive("Setup Type","Click the type of Se")
Send("{ENTER}")
WinWait("Select Program Folder","Setup will add progr")
If Not WinActive("Select Program Folder","Setup will add progr") Then WinActivate("Select Program Folder","Setup will add progr")
WinWaitActive("Select Program Folder","Setup will add progr")
Send("{ENTER}")
WinWait("Setup Complete","Place InstallRite in")
If Not WinActive("Setup Complete","Place InstallRite in") Then WinActivate("Setup Complete","Place InstallRite in")
WinWaitActive("Setup Complete","Place InstallRite in")
Send("{SPACE}{TAB}{SPACE}{TAB}{ENTER}")
EXIT

Thanks

Link to comment
Share on other sites

Here is a working script here that I use to install InstallRight.

Change Compiler to the group name in the startmenu that you prefer.

; Default catagory folder in startmenu.

$group = 'Compilers\InstallRite'

Name your installer InstallRite v2.5.exe and place it in the same directory as the script.

:think:

Edit:

Link removed and posted script below.

Edited by MHz
Link to comment
Share on other sites

Here is a working script here that I use to install InstallRight.

Change Compiler to the group name in the startmenu that you prefer.

Name your installer InstallRite v2.5.exe and place it in the same directory as the script.

:think:

MHz, i cant seem to download script it says i dont have permission

Link to comment
Share on other sites

#region - InstallRite v2.5 install script - (Automated with WinExists functions)

Opt('TrayIconDebug', 1)

; Installer.
$executable = 'InstallRite v2.5.exe'
; Show progess.
$splash = 0
; Default catagory folder in startmenu.
$group = 'Compilers\InstallRite'
; New catagory to move the default folder into.
$catagory = ''
; Installation folder in Program Files.
$directory = ''
; Allowed time for installation.
$allowed = 60 * 1000

; Run the installer.
$pid = _Install()
$time = TimerInit()
Do
    Select
        Case WinExists('Welcome', 'Welcome to the InstallRite')
            If WinExists('InstallRite 2.5 Setup') Then
                WinSetState('InstallRite 2.5 Setup', '', @SW_HIDE)
            EndIf
            ControlClick('Welcome', 'Welcome to the InstallRite', 'Button1')
        Case WinExists('Freeware Status', 'InstallRite 2.5 is provided')
            ControlClick('Freeware Status', 'InstallRite 2.5 is provided', 'Button1')
        Case WinExists('Software License Agreement', 'Please read the following')
            ControlClick('Software License Agreement', 'Please read the following', 'Button2')
        Case WinExists('Information', 'Please visit www.epsilonsquare')
            ControlClick('Information', 'Please visit www.epsilonsquare', 'Button1')
        Case WinExists('Choose Destination Location', 'Setup will install InstallRite')
            ControlClick('Choose Destination Location', 'Setup will install InstallRite', 'Button1')
        Case WinExists('Setup Type', 'Program will be installed with')
            ControlClick('Setup Type', 'Program will be installed with', 'Button5')
        Case WinExists('Select Program Folder', 'Setup will add program icons')
            ControlSetText('Select Program Folder', 'Setup will add program icons', 'Edit1', 'General\InstallRite')
            ControlClick('Select Program Folder', 'Setup will add program icons', 'Button2')
        Case WinExists('Setup Complete', 'InstallRite Setup is complete')
            ControlCommand('Setup Complete', 'InstallRite Setup is complete', 'Button1', 'UnCheck', '')
            ControlCommand('Setup Complete', 'InstallRite Setup is complete', 'Button2', 'UnCheck', '')
            ControlClick('Setup Complete', 'InstallRite Setup is complete', 'Button4')
        Case Else
            Sleep(250)
    EndSelect
    If TimerDiff($time) > $allowed Then _Abort()
Until Not ProcessExists($pid)

; Remove shortcuts.
If _MainShortcut('InstallRite.lnk') Then
    FileDelete('InstallRite Tour.lnk')
    FileDelete('Uninstall InstallRite 2.5c.lnk')
EndIf

#region - Reg Entries
$key = 'HKCU\Software\Epsilon Squared\IW Engine'
RegWrite($key & '\Directories', 'AllFixedDisks', 'Reg_sz', 'TRUE')
RegWrite($key & '\Directories', 'IncludeCRC', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'LanguageDLL', 'Reg_sz', 'resenu.dll')
RegWrite($key & '\Settings', 'ShowHelponstartup', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'FilePatternToIgnore_00', 'Reg_sz', '')
RegWrite($key & '\Settings', 'RunInStartup', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'RunInSystemTray', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'DisplayFileSizeInK', 'Reg_sz', 'TRUE')
RegWrite($key & '\Settings', 'DetectSetupPrograms', 'Reg_sz', 'TRUE')
RegWrite($key & '\Settings', 'Texture', 'Reg_sz', 'Sky')
RegWrite($key & '\SnapshotSelection', 'SCANFILES', 'Reg_sz', 'TRUE')
RegWrite($key & '\SnapshotSelection', 'INCLUDEVERSION', 'Reg_sz', 'FALSE')
RegWrite($key & '\SnapshotSelection', 'CONTENTEXTENSIONS', 'Reg_sz', '')
RegWrite($key & '\SnapshotSelection', 'SCANINI', 'Reg_sz', 'TRUE')
RegWrite($key & '\SnapshotSelection', 'REGISTRYTOSCAN', 'Reg_sz', '000102')
#endregion

#endregion

Exit

Func _Install($path = 'Default')
   ; Run the installer in Default Script directory.
    Dim $splash, $processblock
    If $path = 'Default' Then $path = @ScriptDir
    If StringRight($path, 1) <> '\' Then $path = $path & '\'
    If StringInStr($executable, '\') Then $path = ''
    If Not FileExists($path & $executable) Then Exit(1)
    If $processblock <> '' Then Call('_' & 'ProcessBlock')
    If $splash Then _Splash('Installing:' & StringTrimRight(StringReplace(@ScriptName, '_', ' '), 4))
    If StringRight($executable, 3) = 'msi' Then
        Return Run(@SystemDir & '\msiexec /i "' & $path & $executable & '"')
    Else
        Return Run($path & $executable)
    EndIf
EndFunc

Func _Abort()
   ; close process if exists then exit.
    Dim $pid
    If ProcessExists($pid) Then
        ProcessClose($pid)
        Exit(2)
    Else
        Exit(3)
    EndIf
EndFunc

Func _Desktop($shortcut)
   ; Delete a Desktop shortcut.
    If FileExists(@DesktopDir & '\' & $shortcut) Then
        Return FileChangeDir(@DesktopDir) And FileDelete($shortcut)
    ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then
        Return FileChangeDir(@DesktopCommonDir) And FileDelete($shortcut)
    EndIf
EndFunc

Func _MainShortcut($shortcut, $rename = '')
   ; Change working directory to correct StartMenu\Group directory.
    Dim $group, $catagory, $splash
    If $group = '' Then Return 0
    If FileExists(@ProgramsDir & '\' & $group) Then
        FileChangeDir(@ProgramsDir & '\' & $group)
    ElseIf FileExists(@ProgramsCommonDir & '\' & $group) Then
        FileChangeDir(@ProgramsCommonDir & '\' & $group)
    Else
        Return 0
    EndIf
   ; Wait for main shortcut.
    If $splash Then _Splash('Waiting for shortcuts')
    For $i = 1 To 20
        If FileExists($shortcut) Then ExitLoop
        Sleep(500)
    Next
    If $splash Then _Splash('Cleaning up:' & StringTrimRight(StringReplace(@ScriptName, '_', ' '), 4))
   ; If catagory not assigned anything, then return.
    If $catagory = '' Then Return 1
   ; Move the group folder into the catagory folder.
    If FileChangeDir('..') And DirCopy($group, $catagory & '\' & $group, 1) Then
        If DirRemove($group, 1) Then
           ; If optional rename parameter is used, then rename the group folder.
            If $rename <> '' And FileChangeDir($catagory) Then
                If DirCopy($group, $rename, 1) And DirRemove($group, 1) Then
                    Return FileChangeDir($rename)
                EndIf
            Else
                Return FileChangeDir($catagory & '\' & $group)
            EndIf
        EndIf
    EndIf
EndFunc

Func _QuickLaunch($shortcut)
   ; Delete a Quicklaunch shortcut.
    Local $subdirs = '\Microsoft\Internet Explorer\Quick Launch'
    If FileExists(@AppDataDir & $subdirs & '\' & $shortcut) Then
        Return FileChangeDir(@AppDataDir & $subdirs) And FileDelete($shortcut)
    ElseIf FileExists(@AppDataCommonDir & $subdirs & '\' & $shortcut) Then
        Return FileChangeDir(@AppDataCommonDir & $subdirs) And FileDelete($shortcut)
    EndIf
EndFunc

Func _Splash($text = '')
   ; Shows a small borderless splash message.
    Dim $splash
    If $splash Then
        If $text Then
            SplashTextOn('', $text, 500, 25, -1, 5, 1, '', 14)
        Else
            SplashOff()
        EndIf
    EndIf
EndFunc

Func _WinClose($title, $text = '')
   ; Close a window with further attempts.
    For $i = 1 To 10
        WinClose($title, $text)
        If Not WinExists($title) Then Return 1
        Sleep(500)
    Next
EndFunc

Func OnAutoItStart()
   ; A 2nd script instance will exit.
    Local $interpreter
    If StringInStr($cmdlineraw, '/dummy') Then Exit
    $interpreter = StringTrimRight(@ScriptName, 4) & ' Script Interpreter'
    If WinExists($interpreter) Then Exit
    AutoItWinSetTitle($interpreter)
EndFunc

Link to comment
Share on other sites

#region - InstallRite v2.5 install script - (Automated with WinExists functions)

Opt('TrayIconDebug', 1)

; Installer.
$executable = 'InstallRite v2.5.exe'
; Show progess.
$splash = 0
; Default catagory folder in startmenu.
$group = 'Compilers\InstallRite'
; New catagory to move the default folder into.
$catagory = ''
; Installation folder in Program Files.
$directory = ''
; Allowed time for installation.
$allowed = 60 * 1000

; Run the installer.
$pid = _Install()
$time = TimerInit()
Do
    Select
        Case WinExists('Welcome', 'Welcome to the InstallRite')
            If WinExists('InstallRite 2.5 Setup') Then
                WinSetState('InstallRite 2.5 Setup', '', @SW_HIDE)
            EndIf
            ControlClick('Welcome', 'Welcome to the InstallRite', 'Button1')
        Case WinExists('Freeware Status', 'InstallRite 2.5 is provided')
            ControlClick('Freeware Status', 'InstallRite 2.5 is provided', 'Button1')
        Case WinExists('Software License Agreement', 'Please read the following')
            ControlClick('Software License Agreement', 'Please read the following', 'Button2')
        Case WinExists('Information', 'Please visit www.epsilonsquare')
            ControlClick('Information', 'Please visit www.epsilonsquare', 'Button1')
        Case WinExists('Choose Destination Location', 'Setup will install InstallRite')
            ControlClick('Choose Destination Location', 'Setup will install InstallRite', 'Button1')
        Case WinExists('Setup Type', 'Program will be installed with')
            ControlClick('Setup Type', 'Program will be installed with', 'Button5')
        Case WinExists('Select Program Folder', 'Setup will add program icons')
            ControlSetText('Select Program Folder', 'Setup will add program icons', 'Edit1', 'General\InstallRite')
            ControlClick('Select Program Folder', 'Setup will add program icons', 'Button2')
        Case WinExists('Setup Complete', 'InstallRite Setup is complete')
            ControlCommand('Setup Complete', 'InstallRite Setup is complete', 'Button1', 'UnCheck', '')
            ControlCommand('Setup Complete', 'InstallRite Setup is complete', 'Button2', 'UnCheck', '')
            ControlClick('Setup Complete', 'InstallRite Setup is complete', 'Button4')
        Case Else
            Sleep(250)
    EndSelect
    If TimerDiff($time) > $allowed Then _Abort()
Until Not ProcessExists($pid)

; Remove shortcuts.
If _MainShortcut('InstallRite.lnk') Then
    FileDelete('InstallRite Tour.lnk')
    FileDelete('Uninstall InstallRite 2.5c.lnk')
EndIf

#region - Reg Entries
$key = 'HKCU\Software\Epsilon Squared\IW Engine'
RegWrite($key & '\Directories', 'AllFixedDisks', 'Reg_sz', 'TRUE')
RegWrite($key & '\Directories', 'IncludeCRC', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'LanguageDLL', 'Reg_sz', 'resenu.dll')
RegWrite($key & '\Settings', 'ShowHelponstartup', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'FilePatternToIgnore_00', 'Reg_sz', '')
RegWrite($key & '\Settings', 'RunInStartup', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'RunInSystemTray', 'Reg_sz', 'FALSE')
RegWrite($key & '\Settings', 'DisplayFileSizeInK', 'Reg_sz', 'TRUE')
RegWrite($key & '\Settings', 'DetectSetupPrograms', 'Reg_sz', 'TRUE')
RegWrite($key & '\Settings', 'Texture', 'Reg_sz', 'Sky')
RegWrite($key & '\SnapshotSelection', 'SCANFILES', 'Reg_sz', 'TRUE')
RegWrite($key & '\SnapshotSelection', 'INCLUDEVERSION', 'Reg_sz', 'FALSE')
RegWrite($key & '\SnapshotSelection', 'CONTENTEXTENSIONS', 'Reg_sz', '')
RegWrite($key & '\SnapshotSelection', 'SCANINI', 'Reg_sz', 'TRUE')
RegWrite($key & '\SnapshotSelection', 'REGISTRYTOSCAN', 'Reg_sz', '000102')
#endregion

#endregion

Exit

Func _Install($path = 'Default')
  ; Run the installer in Default Script directory.
    Dim $splash, $processblock
    If $path = 'Default' Then $path = @ScriptDir
    If StringRight($path, 1) <> '\' Then $path = $path & '\'
    If StringInStr($executable, '\') Then $path = ''
    If Not FileExists($path & $executable) Then Exit(1)
    If $processblock <> '' Then Call('_' & 'ProcessBlock')
    If $splash Then _Splash('Installing:' & StringTrimRight(StringReplace(@ScriptName, '_', ' '), 4))
    If StringRight($executable, 3) = 'msi' Then
        Return Run(@SystemDir & '\msiexec /i "' & $path & $executable & '"')
    Else
        Return Run($path & $executable)
    EndIf
EndFunc

Func _Abort()
  ; close process if exists then exit.
    Dim $pid
    If ProcessExists($pid) Then
        ProcessClose($pid)
        Exit(2)
    Else
        Exit(3)
    EndIf
EndFunc

Func _Desktop($shortcut)
  ; Delete a Desktop shortcut.
    If FileExists(@DesktopDir & '\' & $shortcut) Then
        Return FileChangeDir(@DesktopDir) And FileDelete($shortcut)
    ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then
        Return FileChangeDir(@DesktopCommonDir) And FileDelete($shortcut)
    EndIf
EndFunc

Func _MainShortcut($shortcut, $rename = '')
  ; Change working directory to correct StartMenu\Group directory.
    Dim $group, $catagory, $splash
    If $group = '' Then Return 0
    If FileExists(@ProgramsDir & '\' & $group) Then
        FileChangeDir(@ProgramsDir & '\' & $group)
    ElseIf FileExists(@ProgramsCommonDir & '\' & $group) Then
        FileChangeDir(@ProgramsCommonDir & '\' & $group)
    Else
        Return 0
    EndIf
  ; Wait for main shortcut.
    If $splash Then _Splash('Waiting for shortcuts')
    For $i = 1 To 20
        If FileExists($shortcut) Then ExitLoop
        Sleep(500)
    Next
    If $splash Then _Splash('Cleaning up:' & StringTrimRight(StringReplace(@ScriptName, '_', ' '), 4))
  ; If catagory not assigned anything, then return.
    If $catagory = '' Then Return 1
  ; Move the group folder into the catagory folder.
    If FileChangeDir('..') And DirCopy($group, $catagory & '\' & $group, 1) Then
        If DirRemove($group, 1) Then
          ; If optional rename parameter is used, then rename the group folder.
            If $rename <> '' And FileChangeDir($catagory) Then
                If DirCopy($group, $rename, 1) And DirRemove($group, 1) Then
                    Return FileChangeDir($rename)
                EndIf
            Else
                Return FileChangeDir($catagory & '\' & $group)
            EndIf
        EndIf
    EndIf
EndFunc

Func _QuickLaunch($shortcut)
  ; Delete a Quicklaunch shortcut.
    Local $subdirs = '\Microsoft\Internet Explorer\Quick Launch'
    If FileExists(@AppDataDir & $subdirs & '\' & $shortcut) Then
        Return FileChangeDir(@AppDataDir & $subdirs) And FileDelete($shortcut)
    ElseIf FileExists(@AppDataCommonDir & $subdirs & '\' & $shortcut) Then
        Return FileChangeDir(@AppDataCommonDir & $subdirs) And FileDelete($shortcut)
    EndIf
EndFunc

Func _Splash($text = '')
  ; Shows a small borderless splash message.
    Dim $splash
    If $splash Then
        If $text Then
            SplashTextOn('', $text, 500, 25, -1, 5, 1, '', 14)
        Else
            SplashOff()
        EndIf
    EndIf
EndFunc

Func _WinClose($title, $text = '')
  ; Close a window with further attempts.
    For $i = 1 To 10
        WinClose($title, $text)
        If Not WinExists($title) Then Return 1
        Sleep(500)
    Next
EndFunc

Func OnAutoItStart()
  ; A 2nd script instance will exit.
    Local $interpreter
    If StringInStr($cmdlineraw, '/dummy') Then Exit
    $interpreter = StringTrimRight(@ScriptName, 4) & ' Script Interpreter'
    If WinExists($interpreter) Then Exit
    AutoItWinSetTitle($interpreter)
EndFunc
Cheers thanks i see you incorporated the ecluded folders i was having to do that with reg entry :think:

thanks also for cMenu use it all the time.

Link to comment
Share on other sites

Cheers thanks i see you incorporated the ecluded folders i was having to do that with reg entry :think:

thanks also for cMenu use it all the time.

Well, I like to customize with the registry settings also.

Hope it works good for you. CMenu, no problems, as it helps me create these scripts. :(

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