#requireadmin
#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_icon = WinRAR_3.80.exe
#AutoIt3Wrapper_outfile = WinRAR_3.80_zd.exe
#AutoIt3Wrapper_Res_Description = AU3自动安装
#AutoIt3Wrapper_Res_Fileversion = 版本:0.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright = 版权所有 (C) 2009_131738
#AutoIt3Wrapper_Res_Comment = 脚本生成于:2009年 08月 23日
#EndRegion AutoIt3Wrapper 预编译参数设置完成
For $i = 0 to 1
$ChoiceInstallPath = InputBox ( "路径选择", "开始 xx 自动安装" & _
@CR & @CR & " 请输入安装路径盘:","C", " M1" )
If @error = 1 And $i = 0 Then
MsgBox ( 64, "错误", "点错按钮啦!" & _
@CR & @CR & "还有 1 次机会, 小心操作哦!" )
ContinueLoop
ElseIf @error = 1 And $i = 1 Then
MsgBox ( 64,"警告", "操作失误! 3秒后脚本结束!",3 )
Exit
EndIf
$A = FileExists($ChoiceInstallPath & ":")
If $A = 0 And $i = 0 Then
MsgBox( 64, "警告!", "所选驱动器不存在! 重新操作!" & _
@CR & @CR & "还有 1 次机会, 小心操作哦!")
ContinueLoop
ElseIf $A = 0 And $i = 1 Then
MsgBox ( 64,"警告","操作失误! 3秒后脚本结束!",3 )
Exit
EndIf
If @error = 0 And $A = 1 Then ExitLoop
Next
If Not FileExists ( $ChoiceInstallPath & ":\Program Files" ) _
Then DirCreate ( $ChoiceInstallPath & ":\Program Files" )
Run ( @ScriptDir & "\WinRAR_3.80.exe" )
WinWaitActive ( "", "TITLE_BMP" )
$DefaultInstallPath = ControlGetText ( "", "","Edit1" )
$DriveName = StringLeft ( $DefaultInstallPath, 1 )
If $DriveName = $ChoiceInstallPath Then
ControlClick ( "", "", "Button2" )
ElseIf $DriveName <> $ChoiceInstallPath Then
$DriveReplace = StringReplace ( $DefaultInstallPath, 1, $ChoiceInstallPath )
ControlSetText ( "", "", "Edit1", $DriveReplace )
$SoothInstallPath = ControlGetText ( "", "", "Edit1" )
EndIf
ControlClick ( "", "", "Button2" )
WinWaitActive( "WinRAR 简体中文版安装", "WinRAR 关联文件" )
ControlClick( "WinRAR 简体中文版安装", "","Button27" )
WinWaitActive( "WinRAR 简体中文版安装", "WinRAR 已经成功地安装到文件夹" )
ControlClick( "WinRAR 简体中文版安装", "","Button1" )
WinWait ( "WinRAR" )
WinClose ( "WinRAR" )
SplashTextOn ( "自动安装", "已完成 的自动安装. ", 250, 70, -1, -1, 0, "", 14 )
Sleep ( 2000 )