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