[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
|
---|
[5798] | 62 | !define MUI_WELCOMEFINISHPAGE_BITMAP "josm-nsis-brand.bmp"
|
---|
[3771] | 63 | !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] | 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
|
---|
[5214] | 86 | !insertmacro MUI_PAGE_LICENSE "..\core\LICENSE"
|
---|
[2601] | 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
|
---|
[3771] | 160 | InstallDir $PROGRAMFILES\JOSM\
|
---|
[2601] | 161 |
|
---|
| 162 | ; See if this is an upgrade; if so, use the old InstallDir as default
|
---|
[3771] | 163 | InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\JOSM "InstallDir"
|
---|
[2601] | 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}:
|
---|
[3771] | 197 | MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update JOSM file icons"
|
---|
[2601] | 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
|
---|
[3771] | 209 | ; $R0 should contain the prefix to associate to JOSM
|
---|
[2601] | 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:
|
---|
[3771] | 231 | ; The extension is associated with JOSM so, we must destroy this!
|
---|
[2601] | 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}"
|
---|
[3771] | 264 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayName" "JOSM ${VERSION}"
|
---|
[2601] | 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/"
|
---|
[4470] | 269 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLUpdateInfo" "http://wiki.openstreetmap.org/index.php/JOSM"
|
---|
[2601] | 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 | SectionEnd ; "Required"
|
---|
| 279 |
|
---|
| 280 |
|
---|
| 281 | Section "JOSM" SecJosm
|
---|
| 282 | ;-------------------------------------------
|
---|
| 283 | SectionIn 1
|
---|
| 284 | SetOutPath $INSTDIR
|
---|
| 285 | File "josm.exe"
|
---|
[4470] | 286 |
|
---|
| 287 | ; XXX - should be provided/done by josm.jar itself and not here!
|
---|
[2601] | 288 | SetShellVarContext current
|
---|
| 289 | SetOutPath "$APPDATA\JOSM"
|
---|
| 290 |
|
---|
| 291 | ; don't overwrite existing bookmarks
|
---|
| 292 | IfFileExists preferences dont_overwrite_bookmarks
|
---|
| 293 | File "bookmarks"
|
---|
| 294 | dont_overwrite_bookmarks:
|
---|
| 295 |
|
---|
| 296 | ; write reasonable defaults for some preferences
|
---|
[5790] | 297 | ; XXX - some of this should be done in JOSM itself, see also JOSM core, data\Preferences.java function resetToDefault()
|
---|
| 298 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "projection" "org.openstreetmap.josm.data.projection.Epsg4326"
|
---|
| 299 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "draw.segment.direction" "true"
|
---|
[2601] | 300 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "layerlist.visible" "true"
|
---|
[5790] | 301 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "selectionlist.visible" "true"
|
---|
[2601] | 302 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "commandstack.visible" "true"
|
---|
| 303 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "propertiesdialog.visible" "true"
|
---|
[5790] | 304 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "osm-server.url" "http://www.openstreetmap.org/api"
|
---|
| 305 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "laf" "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
|
---|
| 306 |
|
---|
[3243] | 307 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "validator.visible" "true"
|
---|
[2601] | 308 | SectionEnd
|
---|
| 309 |
|
---|
| 310 |
|
---|
[4471] | 311 | SectionGroup "Plugins" SecPluginsGroup
|
---|
[2601] | 312 |
|
---|
| 313 | Section "mappaint" SecMappaintPlugin
|
---|
| 314 | ;-------------------------------------------
|
---|
| 315 | SectionIn 1 2
|
---|
[4470] | 316 | SetShellVarContext all
|
---|
[2601] | 317 | SetOutPath $APPDATA\JOSM\plugins
|
---|
[5214] | 318 | File "..\plugins\dist\mappaint.jar"
|
---|
[2601] | 319 | SectionEnd
|
---|
| 320 |
|
---|
[5120] | 321 | ;Section "osmarender" SecOsmarenderPlugin
|
---|
[5122] | 322 | ; osmarender needs Firefox (which isn't available on all machines)
|
---|
| 323 | ; and often provides clipped SVG graphics - therefore it's ommited by default
|
---|
[2601] | 324 | ;-------------------------------------------
|
---|
[5120] | 325 | ;SectionIn 1 2
|
---|
| 326 | ;SetShellVarContext all
|
---|
| 327 | ;SetOutPath $APPDATA\JOSM\plugins
|
---|
| 328 | ;File "downloads\osmarender.jar"
|
---|
[4470] | 329 | ; XXX - should be done inside the plugin and not here!
|
---|
[5120] | 330 | ;SetShellVarContext current
|
---|
| 331 | ;${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "osmarender.firefox" "$PROGRAMFILES\Mozilla Firefox\firefox.exe"
|
---|
| 332 | ;SectionEnd
|
---|
[2601] | 333 |
|
---|
| 334 | Section "WMS" SecWMSPlugin
|
---|
| 335 | ;-------------------------------------------
|
---|
| 336 | SectionIn 1 2
|
---|
[4470] | 337 | SetShellVarContext all
|
---|
[2601] | 338 | SetOutPath $APPDATA\JOSM\plugins
|
---|
[5214] | 339 | File "..\plugins\dist\wmsplugin.jar"
|
---|
[2601] | 340 | SectionEnd
|
---|
| 341 |
|
---|
[2952] | 342 | Section "namefinder" SecNamefinderPlugin
|
---|
| 343 | ;-------------------------------------------
|
---|
| 344 | SectionIn 1 2
|
---|
[4470] | 345 | SetShellVarContext all
|
---|
[2952] | 346 | SetOutPath $APPDATA\JOSM\plugins
|
---|
[5214] | 347 | File "..\plugins\dist\namefinder.jar"
|
---|
[2952] | 348 | SectionEnd
|
---|
| 349 |
|
---|
[3243] | 350 | Section "validator" SecValidatorPlugin
|
---|
| 351 | ;-------------------------------------------
|
---|
| 352 | SectionIn 1 2
|
---|
[4470] | 353 | SetShellVarContext all
|
---|
[3243] | 354 | SetOutPath $APPDATA\JOSM\plugins
|
---|
[5214] | 355 | File "..\plugins\dist\validator.jar"
|
---|
[3243] | 356 | SectionEnd
|
---|
| 357 |
|
---|
[2601] | 358 | SectionGroupEnd ; "Plugins"
|
---|
| 359 |
|
---|
[4471] | 360 | Section "Start Menu Entry" SecStartMenu
|
---|
| 361 | ;-------------------------------------------
|
---|
| 362 | SectionIn 1 2
|
---|
| 363 | ; Create start menu entries (depending on additional tasks page)
|
---|
| 364 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
|
---|
| 365 | ;StrCmp $0 "0" SecRequired_skip_StartMenu
|
---|
| 366 | ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
|
---|
| 367 | ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
|
---|
| 368 | CreateShortCut "$SMPROGRAMS\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
|
---|
| 369 | ;SecRequired_skip_StartMenu:
|
---|
| 370 | SectionEnd
|
---|
| 371 |
|
---|
| 372 | Section "Desktop Icon" SecDesktopIcon
|
---|
| 373 | ;-------------------------------------------
|
---|
| 374 | ; SectionIn 1 2
|
---|
| 375 | ; is command line option "/desktopicon" set?
|
---|
| 376 | ;${GetParameters} $R0
|
---|
| 377 | ;${GetOptions} $R0 "/desktopicon=" $R1
|
---|
| 378 | ;StrCmp $R1 "no" SecRequired_skip_DesktopIcon
|
---|
| 379 | ;StrCmp $R1 "yes" SecRequired_install_DesktopIcon
|
---|
| 380 |
|
---|
| 381 | ; Create desktop icon (depending on additional tasks page and command line option)
|
---|
| 382 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
|
---|
| 383 | ;StrCmp $0 "0" SecRequired_skip_DesktopIcon
|
---|
| 384 | ;SecRequired_install_DesktopIcon:
|
---|
| 385 | CreateShortCut "$DESKTOP\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
|
---|
| 386 | ;SecRequired_skip_DesktopIcon:
|
---|
| 387 | SectionEnd
|
---|
| 388 |
|
---|
| 389 | Section "Quick Launch Icon" SecQuickLaunchIcon
|
---|
| 390 | ;-------------------------------------------
|
---|
| 391 | SectionIn 1 2
|
---|
| 392 | ; is command line option "/quicklaunchicon" set?
|
---|
| 393 | ;${GetParameters} $R0
|
---|
| 394 | ;${GetOptions} $R0 "/quicklaunchicon=" $R1
|
---|
| 395 | ;StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
|
---|
| 396 | ;StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
|
---|
| 397 |
|
---|
| 398 | ; Create quick launch icon (depending on additional tasks page and command line option)
|
---|
| 399 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
|
---|
| 400 | ;StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
|
---|
| 401 | ;SecRequired_install_QuickLaunchIcon:
|
---|
| 402 | CreateShortCut "$QUICKLAUNCH\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
|
---|
| 403 | ;SecRequired_skip_QuickLaunchIcon:
|
---|
| 404 | SectionEnd
|
---|
| 405 |
|
---|
| 406 | Section "File Extensions" SecFileExtensions
|
---|
| 407 | ;-------------------------------------------
|
---|
| 408 | SectionIn 1 2
|
---|
| 409 | ; Create File Extensions (depending on additional tasks page)
|
---|
| 410 | ;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
|
---|
| 411 | ;StrCmp $0 "0" SecRequired_skip_FileExtensions
|
---|
| 412 | WriteRegStr HKCR ${OSM_ASSOC} "" "OpenStreetMap data"
|
---|
| 413 | WriteRegStr HKCR "${OSM_ASSOC}\Shell\open\command" "" '"$INSTDIR\josm.exe" "%1"'
|
---|
| 414 | WriteRegStr HKCR "${OSM_ASSOC}\DefaultIcon" "" '"$INSTDIR\josm.exe",0'
|
---|
| 415 | push $R0
|
---|
| 416 | StrCpy $R0 ".osm"
|
---|
| 417 | Call Associate
|
---|
| 418 | StrCpy $R0 ".gpx"
|
---|
| 419 | Call Associate
|
---|
| 420 | ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
|
---|
| 421 | pop $R0
|
---|
| 422 | !insertmacro UpdateIcons
|
---|
| 423 | ;SecRequired_skip_FileExtensions:
|
---|
| 424 | SectionEnd
|
---|
| 425 |
|
---|
| 426 |
|
---|
[2601] | 427 | Section "-PluginSetting"
|
---|
| 428 | ;-------------------------------------------
|
---|
[4471] | 429 | SectionIn 1 2
|
---|
[2601] | 430 | ;MessageBox MB_OK "PluginSetting!" IDOK 0
|
---|
[4470] | 431 | ; XXX - should better be handled inside JOSM (recent plugin manager is going in the right direction)
|
---|
[2601] | 432 | SetShellVarContext current
|
---|
[5120] | 433 | ${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "plugins" "mappaint,wmsplugin,namefinder,validator"
|
---|
[2601] | 434 | SectionEnd
|
---|
| 435 |
|
---|
| 436 |
|
---|
| 437 | Section "Uninstall" un.SecUinstall
|
---|
| 438 | ;-------------------------------------------
|
---|
| 439 |
|
---|
| 440 | ;
|
---|
| 441 | ; UnInstall for every user
|
---|
| 442 | ;
|
---|
| 443 | SectionIn 1 2
|
---|
| 444 | SetShellVarContext all
|
---|
| 445 |
|
---|
| 446 | Delete "$INSTDIR\josm.exe"
|
---|
| 447 | Delete "$INSTDIR\uninstall.exe"
|
---|
[4945] | 448 | Delete "$APPDATA\JOSM\plugins\wmsplugin.jar"
|
---|
[5120] | 449 | ;Delete "$APPDATA\JOSM\plugins\osmarender.jar"
|
---|
[4945] | 450 | Delete "$APPDATA\JOSM\plugins\mappaint.jar"
|
---|
| 451 | Delete "$APPDATA\JOSM\plugins\namefinder.jar"
|
---|
| 452 | Delete "$APPDATA\JOSM\plugins\validator.jar"
|
---|
| 453 | RMDir "$APPDATA\JOSM\plugins"
|
---|
| 454 | RMDir "$APPDATA\JOSM"
|
---|
[2601] | 455 | IfErrors 0 NoJOSMErrorMsg
|
---|
| 456 | MessageBox MB_OK "Please note: josm.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if josm.exe removed
|
---|
| 457 | Abort "Please note: josm.exe could not be removed, it's probably in use! Abort uninstall process!"
|
---|
| 458 | NoJOSMErrorMsg:
|
---|
| 459 |
|
---|
[2952] | 460 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM"
|
---|
[2601] | 461 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\josm.exe"
|
---|
| 462 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe"
|
---|
| 463 |
|
---|
| 464 | push $R0
|
---|
| 465 | StrCpy $R0 ".osm"
|
---|
| 466 | Call un.unlink
|
---|
| 467 | StrCpy $R0 ".gpx"
|
---|
| 468 | Call un.unlink
|
---|
| 469 | pop $R0
|
---|
| 470 |
|
---|
| 471 | DeleteRegKey HKCR ${OSM_ASSOC}
|
---|
| 472 | DeleteRegKey HKCR "${OSM_ASSOC}\Shell\open\command"
|
---|
| 473 | DeleteRegKey HKCR "${OSM_ASSOC}\DefaultIcon"
|
---|
| 474 | !insertmacro UpdateIcons
|
---|
| 475 |
|
---|
| 476 | Delete "$SMPROGRAMS\josm.lnk"
|
---|
| 477 | Delete "$DESKTOP\josm.lnk"
|
---|
| 478 | Delete "$QUICKLAUNCH\josm.lnk"
|
---|
| 479 |
|
---|
| 480 | RMDir "$INSTDIR"
|
---|
| 481 |
|
---|
| 482 | SectionEnd ; "Uinstall"
|
---|
| 483 |
|
---|
| 484 | Section /o "Un.Personal Settings" un.SecPersonalSettings
|
---|
| 485 | ;-------------------------------------------
|
---|
| 486 | SectionIn 2
|
---|
| 487 | SetShellVarContext current
|
---|
| 488 | Delete "$APPDATA\JOSM\preferences"
|
---|
| 489 | Delete "$APPDATA\JOSM\bookmarks"
|
---|
[5122] | 490 | ;Delete "$APPDATA\JOSM\de-streets.xml"
|
---|
[2601] | 491 | RMDir "$APPDATA\JOSM"
|
---|
[4470] | 492 | RMDir "$APPDATA\JOSM\plugins\mappaint"
|
---|
[2601] | 493 | SectionEnd
|
---|
| 494 |
|
---|
[4470] | 495 | Section /o "Un.Personal Plugins" un.SecPlugins
|
---|
[2601] | 496 | ;-------------------------------------------
|
---|
| 497 | SectionIn 2
|
---|
| 498 | SetShellVarContext current
|
---|
| 499 | Delete "$APPDATA\JOSM\plugins\wmsplugin.jar"
|
---|
[5120] | 500 | ;Delete "$APPDATA\JOSM\plugins\osmarender.jar"
|
---|
| 501 | ;Delete "$APPDATA\JOSM\plugins\osmarender\*.*"
|
---|
[2601] | 502 | Delete "$APPDATA\JOSM\plugins\mappaint.jar"
|
---|
[2952] | 503 | Delete "$APPDATA\JOSM\plugins\namefinder.jar"
|
---|
[3775] | 504 | Delete "$APPDATA\JOSM\plugins\validator\*.*"
|
---|
[3243] | 505 | Delete "$APPDATA\JOSM\plugins\validator.jar"
|
---|
[5120] | 506 | ;RMDir "$APPDATA\JOSM\plugins\osmarender"
|
---|
[3775] | 507 | RMDir "$APPDATA\JOSM\plugins\validator"
|
---|
[2601] | 508 | RMDir "$APPDATA\JOSM\plugins"
|
---|
| 509 | RMDir "$APPDATA\JOSM"
|
---|
| 510 | SectionEnd
|
---|
| 511 |
|
---|
| 512 |
|
---|
| 513 | Section "-Un.Finally"
|
---|
| 514 | ;-------------------------------------------
|
---|
| 515 | SectionIn 1 2
|
---|
| 516 | ; this test must be done after all other things uninstalled (e.g. Global Settings)
|
---|
| 517 | IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
|
---|
| 518 | MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
|
---|
| 519 | NoFinalErrorMsg:
|
---|
| 520 | SectionEnd
|
---|
| 521 |
|
---|
| 522 |
|
---|
| 523 | ; ============================================================================
|
---|
| 524 | ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
|
---|
| 525 | ; ============================================================================
|
---|
| 526 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
---|
| 527 | !insertmacro MUI_DESCRIPTION_TEXT ${SecJosm} "JOSM is the JAVA OpenStreetMap editor for .osm files."
|
---|
[4471] | 528 | !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "An assortment of useful JOSM plugins."
|
---|
[2601] | 529 | !insertmacro MUI_DESCRIPTION_TEXT ${SecMappaintPlugin} "An alternative renderer for the map with colouring, line thickness, icons after tags."
|
---|
[5120] | 530 | ; !insertmacro MUI_DESCRIPTION_TEXT ${SecOsmarenderPlugin} "Displays the current screen as nicely rendered SVG graphics in FireFox."
|
---|
[2601] | 531 | !insertmacro MUI_DESCRIPTION_TEXT ${SecWMSPlugin} "Display background images from Web Map Service (WMS) sources."
|
---|
[2952] | 532 | !insertmacro MUI_DESCRIPTION_TEXT ${SecNamefinderPlugin} "Add a 'Find places by their name' tab to the download dialog."
|
---|
[3243] | 533 | !insertmacro MUI_DESCRIPTION_TEXT ${SecValidatorPlugin} "Validates edited data if it conforms to common suggestions."
|
---|
[4471] | 534 | !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} "Add a JOSM start menu entry."
|
---|
| 535 | !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopIcon} "Add a JOSM desktop icon."
|
---|
| 536 | !insertmacro MUI_DESCRIPTION_TEXT ${SecQuickLaunchIcon} "Add a JOSM icon to the quick launch bar."
|
---|
| 537 | !insertmacro MUI_DESCRIPTION_TEXT ${SecFileExtensions} "Add JOSM file extensions for .osm and .gpx files."
|
---|
| 538 |
|
---|
| 539 |
|
---|
[2601] | 540 | !insertmacro MUI_FUNCTION_DESCRIPTION_END
|
---|
| 541 |
|
---|
| 542 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
|
---|
| 543 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall JOSM."
|
---|
| 544 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences and bookmarks from your profile: $PROFILE."
|
---|
| 545 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all plugins."
|
---|
| 546 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
|
---|
| 547 |
|
---|
| 548 | ; ============================================================================
|
---|
| 549 | ; Callback functions
|
---|
| 550 | ; ============================================================================
|
---|
| 551 |
|
---|