| 1 | ;
|
|---|
| 2 | ; josm.nsi
|
|---|
| 3 | ;
|
|---|
| 4 |
|
|---|
| 5 | ; Set the compression mechanism first.
|
|---|
| 6 | SetCompressor /SOLID lzma
|
|---|
| 7 |
|
|---|
| 8 | ; Load StdUtils plugin (ANSI until we switch to Unicode installer with NSIS 3)
|
|---|
| 9 | !addplugindir plugins/stdutils/Plugins/Release_ANSI
|
|---|
| 10 | !addincludedir plugins/stdutils/Include
|
|---|
| 11 |
|
|---|
| 12 | !include "StdUtils.nsh"
|
|---|
| 13 |
|
|---|
| 14 | ; make sure the installer will get elevated rights on UAC-enabled system (Vista+)
|
|---|
| 15 | RequestExecutionLevel admin
|
|---|
| 16 |
|
|---|
| 17 | ; Used to refresh the display of file association
|
|---|
| 18 | !define SHCNE_ASSOCCHANGED 0x08000000
|
|---|
| 19 | !define SHCNF_IDLIST 0
|
|---|
| 20 |
|
|---|
| 21 | ; Used to add associations between file extensions and JOSM
|
|---|
| 22 | !define OSM_ASSOC "josm-file"
|
|---|
| 23 |
|
|---|
| 24 | ; ============================================================================
|
|---|
| 25 | ; Header configuration
|
|---|
| 26 | ; ============================================================================
|
|---|
| 27 | ; The name of the installer
|
|---|
| 28 | Name "JOSM ${VERSION}"
|
|---|
| 29 |
|
|---|
| 30 | ; The file to write
|
|---|
| 31 | OutFile "${DEST}-setup-${VERSION}.exe"
|
|---|
| 32 |
|
|---|
| 33 | XPStyle on
|
|---|
| 34 |
|
|---|
| 35 | Var /GLOBAL plugins
|
|---|
| 36 |
|
|---|
| 37 | ; ============================================================================
|
|---|
| 38 | ; Modern UI
|
|---|
| 39 | ; ============================================================================
|
|---|
| 40 |
|
|---|
| 41 | !include "MUI2.nsh"
|
|---|
| 42 |
|
|---|
| 43 | ; Icon of installer and uninstaller
|
|---|
| 44 | !define MUI_ICON "logo.ico"
|
|---|
| 45 | !define MUI_UNICON "logo.ico"
|
|---|
| 46 |
|
|---|
| 47 | !define MUI_COMPONENTSPAGE_SMALLDESC
|
|---|
| 48 | !define MUI_FINISHPAGE_NOAUTOCLOSE
|
|---|
| 49 | !define MUI_UNFINISHPAGE_NOAUTOCLOSE
|
|---|
| 50 | !define MUI_WELCOMEFINISHPAGE_BITMAP "josm-nsis-brand.bmp"
|
|---|
| 51 | !define MUI_WELCOMEPAGE_TEXT $(JOSM_WELCOME_TEXT)
|
|---|
| 52 |
|
|---|
| 53 | !define MUI_FINISHPAGE_RUN
|
|---|
| 54 | !define MUI_FINISHPAGE_RUN_FUNCTION LaunchJOSM
|
|---|
| 55 |
|
|---|
| 56 | ; Function used to Launch JOSM in user (non-elevated) mode
|
|---|
| 57 | Function LaunchJOSM
|
|---|
| 58 | ${StdUtils.ExecShellAsUser} $0 "$INSTDIR\${DEST}.exe" "open" ""
|
|---|
| 59 | FunctionEnd
|
|---|
| 60 |
|
|---|
| 61 | ; ============================================================================
|
|---|
| 62 | ; MUI Pages
|
|---|
| 63 | ; ============================================================================
|
|---|
| 64 |
|
|---|
| 65 | !insertmacro MUI_PAGE_WELCOME
|
|---|
| 66 | !insertmacro MUI_PAGE_LICENSE "..\LICENSE"
|
|---|
| 67 | !insertmacro MUI_PAGE_COMPONENTS
|
|---|
| 68 | !insertmacro MUI_PAGE_DIRECTORY
|
|---|
| 69 | !insertmacro MUI_PAGE_INSTFILES
|
|---|
| 70 | !insertmacro MUI_PAGE_FINISH
|
|---|
| 71 |
|
|---|
| 72 | !insertmacro MUI_UNPAGE_WELCOME
|
|---|
| 73 | !insertmacro MUI_UNPAGE_CONFIRM
|
|---|
| 74 | !insertmacro MUI_UNPAGE_COMPONENTS
|
|---|
| 75 | !insertmacro MUI_UNPAGE_INSTFILES
|
|---|
| 76 | !insertmacro MUI_UNPAGE_FINISH
|
|---|
| 77 |
|
|---|
| 78 | ; ============================================================================
|
|---|
| 79 | ; MUI Languages
|
|---|
| 80 | ; ============================================================================
|
|---|
| 81 |
|
|---|
| 82 | ;Remember the installer language
|
|---|
| 83 | !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
|
|---|
| 84 | !define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM"
|
|---|
| 85 | !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
|---|
| 86 |
|
|---|
| 87 | ;; English goes first because its the default. The rest are
|
|---|
| 88 | ;; in alphabetical order (at least the strings actually displayed
|
|---|
| 89 | ;; will be).
|
|---|
| 90 |
|
|---|
| 91 | !insertmacro MUI_LANGUAGE "English"
|
|---|
| 92 | !insertmacro MUI_LANGUAGE "French"
|
|---|
| 93 | !insertmacro MUI_LANGUAGE "German"
|
|---|
| 94 |
|
|---|
| 95 | ;--------------------------------
|
|---|
| 96 | ;Translations
|
|---|
| 97 |
|
|---|
| 98 | !define JOSM_DEFAULT_LANGFILE "locale\english.nsh"
|
|---|
| 99 |
|
|---|
| 100 | !include "langmacros.nsh"
|
|---|
| 101 |
|
|---|
| 102 | !insertmacro JOSM_MACRO_INCLUDE_LANGFILE "ENGLISH" "locale\english.nsh"
|
|---|
| 103 | !insertmacro JOSM_MACRO_INCLUDE_LANGFILE "FRENCH" "locale\french.nsh"
|
|---|
| 104 | !insertmacro JOSM_MACRO_INCLUDE_LANGFILE "GERMAN" "locale\german.nsh"
|
|---|
| 105 |
|
|---|
| 106 | ; Uninstall stuff
|
|---|
| 107 | !define MUI_UNCONFIRMPAGE_TEXT_TOP ${un.JOSM_UNCONFIRMPAGE_TEXT_TOP}
|
|---|
| 108 |
|
|---|
| 109 | ; ============================================================================
|
|---|
| 110 | ; Installation types
|
|---|
| 111 | ; ============================================================================
|
|---|
| 112 |
|
|---|
| 113 | InstType "$(JOSM_FULL_INSTALL)"
|
|---|
| 114 |
|
|---|
| 115 | InstType "un.$(un.JOSM_DEFAULT_UNINSTALL)"
|
|---|
| 116 | InstType "un.$(un.JOSM_FULL_UNINSTALL)"
|
|---|
| 117 |
|
|---|
| 118 | ; ============================================================================
|
|---|
| 119 | ; Section macros
|
|---|
| 120 | ; ============================================================================
|
|---|
| 121 | !include "Sections.nsh"
|
|---|
| 122 |
|
|---|
| 123 | ; ========= Macro to unselect and disable a section =========
|
|---|
| 124 |
|
|---|
| 125 | !macro DisableSection SECTION
|
|---|
| 126 |
|
|---|
| 127 | Push $0
|
|---|
| 128 | SectionGetFlags "${SECTION}" $0
|
|---|
| 129 | IntOp $0 $0 & ${SECTION_OFF}
|
|---|
| 130 | IntOp $0 $0 | ${SF_RO}
|
|---|
| 131 | SectionSetFlags "${SECTION}" $0
|
|---|
| 132 | Pop $0
|
|---|
| 133 |
|
|---|
| 134 | !macroend
|
|---|
| 135 |
|
|---|
| 136 | ; ========= Macro to enable (unreadonly) a section =========
|
|---|
| 137 | !define SECTION_ENABLE 0xFFFFFFEF
|
|---|
| 138 | !macro EnableSection SECTION
|
|---|
| 139 |
|
|---|
| 140 | Push $0
|
|---|
| 141 | SectionGetFlags "${SECTION}" $0
|
|---|
| 142 | IntOp $0 $0 & ${SECTION_ENABLE}
|
|---|
| 143 | SectionSetFlags "${SECTION}" $0
|
|---|
| 144 | Pop $0
|
|---|
| 145 |
|
|---|
| 146 | !macroend
|
|---|
| 147 |
|
|---|
| 148 | ; ============================================================================
|
|---|
| 149 | ; Command Line
|
|---|
| 150 | ; ============================================================================
|
|---|
| 151 | !include "FileFunc.nsh"
|
|---|
| 152 |
|
|---|
| 153 | ; ============================================================================
|
|---|
| 154 | ; Directory selection page configuration
|
|---|
| 155 | ; ============================================================================
|
|---|
| 156 | ; The text to prompt the user to enter a directory
|
|---|
| 157 | DirText $(JOSM_DIR_TEXT)
|
|---|
| 158 |
|
|---|
| 159 | ; The default installation directory
|
|---|
| 160 | InstallDir $PROGRAMFILES\JOSM\
|
|---|
| 161 |
|
|---|
| 162 | ; See if this is an upgrade; if so, use the old InstallDir as default
|
|---|
| 163 | InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\JOSM "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 $(JOSM_UPDATEICONS_ERROR1)
|
|---|
| 195 | Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
|
|---|
| 196 | UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
|
|---|
| 197 | MessageBox MB_OK|MB_ICONINFORMATION $(JOSM_UPDATEICONS_ERROR2)
|
|---|
| 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 JOSM
|
|---|
| 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 JOSM so, we must destroy this!
|
|---|
| 232 | DeleteRegKey HKCR $R0
|
|---|
| 233 | un.unlink.end:
|
|---|
| 234 | pop $R1
|
|---|
| 235 | FunctionEnd
|
|---|
| 236 |
|
|---|
| 237 | Function .onInit
|
|---|
| 238 | !insertmacro MUI_LANGDLL_DISPLAY
|
|---|
| 239 | FunctionEnd
|
|---|
| 240 |
|
|---|
| 241 | Function un.onInit
|
|---|
| 242 | !insertmacro MUI_UNGETLANGUAGE
|
|---|
| 243 | FunctionEnd
|
|---|
| 244 |
|
|---|
| 245 | ; ============================================================================
|
|---|
| 246 | ; Installation execution commands
|
|---|
| 247 | ; ============================================================================
|
|---|
| 248 |
|
|---|
| 249 | Section "-Required"
|
|---|
| 250 | ;-------------------------------------------
|
|---|
| 251 |
|
|---|
| 252 | ;
|
|---|
| 253 | ; Install for every user
|
|---|
| 254 | ;
|
|---|
| 255 | SectionIn 1 2 RO
|
|---|
| 256 | SetShellVarContext current
|
|---|
| 257 |
|
|---|
| 258 | SetOutPath $INSTDIR
|
|---|
| 259 |
|
|---|
| 260 | ; Write the uninstall keys for Windows
|
|---|
| 261 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "DisplayVersion" "${VERSION}"
|
|---|
| 262 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "DisplayName" "JOSM ${VERSION}"
|
|---|
| 263 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|---|
| 264 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "Publisher" "OpenStreetMap JOSM team"
|
|---|
| 265 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "HelpLink" "mailto:josm-dev@openstreetmap.org."
|
|---|
| 266 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "URLInfoAbout" "https://josm.openstreetmap.de"
|
|---|
| 267 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "URLUpdateInfo" "https://josm.openstreetmap.de"
|
|---|
| 268 | WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "NoModify" 1
|
|---|
| 269 | WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "NoRepair" 1
|
|---|
| 270 | WriteUninstaller "uninstall.exe"
|
|---|
| 271 |
|
|---|
| 272 | ; Write an entry for ShellExecute
|
|---|
| 273 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${DEST}.exe" "" '$INSTDIR\${DEST}.exe'
|
|---|
| 274 | WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${DEST}.exe" "Path" '$INSTDIR'
|
|---|
| 275 |
|
|---|
| 276 | SectionEnd ; "Required"
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 | Section $(JOSM_SEC_JOSM) SecJosm
|
|---|
| 280 | ;-------------------------------------------
|
|---|
| 281 | SectionIn 1
|
|---|
| 282 | SetOutPath $INSTDIR
|
|---|
| 283 | File "${DEST}.exe"
|
|---|
| 284 | File "josm-tested.jar"
|
|---|
| 285 |
|
|---|
| 286 | ; XXX - should be provided/done by josm.jar itself and not here!
|
|---|
| 287 | SetShellVarContext current
|
|---|
| 288 | SetOutPath "$APPDATA\JOSM"
|
|---|
| 289 |
|
|---|
| 290 | SectionEnd
|
|---|
| 291 |
|
|---|
| 292 | SectionGroup $(JOSM_SEC_PLUGINS_GROUP) SecPluginsGroup
|
|---|
| 293 |
|
|---|
| 294 | Section $(JOSM_SEC_TURNRESTRICTIONS_PLUGIN) SecTurnrestrictionsPlugin
|
|---|
| 295 | ;-------------------------------------------
|
|---|
| 296 | SectionIn 1 2
|
|---|
| 297 | SetShellVarContext current
|
|---|
| 298 | SetOutPath $APPDATA\JOSM\plugins
|
|---|
| 299 | File "../../dist/turnrestrictions.jar"
|
|---|
| 300 | StrCpy $plugins "$plugins<entry value='turnrestrictions'/>"
|
|---|
| 301 | SectionEnd
|
|---|
| 302 |
|
|---|
| 303 | SectionGroupEnd ; "Plugins"
|
|---|
| 304 |
|
|---|
| 305 | Section $(JOSM_SEC_STARTMENU) SecStartMenu
|
|---|
| 306 | ;-------------------------------------------
|
|---|
| 307 | SectionIn 1 2
|
|---|
| 308 | ; To quote "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
|
|---|
| 309 | ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
|
|---|
| 310 | CreateShortCut "$SMPROGRAMS\JOSM.lnk" "$INSTDIR\${DEST}.exe" "" "$INSTDIR\${DEST}.exe" 0 "" "" $(JOSM_LINK_TEXT)
|
|---|
| 311 | SectionEnd
|
|---|
| 312 |
|
|---|
| 313 | Section $(JOSM_SEC_DESKTOP_ICON) SecDesktopIcon
|
|---|
| 314 | ;-------------------------------------------
|
|---|
| 315 | ; Create desktop icon
|
|---|
| 316 | ; Desktop icon for a program should not be installed as default!
|
|---|
| 317 | CreateShortCut "$DESKTOP\JOSM.lnk" "$INSTDIR\${DEST}.exe" "" "$INSTDIR\${DEST}.exe" 0 "" "" $(JOSM_LINK_TEXT)
|
|---|
| 318 | SectionEnd
|
|---|
| 319 |
|
|---|
| 320 | Section $(JOSM_SEC_QUICKLAUNCH_ICON) SecQuickLaunchIcon
|
|---|
| 321 | ;-------------------------------------------
|
|---|
| 322 | ; Create quick launch icon. Does not really exist as of Windows 7/8 but still advanced users use it.
|
|---|
| 323 | ; Only disable it by default, see #10241
|
|---|
| 324 | CreateShortCut "$QUICKLAUNCH\JOSM.lnk" "$INSTDIR\${DEST}.exe" "" "$INSTDIR\${DEST}.exe" 0 "" "" $(JOSM_LINK_TEXT)
|
|---|
| 325 | SectionEnd
|
|---|
| 326 |
|
|---|
| 327 | Section $(JOSM_SEC_FILE_EXTENSIONS) SecFileExtensions
|
|---|
| 328 | ;-------------------------------------------
|
|---|
| 329 | SectionIn 1 2
|
|---|
| 330 | ; Create File Extensions
|
|---|
| 331 | WriteRegStr HKCR ${OSM_ASSOC} "" "OpenStreetMap data"
|
|---|
| 332 | WriteRegStr HKCR "${OSM_ASSOC}\Shell\open\command" "" '"$INSTDIR\${DEST}.exe" "%1"'
|
|---|
| 333 | WriteRegStr HKCR "${OSM_ASSOC}\DefaultIcon" "" '"$INSTDIR\${DEST}.exe",0'
|
|---|
| 334 | push $R0
|
|---|
| 335 | StrCpy $R0 ".osm"
|
|---|
| 336 | Call Associate
|
|---|
| 337 | StrCpy $R0 ".gpx"
|
|---|
| 338 | Call Associate
|
|---|
| 339 | ; if somethings added here, add it also to the uninstall section
|
|---|
| 340 | pop $R0
|
|---|
| 341 | !insertmacro UpdateIcons
|
|---|
| 342 | SectionEnd
|
|---|
| 343 |
|
|---|
| 344 | Section "-PluginSetting"
|
|---|
| 345 | ;-------------------------------------------
|
|---|
| 346 | SectionIn 1 2
|
|---|
| 347 | ;MessageBox MB_OK "PluginSetting!" IDOK 0
|
|---|
| 348 | ; XXX - should better be handled inside JOSM (recent plugin manager is going in the right direction)
|
|---|
| 349 | SetShellVarContext current
|
|---|
| 350 | !include LogicLib.nsh
|
|---|
| 351 | IfFileExists "$APPDATA\JOSM\preferences" settings_exists
|
|---|
| 352 | IfFileExists "$APPDATA\JOSM\preferences.xml" settings_exists
|
|---|
| 353 | FileOpen $R0 "$APPDATA\JOSM\preferences.xml" w
|
|---|
| 354 | 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>"
|
|---|
| 355 | FileClose $R0
|
|---|
| 356 | settings_exists:
|
|---|
| 357 | SectionEnd
|
|---|
| 358 |
|
|---|
| 359 | Section "un.$(un.JOSM_SEC_UNINSTALL)" un.SecUinstall
|
|---|
| 360 | ;-------------------------------------------
|
|---|
| 361 |
|
|---|
| 362 | ;
|
|---|
| 363 | ; UnInstall for every user
|
|---|
| 364 | ;
|
|---|
| 365 | SectionIn 1 2
|
|---|
| 366 | SetShellVarContext current
|
|---|
| 367 |
|
|---|
| 368 | ClearErrors
|
|---|
| 369 | Delete "$INSTDIR\josm-tested.jar"
|
|---|
| 370 | IfErrors 0 NoJOSMErrorMsg
|
|---|
| 371 | MessageBox MB_OK $(un.JOSM_IN_USE_ERROR) IDOK 0 ;skipped if josm.jar removed
|
|---|
| 372 | Abort $(un.JOSM_IN_USE_ERROR)
|
|---|
| 373 | NoJOSMErrorMsg:
|
|---|
| 374 | Delete "$INSTDIR\${DEST}.exe"
|
|---|
| 375 | Delete "$INSTDIR\imageformats\qjpeg4.dll"
|
|---|
| 376 | RMDir "$INSTDIR\imageformats"
|
|---|
| 377 | Delete "$INSTDIR\mingwm10.dll"
|
|---|
| 378 | Delete "$INSTDIR\QtCore4.dll"
|
|---|
| 379 | Delete "$INSTDIR\QtGui4.dll"
|
|---|
| 380 | Delete "$INSTDIR\QtNetwork4.dll"
|
|---|
| 381 | Delete "$INSTDIR\QtWebKit4.dll"
|
|---|
| 382 | Delete "$INSTDIR\webkit-image.exe"
|
|---|
| 383 | Delete "$INSTDIR\uninstall.exe"
|
|---|
| 384 |
|
|---|
| 385 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM"
|
|---|
| 386 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\${DEST}.exe"
|
|---|
| 387 | DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${DEST}.exe"
|
|---|
| 388 |
|
|---|
| 389 | ; Remove Language preference info
|
|---|
| 390 | DeleteRegKey HKCU "Software/JOSM" ;${MUI_LANGDLL_REGISTRY_ROOT} ${MUI_LANGDLL_REGISTRY_KEY}
|
|---|
| 391 |
|
|---|
| 392 | push $R0
|
|---|
| 393 | StrCpy $R0 ".osm"
|
|---|
| 394 | Call un.unlink
|
|---|
| 395 | StrCpy $R0 ".gpx"
|
|---|
| 396 | Call un.unlink
|
|---|
| 397 | pop $R0
|
|---|
| 398 |
|
|---|
| 399 | DeleteRegKey HKCR ${OSM_ASSOC}
|
|---|
| 400 | DeleteRegKey HKCR "${OSM_ASSOC}\Shell\open\command"
|
|---|
| 401 | DeleteRegKey HKCR "${OSM_ASSOC}\DefaultIcon"
|
|---|
| 402 | !insertmacro UpdateIcons
|
|---|
| 403 |
|
|---|
| 404 | Delete "$SMPROGRAMS\josm.lnk"
|
|---|
| 405 | Delete "$DESKTOP\josm.lnk"
|
|---|
| 406 | Delete "$QUICKLAUNCH\josm.lnk"
|
|---|
| 407 |
|
|---|
| 408 | RMDir "$INSTDIR"
|
|---|
| 409 |
|
|---|
| 410 | SectionEnd ; "Uninstall"
|
|---|
| 411 |
|
|---|
| 412 | Section /o "un.$(un.JOSM_SEC_PERSONAL_SETTINGS)" un.SecPersonalSettings
|
|---|
| 413 | ;-------------------------------------------
|
|---|
| 414 | SectionIn 2
|
|---|
| 415 | SetShellVarContext current
|
|---|
| 416 | Delete "$APPDATA\JOSM\plugins\turnrestrictions\*.*"
|
|---|
| 417 | RMDir "$APPDATA\JOSM\plugins\turnrestrictions"
|
|---|
| 418 | Delete "$APPDATA\JOSM\plugins\*.*"
|
|---|
| 419 | RMDir "$APPDATA\JOSM\plugins"
|
|---|
| 420 |
|
|---|
| 421 | Delete "$APPDATA\JOSM\motd.html"
|
|---|
| 422 | Delete "$APPDATA\JOSM\preferences.xml"
|
|---|
| 423 | RMDir "$APPDATA\JOSM"
|
|---|
| 424 | SectionEnd
|
|---|
| 425 |
|
|---|
| 426 | Section "-Un.Finally"
|
|---|
| 427 | ;-------------------------------------------
|
|---|
| 428 | SectionIn 1 2
|
|---|
| 429 | ; this test must be done after all other things uninstalled (e.g. Global Settings)
|
|---|
| 430 | IfSilent NoFinalErrorMsg
|
|---|
| 431 | IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
|
|---|
| 432 | MessageBox MB_OK $(un.JOSM_INSTDIR_ERROR) IDOK 0 ; skipped if dir doesn't exist
|
|---|
| 433 | NoFinalErrorMsg:
|
|---|
| 434 | SectionEnd
|
|---|
| 435 |
|
|---|
| 436 | ; ============================================================================
|
|---|
| 437 | ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
|
|---|
| 438 | ; ============================================================================
|
|---|
| 439 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
|---|
| 440 | !insertmacro MUI_DESCRIPTION_TEXT ${SecJosm} $(JOSM_SECDESC_JOSM)
|
|---|
| 441 | !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} $(JOSM_SECDESC_PLUGINS_GROUP)
|
|---|
| 442 | !insertmacro MUI_DESCRIPTION_TEXT ${SecTurnrestrictionsPlugin} $(JOSM_SECDESC_TURNRESTRICTIONS_PLUGIN)
|
|---|
| 443 | !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(JOSM_SECDESC_STARTMENU)
|
|---|
| 444 | !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopIcon} $(JOSM_SECDESC_DESKTOP_ICON)
|
|---|
| 445 | !insertmacro MUI_DESCRIPTION_TEXT ${SecQuickLaunchIcon} $(JOSM_SECDESC_QUICKLAUNCH_ICON)
|
|---|
| 446 | !insertmacro MUI_DESCRIPTION_TEXT ${SecFileExtensions} $(JOSM_SECDESC_FILE_EXTENSIONS)
|
|---|
| 447 | !insertmacro MUI_FUNCTION_DESCRIPTION_END
|
|---|
| 448 |
|
|---|
| 449 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
|
|---|
| 450 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} $(un.JOSM_SECDESC_UNINSTALL)
|
|---|
| 451 | !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} $(un.JOSM_SECDESC_PERSONAL_SETTINGS)
|
|---|
| 452 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
|
|---|
| 453 |
|
|---|
| 454 | ; ============================================================================
|
|---|
| 455 | ; Callback functions
|
|---|
| 456 | ; ============================================================================
|
|---|
| 457 |
|
|---|