Errorlevel("warn")
If(WndExists("
Garmin Mobile XT"))
Show("
Garmin Mobile XT")
Exit
EndIf
Run("\Windows\explorer.exe")
Sleep(1000)
#Hide Taskbar
Run(SystemPath("ScriptPath")\"TaskbarHide.exe")
#Setup a background image to cover the top screen
If(FileExists(SystemPath("ScriptPath")\"Background\CEPhotoViewer.cfg"))
Delete(SystemPath("ScriptPath")\"Background\CEPhotoViewer.cfg")
EndIf
Run(SystemPath("ScriptPath")\"Background\CEPhotoViewer.exe")
Sleep(500)
#Registry for Port Splitter
RegWriteString( "HKLM", "SOFTWARE\JAL\Port Splitter", "InstallPath", SystemPath("ScriptPath") )
RegWriteDWord( "HKLM", "SOFTWARE\JAL\Port Splitter", "MajorVersion", 1 )
RegWriteDWord( "HKCU", "Software\JAL\Port Splitter", "Split", 2 )
RegWriteDWord( "HKCU", "Software\JAL\Port Splitter", "Autostart", 1 )
RegWriteDWord( "HKCU", "Software\JAL\Port Splitter", "Baud", 11 )
RegWriteDWord( "HKCU", "Software\JAL\Port Splitter", "Port", 7 )
#Run Port Splitter if not exists
If(not ProcExists("Port Splitter.exe"))
Run(SystemPath("ScriptPath")\"Port Splitter.exe")
Sleep(1000)
EndIf
#Copy previous stored settings to \
Garmin
XCopy(SystemPath("ScriptPath")\"Settings\*.*", "\
Garmin", TRUE)
#Run
Garmin Mobile XT.
#This script will not go to the next command before que.exe completely shut down
RunWait(SystemPath("ScriptPath")\"..\Apps\WM\que.exe")
#Save new settings back to SD Card
XCopy("\
Garmin\*.*", SystemPath("ScriptPath")\"Settings", TRUE)
#Stop Port Splitter before killing it
#If the port splitting are not stopped before killing the process,
#it will not work again even you run Port Splitter again without soft reset
If(WndExists("Port Splitter V1.31"))
#Stop button
SendCommand("Port Splitter V1.31", 1010)
Sleep(500)
#Exit button
SendCommand("Port Splitter V1.31", 2)
Sleep(500)
EndIf
#Kill Port Splitter process
If(ProcExists("Port Splitter.exe"))
Kill("Port Splitter.exe")
EndIf
#Clean all registry for Port Splitter
RegDeleteKey( "HKLM", "SOFTWARE\JAL", TRUE, TRUE )
RegDeleteKey( "HKCU", "Software\JAL", TRUE, TRUE )
#Close Background Picture
If(ProcExists("CEPhotoViewer.exe"))
Kill("CEPhotoViewer.exe")
EndIf
If(FileExists(SystemPath("ScriptPath")\"Background\CEPhotoViewer.cfg"))
Delete(SystemPath("ScriptPath")\"Background\CEPhotoViewer.cfg")
EndIf
#Kill explorer
If(ProcExists("explorer.exe"))
Kill("explorer.exe")
EndIf
#Show Taskbar
Run(SystemPath("ScriptPath")\"TaskbarShow.exe")