[2601] | 1 | ;
|
---|
| 2 | ; openstreetmap.nsi
|
---|
| 3 | ;
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | ; Set the compression mechanism first.
|
---|
| 7 | ; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
|
---|
| 8 | ; is no longer the default, so use the /SOLID switch.
|
---|
| 9 | ; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
|
---|
| 10 | ; So if you get an error here, please update to at least NSIS 2.07!
|
---|
| 11 | SetCompressor /SOLID lzma
|
---|
| 12 |
|
---|
| 13 | ; work with JAVA ini strings
|
---|
| 14 | !include "INIStrNS.nsh"
|
---|
| 15 |
|
---|
| 16 | !define VERSION "0.0.5"
|
---|
| 17 | !define DEST "openstreetmap"
|
---|
| 18 |
|
---|
| 19 | InstType "OpenStreetMap (full install)"
|
---|
| 20 |
|
---|
| 21 | InstType "un.Default (keep Personal Settings and plugins)"
|
---|
| 22 | InstType "un.All (remove all)"
|
---|
| 23 |
|
---|
| 24 | ; Used to refresh the display of file association
|
---|
| 25 | !define SHCNE_ASSOCCHANGED 0x08000000
|
---|
| 26 | !define SHCNF_IDLIST 0
|
---|
| 27 |
|
---|
| 28 | ; Used to add associations between file extensions and JOSM
|
---|
| 29 | !define OSM_ASSOC "josm-file"
|
---|
| 30 |
|
---|
| 31 | ; ============================================================================
|
---|
| 32 | ; Header configuration
|
---|
| 33 | ; ============================================================================
|
---|
| 34 | ; The name of the installer
|
---|
| 35 | !define PROGRAM_NAME "OpenStreetMap"
|
---|
| 36 |
|
---|
| 37 | Name "${PROGRAM_NAME} ${VERSION}"
|
---|
| 38 |
|
---|
| 39 | ; The file to write
|
---|
| 40 | OutFile "${DEST}-setup-${VERSION}.exe"
|
---|
| 41 |
|
---|
| 42 | ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
|
---|
| 43 | !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following OpenStreetMap installation will be uninstalled. Click 'Next' to continue."
|
---|
| 44 |
|
---|
| 45 | XPStyle on
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 |
|
---|
| 49 | ; ============================================================================
|
---|
| 50 | ; Modern UI
|
---|
| 51 | ; ============================================================================
|
---|
| 52 |
|
---|
| 53 | !include "MUI.nsh"
|
---|
| 54 | ;!addplugindir ".\Plugins"
|
---|
| 55 |
|
---|
| 56 | ; Icon of installer and uninstaller
|
---|
| 57 | !define MUI_ICON "logo.ico"
|
---|
| 58 | !define MUI_UNICON "logo.ico"
|
---|
| 59 |
|
---|
| 60 | !define MUI_COMPONENTSPAGE_SMALLDESC
|
---|
| 61 | !define MUI_FINISHPAGE_NOAUTOCLOSE
|
---|
| 62 | !define MUI_UNFINISHPAGE_NOAUTOCLOSE
|
---|
| 63 | !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of OpenStreetMap.\r\n\r\nBefore starting the installation, make sure any OpenStreetMap applications are not running.\r\n\r\nClick 'Next' to continue."
|
---|
| 64 | ;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
|
---|
| 65 | ;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
|
---|
| 66 |
|
---|
| 67 | ; NSIS shows Readme files by opening the Readme file with the default application for
|
---|
| 68 | ; the file's extension. "README.win32" won't work in most cases, because extension "win32"
|
---|
| 69 | ; is usually not associated with an appropriate text editor. We should use extension "txt"
|
---|
| 70 | ; for a text file or "html" for an html README file.
|
---|
| 71 | ;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
|
---|
| 72 | ;!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
|
---|
| 73 | ;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
---|
| 74 | !define MUI_FINISHPAGE_RUN "$INSTDIR\josm.exe"
|
---|
| 75 | ;!define MUI_FINISHPAGE_RUN_NOTCHECKED
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 | ;!define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
|
---|
| 80 |
|
---|
| 81 | ; ============================================================================
|
---|
| 82 | ; MUI Pages
|
---|
| 83 | ; ============================================================================
|
---|
| 84 |
|
---|
| 85 | !insertmacro MUI_PAGE_WELCOME
|
---|
| 86 | !insertmacro MUI_PAGE_LICENSE "downloads\LICENSE"
|
---|
| 87 | !insertmacro MUI_PAGE_COMPONENTS
|
---|
| 88 | ;Page custom DisplayAdditionalTasksPage
|
---|
| 89 | !insertmacro MUI_PAGE_DIRECTORY
|
---|
| 90 | !insertmacro MUI_PAGE_INSTFILES
|
---|
| 91 | !insertmacro MUI_PAGE_FINISH
|
---|
| 92 |
|
---|
| 93 | !insertmacro MUI_UNPAGE_WELCOME
|
---|
| 94 | !insertmacro MUI_UNPAGE_CONFIRM
|
---|
| 95 | !insertmacro MUI_UNPAGE_COMPONENTS
|
---|
| 96 | !insertmacro MUI_UNPAGE_INSTFILES
|
---|
| 97 | !insertmacro MUI_UNPAGE_FINISH
|
---|
| 98 |
|
---|
| 99 | ; ============================================================================
|
---|
| 100 | ; MUI Languages
|
---|
| 101 | ; ============================================================================
|
---|
| 102 |
|
---|
| 103 | !insertmacro MUI_LANGUAGE "English"
|
---|
| 104 |
|
---|
| 105 | ; ============================================================================
|
---|
| 106 | ; Reserve Files
|
---|
| 107 | ; ============================================================================
|
---|
| 108 |
|
---|
| 109 | ;Things that need to be extracted on first (keep these lines before any File command!)
|
---|
| 110 | ;Only useful for BZIP2 compression
|
---|
| 111 |
|
---|
| 112 | ; ReserveFile "AdditionalTasksPage.ini"
|
---|
| 113 | !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
---|
| 114 |
|
---|
| 115 | ; ============================================================================
|
---|
| 116 | ; Section macros
|
---|
| 117 | ; ============================================================================
|
---|
| 118 | !include "Sections.nsh"
|
---|
| 119 |
|
---|
| 120 | ; ========= Macro to unselect and disable a section =========
|
---|
| 121 |
|
---|
| 122 | !macro DisableSection SECTION
|
---|
| 123 |
|
---|
| 124 | Push $0
|
---|
| 125 | SectionGetFlags "${SECTION}" $0
|
---|
| 126 | IntOp $0 $0 & ${SECTION_OFF}
|
---|
| 127 | IntOp $0 $0 | ${SF_RO}
|
---|
| 128 | SectionSetFlags "${SECTION}" $0
|
---|
| 129 | Pop $0
|
---|
| 130 |
|
---|
| 131 | !macroend
|
---|
| 132 |
|
---|
| 133 | ; ========= Macro to enable (unreadonly) a section =========
|
---|
| 134 | !define SECTION_ENABLE 0xFFFFFFEF
|
---|
| 135 | !macro EnableSection SECTION
|
---|
| 136 |
|
---|
| 137 | Push $0
|
---|
| 138 | SectionGetFlags "${SECTION}" $0
|
---|
| 139 | IntOp $0 $0 & ${SECTION_ENABLE}
|
---|
| 140 | SectionSetFlags "${SECTION}" $0
|
---|
| 141 | Pop $0
|
---|
| 142 |
|
---|
| 143 | !macroend
|
---|
| 144 |
|
---|
| 145 | ; ============================================================================
|
---|
| 146 | ; Command Line
|
---|
| 147 | ; ============================================================================
|
---|
| 148 | !include "FileFunc.nsh"
|
---|
| 149 |
|
---|
| 150 | ;!insertmacro GetParameters
|
---|
| 151 | ;!insertmacro GetOptions
|
---|
| 152 |
|
---|
| 153 | ; ============================================================================
|
---|
| 154 | ; Directory selection page configuration
|
---|
| 155 | ; ============================================================================
|
---|
| 156 | ; The text to prompt the user to enter a directory
|
---|
| 157 | DirText "Choose a directory in which to install OpenStreeMap."
|
---|
| 158 |
|
---|
| 159 | ; The default installation directory
|
---|
| 160 | InstallDir $PROGRAMFILES\OpenStreetMap\
|
---|
| 161 |
|
---|
| 162 | ; See if this is an upgrade; if so, use the old InstallDir as default
|
---|
| 163 | InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\OpenStreetMap "InstallDir"
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | ; ============================================================================
|
---|
| 167 | ; Install page configuration
|
---|
| 168 | ; ============================================================================
|
---|
| 169 | ShowInstDetails show
|
---|
| 170 | ShowUninstDetails show
|
---|
| 171 |
|
---|
| 172 | ; ============================================================================
|
---|
| 173 | ; Functions and macros
|
---|
| 174 | ; ============================================================================
|
---|
| 175 |
|
---|
| 176 | ; update file extension icons
|
---|
| 177 | !macro UpdateIcons
|
---|
| 178 | Push $R0
|
---|
| 179 | Push $R1
|
---|
| 180 | Push $R2
|
---|
| 181 |
|
---|
| 182 | !define UPDATEICONS_UNIQUE ${__LINE__}
|
---|
| 183 |
|
---|
| 184 | IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
|
---|
| 185 | UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
|
---|
| 186 | GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
|
---|
| 187 | IntOp $R2 $R0 / 0x00010000
|
---|
| 188 | IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
|
---|
| 189 | UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
|
---|
| 190 | System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
|
---|
| 191 | Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
|
---|
| 192 |
|
---|
| 193 | UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
|
---|
| 194 | MessageBox MB_OK|MB_ICONSTOP "Can't find 'shell32.dll' library. Impossible to update icons"
|
---|
| 195 | Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
|
---|
| 196 | UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
|
---|
| 197 | MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update OpenStreetMap file icons"
|
---|
| 198 | Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
|
---|
| 199 | UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
|
---|
| 200 | !undef UPDATEICONS_UNIQUE
|
---|
| 201 | Pop $R2
|
---|
| 202 | Pop $R1
|
---|
| 203 | Pop $R0
|
---|
| 204 |
|
---|
| 205 | !macroend
|
---|
| 206 |
|
---|
| 207 | ; associate a file extension to an icon
|
---|
| 208 | Function Associate
|
---|
| 209 | ; $R0 should contain the prefix to associate to OpenStreetMap
|
---|
| 210 | Push $R1
|
---|
| 211 |
|
---|
| 212 | ReadRegStr $R1 HKCR $R0 ""
|
---|
| 213 | StrCmp $R1 "" Associate.doRegister
|
---|
| 214 | Goto Associate.end
|
---|
| 215 | Associate.doRegister:
|
---|
| 216 | ;The extension is not associated to any program, we can do the link
|
---|
| 217 | WriteRegStr HKCR $R0 "" ${OSM_ASSOC}
|
---|
| 218 | Associate.end:
|
---|
| 219 | pop $R1
|
---|
| 220 | FunctionEnd
|
---|
| 221 |
|
---|
| 222 | ; disassociate a file extension from an icon
|
---|
| 223 | Function un.unlink
|
---|
| 224 | ; $R0 should contain the prefix to unlink
|
---|
| 225 | Push $R1
|
---|
| 226 |
|
---|
| 227 | ReadRegStr $R1 HKCR $R0 ""
|
---|
| 228 | StrCmp $R1 ${OSM_ASSOC} un.unlink.doUnlink
|
---|
| 229 | Goto un.unlink.end
|
---|
| 230 | un.unlink.doUnlink:
|
---|
| 231 | ; The extension is associated with OpenStreetMap so, we must destroy this!
|
---|
| 232 | DeleteRegKey HKCR $R0
|
---|
| 233 | un.unlink.end:
|
---|
| 234 | pop $R1
|
---|
| 235 | FunctionEnd
|
---|
| 236 |
|
---|
| 237 | Function .onInit
|
---|
| 238 | ;Extract InstallOptions INI files
|
---|
| 239 | ; !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
|
---|
| 240 | FunctionEnd
|
---|
| 241 |
|
---|
| 242 | ;Function DisplayAdditionalTasksPage
|
---|
| 243 | ; !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
|
---|
| 244 | ; !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
|
---|
| 245 | ;FunctionEnd
|
---|
| 246 |
|
---|
| 247 | ; ============================================================================
|
---|
| 248 | ; Installation execution commands
|
---|
| 249 | ; ============================================================================
|
---|
| 250 |
|
---|
| 251 | Section "-Required"
|
---|
| 252 | ;-------------------------------------------
|
---|
| 253 |
|
---|
| 254 | ;
|
---|
| 255 | ; Install for every user
|
---|
| 256 | ;
|
---|
| 257 | SectionIn 1 2 RO
|
---|
| 258 | SetShellVarContext all
|
---|
| 259 |
|
---|
| 260 | SetOutPath $INSTDIR
|
---|
| 261 |
|
---|
| 262 | ; Write the uninstall keys for Windows
|
---|
| 263 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayVersion" "${VERSION}"
|
---|
| 264 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayName" "OpenStreetMap ${VERSION}"
|
---|
| 265 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
---|
| 266 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "Publisher" "The OpenStreetMap developer community, http://www.openstreetmap.org/"
|
---|
| 267 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "HelpLink" "mailto:newbies@openstreetmap.org."
|
---|
| 268 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLInfoAbout" "http://www.openstreetmap.org/"
|
---|
| 269 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLUpdateInfo" "http://www.openstreetmap.org/"
|
---|
| 270 | WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoModify" 1
|
---|
| 271 | WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoRepair" 1
|
---|
| 272 | WriteUninstaller "uninstall.exe"
|
---|
| 273 |
|
---|
| 274 | ; Write an entry for ShellExecute
|
---|
| 275 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe" "" '$INSTDIR\josm.exe'
|
---|
| 276 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe" "Path" '$INSTDIR'
|
---|
| 277 |
|
---|
| 278 | ; Create start menu entries (depending on additional tasks page)
|
---|
| 279 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
|
---|
| 280 | ;StrCmp $0 "0" SecRequired_skip_StartMenu
|
---|
| 281 | ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
|
---|
| 282 | ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
|
---|
| 283 | CreateShortCut "$SMPROGRAMS\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
|
---|
| 284 | ;SecRequired_skip_StartMenu:
|
---|
| 285 |
|
---|
| 286 | ; is command line option "/desktopicon" set?
|
---|
| 287 | ;${GetParameters} $R0
|
---|
| 288 | ;${GetOptions} $R0 "/desktopicon=" $R1
|
---|
| 289 | ;StrCmp $R1 "no" SecRequired_skip_DesktopIcon
|
---|
| 290 | ;StrCmp $R1 "yes" SecRequired_install_DesktopIcon
|
---|
| 291 |
|
---|
| 292 | ; Create desktop icon (depending on additional tasks page and command line option)
|
---|
| 293 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
|
---|
| 294 | ;StrCmp $0 "0" SecRequired_skip_DesktopIcon
|
---|
| 295 | ;SecRequired_install_DesktopIcon:
|
---|
| 296 | CreateShortCut "$DESKTOP\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
|
---|
| 297 | ;SecRequired_skip_DesktopIcon:
|
---|
| 298 |
|
---|
| 299 | ; is command line option "/quicklaunchicon" set?
|
---|
| 300 | ;${GetParameters} $R0
|
---|
| 301 | ;${GetOptions} $R0 "/quicklaunchicon=" $R1
|
---|
| 302 | ;StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
|
---|
| 303 | ;StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
|
---|
| 304 |
|
---|
| 305 | ; Create quick launch icon (depending on additional tasks page and command line option)
|
---|
| 306 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
|
---|
| 307 | ;StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
|
---|
| 308 | ;SecRequired_install_QuickLaunchIcon:
|
---|
| 309 | CreateShortCut "$QUICKLAUNCH\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
|
---|
| 310 | ;SecRequired_skip_QuickLaunchIcon:
|
---|
| 311 |
|
---|
| 312 | ; Create File Extensions (depending on additional tasks page)
|
---|
| 313 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
|
---|
| 314 | ;StrCmp $0 "0" SecRequired_skip_FileExtensions
|
---|
| 315 | WriteRegStr HKCR ${OSM_ASSOC} "" "OpenStreetMap data"
|
---|
| 316 | WriteRegStr HKCR "${OSM_ASSOC}\Shell\open\command" "" '"$INSTDIR\josm.exe" "%1"'
|
---|
| 317 | WriteRegStr HKCR "${OSM_ASSOC}\DefaultIcon" "" '"$INSTDIR\josm.exe",0'
|
---|
| 318 | push $R0
|
---|
| 319 | StrCpy $R0 ".osm"
|
---|
| 320 | Call Associate
|
---|
| 321 | StrCpy $R0 ".gpx"
|
---|
| 322 | Call Associate
|
---|
| 323 | ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
|
---|
| 324 | pop $R0
|
---|
| 325 | !insertmacro UpdateIcons
|
---|
| 326 | ;SecRequired_skip_FileExtensions:
|
---|
| 327 |
|
---|
| 328 | SectionEnd ; "Required"
|
---|
| 329 |
|
---|
| 330 |
|
---|
| 331 | Section "JOSM" SecJosm
|
---|
| 332 | ;-------------------------------------------
|
---|
| 333 | SectionIn 1
|
---|
| 334 | SetOutPath $INSTDIR
|
---|
| 335 | File "josm.exe"
|
---|
| 336 | SetShellVarContext current
|
---|
| 337 | SetOutPath "$APPDATA\JOSM"
|
---|
| 338 |
|
---|
| 339 | ; don't overwrite existing bookmarks
|
---|
| 340 | IfFileExists preferences dont_overwrite_bookmarks
|
---|
| 341 | File "bookmarks"
|
---|
| 342 | dont_overwrite_bookmarks:
|
---|
| 343 |
|
---|
| 344 | ; don't overwrite existing de_streets.xml file
|
---|
| 345 | IfFileExists de-streets.xml dont_overwrite_de_streets
|
---|
| 346 | File "de-streets.xml"
|
---|
| 347 | dont_overwrite_de_streets:
|
---|
| 348 |
|
---|
| 349 | ; write reasonable defaults for some preferences
|
---|
| 350 | ; XXX - some of this should be done in JOSM itself
|
---|
| 351 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "laf" "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
|
---|
| 352 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "download.osm" "true"
|
---|
| 353 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "layerlist.visible" "true"
|
---|
| 354 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "commandstack.visible" "true"
|
---|
| 355 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "propertiesdialog.visible" "true"
|
---|
| 356 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "draw.segment.direction" "true"
|
---|
| 357 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "projection" "org.openstreetmap.josm.data.projection.Epsg4326"
|
---|
| 358 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "osm-server.url" "http://www.openstreetmap.org/api"
|
---|
| 359 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "annotation.sources" "$APPDATA/JOSM/de-streets.xml"
|
---|
| 360 | SectionEnd
|
---|
| 361 |
|
---|
| 362 |
|
---|
| 363 | SectionGroup /e "Plugins" SecPluginsGroup
|
---|
| 364 |
|
---|
| 365 | Section "mappaint" SecMappaintPlugin
|
---|
| 366 | ;-------------------------------------------
|
---|
| 367 | SectionIn 1 2
|
---|
| 368 | SetShellVarContext current
|
---|
| 369 | SetOutPath $APPDATA\JOSM\plugins
|
---|
| 370 | File "downloads\mappaint.jar"
|
---|
| 371 | SetOutPath $APPDATA\JOSM\plugins\mappaint
|
---|
| 372 | File "downloads\elemstyles.xml"
|
---|
| 373 | SectionEnd
|
---|
| 374 |
|
---|
| 375 | Section "osmarender" SecOsmarenderPlugin
|
---|
| 376 | ;-------------------------------------------
|
---|
| 377 | SectionIn 1 2
|
---|
| 378 | SetShellVarContext current
|
---|
| 379 | SetOutPath $APPDATA\JOSM\plugins
|
---|
| 380 | File "downloads\osmarender.jar"
|
---|
| 381 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "osmarender.firefox" "$PROGRAMFILES\Mozilla Firefox\firefox.exe"
|
---|
| 382 | SectionEnd
|
---|
| 383 |
|
---|
| 384 | Section "WMS" SecWMSPlugin
|
---|
| 385 | ;-------------------------------------------
|
---|
| 386 | SectionIn 1 2
|
---|
| 387 | SetShellVarContext current
|
---|
| 388 | SetOutPath $APPDATA\JOSM\plugins
|
---|
| 389 | File "downloads\wmsplugin.jar"
|
---|
| 390 | SectionEnd
|
---|
| 391 |
|
---|
| 392 | SectionGroupEnd ; "Plugins"
|
---|
| 393 |
|
---|
| 394 | Section "-PluginSetting"
|
---|
| 395 | ;-------------------------------------------
|
---|
| 396 | ;MessageBox MB_OK "PluginSetting!" IDOK 0
|
---|
| 397 | SetShellVarContext current
|
---|
| 398 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "plugins" "mappaint,osmarender,wmsplugin"
|
---|
| 399 | SectionEnd
|
---|
| 400 |
|
---|
| 401 |
|
---|
| 402 | Section "Uninstall" un.SecUinstall
|
---|
| 403 | ;-------------------------------------------
|
---|
| 404 |
|
---|
| 405 | ;
|
---|
| 406 | ; UnInstall for every user
|
---|
| 407 | ;
|
---|
| 408 | SectionIn 1 2
|
---|
| 409 | SetShellVarContext all
|
---|
| 410 |
|
---|
| 411 | Delete "$INSTDIR\josm.exe"
|
---|
| 412 | Delete "$INSTDIR\uninstall.exe"
|
---|
| 413 | IfErrors 0 NoJOSMErrorMsg
|
---|
| 414 | MessageBox MB_OK "Please note: josm.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if josm.exe removed
|
---|
| 415 | Abort "Please note: josm.exe could not be removed, it's probably in use! Abort uninstall process!"
|
---|
| 416 | NoJOSMErrorMsg:
|
---|
| 417 |
|
---|
| 418 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM"
|
---|
| 419 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\josm.exe"
|
---|
| 420 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe"
|
---|
| 421 |
|
---|
| 422 | push $R0
|
---|
| 423 | StrCpy $R0 ".osm"
|
---|
| 424 | Call un.unlink
|
---|
| 425 | StrCpy $R0 ".gpx"
|
---|
| 426 | Call un.unlink
|
---|
| 427 | pop $R0
|
---|
| 428 |
|
---|
| 429 | DeleteRegKey HKCR ${OSM_ASSOC}
|
---|
| 430 | DeleteRegKey HKCR "${OSM_ASSOC}\Shell\open\command"
|
---|
| 431 | DeleteRegKey HKCR "${OSM_ASSOC}\DefaultIcon"
|
---|
| 432 | !insertmacro UpdateIcons
|
---|
| 433 |
|
---|
| 434 | Delete "$SMPROGRAMS\josm.lnk"
|
---|
| 435 | Delete "$DESKTOP\josm.lnk"
|
---|
| 436 | Delete "$QUICKLAUNCH\josm.lnk"
|
---|
| 437 |
|
---|
| 438 | RMDir "$INSTDIR"
|
---|
| 439 |
|
---|
| 440 | SectionEnd ; "Uinstall"
|
---|
| 441 |
|
---|
| 442 | Section /o "Un.Personal Settings" un.SecPersonalSettings
|
---|
| 443 | ;-------------------------------------------
|
---|
| 444 | SectionIn 2
|
---|
| 445 | SetShellVarContext current
|
---|
| 446 | Delete "$APPDATA\JOSM\preferences"
|
---|
| 447 | Delete "$APPDATA\JOSM\bookmarks"
|
---|
| 448 | RMDir "$APPDATA\JOSM"
|
---|
| 449 | SectionEnd
|
---|
| 450 |
|
---|
| 451 | Section /o "Un.Plugins" un.SecPlugins
|
---|
| 452 | ;-------------------------------------------
|
---|
| 453 | SectionIn 2
|
---|
| 454 | SetShellVarContext current
|
---|
| 455 | Delete "$APPDATA\JOSM\plugins\wmsplugin.jar"
|
---|
| 456 | Delete "$APPDATA\JOSM\plugins\osmarender.jar"
|
---|
| 457 | Delete "$APPDATA\JOSM\plugins\osmarender\*.*"
|
---|
| 458 | Delete "$APPDATA\JOSM\plugins\mappaint.jar"
|
---|
| 459 | Delete "$APPDATA\JOSM\plugins\mappaint\elemstyles.xml"
|
---|
| 460 | RMDir "$APPDATA\JOSM\plugins\osmarender"
|
---|
| 461 | RMDir "$APPDATA\JOSM\plugins\mappaint"
|
---|
| 462 | RMDir "$APPDATA\JOSM\plugins"
|
---|
| 463 | RMDir "$APPDATA\JOSM"
|
---|
| 464 | SectionEnd
|
---|
| 465 |
|
---|
| 466 |
|
---|
| 467 | Section "-Un.Finally"
|
---|
| 468 | ;-------------------------------------------
|
---|
| 469 | SectionIn 1 2
|
---|
| 470 | ; this test must be done after all other things uninstalled (e.g. Global Settings)
|
---|
| 471 | IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
|
---|
| 472 | MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
|
---|
| 473 | NoFinalErrorMsg:
|
---|
| 474 | SectionEnd
|
---|
| 475 |
|
---|
| 476 |
|
---|
| 477 | ; ============================================================================
|
---|
| 478 | ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
|
---|
| 479 | ; ============================================================================
|
---|
| 480 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
---|
| 481 | !insertmacro MUI_DESCRIPTION_TEXT ${SecJosm} "JOSM is the JAVA OpenStreetMap editor for .osm files."
|
---|
| 482 | !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Various JOSM plugins."
|
---|
| 483 | !insertmacro MUI_DESCRIPTION_TEXT ${SecMappaintPlugin} "An alternative renderer for the map with colouring, line thickness, icons after tags."
|
---|
| 484 | !insertmacro MUI_DESCRIPTION_TEXT ${SecOsmarenderPlugin} "Displays the current screen as nicely rendered SVG graphics in FireFox."
|
---|
| 485 | !insertmacro MUI_DESCRIPTION_TEXT ${SecWMSPlugin} "Display background images from Web Map Service (WMS) sources."
|
---|
| 486 | !insertmacro MUI_FUNCTION_DESCRIPTION_END
|
---|
| 487 |
|
---|
| 488 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
|
---|
| 489 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall JOSM."
|
---|
| 490 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences and bookmarks from your profile: $PROFILE."
|
---|
| 491 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all plugins."
|
---|
| 492 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
|
---|
| 493 |
|
---|
| 494 | ; ============================================================================
|
---|
| 495 | ; Callback functions
|
---|
| 496 | ; ============================================================================
|
---|
| 497 |
|
---|