Switch to full style
Topic locked

Garmin XT for WinCE only start via Que.exe not garmin.exe

Sun Oct 03, 2010 8:43 pm

Hi Guys,
After many hours and even days I got Garmin mobile XT working on my Mio C210 (CE 4.2) device. It has Igo8 installed on the flash memory and Garmin on the SD card. To start Garmin I enter CE via goce.exe in the root of the SD card. From there I use explorer to click Que.exe in the apps folder, Garmin runs fine and finds the GPS, maps work well. However when I try to start via Garmin\RunGMXT\garmin.exe there is just a quick flash on the screen and nothing else happens.

The problem is by starting Garmin via Que.exe is of course that my settings get deleted every time I swich off the device. I've tried editing the garmin.mscr and searching the net for hours without any luck. Hope there is someone here willing to help me!

Sun Oct 03, 2010 9:30 pm

More details which garmin xt for win ce release did you use? Where did you find it? When you ask for help, provide more informations!

How is recognized your SD CARD by your device, if i remember good MIO recognize SD Cards like Storage Card , or ? Then, you'll have to edit in your garmin.mscr where is SDMMC with Storage Card and if you have some .xml file, make these changes inside .xml file in garmin folder.

Post your garmin.mscr script here, normally put it in code and with spoilers, cause it's bigger content.

Mon Oct 04, 2010 11:18 am

Black Wolf,
The release I am using is the one from mobilsim forum which is supposed to work with CE 4.2: [Please Register or Login to download file]

Below is the garmin.mscr Im using (original one). I have tried to edit it in different ways without luck. You are correct, my SD is named "Storage Card", I thougt the script would take care of different names of the SD by itself. Im not very good at scrips so Im not sure exactly which parts (with witout spaces quotes etc..) to replace with "Storage Card". I dont have any .xml in the garmin folder.
Thanks

Spoiler: Show
Errorlevel("warn")

If(WndExists("Garmin Mobile XT"))
Show("Garmin Mobile XT")
Exit
EndIf

#Whether to use Port Splitter
usePortSplitter = 0

cwd = SystemPath("ScriptPath")
queDir = cwd \ "..\Apps\WM"
queExe = "Que.exe"

#Devices with Windows CE 6 already have aygshell.dll hence Que.aygshell.exe will be run instead of Que.exe which is linked to aygshel2.dll
If(SystemVersion("major") = 6)
queExe = "Que.aygshell.exe"
EndIf

#Rename coredl2.dll depending on the current version of Windows CE
Call("RenameCoredll")


If(usePortSplitter)
Call("StartPortSplitter")
EndIf

isExplorerRunning = ProcExists("explorer.exe")

#Run explorer.exe if not running
If(not isExplorerRunning)
Run("\Windows\explorer.exe")
Sleep(1000)
EndIf

#Hide Taskbar
Run(cwd \ "TaskbarHide.exe")

#Copy previous stored settings to \Garmin
XCopy(cwd \ "Settings\*.*", "\Garmin", TRUE)

#Run and wait for Garmin Mobile XT to exit
RunWait(queDir \ queExe)

#Save new settings back to SD Card
XCopy("\Garmin\*.*", cwd \ "Settings", TRUE)

#Kill explorer.exe if it was not running before
If(not isExplorerRunning)
If(ProcExists("explorer.exe"))
Kill("explorer.exe")
EndIf
EndIf

#Show Taskbar
Run(cwd \ "TaskbarShow.exe")

If(usePortSplitter)
Call("StopPortSplitter")
EndIf



#Start Port Splitter
Sub StartPortSplitter
Global(cwd)
#If Settings.dat does not exit ask the user to configure Port Splitter
If(not FileExists(cwd \ "Settings.dat"))
BigMessage("Port Splitter's Settings.dat not found.^NL^Port Splitter will now run to configure it.^NL^1. Select input port and baudrate.^NL^2. Check Autostart.^NL^3. Select ouput port.^NL^4. Click Add.^NL^5. Click Start.^NL^6. Click Stop.^NL^7. Click Exit.^NL^If you want to reconfigure it delete:^NL^" & cwd \ "Settings.dat", "PortSplitter Settings")
Run(cwd \ "Port Splitter.exe")
Sleep(500)

#Wait up to 60 seconds for the window to be closed
timeout_ms = 60000
sleep_ms = 250
i = 0
While(WndExists("Port Splitter V1.31") AND i < timeout_ms)
Sleep(sleep_ms)
i += sleep_ms
EndWhile

#Stop Port Splitter in case the user did not click exit
Call("StopPortSplitter")
EndIf

#Run Port Splitter if not running
If(not ProcExists("Port Splitter.exe"))
Run(cwd \ "Port Splitter.exe")
Sleep(500)
EndIf
EndSub

#Stop Port Splitter
Sub StopPortSplitter
#Try first to stop and exit Port Splitter before killing it
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
EndSub

