Re: [mkgmap-dev] MapSource installer improvements v5

2011-03-08 Thread Minko
A few remarks:
The Typ file is not registered in mapsource (I think someone already mentioned 
it, but it is quite urgent to repair this)
I dont know where to find / how to access the installer templates. Do I have to 
compile mkgmap for this?
Another thing on the wishlist is to add support for more languages.
The other improvements are working fine as far as I can see.


Cheers, Minko
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] MapSource installer improvements v5

2011-03-08 Thread Nakor
On 3/8/2011 6:14 AM, Minko wrote:
 A few remarks:
 The Typ file is not registered in mapsource (I think someone already 
 mentioned it, but it is quite urgent to repair this)
 I dont know where to find / how to access the installer templates. Do I have 
 to compile mkgmap for this?
 Another thing on the wishlist is to add support for more languages.
 The other improvements are working fine as far as I can see.

To sum up there are 3 issues/requests here:

1) I do not personally use TYP files. I can produce a patch to have them 
added but I cannot test it.
2) ATM yes, the plan would be to be able to read a template file if 
provided similarly to what is done for the locator
3) as discussed in private this is my plans. Of course implementing #2 
can allow people to provide their own translation quicker.

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] MapSource installer improvements v5

2011-03-08 Thread Minko
PS
Those two lines were missing:
 
  WriteRegStr HKLM SOFTWARE\Garmin\MapSource\Families\${REG_KEY} TYP 
$INSTDIR\$x.TYP
  DeleteRegValue HKLM SOFTWARE\Garmin\MapSource\Families\${REG_KEY} TYP

typfile=x.typ
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] MapSource installer improvements v5

2011-03-07 Thread Thorsten Kukuk

Hi,

On Thu, Mar 03, Nakor wrote:

 The previous versions had a file name hardcoded and would not work in most 
 cases. Sorry about that.

I tested the current version from svn and found out, that the TYP
file is not added to the registry. 

Any chance that we can add that registry entry automatically?

I have no idea how to find out the name of the TYP file, else
the entry would look like:
WriteRegStr HKLM SOFTWARE\Garmin\MapSource\Families\${REG_KEY} TYP 
$INSTDIR\${MAPNAME}.TYP


  Thanks,
Thorsten

-- 
Thorsten Kukuk, Project Manager/Release Manager SLES
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
GF: Markus Rex, HRB 16746 (AG Nuernberg)
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Mapsource installer

2010-01-03 Thread Mark Burton

Hi Steve,

  New patch attached.
 
 Thanks, giving it a go... looks good.

Ah, just noticed that it doesn't put a line in the script to delete the
TYP file on uninstall - otherwise, looking good.

Cheers,

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Mapsource installer

2010-01-02 Thread Nakor

 2. Run mkgmap with the --nsis option. This will give you a .nsi file
 (by default osmmap.nsi).  This is just a text file that you can adjust
 if need be.
 
 OK - I notice that it misses out the TYP file and indexing files. It
 would be good if it included them (please could you add them into the
 script).
  
Mark, I am not familiar with TYP files, but if you provide me a sample
with all the files you submit to mkgmap, the command line and which
files should be included in the install I will be glad to improve the
NSIS file generation.

  Thanks,

N.
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Mapsource installer

2010-01-02 Thread Mark Burton

Hi Nakor,

 Mark, I am not familiar with TYP files, but if you provide me a sample
 with all the files you submit to mkgmap, the command line and which
 files should be included in the install I will be glad to improve the
 NSIS file generation.

If you give the --index option mkgmap generates osmmap.mdx and
osmmap_mdr.idx files that should be installed with the others and have
registry entries like these:

SOFTWARE\Garmin\MapSource\Families\${REG_KEY} IDX $INSTDIR\${MAPNAME}.mdx
SOFTWARE\Garmin\MapSource\Families\${REG_KEY} MDR 
$INSTDIR\${MAPNAME)_mdr.img

If a TYP file is given as one filenames to mkgmap, you could include it
in the list of files to install and generate a registry entry for it:

