; ; 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% ;EnvGet, WORK_DIR, RUN_PATH SetTitleMatchMode RegEx ;******************************************:// ;//******************************************:// ;//OFFICE_2003CN******************************************:// VIRTUAL_BOX: ;Goto,VMWARE_TOOLS_X ;//******************************************:// global title, title2, include_txt, myvar, lang, timeout, box_ver ;;box_ver = %1% ;;box_ver=5.2.8 box_ver=\d+\.\d+\.\d+ /* RegRead, lang, HKEY_LOCAL_MACHINE, SYSTEM\CurrentControlSet\Control\Nls\Language, Default if (lang = 0804) { title := "VMware Tools 安装程序" include_txt := "WixUI_Bmp_Dialog" }else if( lang = 0411 ) { title := "VMware Tools セットアップ" include_txt := "WixUI_Bmp_Dialog" }else if( lang = 0412 ) { title := "VMware Tools 설치" include_txt := "WixUI_Bmp_Dialog" } */ title := "Oracle VM VirtualBox Guest Additions " box_ver " Setup" include_txt := "It is recommended that you close all other applications before starting Setup. " IfWinExist,%title%,%include_txt% { }else{ RUN_VIRTUAL_BOX(title,include_txt) ;; SetTimer, check_running, 1000 } WinWait ,%title%,%include_txt%, 1000 if ErrorLevel { Goto,VIRTUAL_BOX } cmds := Object() idx :=0 cmds[++idx] := [ 100, "WinWaitAndClikButton", title, "Button2" , "It is recommended that you close all other applications before starting Setup."] cmds[++idx] := [ , , , , "Choose Install Location"] cmds[++idx] := [ , , , , "Choose Components"] cmds[++idx] := [ 6000, , , , "I want to manually reboot later"] do_all_commands( cmds ) VIRTUAL_BOX_END: exit 0 ;***************************************************** ;*************************************************** ;*************************************************** ;//-------------------------------------------------- RUN_VIRTUAL_BOX(WinTitle,WinText) { TRY_AGAIN: DriveGet, Cd_list, List,CDROM StringLen, cd_list_len , Cd_list ;MsgBox,%cd_list_len% GET_CDLETTER: StringRight,drive_letter,Cd_list, 1 DriveGet, cd_label,Label, %drive_letter%: ;MsgBox,%Label% if ( cd_label ~= "VBox_GAs_" box_ver ){ sleep 5000 }else{ cd_list_len-- if( cd_list_len =0 ){ sleep,2000 Goto,TRY_AGAIN }else{ StringLeft, Cd_list, Cd_list,cd_list_len Goto,GET_CDLETTER } } ;MsgBox,%drive_letter%: ;return IfWinExist,%WinTitle%,%WinText% { }else{ Run, %drive_letter%:\VBoxWindowsAdditions.exe } } ;***************************************************** ;*************************************************** ;*************************************************** ;//-------------------------------------------------- ;------------------------------------------------------------------------------------------------ ; Iterate through controls with the same class, find the one with ctrlID and return its handle ; Used for finding a specific control ; check_running: if (lang = 0804) { title2 := "VMware 产品安装" include_txt2 := "另一个安装实例已在运行。正在退出..." }else if( lang = 0411 ) { title2 := "VMware 製品のインストール" include_txt2 := "セットアップの別のインスタンスがすでに実行中です。終了しています..." }else if( lang = 0412 ) { title2 := "VMware 제품 설치" include_txt2 := "설치 프로그램의 다른 인스턴스가 이미 실행되고 있습니다. 종료하는 중..." } IfWinExist ,%title2%,%include_txt2% { WinWaitAndClikButton(title2,"Button1",include_txt2) } return check_warning: if (lang = 0804) { title2 := "没有找到数字签名" include_txt2 := "Microsoft 数字签名确认软件已在 Windows 上测试过,并且测试后未经更改。" }else if( lang = 0411 ) { title2 := "デジタル署名が見つかりませんでした" include_txt2 := "Microsoft デジタル署名によって、ソフトウェアが Windows 上でテストされ、その後変更されていないことが保証されます。" }else if( lang = 0412 ) { title2 := "디지털 서명을 찾을 수 없음" include_txt2 := "해당 소프트웨어는 Windows에서 테스트되었으며 테스트된 후 변경되지 않았습니다." } IfWinExist ,%title2%,%include_txt2% { WinWaitAndClikButton(title2, "Button1", include_txt2) sleep,15000 } return ;;#include RemoteBuf.ahk ;;#include RTV.ahk #include %A_ScriptDir%\BUTTON_LIB.ahk