#Rename coredl2.dll depending on the current version of Windows CE
Sub RenameCoredll
If(SystemVersion("major") = 4)
If(FileExists(queDir \ "coredl2.wince4.dll"))
If(FileExists(queDir \ "coredl2.dll"))
Rename(queDir \ "coredl2.dll", queDir \ "coredl2.wince5.dll")
EndIf
Rename(queDir \ "coredl2.wince4.dll", queDir \ "coredl2.dll")
EndIf
Else
If(FileExists(queDir \ "coredl2.wince5.dll"))
If(FileExists(queDir \ "coredl2.dll"))
Rename(queDir \ "coredl2.dll", queDir \ "coredl2.wince4.dll")
EndIf
Rename(queDir \ "coredl2.wince5.dll", queDir \ "coredl2.dll")
EndIf
EndIf
EndSub

Mon Oct 04, 2010 12:07 pm

The paths need to be correct in the XML, morstscript and QUE.EXE
If the release you use is not specificically for your SD card label than it won't work, you will always loose your settings as they can not be saved due to the wrong paths in the EXE file.
If you upload the QUE.EXE than I might be able to modify it for the use with your SD card.
If you prefer to try it yourself make sure to use a good Hex Editor like Hex Editor NEO and only work with a backup, never with the original file.

Mon Oct 04, 2010 12:23 pm

Thanks Downunder!
I have attached the garmin.exe, garmin.mscr and que.exe. I cannot find any .xml file in the garmin folder or its subfolder.

Mon Oct 04, 2010 1:03 pm

I looked into the QUE.exe and it seems I got bad news :
The paths are encoded from address 0049e46c onwards but it seems the author was not willing to allow enogh space to change the paths in the way you need.
Without the source and recompliling it is impossible for me to change it all to "Starage Card".
You could however try to use my Hi-res release instead.
If you can't get it to work directly, try to put your current Garmin version on it and only replace the QUE.EXE with the one from my release. This way you should have all needed DLL files present.
Make sure to use the right .EXE for your system as I have uploaded several different versions here.

Mon Oct 04, 2010 4:05 pm

Thanks for taking the time to help!
I have downloaded your Hi-res package for "Storage Card" and tried the following:
-Changing only the Que.exe
-Changing Que.exe & sw.unl
-Changing Que.exe, sw.unl & the RunGMXT map content
=> still only a flash when i click garmin.exe. When I click your Que.exe I get "No application associated with Que.exe.."
-Changing everything in "Storage Card\garmin" for the content in your package & clicking garmin.exe or que.exe
=> Fatal application error by explorer.exe Exception 0xC000001C Address: 8C032588

I think I may have provided you with the incorrect QUE.exe before, I have now exchanged (que2.zip) it for the one confirmed to work on my c210 when I click Que.exe. I guess this is not possible to edit either?
Any Idea what I could try next? When I look into garmin.mscr I get the impression it is supposed to handle different SD root names, or am I wrong here?

Tue Oct 05, 2010 2:22 am

I tried your new QUE as well and the result is the same :(
The path is only "Storage" and without the source there is no chance to recompile it.
If you check the newer releases you will note that mostly Artful added enough space to edit almost any path necessary.
If the file is supposed to work with your device than I don't know what might be wrong.
I tried to update at least what is possible without corrupting the file but I think it is not enough to make it work - you can give it a try :1676

Tue Oct 05, 2010 5:08 pm

Thanks for trying, unfortunately the QUE.exe did not work :-(
BUT, I managed to get it working another way!!

I took a short garmin.mscr script from one of Artful:s releases and with the aid of the mortscript manual I found a parameter (/../) that did not seem to work with my CE version (4.2). I kept my original installation with the working QUE.exe (above) and start via garmin.exe (attached) in the garmin\RunGMXT folder. The script (attached) now works like its supposed to saving/reinstalling the garmin settings from the SD even after power off!

Only problem now is a "cosmetic" one : The script is supposed to kill explorer.exe at shutdown of que.exe. The "ProcExists" and "kill" command apparently requires toolhelp.dll to work,therefore I added a line to copy this .dll from SD to \windows. I tried two different toolhelp.dll (for CE 4.2 & 5) I found in a forum, but only get error mesasges & explorer.exe starts acting strange. Either there is something wrong with my copy command in the script or something is wrong with the dll:s.

Thu Oct 07, 2010 3:51 am

Sweet ! Thanks for sharing the good news!
The toolhelp.dll should work fine if placed in the Garmin folder - or where it is actually needed like the folder where the mortscript is.
If placed into the Windows folder you still need to register it in order to make it work and I think that will only last to the next reset or boot.
Please try it inside the Garmin folder and it might just work.
Since not every device needs the Explorer started before Garmin you can also try to comment out the Explorer lines in the script and give it a try.

Thu Oct 07, 2010 12:00 pm

Hi, Placing toolhelp.dll inside the scriptfolder makes no difference. When I deleted the lines for start/kill of explorer.exe and for copying toolhep.dll then explorer.exe (I use it when I start garmin.exe) is still corrupted in some way after shutting down garmin and the device has to be reset. It seems it is the Garmin software itself that affects explorer.exe somehow.

Important thing however is that saving the Garmin settings work now! Hopefully someone else with a Mio c210 could benefit from the sollution and avoid spending days like i did :-)
Thanks for supporting!
Topic locked