You are on page 1of 10

/* Created in AutoHotKey - www.autohotkey.com Created by Paul (pw8818@gmail.com) Created on 1st May 2007 *Version 1.

8 -Vista Compatability -Window title changes -Added pw88 -Bug with remove CD where message only came once -Warning when installation files cannot be found *Version 1.7 -Option to eject CD on close -Retry button on cd remove *Version 1.6 -25% cpu usage bug -Option to lock CD -increased process priority *Version 1.5 -Switch to enable or disable auto insert serial -Focus onto next button once installed *Version 1.4 -Checks for serial insert on install, will ask if serial is needed *Version 1.3 -CD does not eject on Close X button (does in v1.7) *Version 1.2 -Increased chance of entering serial correctly -Added Version number *Version 1.1 -Fixed "Isn't Admin" on Vista */ #NoTrayIcon #SingleInstance Ignore #WinActivateForce Process, Priority,, A If A_OSVersion in WIN_NT4,WIN_95,WIN_98,WIN_ME,WIN_2000 { MsgBox 0, Can't Run Office 2007 Launcher, You need Windows XP, Windows Vista or later to install Office 2007. ExitApp } else if A_OSVersion in WIN_XP,WIN_2003 { If A_IsAdmin { Goto, Run } else { Msgbox 0, Can't Run Office 2007 Launcher Launcher, You must be a n Administrator to install Office 2007. ExitApp } } else if A_OSVersion in Win_XP,WIN_VISTA { If A_IsAdmin

