[2601] | 1 | ;
|
---|
[3771] | 2 | ; josm.nsi
|
---|
[2601] | 3 | ;
|
---|
| 4 |
|
---|
| 5 | ; Set the compression mechanism first.
|
---|
[14194] | 6 | ; If you get an error here, please update to at least NSIS 2.07!
|
---|
[2601] | 7 | SetCompressor /SOLID lzma
|
---|
| 8 |
|
---|
[3771] | 9 | !define DEST "josm"
|
---|
[2601] | 10 |
|
---|
| 11 | ; Used to refresh the display of file association
|
---|
| 12 | !define SHCNE_ASSOCCHANGED 0x08000000
|
---|
| 13 | !define SHCNF_IDLIST 0
|
---|
| 14 |
|
---|
| 15 | ; Used to add associations between file extensions and JOSM
|
---|
| 16 | !define OSM_ASSOC "josm-file"
|
---|
| 17 |
|
---|
| 18 | ; ============================================================================
|
---|
| 19 | ; Header configuration
|
---|
| 20 | ; ============================================================================
|
---|
| 21 | ; The name of the installer
|
---|
[3771] | 22 | !define PROGRAM_NAME "JOSM"
|
---|
[2601] | 23 |
|
---|
| 24 | Name "${PROGRAM_NAME} ${VERSION}"
|
---|
| 25 |
|
---|
| 26 | ; The file to write
|
---|
| 27 | OutFile "${DEST}-setup-${VERSION}.exe"
|
---|
| 28 |
|
---|
| 29 | XPStyle on
|
---|
| 30 |
|
---|
[27251] | 31 | Var /GLOBAL plugins
|
---|
[2601] | 32 |
|
---|
| 33 | ; ============================================================================
|
---|
| 34 | ; Modern UI
|
---|
| 35 | ; ============================================================================
|
---|
| 36 |
|
---|
| 37 | !include "MUI.nsh"
|
---|
| 38 |
|
---|
| 39 | ; Icon of installer and uninstaller
|
---|
| 40 | !define MUI_ICON "logo.ico"
|
---|
| 41 | !define MUI_UNICON "logo.ico"
|
---|
| 42 |
|
---|
| 43 | !define MUI_COMPONENTSPAGE_SMALLDESC
|
---|
| 44 | !define MUI_FINISHPAGE_NOAUTOCLOSE
|
---|
| 45 | !define MUI_UNFINISHPAGE_NOAUTOCLOSE
|
---|
[5798] | 46 | !define MUI_WELCOMEFINISHPAGE_BITMAP "josm-nsis-brand.bmp"
|
---|
[6054] | 47 | !define MUI_WELCOMEPAGE_TEXT $(JOSM_WELCOME_TEXT)
|
---|
[2601] | 48 |
|
---|
| 49 | !define MUI_FINISHPAGE_RUN "$INSTDIR\josm.exe"
|
---|
| 50 |
|
---|
| 51 |
|
---|
| 52 | ; ============================================================================
|
---|
| 53 | ; MUI Pages
|
---|
| 54 | ; ============================================================================
|
---|
| 55 |
|
---|
| 56 | !insertmacro MUI_PAGE_WELCOME
|
---|
[5214] | 57 | !insertmacro MUI_PAGE_LICENSE "..\core\LICENSE"
|
---|
[2601] | 58 | !insertmacro MUI_PAGE_COMPONENTS
|
---|
| 59 | ;Page custom DisplayAdditionalTasksPage
|
---|
| 60 | !insertmacro MUI_PAGE_DIRECTORY
|
---|
| 61 | !insertmacro MUI_PAGE_INSTFILES
|
---|
| 62 | !insertmacro MUI_PAGE_FINISH
|
---|
| 63 |
|
---|
| 64 | !insertmacro MUI_UNPAGE_WELCOME
|
---|
| 65 | !insertmacro MUI_UNPAGE_CONFIRM
|
---|
| 66 | !insertmacro MUI_UNPAGE_COMPONENTS
|
---|
| 67 | !insertmacro MUI_UNPAGE_INSTFILES
|
---|
| 68 | !insertmacro MUI_UNPAGE_FINISH
|
---|
| 69 |
|
---|
| 70 | ; ============================================================================
|
---|
| 71 | ; MUI Languages
|
---|
| 72 | ; ============================================================================
|
---|
| 73 |
|
---|
[6054] | 74 | ;Remember the installer language
|
---|
| 75 | !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
|
---|
| 76 | !define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM"
|
---|
| 77 | !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
---|
| 78 |
|
---|
| 79 | ;; English goes first because its the default. The rest are
|
---|
| 80 | ;; in alphabetical order (at least the strings actually displayed
|
---|
| 81 | ;; will be).
|
---|
[2601] | 82 |
|
---|
[6054] | 83 | !insertmacro MUI_LANGUAGE "English"
|
---|
[27246] | 84 | !insertmacro MUI_LANGUAGE "French"
|
---|
[6054] | 85 | !insertmacro MUI_LANGUAGE "German"
|
---|
| 86 |
|
---|
| 87 | ;--------------------------------
|
---|
| 88 | ;Translations
|
---|
| 89 |
|
---|
| 90 | !define JOSM_DEFAULT_LANGFILE "locale\english.nsh"
|
---|
| 91 |
|
---|
| 92 | !include "langmacros.nsh"
|
---|
| 93 |
|
---|
| 94 | !insertmacro JOSM_MACRO_INCLUDE_LANGFILE "ENGLISH" "locale\english.nsh"
|
---|
[27246] | 95 | !insertmacro JOSM_MACRO_INCLUDE_LANGFILE "FRENCH" "locale\french.nsh"
|
---|
[6054] | 96 | !insertmacro JOSM_MACRO_INCLUDE_LANGFILE "GERMAN" "locale\german.nsh"
|
---|
| 97 |
|
---|
[14194] | 98 | ; Uninstall stuff
|
---|
[6054] | 99 | !define MUI_UNCONFIRMPAGE_TEXT_TOP ${un.JOSM_UNCONFIRMPAGE_TEXT_TOP}
|
---|
| 100 |
|
---|
[2601] | 101 | ; ============================================================================
|
---|
[6054] | 102 | ; Installation types
|
---|
| 103 | ; ============================================================================
|
---|
| 104 |
|
---|
| 105 | InstType "$(JOSM_FULL_INSTALL)"
|
---|
| 106 |
|
---|
| 107 | InstType "un.$(un.JOSM_DEFAULT_UNINSTALL)"
|
---|
| 108 | InstType "un.$(un.JOSM_FULL_UNINSTALL)"
|
---|
| 109 |
|
---|
| 110 | ; ============================================================================
|
---|
[2601] | 111 | ; Reserve Files
|
---|
| 112 | ; ============================================================================
|
---|
| 113 |
|
---|
| 114 | ;Things that need to be extracted on first (keep these lines before any File command!)
|
---|
| 115 | ;Only useful for BZIP2 compression
|
---|
| 116 |
|
---|
| 117 | !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
---|
| 118 |
|
---|
| 119 | ; ============================================================================
|
---|
| 120 | ; Section macros
|
---|
| 121 | ; ============================================================================
|
---|
| 122 | !include "Sections.nsh"
|
---|
| 123 |
|
---|
| 124 | ; ========= Macro to unselect and disable a section =========
|
---|
| 125 |
|
---|
| 126 | !macro DisableSection SECTION
|
---|
| 127 |
|
---|
| 128 | Push $0
|
---|
| 129 | SectionGetFlags "${SECTION}" $0
|
---|
| 130 | IntOp $0 $0 & ${SECTION_OFF}
|
---|
| 131 | IntOp $0 $0 | ${SF_RO}
|
---|
| 132 | SectionSetFlags "${SECTION}" $0
|
---|
| 133 | Pop $0
|
---|
| 134 |
|
---|
| 135 | !macroend
|
---|
| 136 |
|
---|
| 137 | ; ========= Macro to enable (unreadonly) a section =========
|
---|
| 138 | !define SECTION_ENABLE 0xFFFFFFEF
|
---|
| 139 | !macro EnableSection SECTION
|
---|
| 140 |
|
---|
| 141 | Push $0
|
---|
| 142 | SectionGetFlags "${SECTION}" $0
|
---|
| 143 | IntOp $0 $0 & ${SECTION_ENABLE}
|
---|
| 144 | SectionSetFlags "${SECTION}" $0
|
---|
| 145 | Pop $0
|
---|
| 146 |
|
---|
| 147 | !macroend
|
---|
| 148 |
|
---|
| 149 | ; ============================================================================
|
---|
| 150 | ; Command Line
|
---|
| 151 | ; ============================================================================
|
---|
| 152 | !include "FileFunc.nsh"
|
---|
| 153 |
|
---|
| 154 | ; ============================================================================
|
---|
| 155 | ; Directory selection page configuration
|
---|
| 156 | ; ============================================================================
|
---|
| 157 | ; The text to prompt the user to enter a directory
|
---|
[6054] | 158 | DirText $(JOSM_DIR_TEXT)
|
---|
[2601] | 159 |
|
---|
| 160 | ; The default installation directory
|
---|
[3771] | 161 | InstallDir $PROGRAMFILES\JOSM\
|
---|
[2601] | 162 |
|
---|
| 163 | ; See if this is an upgrade; if so, use the old InstallDir as default
|
---|
[3771] | 164 | InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\JOSM "InstallDir"
|
---|
[2601] | 165 |
|
---|
| 166 |
|
---|
| 167 | ; ============================================================================
|
---|
| 168 | ; Install page configuration
|
---|
| 169 | ; ============================================================================
|
---|
| 170 | ShowInstDetails show
|
---|
| 171 | ShowUninstDetails show
|
---|
| 172 |
|
---|
| 173 | ; ============================================================================
|
---|
| 174 | ; Functions and macros
|
---|
| 175 | ; ============================================================================
|
---|
| 176 |
|
---|
| 177 | ; update file extension icons
|
---|
| 178 | !macro UpdateIcons
|
---|
| 179 | Push $R0
|
---|
| 180 | Push $R1
|
---|
| 181 | Push $R2
|
---|
| 182 |
|
---|
| 183 | !define UPDATEICONS_UNIQUE ${__LINE__}
|
---|
| 184 |
|
---|
| 185 | IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
|
---|
| 186 | UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
|
---|
| 187 | GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
|
---|
| 188 | IntOp $R2 $R0 / 0x00010000
|
---|
| 189 | IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
|
---|
| 190 | UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
|
---|
| 191 | System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
|
---|
| 192 | Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
|
---|
| 193 |
|
---|
| 194 | UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
|
---|
[6054] | 195 | MessageBox MB_OK|MB_ICONSTOP $(JOSM_UPDATEICONS_ERROR1)
|
---|
[2601] | 196 | Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
|
---|
| 197 | UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
|
---|
[6054] | 198 | MessageBox MB_OK|MB_ICONINFORMATION $(JOSM_UPDATEICONS_ERROR2)
|
---|
[2601] | 199 | Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
|
---|
| 200 | UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
|
---|
| 201 | !undef UPDATEICONS_UNIQUE
|
---|
| 202 | Pop $R2
|
---|
| 203 | Pop $R1
|
---|
| 204 | Pop $R0
|
---|
| 205 |
|
---|
| 206 | !macroend
|
---|
| 207 |
|
---|
| 208 | ; associate a file extension to an icon
|
---|
| 209 | Function Associate
|
---|
[3771] | 210 | ; $R0 should contain the prefix to associate to JOSM
|
---|
[2601] | 211 | Push $R1
|
---|
| 212 |
|
---|
| 213 | ReadRegStr $R1 HKCR $R0 ""
|
---|
| 214 | StrCmp $R1 "" Associate.doRegister
|
---|
| 215 | Goto Associate.end
|
---|
| 216 | Associate.doRegister:
|
---|
| 217 | ;The extension is not associated to any program, we can do the link
|
---|
| 218 | WriteRegStr HKCR $R0 "" ${OSM_ASSOC}
|
---|
| 219 | Associate.end:
|
---|
| 220 | pop $R1
|
---|
| 221 | FunctionEnd
|
---|
| 222 |
|
---|
| 223 | ; disassociate a file extension from an icon
|
---|
| 224 | Function un.unlink
|
---|
| 225 | ; $R0 should contain the prefix to unlink
|
---|
| 226 | Push $R1
|
---|
| 227 |
|
---|
| 228 | ReadRegStr $R1 HKCR $R0 ""
|
---|
| 229 | StrCmp $R1 ${OSM_ASSOC} un.unlink.doUnlink
|
---|
| 230 | Goto un.unlink.end
|
---|
| 231 | un.unlink.doUnlink:
|
---|
[3771] | 232 | ; The extension is associated with JOSM so, we must destroy this!
|
---|
[2601] | 233 | DeleteRegKey HKCR $R0
|
---|
| 234 | un.unlink.end:
|
---|
| 235 | pop $R1
|
---|
| 236 | FunctionEnd
|
---|
| 237 |
|
---|
| 238 | Function .onInit
|
---|
| 239 | ;Extract InstallOptions INI files
|
---|
| 240 | ; !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
|
---|
[6054] | 241 | !insertmacro MUI_LANGDLL_DISPLAY
|
---|
[2601] | 242 | FunctionEnd
|
---|
| 243 |
|
---|
[6054] | 244 | Function un.onInit
|
---|
| 245 |
|
---|
| 246 | !insertmacro MUI_UNGETLANGUAGE
|
---|
| 247 |
|
---|
| 248 | FunctionEnd
|
---|
| 249 |
|
---|
[2601] | 250 | ; ============================================================================
|
---|
| 251 | ; Installation execution commands
|
---|
| 252 | ; ============================================================================
|
---|
| 253 |
|
---|
| 254 | Section "-Required"
|
---|
| 255 | ;-------------------------------------------
|
---|
| 256 |
|
---|
| 257 | ;
|
---|
| 258 | ; Install for every user
|
---|
| 259 | ;
|
---|
| 260 | SectionIn 1 2 RO
|
---|
[14196] | 261 | SetShellVarContext current
|
---|
[2601] | 262 |
|
---|
| 263 | SetOutPath $INSTDIR
|
---|
| 264 |
|
---|
| 265 | ; Write the uninstall keys for Windows
|
---|
| 266 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayVersion" "${VERSION}"
|
---|
[3771] | 267 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayName" "JOSM ${VERSION}"
|
---|
[2601] | 268 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
---|
| 269 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "Publisher" "The OpenStreetMap developer community, http://www.openstreetmap.org/"
|
---|
| 270 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "HelpLink" "mailto:newbies@openstreetmap.org."
|
---|
| 271 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLInfoAbout" "http://www.openstreetmap.org/"
|
---|
[4470] | 272 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLUpdateInfo" "http://wiki.openstreetmap.org/index.php/JOSM"
|
---|
[2601] | 273 | WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoModify" 1
|
---|
| 274 | WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoRepair" 1
|
---|
| 275 | WriteUninstaller "uninstall.exe"
|
---|
| 276 |
|
---|
| 277 | ; Write an entry for ShellExecute
|
---|
| 278 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe" "" '$INSTDIR\josm.exe'
|
---|
| 279 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe" "Path" '$INSTDIR'
|
---|
| 280 |
|
---|
| 281 | SectionEnd ; "Required"
|
---|
| 282 |
|
---|
| 283 |
|
---|
[6054] | 284 | Section $(JOSM_SEC_JOSM) SecJosm
|
---|
[2601] | 285 | ;-------------------------------------------
|
---|
| 286 | SectionIn 1
|
---|
| 287 | SetOutPath $INSTDIR
|
---|
| 288 | File "josm.exe"
|
---|
[18004] | 289 | File "josm-tested.jar"
|
---|
[4470] | 290 |
|
---|
| 291 | ; XXX - should be provided/done by josm.jar itself and not here!
|
---|
[2601] | 292 | SetShellVarContext current
|
---|
| 293 | SetOutPath "$APPDATA\JOSM"
|
---|
| 294 |
|
---|
| 295 | SectionEnd
|
---|
| 296 |
|
---|
[6054] | 297 | SectionGroup $(JOSM_SEC_PLUGINS_GROUP) SecPluginsGroup
|
---|
[2601] | 298 |
|
---|
[14201] | 299 | Section $(JOSM_SEC_OPENSTREETBUGS_PLUGIN) SecOpenStreetBugsPlugin
|
---|
| 300 | ;-------------------------------------------
|
---|
| 301 | SectionIn 1 2
|
---|
| 302 | SetShellVarContext current
|
---|
| 303 | SetOutPath $APPDATA\JOSM\plugins
|
---|
| 304 | File "..\dist\openstreetbugs.jar"
|
---|
[27251] | 305 | StrCpy $plugins "$plugins<entry value='openstreetbugs'/>"
|
---|
[14201] | 306 | SectionEnd
|
---|
| 307 |
|
---|
[24579] | 308 | Section $(JOSM_SEC_TURNRESTRICTIONS_PLUGIN) SecTurnrestrictionsPlugin
|
---|
[14200] | 309 | ;-------------------------------------------
|
---|
| 310 | SectionIn 1 2
|
---|
| 311 | SetShellVarContext current
|
---|
| 312 | SetOutPath $APPDATA\JOSM\plugins
|
---|
[24579] | 313 | File "..\dist\turnrestrictions.jar"
|
---|
[27251] | 314 | StrCpy $plugins "$plugins<entry value='turnrestrictions'/>"
|
---|
[14200] | 315 | SectionEnd
|
---|
| 316 |
|
---|
[24717] | 317 | Section $(JOSM_SEC_WMS) SecWMS
|
---|
[2601] | 318 | ;-------------------------------------------
|
---|
| 319 | SectionIn 1 2
|
---|
[14196] | 320 | SetShellVarContext current
|
---|
[14194] | 321 | SetOutPath $INSTDIR\imageformats
|
---|
[14189] | 322 | File "webkit-image\imageformats\qjpeg4.dll"
|
---|
[14194] | 323 | SetOutPath $INSTDIR
|
---|
[14189] | 324 | File "webkit-image\mingwm10.dll"
|
---|
| 325 | File "webkit-image\QtCore4.dll"
|
---|
| 326 | File "webkit-image\QtGui4.dll"
|
---|
| 327 | File "webkit-image\QtNetwork4.dll"
|
---|
| 328 | File "webkit-image\QtWebKit4.dll"
|
---|
| 329 | File "webkit-image\webkit-image.exe"
|
---|
[2601] | 330 | SectionEnd
|
---|
| 331 |
|
---|
| 332 | SectionGroupEnd ; "Plugins"
|
---|
| 333 |
|
---|
[6054] | 334 | Section $(JOSM_SEC_STARTMENU) SecStartMenu
|
---|
[4471] | 335 | ;-------------------------------------------
|
---|
| 336 | SectionIn 1 2
|
---|
[27246] | 337 | ; To quote "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
|
---|
[4471] | 338 | ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
|
---|
[6054] | 339 | CreateShortCut "$SMPROGRAMS\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" $(JOSM_LINK_TEXT)
|
---|
[4471] | 340 | SectionEnd
|
---|
| 341 |
|
---|
[6054] | 342 | Section $(JOSM_SEC_DESKTOP_ICON) SecDesktopIcon
|
---|
[4471] | 343 | ;-------------------------------------------
|
---|
| 344 | ; SectionIn 1 2
|
---|
[14194] | 345 | ; Create desktop icon
|
---|
| 346 | ; Desktop icon for a program should not be installed as default!
|
---|
[6054] | 347 | CreateShortCut "$DESKTOP\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" $(JOSM_LINK_TEXT)
|
---|
[4471] | 348 | SectionEnd
|
---|
| 349 |
|
---|
[6054] | 350 | Section $(JOSM_SEC_QUICKLAUNCH_ICON) SecQuickLaunchIcon
|
---|
[4471] | 351 | ;-------------------------------------------
|
---|
| 352 | SectionIn 1 2
|
---|
[14194] | 353 | ; Create quick launch icon
|
---|
[6054] | 354 | CreateShortCut "$QUICKLAUNCH\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" $(JOSM_LINK_TEXT)
|
---|
[4471] | 355 | SectionEnd
|
---|
| 356 |
|
---|
[6054] | 357 | Section $(JOSM_SEC_FILE_EXTENSIONS) SecFileExtensions
|
---|
[4471] | 358 | ;-------------------------------------------
|
---|
| 359 | SectionIn 1 2
|
---|
[14194] | 360 | ; Create File Extensions
|
---|
[4471] | 361 | WriteRegStr HKCR ${OSM_ASSOC} "" "OpenStreetMap data"
|
---|
| 362 | WriteRegStr HKCR "${OSM_ASSOC}\Shell\open\command" "" '"$INSTDIR\josm.exe" "%1"'
|
---|
| 363 | WriteRegStr HKCR "${OSM_ASSOC}\DefaultIcon" "" '"$INSTDIR\josm.exe",0'
|
---|
| 364 | push $R0
|
---|
| 365 | StrCpy $R0 ".osm"
|
---|
| 366 | Call Associate
|
---|
| 367 | StrCpy $R0 ".gpx"
|
---|
| 368 | Call Associate
|
---|
[14194] | 369 | ; if somethings added here, add it also to the uninstall section
|
---|
[4471] | 370 | pop $R0
|
---|
| 371 | !insertmacro UpdateIcons
|
---|
| 372 | SectionEnd
|
---|
| 373 |
|
---|
| 374 |
|
---|
[2601] | 375 | Section "-PluginSetting"
|
---|
| 376 | ;-------------------------------------------
|
---|
[4471] | 377 | SectionIn 1 2
|
---|
[2601] | 378 | ;MessageBox MB_OK "PluginSetting!" IDOK 0
|
---|
[4470] | 379 | ; XXX - should better be handled inside JOSM (recent plugin manager is going in the right direction)
|
---|
[2601] | 380 | SetShellVarContext current
|
---|
[6054] | 381 | !include LogicLib.nsh
|
---|
[27237] | 382 | IfFileExists "$APPDATA\JOSM\preferences" settings_exists
|
---|
[27236] | 383 | IfFileExists "$APPDATA\JOSM\preferences.xml" settings_exists
|
---|
[27235] | 384 | FileOpen $R0 "$APPDATA\JOSM\preferences.xml" w
|
---|
[27251] | 385 | FileWrite $R0 "<?xml version='1.0' encoding='UTF-8'?><preferences xmlns='http://josm.openstreetmap.de/preferences-1.0' version='4660'><list key='plugins'>$plugins</list></preferences>"
|
---|
[27235] | 386 | FileClose $R0
|
---|
[27236] | 387 | settings_exists:
|
---|
[27235] | 388 |
|
---|
[2601] | 389 | SectionEnd
|
---|
| 390 |
|
---|
| 391 |
|
---|
[6054] | 392 | Section "un.$(un.JOSM_SEC_UNINSTALL)" un.SecUinstall
|
---|
[2601] | 393 | ;-------------------------------------------
|
---|
| 394 |
|
---|
| 395 | ;
|
---|
| 396 | ; UnInstall for every user
|
---|
| 397 | ;
|
---|
| 398 | SectionIn 1 2
|
---|
[14196] | 399 | SetShellVarContext current
|
---|
[2601] | 400 |
|
---|
[18004] | 401 | Delete "$INSTDIR\josm-tested.jar"
|
---|
[6054] | 402 | IfErrors 0 NoJOSMErrorMsg
|
---|
[17700] | 403 | MessageBox MB_OK $(un.JOSM_IN_USE_ERROR) IDOK 0 ;skipped if josm.jar removed
|
---|
[6054] | 404 | Abort $(un.JOSM_IN_USE_ERROR)
|
---|
| 405 | NoJOSMErrorMsg:
|
---|
[17700] | 406 | Delete "$INSTDIR\josm.exe"
|
---|
[14194] | 407 | Delete "$INSTDIR\imageformats\qjpeg4.dll"
|
---|
| 408 | RMDir "$INSTDIR\imageformats"
|
---|
| 409 | Delete "$INSTDIR\mingwm10.dll"
|
---|
| 410 | Delete "$INSTDIR\QtCore4.dll"
|
---|
| 411 | Delete "$INSTDIR\QtGui4.dll"
|
---|
| 412 | Delete "$INSTDIR\QtNetwork4.dll"
|
---|
| 413 | Delete "$INSTDIR\QtWebKit4.dll"
|
---|
| 414 | Delete "$INSTDIR\webkit-image.exe"
|
---|
[2601] | 415 | Delete "$INSTDIR\uninstall.exe"
|
---|
| 416 |
|
---|
[2952] | 417 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM"
|
---|
[2601] | 418 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\josm.exe"
|
---|
| 419 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe"
|
---|
| 420 |
|
---|
[6054] | 421 | ; Remove Language preference info
|
---|
| 422 | DeleteRegKey HKCU "Software/JOSM" ;${MUI_LANGDLL_REGISTRY_ROOT} ${MUI_LANGDLL_REGISTRY_KEY}
|
---|
| 423 |
|
---|
[2601] | 424 | push $R0
|
---|
| 425 | StrCpy $R0 ".osm"
|
---|
| 426 | Call un.unlink
|
---|
| 427 | StrCpy $R0 ".gpx"
|
---|
| 428 | Call un.unlink
|
---|
| 429 | pop $R0
|
---|
| 430 |
|
---|
| 431 | DeleteRegKey HKCR ${OSM_ASSOC}
|
---|
| 432 | DeleteRegKey HKCR "${OSM_ASSOC}\Shell\open\command"
|
---|
| 433 | DeleteRegKey HKCR "${OSM_ASSOC}\DefaultIcon"
|
---|
| 434 | !insertmacro UpdateIcons
|
---|
| 435 |
|
---|
| 436 | Delete "$SMPROGRAMS\josm.lnk"
|
---|
| 437 | Delete "$DESKTOP\josm.lnk"
|
---|
| 438 | Delete "$QUICKLAUNCH\josm.lnk"
|
---|
| 439 |
|
---|
| 440 | RMDir "$INSTDIR"
|
---|
| 441 |
|
---|
[27246] | 442 | SectionEnd ; "Uninstall"
|
---|
[2601] | 443 |
|
---|
[6054] | 444 | Section /o "un.$(un.JOSM_SEC_PERSONAL_SETTINGS)" un.SecPersonalSettings
|
---|
[2601] | 445 | ;-------------------------------------------
|
---|
| 446 | SectionIn 2
|
---|
| 447 | SetShellVarContext current
|
---|
[24579] | 448 | Delete "$APPDATA\JOSM\plugins\turnrestrictions\*.*"
|
---|
| 449 | RMDir "$APPDATA\JOSM\plugins\turnrestrictions"
|
---|
[14201] | 450 | Delete "$APPDATA\JOSM\plugins\openstreetbugs\*.*"
|
---|
| 451 | RMDir "$APPDATA\JOSM\plugins\openstreetbugs"
|
---|
| 452 | Delete "$APPDATA\JOSM\plugins\remotecontrol\*.*"
|
---|
| 453 | RMDir "$APPDATA\JOSM\plugins\remotecontrol"
|
---|
[24717] | 454 | Delete "$APPDATA\JOSM\plugins\validator\*.*"
|
---|
| 455 | RMDir "$APPDATA\JOSM\plugins\validator"
|
---|
[14196] | 456 | Delete "$APPDATA\JOSM\plugins\wmsplugin\*.*"
|
---|
| 457 | RMDir "$APPDATA\JOSM\plugins\wmsplugin"
|
---|
| 458 | Delete "$APPDATA\JOSM\plugins\*.*"
|
---|
[2601] | 459 | RMDir "$APPDATA\JOSM\plugins"
|
---|
[14196] | 460 |
|
---|
| 461 | Delete "$APPDATA\JOSM\motd.html"
|
---|
| 462 | Delete "$APPDATA\JOSM\preferences"
|
---|
[27239] | 463 | Delete "$APPDATA\JOSM\preferences.xml"
|
---|
[14196] | 464 | Delete "$APPDATA\JOSM\bookmarks"
|
---|
[2601] | 465 | RMDir "$APPDATA\JOSM"
|
---|
| 466 | SectionEnd
|
---|
| 467 |
|
---|
| 468 |
|
---|
| 469 | Section "-Un.Finally"
|
---|
| 470 | ;-------------------------------------------
|
---|
| 471 | SectionIn 1 2
|
---|
| 472 | ; this test must be done after all other things uninstalled (e.g. Global Settings)
|
---|
| 473 | IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
|
---|
[6054] | 474 | MessageBox MB_OK $(un.JOSM_INSTDIR_ERROR) IDOK 0 ; skipped if dir doesn't exist
|
---|
[2601] | 475 | NoFinalErrorMsg:
|
---|
| 476 | SectionEnd
|
---|
| 477 |
|
---|
| 478 |
|
---|
| 479 | ; ============================================================================
|
---|
| 480 | ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
|
---|
| 481 | ; ============================================================================
|
---|
| 482 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
---|
[6054] | 483 | !insertmacro MUI_DESCRIPTION_TEXT ${SecJosm} $(JOSM_SECDESC_JOSM)
|
---|
| 484 | !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} $(JOSM_SECDESC_PLUGINS_GROUP)
|
---|
[14201] | 485 | !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenStreetBugsPlugin} $(JOSM_SECDESC_OPENSTREETBUGS_PLUGIN)
|
---|
[24582] | 486 | !insertmacro MUI_DESCRIPTION_TEXT ${SecTurnrestrictionsPlugin} $(JOSM_SECDESC_TURNRESTRICTIONS_PLUGIN)
|
---|
[24717] | 487 | !insertmacro MUI_DESCRIPTION_TEXT ${SecWMS} $(JOSM_SECDESC_WMS)
|
---|
[6054] | 488 | !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(JOSM_SECDESC_STARTMENU)
|
---|
| 489 | !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopIcon} $(JOSM_SECDESC_DESKTOP_ICON)
|
---|
| 490 | !insertmacro MUI_DESCRIPTION_TEXT ${SecQuickLaunchIcon} $(JOSM_SECDESC_QUICKLAUNCH_ICON)
|
---|
| 491 | !insertmacro MUI_DESCRIPTION_TEXT ${SecFileExtensions} $(JOSM_SECDESC_FILE_EXTENSIONS)
|
---|
[4471] | 492 |
|
---|
| 493 |
|
---|
[2601] | 494 | !insertmacro MUI_FUNCTION_DESCRIPTION_END
|
---|
| 495 |
|
---|
| 496 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
|
---|
[6054] | 497 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} $(un.JOSM_SECDESC_UNINSTALL)
|
---|
| 498 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} $(un.JOSM_SECDESC_PERSONAL_SETTINGS)
|
---|
[2601] | 499 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
|
---|
| 500 |
|
---|
| 501 | ; ============================================================================
|
---|
| 502 | ; Callback functions
|
---|
| 503 | ; ============================================================================
|
---|
| 504 |
|
---|