GPSFileDepot Forums

General Category => Map Making Support => Topic started by: glendeni on January 03, 2015, 09:40:54 AM

Title: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 09:40:54 AM
I'm now creating "universal" Garmin "gmapi" map files which can be used to install maps on both Windows and Mac machines.  My current plan is to offer both a "registry" installation version of my maps for Windows users and the "gmapi" files for Mac users or others who might have a problem with the "registry" installation.   I'm going to assume that any gmapi users will have enough knowledge to do basic computer operations such as a "copy" (and possibly "unzip"), so will not need an installation script - but don't know what would be the most "convenient" form for them to use.

I've tested gmapi use on a Windows PC but am unsure how they should be used (and hence packaged) for a Mac.  Since I don't have one and can't test that, I'm looking for some guidance here.

"gmapi" creation produces a gmapi directory with a gmap subdirectory which contains the map files actually used.  On a Windows machine, the "gmap" subdirectory is utilized, not the "gmapi" one, being placed under an OS-dependent folder such as C:\ProgramData\Garmin\Maps.

Based on the thread http://forums.gpsfiledepot.com/index.php?topic=2383 I believe that for a Mac I should provide the "gmapi" directory (not its "gmap" subdirectory) as either a .zip or .tgz file.  Can someone who uses a Mac enlighten me on this?

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: Boyd on January 03, 2015, 11:32:53 AM
MacOSX is actually BSD unix "under the hood". A .zip file will automatically be extracted to a folder when double-clicked on the Mac. Not entirely sure about .tgz, the last time I tried double-clicking it opened with a program called "stuffit". But that was several versions ago on MacOSX and I don't think this program is part of the standard install. To play it safe, I would use a .zip file. Sorry, I don't have any .tgz files handy to test on my current mac.

The key to making a .gmapi work however is fore the user to install Garmin Basecamp first. The Mac uses something called "packages" for software installation. They are really just folders (directories) that are specially flagged so that the user interface displays them as files. Extensions are associated with the programs that can open them, just like on Windows. And if a folder has the .gmapi extension and the user has already installed Basecamp, then it will appear as a package that is handled by MapManager, a component of Basecamp. If Basecamp isn't installed, then a .gmapi will appear as a folder, just like it does on Windows.

So MapManager actually becomes the "installer" and prompts the user for what to do. Therefore no Windows style installer is really needed.
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 11:51:44 AM
So if I supply a gmapi folder as a .zip file, then would the following instructions work:

"click on the downloaded "Univeral Garmin File", a .zip format file, to extract the gmapi folder it contains, then click on that to run the MapManager (which should automatically appear if BaseCamp is installed)"

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: Boyd on January 03, 2015, 11:55:14 AM
That's basically it, but I would start by saying to install Basecamp before double-clicking on your .zip file. And don't call the .gmapi a "folder", because it will appear to be a "file" if Basecamp already exists on the user's Mac.
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 12:13:37 PM
Thanks.  I gather that in _both_ cases "click" should be "double-click".

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 12:17:18 PM
PS: does MapManager require any input or instructions - or are things completely automatic at that point?
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 12:49:19 PM
Just realized I'd forgotten one important thing I don't understand, which might be a difference between Windows and a Mac. 

On a Windows PC if I supply a zipped gmapi directory, then double clicking exposes the gmapi directory inside and I must further extract the gmap directory it contains.  IE on Windows one really needs the gmap directory, not the gmapi one.  So if I was supplying a file only for Windows, I'd want to zip the gmap directory not the gmapi one to make things easiest

But if I understand correctly, the Mac needs the gmapi one, so for it I must zip the gmapi one, not the gmap directory.

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 12:56:42 PM
Yet again - I now get the feeling that for a Mac I should be zipping the "gmap" directory but then _naming_ it with a "gmapi"  as a tail on the filename ala "BigSurTrailmap.gmapi" where that is a zip file of the gmap directory.

I am getting myself confused!  (Partly because in the python-script I run to create the gmap files, those are created in a BigSurTrailmap.gmap directory which is below a BigSurTrailmap.gmapi directory - so using that last name as a zip file name would require some fancy footwork to avoid a name conflict.) 

I am used to a zip file always having a .zip tail in the filename but this would be a case where that is not so (but now that I think of it, a GoogleEarth kmz file is really just a zip file - so that would be another example.)

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: Boyd on January 03, 2015, 01:33:33 PM
Quote from: glendeni on January 03, 2015, 12:56:42 PMI am getting myself confused!

Me too! I use Macs for everything BUT mapping. And frankly, I just don't like Basecamp. So I'm a little rusty on this and don't even have the software installed on my Mac anymore. But I believe you want the .gmapi file for the Mac, because double-clicking that will launch MapManager. And once MapManager starts, it's pretty much self-explanatory. If the .gmap folder is named "myMap" then MapManager puts up a message to the effect "do you want to install myMap".

The .gmap directory will also work on the Mac, but you would have to manually copy it to the correct directory on the Mac. And I believe that has gotten more difficult on newer versions of MacOSX because they are hiding the user library.

You totally lost me with the part about .zip files. There is no reason to use it at all as far as MacOSX is concerned. It's just a way to package a download. And IIRC, the way Oz has set things up here, the only way to upload a Mac file at GPSFileDepot is in the form of a .tgz file or a .zip file for a "universal" version. If you read that long thread about universal installers, the .zip file was my idea because it allowed us to upload one file that contained BOTH a windows .exe installer AND a Mac .gmapi.

Honestly, this was all confusing stuff that I would need to wrap my brain around again in order to be any more helpful. And, sorry, that's just not something I'm willing to do here and now. I'm working on a couple new maps and will need to revisit the whole installer thing when they are finished, but that will probably be a couple months from now.
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 01:42:24 PM
OK, thanks for the info.  I was going to try installing Garmin MapConverter on my PC so I could look at the structure of the file it was creating - but that fails to install for me!  Think I will just have to make my best guess of what the structure of the gmapi file should be and let my users let me know if that works or not.

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: popej on January 03, 2015, 02:19:55 PM
Mac (or actually MapManager) should support gmap folder directly, just like gmapi. See example on this video (about 0:50):
https://www.youtube.com/watch?v=4n-sACErYL4

Gmapi can contain gmap directory and unlock codes. I think it is designed to transfer maps from PC to Mac. For publishing gmap alone should be ok.

Edit: MapConverter should work under wine. Instead of installing, unpack installer and extract exe. MapConverter expects maps to be installed in registry, like for Mapsource.
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 02:36:08 PM
Thanks for that enlightenment.  One problem I think I have is that as a Linux person I think of the file "name" as including a "zip" tail ala  myfile.zip whereas sometimes Windows omits that  tail in reporting a filename - and I don't know how a Mac reports such filenames.

After looking at some "gmapi" files I found online, they appear to be zip files created from a gmapi directory which has a gmap subdirectory. - a file I would give a filename  like "MyMap.gmapi.zip"   So "unzipping" file "MyMap.gmapi.zip" produces a "MyMap.gmapi" directory with a "MyMap.gmap" subdirectory.

But from what you say, I should be able to create a "MyMap.gmap.zip" file which will unzip to create a "MyMap.gmap" directory with subfiles.  I will try that until my Mac users report that does not work for them.  I have no difficulty creating instructions which will work for such a file on a Windows machine but won't be able to test the instructions I supply for a Mac user.

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: Boyd on January 03, 2015, 04:08:52 PM
That is interesting popej. Wasn't aware that you could use .gmap with MapManager.

Quote from: glendeni on January 03, 2015, 02:36:08 PMOne problem I think I have is that as a Linux person I think of the file "name" as including a "zip" tail ala  myfile.zip whereas sometimes Windows omits that  tail in reporting a filename - and I don't know how a Mac reports such filenames.

I have always heard the term "extension" used for the component of a filename that follows the dot. I assume that's what you mean by "tail". :)

The Mac is pretty similar to Windows in this regard. There are user preferences that determine whether the extension is shown. On the Mac there is an item "show all filename extensions" in the Finder Preferences that must be checked. I always do this on my machines, but think the default is not to show extensions. On Windows, there is an option "hide extensions for known file types" in the Folder Options Control Panel. I believe it is checked by default.
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 03, 2015, 04:13:14 PM
That triggers a memory, that I have set up my Windows display to show the "extension" - but since I do see the full filename I tend to forget that other Windows users will only see a partial name. 
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 04, 2015, 04:13:48 AM
I found a link where a "gmap" file (folder) is input to Garmin MapManager on a Mac - so apparently that software knows how to utilize both gmapi and gmap folders.
  http://www.openfietsmap.nl/installation

For giggles, I decided to see what would happen if I placed a "gmapi" folder on the Garmin/Maps directory on my Windows PC.  It was not recognized by MapSource - so the "gmap" folder must be placed there.

Jack
Title: Re: packaging gmapi/gmap folder for Mac
Post by: maps4gps on January 11, 2015, 08:21:36 AM
When Boyd originally mentioned this method, I was hoping he, OZ, or someone else would  create an installer 'script' file. Great for MAC users (which I am not), but as I understood it, a PC user would have an additional step to do.  With about 9 PC per 1 MAC download, that did not seam right to me.

Be aware, that as simple/easy as the PC installer is, there are many who want to install map sets there way and you or someone else will need to assist them.
Title: Re: packaging gmapi/gmap folder for Mac
Post by: Boyd on January 11, 2015, 09:58:23 AM
Quote from: maps4gps on January 11, 2015, 08:21:36 AM
When Boyd originally mentioned this method, I was hoping he, OZ, or someone else would  create an installer 'script' file.

Not sure if I understand you. Oz did create a NSIS gmap installer - see the attachment to his post here:

http://forums.gpsfiledepot.com/index.php/topic,2383.msg13980.html#msg13980

My INNO installer is here, along with instructions:

http://forums.gpsfiledepot.com/index.php?topic=2383.msg15974#msg15974

RWS also posted a simple Windows INNO script here:

http://forums.gpsfiledepot.com/index.php/topic,2383.msg14536.html#msg14536

With my "universal" version, users on both platforms download the same zip file that contains the .gmap data and an INNO script. Mac users can just double-click the .gmapi file and MapManager performs the installation (no installer script required).

Windows users just double-click the Windows installer file and are guided through the process by the INNO script.

I understand why some mapmakers want to stick with the old approach, and that's fine. But the universal version means the author only has to do one upload and Oz only stores half the data used with the old system of separate Mac and Windows maps.
Title: Re: packaging gmapi/gmap folder for Mac
Post by: glendeni on January 11, 2015, 10:12:24 AM
Currently my users have the choice of downloading either a PC executable or a gmap format file.  FWIW, last week (excluding bots and multiple downloads from the same IP) there were 3 PC executable downloads and 7 gmap downloads (Apple Safari browser downloads accounted for 5 of the latter).  I've put instructions for the gmap install for both PC and Mac on the download webpage - so far no one has asked for any more help on my forum.

Jack

PS:  the ratio of executable vs gmap downloads is likely skewed in favor  of the latter since I announced the new gmap on my home page, so Mac users likely have taken advantage of that new availability