{ Goto, Run } else { VistaLimited = 1 Guion = 1 Gui, font, s11, Arial Gui, Font, Bold Gui, Add, Text, x10 y10 w290 ,Vista Compatability Issue. Please Read. Gui, Font Gui, Font, s10, Arial Gui, Add, Text, x10 y40 w280, You need to follow these steps oth erwise Launcher can not insert the serials. Gui, Font Gui, Font, s9 c660000, Arial Gui, Add, Text, x10 y72 w280, Clicking Ignore will skip to Launc her. Gui, Font, s11 c000066, Arial Gui, Add, Text, x10 y100 w280, -Click button below Gui, Font Gui, Add, button, x10 y122 w150 h42 gScriptProperties, %A_Script Name% &Properties Gui, Font, s11 c000066, Arial Gui, Add, Text, x10 y170 w280, -Click the Compatability tab. Gui, Add, Text, x10 y200 w280, -Check the box 'Run this program as an administrator'. Gui, Add, Text, x10 y245 w280, -Click OK. Gui, Add, Text, x10 y275 w280, -Hit Reload below Gui, Font Gui, Add, Button, x10 y300 h40 w90 default, &Reload Gui, Add, Button, x110 y300 h40 w90, &Ignore Gui, Add, Button, x210 y300 h40 w85, &Exit Gui, -0x20000 Gui, Color, FF0066 Gui, Show, xCenter yCenter h350 w300, Vista Compatability - Laun cher WinActivate, Vista Compatability If A_OSVersion in WIN_VISTA WinSet, Transparent, 230, Vista Compatability - Launcher CDin: Loop { If guion = 1 { IfNotExist %A_ScriptFullPath% { Gui, Hide Removed: Msgbox 262149, CD Removed - Office 2007 Launcher, CD has been removed, re-insert to re-activate launcher. IfMsgbox Retry { IfNotExist %A_ScriptFullPath% { Goto Removed }

else { Gui, Show Goto, CDin } return } IfMsgbox Cancel ExitApp } Sleep 50 } else { Break Return } } Return } } Msgbox , 0, Unkown Operating System, You are using an Operating System that Laun cher is not compatable with,`n Launcher will continue to run however you may exp erience problems with the Launcher application. Goto, Run ScriptProperties: Run , properties %A_ScriptFullPath% return ButtonReload: Reload ExitApp return ButtonIgnore: Gui, Cancel Guion = 0 Goto, Run return ButtonExit: ExitApp GuiClose: ExitApp Run: SplitPath, A_ScriptFullPath ,,,,, root Detection = 0 IfExist %A_ScriptDir%\Office 2007 Enterprise\setup.exe { Gui,2: Add, Button, x26 y40 w254 h60 , Office 2007 &Enterprise Gui,2: Add, Picture, x18 y105 , %A_ScriptDir%\images\access.bmp Gui,2: Add, Picture, x46 y105 , %A_ScriptDir%\images\excel.bmp Gui,2: Add, Picture, x77 y105 , %A_ScriptDir%\images\groove.bmp Gui,2: Add, Picture, x106 y105 , %A_ScriptDir%\images\infopath.bmp Gui,2: Add, Picture, x136 y105 , %A_ScriptDir%\images\onenote.bmp

Gui,2: Add, Gui,2: Add, Gui,2: Add, Gui,2: Add, } else { Gui,2: Add, Gui,2: Add, Gui,2: Add, ++Detection }

Picture, Picture, Picture, Picture,

x167 x198 x229 x259

y105 y105 y105 y105

, , , ,

%A_ScriptDir%\images\outlook.bmp %A_ScriptDir%\images\powerpoint.bmp %A_ScriptDir%\images\publisher.bmp %A_ScriptDir%\images\word.bmp

Button, x26 y40 w254 h60 +Disabled, Office 2007 &Enterprise Text, x26 y110 w30 h20 , Error: Text, x56 y110 w200 h20 , Installation files not found

IfExist %A_ScriptDir%\Office 2007 Visio\setup.exe { Gui,2: Add, Button, x26 y140 w254 h60 , Office 2007 &Visio Gui,2: Add, Picture, x138 y205 , %A_ScriptDir%\images\visio.bmp } else { Gui,2: Add, Button, x26 y140 w254 h60 +Disabled, Office 2007 &Visio Gui,2: Add, Text, x26 y210 w30 h20 , Error: Gui,2: Add, Text, x56 y210 w200 h20 , Installation files not found ++Detection } IfExist %A_ScriptDir%\Office 2007 Project\setup.exe { Gui,2: Add, Button, x26 y240 w254 h60 , Office 2007 &Project Gui,2: Add, Picture, x138 y305 , %A_ScriptDir%\images\project.bmp } else { Gui,2: Add, Button, x26 y240 w254 h60 +Disabled, Office 2007 &Project Gui,2: Add, Text, x26 y310 w30 h20 , Error: Gui,2: Add, Text, x56 y310 w200 h20 , Installation files not found ++Detection } IfExist %A_ScriptDir%\ExpressionWeb\setup.exe { Gui,2: Add, Button, x26 y340 w254 h60 , Expression &Web Gui,2: Add, Picture, x138 y405 , %A_ScriptDir%\images\expressionweb.bmp } else { Gui,2: Add, Button, x26 y340 w254 h60 +Disabled, Expression &Web Gui,2: Add, Text, x26 y410 w30 h20 , Error: Gui,2: Add, Text, x56 y410 w200 h20 , Installation files not found ++Detection } If Detection = 4 Msgbox 0, Warning - Office 2007 Launcher, Launcher cannot find any of the instal lation files. Gui,2: Add, GroupBox, x16 y10 w276 h430 , Install Gui,2: Add, Button, x16 y450 w80 h40 , E&xit If VistaLimited = 1 Gui,2: Add, Checkbox, x110 y445 w110 h15 unchecked disabled vInsSerials, &Auto I

nsert Serials else Gui,2: Add, Checkbox, x110 y445 w110 h15 Checked vInsSerials, &Auto Insert Seria ls Gui,2: Add, Checkbox, x110 y460 w110 h15 vLockDrive, &Lock CD Drive Gui,2: Add, Checkbox, x110 y475 w110 h15 Checked vEjectCD, E&ject CD on close Gui,2: Add, Picture, x220 y445 , %A_ScriptDir%\images\office.bmp Gui,2: Add, Text, x280 y469 w50 h15, pw88 Gui,2: Add, Text, x285 y482 w22 h15, v1.8 Gui,2: Show, xCenter yCenter h495 w308, Microsoft Office 2007 Launcher Gui,2: Color, 3399CC If A_OSVersion in WIN_VISTA WinSet, Transparent, 240, Microsoft Office 2007 Launcher WinActivate, Microsoft Office 2007 Launcher Regread, EnterInst, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Office\12.0\Registrat ion\{90120000-0030-0000-0000-0000000FF1CE}, ProductName Regread, VisInst, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Office\12.0\Registratio n\{90120000-0051-0000-0000-0000000FF1CE}, ProductName Regread, ProInst, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Office\12.0\Registratio n\{90120000-003B-0000-0000-0000000FF1CE}, ProductName Regread, WebInst, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Office\12.0\Registratio n\{90120000-0026-0000-0000-0000000FF1CE}, ProductName CDin2: Loop { IfNotExist %A_ScriptFullPath% { Gui,2: Hide Removed2: Msgbox 262149, CD Removed - Office 2007 Launcher, CD has been re moved, re-insert to re-activate launcher. IfMsgbox Retry { IfNotExist %A_ScriptFullPath% { Goto Removed2 } else { Gui,2: Show Goto, CDin2 } return } IfMsgbox Cancel ExitApp } Sleep 50 }

2ButtonOffice2007Enterprise: { Gui Minimize Gui +0x8000000 GuiControlGet, LockDrive If LockDrive = 1 Drive, Lock, %root% Run %A_ScriptDir%\Office 2007 Enterprise\setup.exe WinWait, 2007 Microsoft Office system WinSet, Style, -0x80000, 2007 Microsoft Office system WinSet, Style, +0x8000000, 2007 Microsoft Office system WinWait, Microsoft Office Enterprise 2007 WinSet, Style, +0x80000, Microsoft Office Enterprise 2007 WinSet, Style, -0x8000000, Microsoft Office Enterprise 2007 GuiControlGet, InsSerials If InsSerials = 1 { If EnterInst = Microsoft Office Enterprise 2007 { WinSet, Style, +0x8000000, Microsoft Office Enterprise 2007 Msgbox, 262404, Insert Serial?, Office Enterprise 2007 has been detected as installed, but if your being asked for the serial please press yes, otherwis e click no. IfMsgbox Yes { Blockinput on WinSet, Style, -0x8000000, Microsoft Office Enterprise 2007 Sleep 10 WinActivate, Microsoft Office Enterprise 2007 ControlFocus, RichEdit20W1, Microsoft Office Enterprise 2007 SendInput F3DJD-6FFQ4-XQTQF-PGK47-8MDQ8`n Blockinput off } IfMsgbox No { WinSet, Style, -0x8000000, Microsoft Office Enterprise 2007 WinActivate, Microsoft Office Enterprise 2007 } } else { Blockinput on WinActivate, Microsoft Office Enterprise 2007 ControlFocus, RichEdit20W1, Microsoft Office Enterprise 2007 SendInput F3DJD-6FFQ4-XQTQF-PGK47-8MDQ8`n Blockinput off } } WinWaitClose, Microsoft Office Enterprise 2007 If LockDrive = 1 Drive, Unlock, %root% Gui -0x8000000 Gui Restore GuiControl, +default, Office 2007 &Visio } return 2ButtonOffice2007Visio: {

Gui Minimize Gui +0x8000000 GuiControlGet, LockDrive If LockDrive = 1 Drive, Lock, %root% Run %A_ScriptDir%\Office 2007 Visio\setup.exe WinWait, 2007 Microsoft Office system WinSet, Style, -0x80000, 2007 Microsoft Office system WinSet, Style, +0x8000000, 2007 Microsoft Office system WinWait, Microsoft Office Visio Professional 2007 WinSet, Style, +0x80000, Microsoft Office Visio Professional 2007 WinSet, Style, -0x8000000, Microsoft Office Visio Professional 2007 GuiControlGet, InsSerials If InsSerials = 1 { If VisInst = Microsoft Office Visio Professional 2007 { WinSet, Style, +0x8000000, Microsoft Office Visio Professional 2 007 Msgbox, 262404, Insert Serial?, Office Visio 2007 has been detec ted as installed, but if your being asked for the serial please press yes, other wise click no. IfMsgbox Yes { Blockinput on WinSet, Style, -0x8000000, Microsoft Office Visio Professional 2 007 Sleep 10 WinActivate, Microsoft Office Visio Professional 2007 ControlFocus, RichEdit20W1, Microsoft Office Visio Professional 2007 SendInput HCFPT-K86VV-DCKH3-87CCR-FM6HW`n Blockinput off } IfMsgbox No { WinSet, Style, -0x8000000, Microsoft Office Visio Professional 2 007 WinActivate, Microsoft Office Visio Professional 2007 } } else { Blockinput on WinActivate, Microsoft Office Visio Professional 2007 ControlFocus, RichEdit20W1, Microsoft Office Visio Professional 2007 SendInput HCFPT-K86VV-DCKH3-87CCR-FM6HW`n Blockinput off } } WinWaitClose, Microsoft Office Visio Professional 2007 If LockDrive = 1 Drive, Unlock, %root% Gui -0x8000000 Gui Restore GuiControl, +default, Office 2007 &Project } return 2ButtonOffice2007Project:

{ Gui Minimize Gui +0x8000000 GuiControlGet, LockDrive If LockDrive = 1 Drive, Lock, %root% Run %A_ScriptDir%\Office 2007 Project\setup.exe WinWait, 2007 Microsoft Office system WinSet, Style, -0x80000, 2007 Microsoft Office system WinSet, Style, +0x8000000, 2007 Microsoft Office system WinWait, Microsoft Office Project Professional 2007 WinSet, Style, +0x80000, Microsoft Office Project Professional 2007 WinSet, Style, -0x8000000, Microsoft Office Project Professional 2007 GuiControlGet, InsSerials If InsSerials = 1 { If ProInst = Microsoft Office Project Professional 2007 { WinSet, Style, +0x8000000, Microsoft Office Project Professional 2007 Msgbox, 262404, Insert Serial?, Office Project Professional 2007 has bee n detected as installed, but if your being asked for the serial please press yes , otherwise click no. IfMsgbox Yes { Blockinput on WinSet, Style, -0x8000000, Microsoft Office Project Professional 2007 WinActivate, Microsoft Office Project Professional 2007 ControlFocus, RichEdit20W1, Microsoft Office Project Professiona l 2007 SendInput HCFPT-K86VV-DCKH3-87CCR-FM6HW`n Blockinput off } IfMsgbox No { WinSet, Style, -0x8000000, Microsoft Office Project Professional 2007 WinActivate, Microsoft Office Project Professional 2007 } } else { Blockinput on WinActivate, Microsoft Office Project Professional 2007 ControlFocus, RichEdit20W1, Microsoft Office Project Professional 2007 SendInput HCFPT-K86VV-DCKH3-87CCR-FM6HW`n Blockinput off } } WinWaitClose, Microsoft Office Project Professional 2007 If LockDrive = 1 Drive, Unlock, %root% Gui -0x8000000 Gui Restore GuiControl, +default, Expression &Web } return 2ButtonExpressionWeb: {

Gui Minimize Gui +0x8000000 GuiControlGet, LockDrive If LockDrive = 1 Drive, Lock, %root% Run %A_ScriptDir%\ExpressionWeb\setup.exe WinWait, Expression Web WinSet, Style, -0x80000, Expression Web WinSet, Style, +0x8000000, Expression Web WinWait, Microsoft Expression Web WinSet, Style, +0x80000, Microsoft Expression Web WinSet, Style, -0x8000000, Microsoft Expression Web GuiControlGet, InsSerials If InsSerials = 1 { If WebInst = Microsoft Expression Web { WinSet, Style, +0x8000000, Microsoft Expression Web Msgbox, 262404, Insert Serial?, Expression Web has been detected as inst alled, but if your being asked for the serial please press yes, otherwise click no. IfMsgbox Yes { Blockinput on WinSet, Style, -0x8000000, Microsoft Expression Web WinActivate, Microsoft Expression Web ControlFocus, RichEdit20W1, Microsoft Expression Web SendInput DDWJC-VFGHJ-7GFK6-9QK3D-PFTHW`n Blockinput off } IfMsgbox No { WinSet, Style, -0x8000000, Microsoft Expression Web WinActivate, Microsoft Expression Web } } else { Blockinput on WinActivate, Microsoft Expression Web ControlFocus, RichEdit20W1, Microsoft Expression Web SendInput DDWJC-VFGHJ-7GFK6-9QK3D-PFTHW`n Blockinput off } } WinWaitClose, Microsoft Expression Web If LockDrive = 1 Drive, Unlock, %root% Gui -0x8000000 Gui Restore GuiControl, +default, E&xit } return 2ButtonExit: GuiControlGet, EjectCD If EjectCD = 1 Drive, Eject, %root% ExitApp Return

2GuiClose: GuiControlGet, EjectCD If EjectCD = 1 Drive, Eject, %root% ExitApp Return

You might also like