; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: A.N.Other ; ; Script Function: ; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder) ; if not A_IsAdmin { Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+ ExitApp } ;^!p:: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. ;SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;;SetWorkingDir %A_WorkingDir% SetWorkingDir %A_ScriptDir% global title, include_txt, myvar, lang, svn_ver, sub_ver, int_drv svn_ver = %1% sub_ver = %2% if 3 = { int_drv := "D" }else{ int_drv = %3% } ;svn_ver := "1.8.12.26645" for xp ;sub_ver := "1.8.14" for xp ;svn_ver := "1.6.10.19898" for 2k ;sub_ver := "1.6.12" for 2k ;EnvGet, WORK_DIR, RUN_PATH ;******************************************:// ;//******************************************:// ;//OFFICE_2003CN******************************************:// TORTOISESVN: ;Goto,TORTOISESVN_X ;//******************************************:// RegRead, lang, HKEY_LOCAL_MACHINE, SYSTEM\CurrentControlSet\Control\Nls\Language, Default ;title= ;include_txt= ;RUN_TORTOISESVN() START_TORTOISESVN: ;run %comspec% /c "\\Nas-e5-dd-10\SYS\soft\win\SVN\TortoiseSVN-" svn_ver "-win32-svn-" sub_ver ".msi" run,%comspec% /c "%A_ScriptDir%\TortoiseSVN-%svn_ver%-win32-svn-%sub_ver%.msi" myvar :=0 RE_TRY_TORTOISESVN: title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "Welcome to the TortoiseSVN " svn_ver " (32 bit) Setup Wizard" WinWait ,%title%,%include_txt%, 1 if ErrorLevel { if(myvar<300){ if (lang = 0804) { title := "打开文件 - 安全警告" include_txt := "您想运行此文件吗?" }else if( lang = 0411 ) { title := "開いているファイル - セキュリティの警告" include_txt := "実行しますか?" }else if( lang = 0412 ) { title := "파일 열기 - 보안 경고" include_txt := "이 파일을 실행하시겠습니까?" } IfWinExist,%title%,%include_txt% { WinWaitAndClikButton(title,"Button1",include_txt) } myvar++ Goto,RE_TRY_TORTOISESVN }else{ Goto,START_TORTOISESVN } } Sleep,500 ;;MouseMove,200,145 WinActivate,%title%,%include_txt% CoordMode,Mouse,Relative ret := WinClikAndWaitTime(title,"Button2",include_txt,10) check_tortoisesvn( ret ) if ( ret = 1) { Goto,START_TORTOISESVN } title := "TortoiseSVN " svn_ver " (32 bit) License Agreement" include_txt := "End-User License Agreement" ControlCheck(title,"Button5",include_txt) ret := WinClikAndWaitTime(title,"Button2",include_txt,10) check_tortoisesvn( ret ) if ( ret = 1) { Goto,START_TORTOISESVN } RE_TRY_TORTOISESVN_2: title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "Click on the icons in the tree below to change the way features will be installed." WinWait ,%title%,%include_txt%, 20 if ErrorLevel { if(myvar<30){ myvar++ Goto,RE_TRY_TORTOISESVN } } ControlFocus, Button6,%title%,%include_txt% Sleep,200 SetControlDelay, -1 ;MsgBox,text-%Button%:%WinTitle%:%WinText% ControlClick,Button6,%title%,%include_txt%,,,NA title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "Browse to the destination folder" WinWait ,%title%,%include_txt%, 2 if ErrorLevel { Goto,RE_TRY_TORTOISESVN_2 } ControlGetText, OutputVar, RichEdit20W1,%title%,%include_txt% NewStr := RegExReplace(OutputVar, "^\s*(\w)(:.+)", int_drv "$2") WinActivate,%title%,%include_txt% CoordMode,Mouse,Relative ;对于激活的窗口 SendEvent {Click 119,310, down} MouseMove, 264,310,30 SendEvent {Click 264,310, up} SendMessage, 0xC, 0, &NewStr, RichEdit20W1, %title%,%include_txt% WinWaitAndClikButton(title,"Button1",include_txt) title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "Click on the icons in the tree below to change the way features will be installed." WinWaitAndClikButton(title,"Button2",include_txt) title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "The Setup Wizard is ready to begin the Custom installation" WinWaitAndClikButton(title,"Button2",include_txt) ;install sleep,5000 title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "Show Changelog" WinWaitAndClikButton(title,"Button2",include_txt) title := "Installer Information" include_txt := "Click Yes to restart now or No if you plan to manually restart later." WinWait ,%title%,%include_txt%, 5 if ErrorLevel { }else{ WinWaitAndClikButton(title,"Button2",include_txt) } TORTOISESVN_END: exit 0 check_tortoisesvn( retcode =0 ) { if (retcode = 1) { title_l := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt_l := "Please wait while the installer finishes determining your disk space requirements." WinWaitAndClikButton(title_l,"Button1",include_txt_l) ;title := "TortoiseSVN " svn_ver " (32 bit) License Agreement" ;include_txt := "End-User License Agreement" WinWaitAndClikButton(title,"Button3",include_txt) title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "Are you sure you want to cancel TortoiseSVN " svn_ver " (32 bit) installation?" WinWait ,%title%,%include_txt%, 10 if ErrorLevel { }else{ WinWaitAndClikButton(title,"Button2",include_txt) } title := "TortoiseSVN " svn_ver " (32 bit) Setup" include_txt := "TortoiseSVN " svn_ver " (32 bit) Setup Wizard was interrupted" WinWaitAndClikButton(title,"Button2",include_txt) sleep,3000 } } ;#include RemoteBuf.ahk ;#include RTV.ahk #include %A_ScriptDir%\BUTTON_LIB.ahk