Welcome, Guest. Please login or register.

Login with username, password and session length
Forums Search:  


Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - freecat

Pages: [1] 2
1
Thanks for the link Indrid The site seems to be down but I will keep trying it.
Freecat

2
Map Making Support / Re: Trails are being doubled, why
« on: April 03, 2010, 04:33:50 AM »
xinull
 I had a similar issue with overview and the maps selection tool in mapsource with maps made with gpsmapedit, Well it looked kind of like the pic you posted. I had to add a map coverage area (invisible) to the map area to get it to work right.
0x004b  polygon others map coverage area
This made the preview file work right as well as the map selection area as well. not sure if this is causing your problems but its work a try.
Freecat

3
Map Making Support / Re: Problem with NSIS and registry entries
« on: March 18, 2010, 03:53:28 AM »
Hi Oz
Just thought I would let ya know I finally had time to tested the new script In Win7  64bit and windows XP 32 bit and it worked fine on both.  :)
freecat

4
Map Making Support / Re: Problem with NSIS and registry entries
« on: March 05, 2010, 04:48:00 AM »
Hi Oz

Registry.nsh Should have been deleted from the includes. This was a 3rd party registry plug-in that I was messing with. It is not necessary for the script to work. I will edit the code I posted sorry.

 The script changes I made does remove the registry entries from 32 or 64 bit systems. I checked again on both 32bit xp and 64bit win7 and they are removed. I have tested it several times and am sure they are gone on both. Did the entries not get removed from your system when you tested the script?
While the uninstaller seems to auto detect the bit type and removes the registry entries  on both my systems. If this does not work  for everyone it would be very easy to have the script write one uninstaller for 64bit and one for 32bit if  things are not uninstalling correctly. BTW what operating systems are you testing the script on Oz?

Freecat

5
Map Making Support / Re: help printing poster sized *.mp format maps
« on: March 02, 2010, 04:56:59 AM »
Hi newwood
I have used that typdecomp site, sometimes it works for me sometimes not and you can only DLD the compiled (.typ) files. >:( . I was able to get 1 .typ file to load in mapedit by renaming it to foo.txt but it acted odd. I think .txt files are the only way to go. The text files are easier to work with anyways since you can edit them in notepad and thats way faster than recompiling every-time.
I think I am going to have a slow work day and hope to start working on some custom symbols for POIs today. I will try several different sizes to see if I can get one to look good on a printed map and will let you know what I find out.

I just ran across this. It is a complete custom typ file example with lots of comments and notes. It should come in handy for anyone making custom types.
http://www.cgpsmapper.com/download/custom.txt

Freecat

6
Map Making Support / Re: Problem with NSIS and registry entries
« on: March 02, 2010, 04:45:46 AM »
Hi Oz
I think the reason that the installer worked for you is that NSIS has a way to check the bit type of the OS and then make changes to the registry part of the installer based on this. From what I have read this is a very buggy feature and rarely works right. Several developers have made plug-ins  to check the OS and bit type and return a string to get around this bug but I think the way I did it will be fine to.
Let me know how your test go and if I need to make any changes to the script.
Thanks
freecat

7
Map Making Support / Re: help printing poster sized *.mp format maps
« on: March 01, 2010, 11:29:27 AM »
Hi newwood
Thanks for the info. The test prints I have done so far have been around 900ft zoom in mapedit the lines and look good and the symbols are a usable size The only way I can think of to change those line widths like your talking about is to use custom types but that's very easy to do with GenTyp
 I made a little How-to on using the custom lines in gpsmapedit you can find it here:
http://forums.gpsfiledepot.com/index.php/topic,1031.0.html

Below is a sample type file(made with gentyp) that will give you a place to start . It will assign some various custom line widths, colors, borders to 5 different lines at 0x10, 0x11, 0x12, 0x13, 0x30 just change the border width and line width to what you want in pixels. Set your color(html Hex format) color 1 is the center line, color 2 is the border. Then follow the how-to above to load it into mapedit. Hmmm I was just thinking maybe you could make over sized custom symbols that would shrink down to the correct size when printed. I'll give that a try when i get a chance.

Note save code below as a .txt file
Code: [Select]
[_id]
ProductCode=7728
FID=1
[End]

[_drawOrder]
Type=0x01,1
Type=0x02,1
Type=0x03,1
Type=0x04,1
Type=0x05,1
Type=0x06,1
Type=0x07,1
Type=0x08,1
Type=0x09,1
Type=0x0a,1
Type=0x0b,1
Type=0x0c,1
Type=0x0d,1
Type=0x0e,1
Type=0x0f,1
Type=0x10,1
Type=0x11,1
Type=0x12,1
Type=0x13,1
Type=0x14,1
Type=0x15,1
Type=0x16,1
Type=0x17,1
Type=0x18,1
Type=0x19,1
Type=0x1a,1
Type=0x1e,1
Type=0x1f,1
Type=0x20,1
Type=0x21,1
Type=0x22,1
Type=0x23,1
Type=0x24,1
Type=0x25,1
Type=0x26,1
Type=0x27,1
Type=0x28,1
Type=0x29,1
Type=0x32,1
Type=0x3b,1
Type=0x3c,1
Type=0x3d,1
Type=0x3e,1
Type=0x3f,1
Type=0x40,1
Type=0x41,1
Type=0x42,1
Type=0x43,1
Type=0x44,1
Type=0x45,1
Type=0x46,1
Type=0x47,1
Type=0x48,1
Type=0x49,1
Type=0x4c,1
Type=0x4d,1
Type=0x4e,1
Type=0x4f,1
Type=0x50,1
Type=0x51,1
Type=0x52,1
Type=0x53,1
[end]



[_line]
Type=0x10
BorderWidth=1
LineWidth=2
XPM="0 0 2 0"
"1 c #7A3000"
"2 c #000000"
[end]




[_line]
Type=0x11
BorderWidth=1
LineWidth=3
XPM="0 0 2 0"
"1 c #FFFF01"
"2 c #000000"
[end]




[_line]
Type=0x12
BorderWidth=2
LineWidth=24
XPM="0 0 2 0"
"1 c #FF6541"
"2 c #000000"
[end]



[_line]
Type=0x13
BorderWidth=1
LineWidth=1
XPM="0 0 2 0"
"1 c #B4B4B4"
"2 c #000000"
[end]



[_line]
Type=0x30
BorderWidth=2
LineWidth=2
XPM="0 0 2 0"
"1 c #FFFF01"
"2 c #B4B4B4"
[end]

8
Map Making Support / Re: Problem with NSIS and registry entries
« on: March 01, 2010, 08:26:43 AM »
All right I have the modified map_install.nsi script written, commented and tested. 8)
What I did was (also see script comments)

1- Put registry entries into separate functions for each Bit type
2-Run a check for a folder that is only on 64 bit systems
3-Execute the correct function based on the result of #2

NOTE FOR CUSTOM TYPES: Un-comment and adjust lines- 17, 109 ,159(for 64 bit), 186(for32bit)

 It works fine in Windows XP 32Bit and on Windows 7 64Bit. If anyone can test this script on Vista 32/64 and XP 64Bit and post back to this thread that  would be awesome. Also I can zip this file up and host it on my website or can I or a Mod put it into the download section here???
Anyhow here's the new script
Code: [Select]
;--------------------------------
;Multi-bit NSIS installer script**original script by Oz** modified 3-1-2010 by =^_^= Freecat =^_^= *****
;NOTE FOR CUSTOM TYPES: Un-comment and adjust lines- 17, 109, 159(for 64 bit), 186(for32bit)
; install.nsi
;--------------------------------
  !include "MUI2.nsh"
!include "Sections.nsh"
; Configuration parameters
  !define MAP_DESC_NAME       "Mississippi Topo Map"
  !define MAP_SHORT_NAME      "Mississippi_Topo"  ;<<<Name must match>>>.TDB file name ?????
  !define MAP_URL             "http://www.gpsfiledepot.com/"
  !define MAP_EMAIL           "[email protected]"
  !define MAP_COPYRIGHT       "Copyright (C) 2008 GPSFileDepot.com"
  !define MAP_VERSION         "1.0"
  !define MAP_REL_DATE        "21 Jul 2008"
  !define MAP_ID              C10C             ; Family ID = 4644 (dec) = 1224 (hex) = 2412 (hex flipped) --> http://www.geocities.com/binary_converter/
;  !define MAP_TYPE            11224          ; only if using custom types
  !define DIRECTORY  "C:\gps_maps\mississippi_topo\release_version_1.00\"
  !define EXE_FILE            "${DIRECTORY}mstopo_install.exe"

;  !define INSTALL_ICON        "C:\gps_maps\arizona_topo\complete\favicon.ico"
;  !define INSTALL_IMAGE       "C:\gps_maps\left_header.bmp"
;  !define INSTALL_LICENSE     "C:\gps_maps\license.txt"
;  !define INSTALL_README      "$INSTDIR\readme.txt"
;  !define INSTALL_MSG         "${MAP_DESC_NAME} - Maps for Garmin GPS Units$\r$\n${MAP_URL}$\r$\nVersion ${MAP_VERSION} - ${MAP_REL_DATE}$\r$\n$\r$\n$\r$\nPlease email ${MAP_EMAIL} with any questions or comments or if you paid for this map.$\r$\n$\r$\n$\r$\n${MAP_COPYRIGHT}$\r$\nThis software is provided 'as-is', without any express or implied warranty.  In no event will the author(s) be held liable for any damages arising from the use of this software."
  !define INSTALL_MSG         "This wizard will guide you through the installation of ${MAP_DESC_NAME} version ${MAP_VERSION} (${MAP_REL_DATE}) for Garmin GPS Units.$\r$\n$\r$\n${MAP_URL}$\r$\n$\r$\nPlease email ${MAP_EMAIL} with any questions or comments or if you paid for this map.$\r$\n$\r$\nIt is recommended that you close all other applications before starting Setup.  This will make it possible to update relevant system files without having to reboot your computer.$\r$\n$\r$\nClick Next to continue."
 
; Setup installer
  Name       "${MAP_DESC_NAME}"
  OutFile    ${EXE_FILE}
  InstallDir "$PROGRAMFILES\${MAP_SHORT_NAME}"
  BrandingText " "

;--------------------------------
;Interface Settings
;--------------------------------
  !define MUI_ABORTWARNING
;  !define MUI_ICON   ${INSTALL_ICON}
;  !define MUI_UNICON ${INSTALL_ICON}

;--------------------------------
;Pages
;--------------------------------
; Generic welcome screen (optional)
;  !define MUI_WELCOMEFINISHPAGE_BITMAP ${INSTALL_IMAGE}
;  !insertmacro MUI_PAGE_WELCOME

; Custom welcome screen (optional)
  !define MUI_WELCOMEPAGE_TITLE "Welcome to the ${MAP_DESC_NAME} Setup Wizard"
  !define MUI_WELCOMEPAGE_TEXT "${INSTALL_MSG}"
  !insertmacro MUI_PAGE_WELCOME

;  !define MUI_LICENSEPAGE_CHECKBOX
;  !insertmacro MUI_PAGE_LICENSE "${INSTALL_LICENSE}"

; Installation directory dialog
  !insertmacro MUI_PAGE_DIRECTORY

; Installation
  !insertmacro MUI_PAGE_INSTFILES
  
; Readme (optional)
;  !define MUI_FINISHPAGE_SHOWREADME "${INSTALL_README}"
  !insertmacro MUI_PAGE_FINISH

  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES

;--------------------------------
;Languages
;--------------------------------
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
; The stuff to install
;--------------------------------
Section "Install"
;remove the old version first
  ReadRegStr $R0 HKLM \
  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" \
  "UninstallString"
  StrCmp $R0 "" done
 
  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
  "${MAP_DESC_NAME} is already installed. $\n$\nClick `OK` to remove the \
  previous version and upgrade or `Cancel` to cancel this upgrade." \
  IDOK uninst
  Abort
 
;Run the uninstaller
uninst:
  ClearErrors
  ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
 
  IfErrors no_remove_uninstaller
    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
    ;here to remove the uninstaller. Use a registry key to check
    ;whether the user has chosen to uninstall. If you are using an uninstaller
    ;components page, make sure all sections are uninstalled.
  no_remove_uninstaller:
 
done:
; Set output path to the installation directory.
  SetOutPath $INSTDIR
  
; Source files for creating installation
  File /a "${DIRECTORY}${MAP_SHORT_NAME}.tdb"
  File /a "${DIRECTORY}${MAP_SHORT_NAME}.img"
;  File /a "..\garmin\types\${MAP_TYPE}.typ"    ; only if using custom type
;  File /a ".\readme.txt"
  File /a "${DIRECTORY}*.img"

  ;*****************************************************************************************************************
  ;This part determines if the OS is 32 or 64 bit and executes the needed function
  ;*****************************************************************************************************************
  StrCpy $0 0
  ClearErrors ; reset error flags
  IfFileExists C:\Windows\SysWOW64\*.* +1 +3 ;check for folder that only occurs on 64 bit systems
  Call .win7 ; if folder is there call the 64 bit function
  Goto fin   ; move to Label fin:
  Call .winxp ; if folder is not there call the 32 bit function
  
  fin: ;ends section after 64 bit reg entries are written
 
  ;*****************************************************************************************************************
SectionEnd

;--------------------------------
; Uninstaller
;--------------------------------
Section "Uninstall"

; Remove registry keys
  DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}"
  DeleteRegKey HKLM "SOFTWARE\${MAP_SHORT_NAME}"
  DeleteRegKey HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}"

; Remove files and uninstaller
  Delete $INSTDIR\*.*
  Delete $INSTDIR\uninstall.exe

; Remove directories used
  RMDir "$INSTDIR"
  
SectionEnd

;*************************FUNCTIONS********************************************
;******************************************************************************
;****************This function writes the 64 Bit registry entries**************
;******************************************************************************
Function .win7

 ; Write the installation path into the registry
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Install_Dir" "$INSTDIR"
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Version"     "${MAP_VERSION}"

; Write the MapSource configuration into the registry
  WriteRegBin   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "ID"    ${MAP_ID}
;  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "TYP"   "$INSTDIR\${MAP_TYPE}.typ"     ; only if using custom type

  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "LOC"   "$INSTDIR\"
  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "BMAP"  "$INSTDIR\${MAP_SHORT_NAME}.img"
  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "TDB"   "$INSTDIR\${MAP_SHORT_NAME}.tdb"

; Write the uninstall keys for Windows
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "DisplayName"     "${MAP_DESC_NAME}"
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoModify" 1
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoRepair" 1

  WriteUninstaller "uninstall.exe"
  
   FunctionEnd
  
;******************************************************************************
;****************This function writes the 32 Bit registry entries**************
;******************************************************************************
Function .winxp

 ; Write the installation path into the registry
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Install_Dir" "$INSTDIR"
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Version"     "${MAP_VERSION}"

; Write the MapSource configuration into the registry
  WriteRegBin   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "ID"    ${MAP_ID}
;  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "TYP"   "$INSTDIR\${MAP_TYPE}.typ"     ; only if using custom type

  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "LOC"   "$INSTDIR\"
  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "BMAP"  "$INSTDIR\${MAP_SHORT_NAME}.img"
  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "TDB"   "$INSTDIR\${MAP_SHORT_NAME}.tdb"

; Write the uninstall keys for Windows
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "DisplayName"     "${MAP_DESC_NAME}"
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoModify" 1
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoRepair" 1

  WriteUninstaller "uninstall.exe"
 
Functionend
;**********************************************

9
Map Making Support / Re: Problem with NSIS and registry entries
« on: March 01, 2010, 02:33:43 AM »
Hi Oz
Your correct the script I posted will only work in 64 bit windows. Since NSIS scripts can read/write to the registry and also can check conditions (if statements), I think I can have the script check the bit type then load the 32 bit or the 64 bit reg entries based on the result of the condition check. NSIS has a registry plug-in that should make this easy.
http://nsis.sourceforge.net/Registry_plug-in
I am going to start  making the changes to the script as soon as I figure out how to get the OS bit type from the registry. I think I can just check for the Wow6432Node folder and if if the check returns true install the 64 bit reg entries and if not install the 32 bit reg entries.
Freecat

10
Since I could find very little information about loading custom types into gpsmapedit I thought I would make a mini How-to on loading the custom types and how to get the same result you see in mapedit onto your map.

Make custom type .txt file
1- Create your custom types-I used GenTyp
2- Find unused types such as 0x11, 0x12, 0x30 to set your custom types to
3- Save typ file as a .txt file (do not check compile)

Setup mapedit to display the custom types
4- In gpsmapedit open your map
5- Click view>manage map skins
6- Click add and choose the .txt file you just made. ( 2 files will load day/night)
7- Now you can create or modify type on your objects to the custom type like you would for any other type and gpsmapedit will display it

Compile custom types into finished map
8- After creating your .img file open Mapsettoolkit
9- Choose your .img file
10- In the type files box, browse to your custom type .txt file choose it and check the compile box
11- Click start and your custom types will be added to the .img file/installer

And thats it  ;D the maps I have done this way have loaded correctly into mapsource and into my GPS

Note---------- GPS units have limited and ??different?? color pallets so colors that display correctly in mapsource may change  when the map is loaded into the GPS. for example one purple color i used always shows up blue on my GPS.

Anyways I hope this helps save someone a little time and I will edit in the future if I can think of anything else to add

=^_^=Freecat=^_^=

11
Map Making Support / Re: Problem with NSIS and registry entries
« on: February 25, 2010, 06:30:53 AM »
I got everything working fine in xp with the original .nsi file. It must have been a issue with my mapsource install. Once I un.../reinstalled and updated mapsource my map installed without a issue, both with and without custom types.
Oz thanks for your help and for making the .nsi script. If not for this site :) and folks like you this type of project would be much more difficult to complete.

=^_^= Freecat=^_^=

12
Map Making Support / Re: Problem with NSIS and registry entries
« on: February 25, 2010, 05:47:38 AM »
NSIS Installer worked just fine with my map both with and without custom types. I think the script can be  modified the to check the registry and use the correct set of reg entries for the OS that it is being installed into. The NSIS registry plug-in looks like it is able to do this. I could give it a try but I am sure Oz can do it better.
Next I have to sort out my  previously mentioned issues on XP  WEEEEEEEEEE fun :-\

Below is a copy of the original .nsi script with only the registry changes made if anyone needs a copy: 
Code: [Select]
;--------------------------------
; install.nsi*********************** FOR WINDOWS 7 64 BIT***************************************
;--------------------------------
  !include "MUI2.nsh"

; Configuration parameters
  !define MAP_DESC_NAME       "Mississippi Topo Map"
  !define MAP_SHORT_NAME      "Mississippi Topo"
  !define MAP_URL             "http://www.gpsfiledepot.com/"
  !define MAP_EMAIL           "[email protected]"
  !define MAP_COPYRIGHT       "Copyright (C) 2008 GPSFileDepot.com"
  !define MAP_VERSION         "1.0"
  !define MAP_REL_DATE        "21 Jul 2008"
  !define MAP_ID              C10C             ; Family ID = 4644 (dec) = 1224 (hex) = 2412 (hex flipped) --> http://www.geocities.com/binary_converter/
;  !define MAP_TYPE            11224          ; only if using custom types
  !define DIRECTORY   "C:\gps_maps\mississippi_topo\release_version_1.00\"
  !define EXE_FILE            "${DIRECTORY}mstopo_install.exe"

;  !define INSTALL_ICON        "C:\gps_maps\arizona_topo\complete\favicon.ico"
;  !define INSTALL_IMAGE       "C:\gps_maps\left_header.bmp"
;  !define INSTALL_LICENSE     "C:\gps_maps\license.txt"
;  !define INSTALL_README      "$INSTDIR\readme.txt"
;  !define INSTALL_MSG         "${MAP_DESC_NAME} - Maps for Garmin GPS Units$\r$\n${MAP_URL}$\r$\nVersion ${MAP_VERSION} - ${MAP_REL_DATE}$\r$\n$\r$\n$\r$\nPlease email ${MAP_EMAIL} with any questions or comments or if you paid for this map.$\r$\n$\r$\n$\r$\n${MAP_COPYRIGHT}$\r$\nThis software is provided 'as-is', without any express or implied warranty.  In no event will the author(s) be held liable for any damages arising from the use of this software."
  !define INSTALL_MSG         "This wizard will guide you through the installation of ${MAP_DESC_NAME} version ${MAP_VERSION} (${MAP_REL_DATE}) for Garmin GPS Units.$\r$\n$\r$\n${MAP_URL}$\r$\n$\r$\nPlease email ${MAP_EMAIL} with any questions or comments or if you paid for this map.$\r$\n$\r$\nIt is recommended that you close all other applications before starting Setup.  This will make it possible to update relevant system files without having to reboot your computer.$\r$\n$\r$\nClick Next to continue."
 

; Setup installer
  Name       "${MAP_DESC_NAME}"
  OutFile    ${EXE_FILE}
  InstallDir "$PROGRAMFILES\${MAP_SHORT_NAME}"
  BrandingText " "

;--------------------------------
;Interface Settings
;--------------------------------
  !define MUI_ABORTWARNING
;  !define MUI_ICON   ${INSTALL_ICON}
;  !define MUI_UNICON ${INSTALL_ICON}

;--------------------------------
;Pages
;--------------------------------
; Generic welcome screen (optional)
;  !define MUI_WELCOMEFINISHPAGE_BITMAP ${INSTALL_IMAGE}
;  !insertmacro MUI_PAGE_WELCOME

; Custom welcome screen (optional)
  !define MUI_WELCOMEPAGE_TITLE "Welcome to the ${MAP_DESC_NAME} Setup Wizard"
  !define MUI_WELCOMEPAGE_TEXT "${INSTALL_MSG}"
  !insertmacro MUI_PAGE_WELCOME

;  !define MUI_LICENSEPAGE_CHECKBOX
;  !insertmacro MUI_PAGE_LICENSE "${INSTALL_LICENSE}"

; Installation directory dialog
  !insertmacro MUI_PAGE_DIRECTORY

; Installation
  !insertmacro MUI_PAGE_INSTFILES
 
; Readme (optional)
;  !define MUI_FINISHPAGE_SHOWREADME "${INSTALL_README}"
  !insertmacro MUI_PAGE_FINISH

  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES

;--------------------------------
;Languages
;--------------------------------
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
; The stuff to install
;--------------------------------
Section "Install"
;remove the old version first
  ReadRegStr $R0 HKLM \
  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" \
  "UninstallString"
  StrCmp $R0 "" done
 
  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
  "${MAP_DESC_NAME} is already installed. $\n$\nClick `OK` to remove the \
  previous version and upgrade or `Cancel` to cancel this upgrade." \
  IDOK uninst
  Abort
 
;Run the uninstaller
uninst:
  ClearErrors
  ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
 
  IfErrors no_remove_uninstaller
    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
    ;here to remove the uninstaller. Use a registry key to check
    ;whether the user has chosen to uninstall. If you are using an uninstaller
    ;components page, make sure all sections are uninstalled.
  no_remove_uninstaller:
 
done:
; Set output path to the installation directory.
  SetOutPath $INSTDIR
 
; Source files for creating installation
  File /a "${DIRECTORY}${MAP_SHORT_NAME}.tdb"
  File /a "${DIRECTORY}${MAP_SHORT_NAME}.img"
;  File /a "..\garmin\types\${MAP_TYPE}.typ"    ; only if using custom type
;  File /a ".\readme.txt"
  File /a "${DIRECTORY}*.img"

; Write the installation path into the registry
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Install_Dir" "$INSTDIR"
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Version"     "${MAP_VERSION}"

; Write the MapSource configuration into the registry
  WriteRegBin   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "ID"    ${MAP_ID}
;  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "TYP"   "$INSTDIR\${MAP_TYPE}.typ"     ; only if using custom type

  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "LOC"   "$INSTDIR\"
  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "BMAP"  "$INSTDIR\${MAP_SHORT_NAME}.img"
  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "TDB"   "$INSTDIR\${MAP_SHORT_NAME}.tdb"

; Write the uninstall keys for Windows
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "DisplayName"     "${MAP_DESC_NAME}"
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoModify" 1
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoRepair" 1

  WriteUninstaller "uninstall.exe"
SectionEnd

;--------------------------------
; Uninstaller
;--------------------------------
Section "Uninstall"

; Remove registry keys
  DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}"
  DeleteRegKey HKLM "SOFTWARE\${MAP_SHORT_NAME}"
  DeleteRegKey HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}"

; Remove files and uninstaller
  Delete $INSTDIR\*.*
  Delete $INSTDIR\uninstall.exe

; Remove directories used
  RMDir "$INSTDIR"
SectionEnd

13
Map Making Support / Re: Problem with NSIS and registry entries
« on: February 25, 2010, 05:11:22 AM »
 ;D Ok problem solved the registry locations are wrong in the map_install.nis file

OLD FILE:
Code: [Select]
; Write the installation path into the registry
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Install_Dir" "$INSTDIR"
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Version"     "${MAP_VERSION}"

; Write the MapSource configuration into the registry
  WriteRegBin   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "ID"    ${MAP_ID}
  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "TYP"   "$INSTDIR\${MAP_TYPE}.typ"     ; only if using custom type

  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "LOC"   "$INSTDIR\"
  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "BMAP"  "$INSTDIR\${MAP_SHORT_NAME}.img"
  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "TDB"   "$INSTDIR\${MAP_SHORT_NAME}.tdb"

; Write the uninstall keys for Windows
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "DisplayName"     "${MAP_DESC_NAME}"
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoModify" 1
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoRepair" 1

  WriteUninstaller "uninstall.exe"
SectionEnd

NEW FILE
Code: [Select]
; Write the installation path into the registry
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Install_Dir" "$INSTDIR"
  WriteRegStr   HKLM "SOFTWARE\${MAP_SHORT_NAME}" "Version"     "${MAP_VERSION}"

; Write the MapSource configuration into the registry
  WriteRegBin   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "ID"    ${MAP_ID}
;  WriteRegStr   HKLM "SOFTWARE\Garmin\MapSource\Families\${MAP_SHORT_NAME}"   "TYP"   "$INSTDIR\${MAP_TYPE}.typ"     ; only if using custom type

  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "LOC"   "$INSTDIR\"
  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "BMAP"  "$INSTDIR\${MAP_SHORT_NAME}.img"
  WriteRegStr   HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${MAP_SHORT_NAME}\1" "TDB"   "$INSTDIR\${MAP_SHORT_NAME}.tdb"

; Write the uninstall keys for Windows
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "DisplayName"     "${MAP_DESC_NAME}"
  WriteRegStr   HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoModify" 1
  WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MAP_SHORT_NAME}" "NoRepair" 1

  WriteUninstaller "uninstall.exe"
SectionEnd

Notice the only change is Wow6432Node folder entry. The test was done with a known working image of 1 24000 quad and the installer was run normally without admin rights in Win7 64B. The uninstaller works ok and removes all the associated registry entires.  Next I am going to test this on my map and will update this thread when I get done but I expect it to work.
Freecat

14
Map Making Support / Re: Problem with NSIS and registry entries
« on: February 25, 2010, 04:45:34 AM »
Thanks for all the help everyone. Oz I have run the installer as administrator and get the same behavior. I am going to create a small test mapset and go though everything again to see if i messed up somewhere. Will post what happens in a little while.
Freecat

15
Map Making Support / Re: Problem with NSIS and registry entries
« on: February 24, 2010, 01:28:40 PM »
I just rebuilt my installer package with Clickteam's Install Creator and got the same behavior as NSIS. Then I set the installer to run the .reg file as visible at the end of the install process. Now at the last installer window a box pops up asking for permission to add to the registry, click ok  and the .reg entries installed ok and mapsource loads the maps perfectly  ;D. This worked with both standard and custom types but it's not as clean as having the installer write them. I am going to keep messing with NSIS and see if I can get it to work correctly.

Pages: [1] 2
anything