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