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