; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x / NT
; Author:         Kemal <kemal69@gmail.com>
; Version:	  1.0
;
; Script Function:
; Partition Magic v8.05
;
; ----------------------------------------------------------------------------


; End User Var's
; ----------------------------------------------------------------------------

$SF_1  = 'Setup.exe'		; Setup File Name
$MF_1  = '\Partition Magic'	; Location For Main  Folder
$GF_1  = '\Tools - System'	; Location For Group Folder
$UN_1  = 'Your Name'		; Enter Username
$CN_1  = 'Your Company'			; Enter Company Name
$KEY_1 = 'XXXXXXXX-XXXXXXXX'; License Key

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

Opt ( 'WinTitleMatchMode',	  3 )
Opt ( 'MouseCoordMode',		  0 )
Opt ( 'WinWaitDelay',		100 )
Opt ( 'Winsearchchildren',	  1 )

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

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

; ----------------------------------------------------------------------------
; Execute Setup
; ----------------------------------------------------------------------------

If FileExists	( @ScriptDir & '\' & $SF_1 ) Then
	Run	( @ScriptDir & '\' & $SF_1 )
Else
	Exit
EndIf

$title = 'Norton PartitionMagic 8.0 Setup'

;Welcome Screen
WinWaitActive($title,'Welcome to the InstallShield Wizard')
ControlClick($title, '', 'Button1')

;Customer Information
WinWaitActive($title,'Please enter your name')
ControlSetText($title, '', 'Edit2', $UN_1)
ControlSetText($title, '', 'Edit3', $CN_1)
ControlSetText($title, '', 'Edit1', $KEY_1)
ControlClick($title, '', 'Button2')

;License Agreement
WinWaitActive($title,'SYMANTEC SOFTWARE LICENSE AGREEMENT')
ControlClick($title, '', 'Button2')

;Installation Directory #1
WinWaitActive($title,'Destination Folder')
ControlClick($title, '', 'Button3')

;Installation Directory #2
WinWaitActive('Choose Folder','')
ControlSetText('Choose Folder', '', 'Edit1', @ProgramFilesDir & $GF_1 & $MF_1 )
ControlClick('Choose Folder', '', 'Button1')

;Installation Directory #3
WinWaitActive($title,'Destination Folder')
ControlClick($title, '', 'Button1')

;Setup Type
WinWaitActive($title,'Click the type of Setup you prefe')
ControlClick($title, '', 'Button1')
ControlClick($title, '', 'Button5')

;Start Menu Folder
WinWaitActive($title,'Setup will add program icons')
ControlSetText($title, '', 'Edit1', $GF_1 & $MF_1 )
ControlClick($title, '', 'Button2')

;Create Rescue Diskettes
WinWaitActive('Create Rescue Diskettes','')
ControlClick('Create Rescue Diskettes', '', 'Button2')

;Complete
WinWaitActive($title,'Norton PartitionMagic Setup is now complete')
ControlClick($title, '', 'Button1')
ControlClick($title, '', 'Button2')
ControlClick($title, '', 'Button4')

;Cleanup Open Start Menu Folder
$Folder = StringTrimLeft ( $MF_1, 1)
WinClose($Folder, 'FolderView')

Exit

;EOF