SOFTWARE\Garmin\MapSource\Families\${REG_KEY} TYP $INSTDIR\TYPEFILENAME

Is that enough info?

Cheers,

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Mapsource installer

2010-01-02 Thread Mark Burton

Hi Steve,

 It will include the index files if --index is given.  Of course this
 also generates the index too and it might be good to be able to build
 from a previously generated set of files.

Hmm, I'm specifying --index but it's not putting anything into
osmmap.nsi that's related to MDR or IDX files. Something's not right.

 I've created a patch (attached) that picks up mdr and typ files and adds 
 them
 if present.  It could do with with a tad more testing than I've given
 it.

Thanks, I will give it a go.

Cheers,

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Mapsource installer

2010-01-02 Thread Mark Burton

Steve,

 Thanks, I will give it a go.

No sooner said than done. 2 issues observed in osmmap.nsi:

1 - the WriteRegStr line for the TYP file includes the TYP file's path
when it should be stripped? i.e.

 WriteRegStr HKLM SOFTWARE\Garmin\MapSource\Families\${REG_KEY} TYP 
$INSTDIR\/home/markb/OSM/M38d.TYP

2 - the delete registry entry for the TYP file is the same as the create entry!

 WriteRegStr HKLM SOFTWARE\Garmin\MapSource\Families\${REG_KEY} TYP 
$INSTDIR\/home/markb/OSM/M38d.TYP

You're right, the IDX/MDR stuff does get generated, I had inadvertently
removed the --index option and was just seeing old index files in my
maps.

Cheers,

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Mapsource installer

2010-01-02 Thread Steve Ratcliffe

On 02/01/10 23:23, Mark Burton wrote:


Steve,


Thanks, I will give it a go.

1 - the WriteRegStr line for the TYP file includes the TYP file's path
when it should be stripped? i.e.


Would giving an arbitary Unix path even work in a windows installer?
I always have all files in the current directory when making an
one.

New patch attached.

..Steve
Index: src/uk/me/parabola/mkgmap/combiners/FileInfo.java
===
--- src/uk/me/parabola/mkgmap/combiners/FileInfo.java	(revision 1443)
+++ src/uk/me/parabola/mkgmap/combiners/FileInfo.java	Sat Jan 02 16:31:25 GMT 2010
@@ -139,8 +139,10 @@
 
 		if (ext.equals(IMG)) {
 			info = imgInfo(inputName);
+		} else if (TYP.equals(ext)) {
+			info = fileInfo(inputName, TYP_KIND);
 		} else if (KNOWN_FILE_TYPE_EXT.contains(ext)) {
-			info = fileInfo(inputName);
+			info = fileInfo(inputName, APP_KIND);
 		} else {
 			info = new FileInfo(inputName, UNKNOWN_KIND);
 		}
@@ -154,9 +156,10 @@
 	 * but you can do.
 	 * 
 	 * @param inputName The input file name.
+	 * @param kind The kind of file being added.
 	 */
-	private static FileInfo fileInfo(String inputName) {
-		FileInfo info = new FileInfo(inputName, FILE_KIND);
+	private static FileInfo fileInfo(String inputName, FileKind kind) {
+		FileInfo info = new FileInfo(inputName, kind);
 
 		// Get the size of the file.
 		File f = new File(inputName);
Index: src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java
===
--- src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java	(revision 1443)
+++ src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java	Sat Jan 02 16:31:25 GMT 2010
@@ -162,7 +162,8 @@
 addImg(outfs, filename);
 addMpsFile(info);
 break;
-			case FILE_KIND:
+			case APP_KIND:
+			case TYP_KIND:
 addFile(outfs, filename);
 break;
 			case MDR_KIND:
Index: src/uk/me/parabola/mkgmap/main/Main.java
===
--- src/uk/me/parabola/mkgmap/main/Main.java	(revision 1363)
+++ src/uk/me/parabola/mkgmap/main/Main.java	Sat Jan 02 17:47:03 GMT 2010
@@ -154,6 +154,7 @@
 	public void startOptions() {
 		MapProcessor saver = new NameSaver();
 		processMap.put(img, saver);
+		processMap.put(mdx, saver);
 
 		// Todo: instead of the direct saver, modify the file with the correct
 		// family-id etc.
Index: src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java
===
--- src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java	(revision 1365)
+++ src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java	Sat Jan 02 23:40:43 GMT 2010
@@ -33,14 +33,19 @@
 	private String seriesName;
 	private String id;
 	private int productId;
-	private Boolean hasIndex = true;
+
+	private boolean hasIndex;
+	private boolean hasTyp;
+
 	private final ListString mapList = new ArrayListString();
+	private static final String HKLM_FAMILIES = HKLM \SOFTWARE\\Garmin\\MapSource\\Families\\${REG_KEY};
+	private String typName;
 
 	public void init(CommandArgs args) {
 		int familyId = args.get(family-id, 0);
 		productId = args.get(product-id, 1);
 
-		baseFilename = args.get(overview-mapname, osm);
+		baseFilename = args.get(overview-mapname, osmmap);
 		seriesName = args.get(series-name, OSM map);
 
 		String tmpId = Integer.toHexString(0x1 | familyId);
@@ -54,20 +59,29 @@
 	}
 
 	public void onMapEnd(FileInfo finfo) {
-		if (!finfo.isImg())
-			return;
-
+		switch (finfo.getKind()) {
+		case IMG_KIND:
-		mapList.add(finfo.getMapname());
+			mapList.add(finfo.getMapname());
+			break;
+		case TYP_KIND:
+			hasTyp = true;
+			typName = finfo.getFilename();
+			break;
+		case MDR_KIND:
+			hasIndex = true;
+			break;
+		case GMAPSUPP_KIND:
+			break;
-	}
+		}
+	}
 
 	public void onFinish() {
-		writeNSISFile();
+		writeNsisFile();
+		writeLicenceFile();
 	}
 
-
-	public void writeNSISFile() {
+	private void writeNsisFile() {
 		Writer w = null;
-
 		try {
 			w = new FileWriter(nsisFilename);
 			PrintWriter pw = new PrintWriter(w);
@@ -114,19 +128,28 @@
 pw.format(Locale.ROOT,   File \${MAPNAME}_mdr.img\\n);
 pw.format(Locale.ROOT,   File \${MAPNAME}.mdx\\n);
 			}
+			if (hasTyp)
+pw.format(Locale.ROOT,   File \%s\\n, typName);
+
 			pw.format(Locale.ROOT,   File \${MAPNAME}.tdb\\n);
 			for (String file : mapList) {
 pw.format(Locale.ROOT,   File \%s.img\\n, file);
 			}
+
+			// Registry values
 			pw.println();
-			pw.format(Locale.ROOT,   WriteRegBin HKLM \SOFTWARE\\Garmin\\MapSource\\Families\\${REG_KEY}\ \ID\ %s\n, id);
+			pw.format(Locale.ROOT,   WriteRegBin  + HKLM_FAMILIES + \ \ID\ %s\n, id);
 			if (hasIndex) {
-pw.format(Locale.ROOT,   WriteRegStr HKLM \SOFTWARE\\Garmin\\MapSource\\Families\\${REG_KEY}\ \IDX\ \$INSTDIR\\${MAPNAME}.mdx\\n);
-pw.format(Locale.ROOT,   WriteRegStr HKLM \SOFTWARE\\Garmin\\MapSource\\Families\\${REG_KEY}\ \MDR\ 

Re: [mkgmap-dev] Mapsource installer

2010-01-02 Thread Mark Burton

Steve,

  Thanks, I will give it a go.
  1 - the WriteRegStr line for the TYP file includes the TYP file's path
  when it should be stripped? i.e.
 
 Would giving an arbitary Unix path even work in a windows installer?

Well, the problem would be the same if you were running it under
windows. It's not just a unix thing.

 I always have all files in the current directory when making an
 one.

That's one solution - I'll just edit the generated .nsi file and fixup
the line, it's no big deal.
 
 New patch attached.

Thanks, giving it a go... looks good.

Cheers,

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev