Advertisement
Guest User

Untitled

a guest
Sep 30th, 2011
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.80 KB | None | 0 0
  1. Index: src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java
  2. ===================================================================
  3. --- src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java    (revision 2039)
  4. +++ src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java    (working copy)
  5. @@ -114,6 +114,8 @@
  6.                     writeDefines(pw);
  7.                 else if (strLine.contains("INSERT_REGBIN_HERE"))
  8.                     writeRegBin(pw);
  9. +               else if (strLine.contains("INSERT_REGBIN_64_HERE"))
  10. +                   writeRegBin64(pw);
  11.                 else if (strLine.contains("INSERT_ADDED_FILES_HERE"))
  12.                     writeAddedFiles(pw);
  13.                 else if (strLine.contains("INSERT_REMOVED_FILES_HERE"))
  14. @@ -145,6 +147,10 @@
  15.         // Ideally we should have a define for the family value but NSIS won't allow "hexadecimal" variables
  16.         pw.format(Locale.ROOT, "  WriteRegBin HKLM \"SOFTWARE\\Garmin\\MapSource\\Families\\${REG_KEY}\" \"ID\" %s\n", id);
  17.  } 
  18. +   private void writeRegBin64(PrintWriter pw) {
  19. +       // Ideally we should have a define for the family value but NSIS won't allow "hexadecimal" variables
  20. +       pw.format(Locale.ROOT, "  WriteRegBin HKLM \"SOFTWARE\\Wow6432Node\\Garmin\\MapSource\\Families\\${REG_KEY}\" \"ID\" %s\n", id);
  21. +} 
  22.            
  23.     private void writeAddedFiles(PrintWriter pw) {
  24.             pw.format(Locale.ROOT, "  File \"${MAPNAME}.img\"\n");
  25. Index: resources/installer/installer_template.nsi
  26. ===================================================================
  27. --- resources/installer/installer_template.nsi  (revision 2039)
  28. +++ resources/installer/installer_template.nsi  (working copy)
  29. @@ -78,6 +78,24 @@
  30.  ; INSERT_ADDED_FILES_HERE
  31.  
  32.  ; Create MapSource registry keys
  33. +  ReadRegStr $R0 HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Products" "InstallDir"
  34. +  IfErrors system_x86
  35. +; system_64
  36. +; INSERT_REGBIN_64_HERE
  37. +!ifdef INDEX  
  38. +  WriteRegStr HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}" "IDX" "$INSTDIR\${MAPNAME}.mdx"
  39. +  WriteRegStr HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}" "MDR" "$INSTDIR\${MAPNAME}_mdr.img"
  40. +!endif
  41. +!ifdef TYPNAME  
  42. +  WriteRegStr HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}" "TYP" "$INSTDIR\${TYPNAME}"
  43. +!endif
  44. +  WriteRegStr HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "BMAP" "$INSTDIR\${MAPNAME}.img"
  45. +  WriteRegStr HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "LOC" "$INSTDIR"
  46. +  WriteRegStr HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "TDB" "$INSTDIR\${MAPNAME}.tdb"
  47. +  
  48. +  goto mainreg_done
  49. +
  50. +  system_x86:
  51.  ; INSERT_REGBIN_HERE
  52.  !ifdef INDEX  
  53.    WriteRegStr HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}" "IDX" "$INSTDIR\${MAPNAME}.mdx"
  54. @@ -89,6 +107,8 @@
  55.    WriteRegStr HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "BMAP" "$INSTDIR\${MAPNAME}.img"
  56.    WriteRegStr HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "LOC" "$INSTDIR"
  57.    WriteRegStr HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "TDB" "$INSTDIR\${MAPNAME}.tdb"
  58. +
  59. +  mainreg_done:
  60.    
  61.  ; Write uninstaller
  62.    WriteUninstaller "$INSTDIR\Uninstall.exe"
  63. @@ -107,6 +127,25 @@
  64.    RmDir "$INSTDIR"
  65.  
  66.  ; Registry cleanup
  67. +  ReadRegStr $R0 HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Products" "InstallDir"
  68. +  IfErrors clean_system_x86
  69. +
  70. +  DeleteRegValue HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}" "ID"
  71. +!ifdef INDEX  
  72. +  DeleteRegValue HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}" "IDX"
  73. +  DeleteRegValue HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}" "MDR"
  74. +!endif
  75. +!ifdef TYPNAME  
  76. +  DeleteRegValue HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}" "TYP"
  77. +!endif
  78. +  DeleteRegValue HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "BMAP"
  79. +  DeleteRegValue HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "LOC"
  80. +  DeleteRegValue HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "TDB"
  81. +  DeleteRegKey /IfEmpty HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}"
  82. +  DeleteRegKey /IfEmpty HKLM "SOFTWARE\Wow6432Node\Garmin\MapSource\Families\${REG_KEY}"
  83. +
  84. +  goto clean_done
  85. +  clean_system_x86:
  86.    DeleteRegValue HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}" "ID"
  87.  !ifdef INDEX  
  88.    DeleteRegValue HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}" "IDX"
  89. @@ -120,6 +159,7 @@
  90.    DeleteRegValue HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}" "TDB"
  91.    DeleteRegKey /IfEmpty HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}\${PRODUCT_ID}"
  92.    DeleteRegKey /IfEmpty HKLM "SOFTWARE\Garmin\MapSource\Families\${REG_KEY}"
  93. +  clean_done:
  94.    
  95.    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${REG_KEY}"
  96.  
  97.  
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement