Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- #include <MsgBoxConstants.au3>
- if not RunWait('C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe "Mount-DiskImage ""' & @ScriptDir & '\FF7DISC1.ISO"""', @ScriptDir, @SW_HIDE) == 0 then ; mount iso
- MsgBox($MB_ICONERROR, "Error", "Failed to mount ISO: " & @error & @CRLF & @extended) ; error if mounting ISO fails
- else
- if not WinExists("7thHeaven Version") then ; only run 7th Heaven if it's not already open
- if not Run(@ScriptDir & "\7thHeaven\7thHeaven.exe", @ScriptDir & "\7thHeaven\") then ; run 7th Heaven
- MsgBox($MB_ICONERROR, "Error", "Failed to launch 7th Heaven: " & @error & @CRLF & @extended) ; error if launching fails
- endif
- else
- WinWaitActive("7thHeaven Version")
- Sleep(10000) ; some extra delay to make sure the window has loaded
- if not ControlClick("7thHeaven Version", "", "[TEXT:Launch Game]") then ; launch game
- MsgBox($MB_ICONERROR, "Error", "Failed to launch game: " & @error & @CRLF & @extended) ; error if clicking "Launch Game" fails
- else
- Sleep(15000) ; sleep 10 seconds
- WinClose("7thHeaven Version") ; finally, close 7th Heaven
- endif
- endif
- if not RunWait('C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe "Dismount-DiskImage ""' & @ScriptDir & '\FF7DISC1.ISO"""', @ScriptDir, @SW_HIDE) == 0 then ; mount iso
- MsgBox($MB_ICONERROR, "Error", "Failed to unmount ISO: " & @error & @CRLF & @extended) ; error if mounting ISO fails
- endif
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement