NSIS installer improvements phase 2 v1

Hi, Thanks to Thorsten and Minko for they report about the TYP file issue. It also looks like I overlooked the index files so in the current mkgmap, the registry keys for the MDX and MDR files will be created regardless of those files actually existing. This was an easy fix and attached is a file patch that takes care of it. Hopefully someone can commit it. Thanks, N.

Hi, Here is an updated version with the following fixes/improvements: * correctly set registry key for TYP file * set registry key for index files only when present * possibility to use own template for installer script (details below) * installer localization (English and French at the moment) To customize the installer script one need to create a resources directory with: * installer_template.nsi to customize the installer script. There are four important lines that the file should have for mkgmap to generate the script properly: * ; INSERT_DEFINES_HERE should be near the beginning of the file, mkgmap will define a certain number of variables that are used later in the script * ; INSERT_ADDED_FILES_HERE mkgmap will generated the list of files to be packaged in the installer * ; INSERT_REGBIN_HERE mkgmap will add a line for the family_id registry key. This is binary and cannot be taken care of in the defines unfortunately * ; INSERT_REMOVED_FILES_HERE mkgmap will generated the list of files to be uninstalled by the uninstaller * license_template.txt this file will be displayed by the installer in the license page the default files are provided in the examples directory of the mkgmap installation for convenience Thanks, N.

Hi Nakor, I suppose you need to put this installer template into a installer subdirectory, like 'mkgmap-r1894\resources\ïnstaller\' ? Nakor wrote: To customize the installer script one need to create a resources directory

Hi, some things about the current installer: currently, $REG_KEY will be used to determine if the map is already installed. But $REG_KEY is not unique, if you have several maps with the same family-id, but different product IDs. All maps with the same family-id need the same $REG_KEY. So we should better use $MAPNAME. Or installing a new map of the same product family will remove a random other version. So the registry tree would look like: ${REG_KEY} -> ID=Family-ID |--> {PRODUCT_ID1} -> data |--> {PRODUCT_ID2} -> data |--> ... And that lead to the next problem: Removing a map from a family, where still other family members are installed, will remove the ID tag and thus renders all installed maps of this family useless. I don't have a solution for that yet. And at last, a german translation: @@ -20,9 +20,11 @@ !define MUI_LANGDLL_ALLLANGUAGES !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "French" +!insertmacro MUI_LANGUAGE "German" LangString AlreadyInstalled ${LANG_ENGLISH} "${INSTALLER_NAME} is already installed. $\n$\nClick `OK` to remove the previous version or `Cancel` to cancel this upgrade." LangString AlreadyInstalled ${LANG_FRENCH} "${INSTALLER_NAME} est d��install� $\n$\nAppuyez sur `OK` pour retirer la version pr��ente ou sur `Annuler` pour annuler cette mise �jour." +LangString AlreadyInstalled ${LANG_GERMAN} "${INSTALLER_NAME} ist bereits installiert. Klicken Sie auf `OK` um die alte Version zu entfernen oder `Cancel` um das Update abzubrechen." ; Reservefiles -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Markus Rex, HRB 16746 (AG Nuernberg)

Is that possible, different maps with the same FID and different PID? I thought only one Family ID can be used in Mapsource. btw, I tried to adapt the template but mkgmap can't find it, where do I have to put installer_template.nsi? I've tried it in a resources folder and in resources/installer but that doesn't work. About the language, the programm asks what language to use, English/French. Then it detects there is an old version already there, the uninstaller pops up, asking again what language you want to use. Maybe it is possible to skip this double check? Thorsten wrote: currently, $REG_KEY will be used to determine if the map is already installed. But $REG_KEY is not unique, if you have several maps with the same family-id, but different product IDs.

On Fri, Mar 11, Minko wrote:
Is that possible, different maps with the same FID and different PID?
Yes, as long as they have the same $REG_KEY.
I thought only one Family ID can be used in Mapsource.
You cannot have different TYP or IDX/MDX files. Else yes, that's working fine. I'm using this for my maps: The Basemap for every country has a different FID with PID 1, and then I have different layers like SRTM, Fixme, KeepRight with the same FID, but different PID. All are installed with the same $REG_KEY, so that the PID entries are all together. http://osm.thkukuk.de/ has my maps, but using a hacked installed script, which uses Ralf Kleineisels idea with extracting the sub-img files from gmapsupp.img with gmt.exe. There's only one bug left, depending on the installation order, the TYP file will be sometimes ignored. Thorsten -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Markus Rex, HRB 16746 (AG Nuernberg)

On 3/11/2011 5:03 AM, Minko wrote:
Is that possible, different maps with the same FID and different PID? I thought only one Family ID can be used in Mapsource.
btw, I tried to adapt the template but mkgmap can't find it, where do I have to put installer_template.nsi? I've tried it in a resources folder and in resources/installer but that doesn't work.
Minko, You just need a resources directory (not installer sub-directory) in the directory where you execute mkgmap. Thanks, N.

Thanks Nakor, it worked. Maybe add this to the option help file because it's not very clear. Or make it possible to specify another location where the template file is located in the --nsis option? --nsis="..\template\template.nsi" More improvements: If you put a "/S" when running the installer, you dont get a prompt for language selection twice: ;Run the uninstaller uninst: ClearErrors ExecWait '"$R0" /S _?=$INSTDIR' ;Do not copy the uninstaller to a temp file Dutch language string: LangString AlreadyInstalled ${LANG_DUTCH} "${INSTALLER_NAME} is reeds geinstalleerd. $\n$\nKlik op `OK` om de oude versie te verwijderen of `Annuleer` om deze update te onderbreken."

Small edit in the Dutch language string: LangString AlreadyInstalled ${LANG_DUTCH} "${INSTALLER_NAME} is reeds geïnstalleerd. $\n$\nKlik op `OK` om de oude versie te verwijderen of `Annuleren` om deze update te onderbreken."

If you update map_X with FID=x with PID=1, there will be an uninstall.exe in the folder of map_X. How would that work with a special layer of that map_X with PID=2 ? I had a look on your map files, but can't see an installer for the srtm layer. Let's assume you only want to update the base layer of your map, but not the srtm layer. Maybe its better to give the uninstaller name of that base layer (which is now uninstall.exe) an unique name like uninstall_FID-PID.exe, so you can choose what kind of map you want to remove. basemap FID=1000, PID=1, uninstaller name: uninstall_1000-1.exe srtm layer=FID=1000, PID=2 uninstaller name: uninstall_1000-2.exe etc This also makes it possible to install different maps into one directory. Thorsten wrote So the registry tree would look like: ${REG_KEY} -> ID=Family-ID |--> {PRODUCT_ID1} -> data |--> {PRODUCT_ID2} -> data |--> ... And that lead to the next problem: Removing a map from a family, where still other family members are installed, will remove the ID tag and thus renders all installed maps of this family useless. I don't have a solution for that yet.

On Fri, Mar 11, Minko wrote:
If you update map_X with FID=x with PID=1, there will be an uninstall.exe in the folder of map_X. How would that work with a special layer of that map_X with PID=2 ? I had a look on your map files, but can't see an installer for the srtm layer.
No, srtm isn't updated yet, but most the other layers for Germany are. But where is the problem? C:\Garmin\Maps\TK-OSM-DE-Basesystem\Uninstall.exe C:\Garmin\Maps\TK-OSM-DE-Hiking\Uninstall.exe You don't need to put them in the same directory, only the $REG_KEY needs to be the same.
Let's assume you only want to update the base layer of your map, but not the srtm layer. Maybe its better to give the uninstaller name of that base layer (which is now uninstall.exe) an unique name like uninstall_FID-PID.exe, so you can choose what kind of map you want to remove.
You don't need if you choose different directorys.
This also makes it possible to install different maps into one directory.
That was my first idea, but in the end, I had to struggle with too many possible file conflicts and making sure, not to delete a file still needed by another map, that I decided to use different directorys. MapSource and BaseCamp don't care about where the files are on disk, only where the registry entries are. Thorsten -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Markus Rex, HRB 16746 (AG Nuernberg)

Thorsten, I have now tried to install your bicycle layer, but this gave several errors in Mapsource and the map didnt show up. Duplicated FID, TYP file not found, productcode in registry doesnt match with tdb file. Looks like its not possible to use the same Family ID's on different maps.....

On Fri, Mar 11, Minko wrote:
Thorsten, I have now tried to install your bicycle layer, but this gave several errors in Mapsource and the map didnt show up. Duplicated FID, TYP file not found, productcode in registry doesnt match with tdb file. Looks like its not possible to use the same Family ID's on different maps.....
Strange, it works fine here. Which MapSource version do you have? I'm using the latest MapSource and Basecamp. Especially the "productcode in registry doesn't match with tdb file" sounds like you have other maps with the same FID already installed or soemthing with the registry is wrong? Here are two screenshots from Mapsource and regedit with all the maps installed: http://www.thkukuk.de/tmp/Mapsource.jpeg http://www.thkukuk.de/tmp/regedit.jpeg Thorsten -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Markus Rex, HRB 16746 (AG Nuernberg)

Hi all, should I commit this patch? WanMil
Hi,
Here is an updated version with the following fixes/improvements:
* correctly set registry key for TYP file * set registry key for index files only when present * possibility to use own template for installer script (details below) * installer localization (English and French at the moment)
To customize the installer script one need to create a resources directory with:
* installer_template.nsi to customize the installer script. There are four important lines that the file should have for mkgmap to generate the script properly: * ; INSERT_DEFINES_HERE should be near the beginning of the file, mkgmap will define a certain number of variables that are used later in the script * ; INSERT_ADDED_FILES_HERE mkgmap will generated the list of files to be packaged in the installer * ; INSERT_REGBIN_HERE mkgmap will add a line for the family_id registry key. This is binary and cannot be taken care of in the defines unfortunately * ; INSERT_REMOVED_FILES_HERE mkgmap will generated the list of files to be uninstalled by the uninstaller * license_template.txt this file will be displayed by the installer in the license page
the default files are provided in the examples directory of the mkgmap installation for convenience
Thanks,
N.

Is this not already committed in mkgmap-r1894? Wanmil asked: should I commit this patch?
participants (4)
-
Minko
-
Nakor
-
Thorsten Kukuk
-
WanMil