Changeset 30581 in osm for applications


Ignore:
Timestamp:
2014-08-13T02:48:01+02:00 (10 years ago)
Author:
donvip
Message:

[josm_nsis] fix #josm9587 - JOSM runs with elevated permissions when run from the end of the installer:

  • update to MUI2
  • proper UAC handling (requires admin privileges)
  • locale update, proper use of $\r and $\n
  • fix typo in French translation
  • use of stdutils nsis plugin to launch JOSM as user in MUI_FINISHPAGE (ansi version until we switch to unicode installer later with NSIS 3)
Location:
applications/editors/josm/nsis
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/nsis/josm-setup-unix.sh

    r30580 r30581  
    101101
    102102        export TARGET=$1        # josm / josm64. Used in file name of launcher and installer
    103         #export RTBITS=$2       # L4J "runtimeBits" (JVM architecture used by launcher)
    104         #export INIHEAP=$3      # L4J "initialHeapSize" (initial heap size in MB)
    105         #export MAXHEAP=$4      # L4J "maxHeapSize" (max heap size in MB)
    106103       
    107104        /bin/rm -f "launch4j_${TARGET}.xml"
     
    137134
    138135build_exe "josm" "64\/32" 128 1024
    139 build_exe "josm64"  "64" 256 2048
     136# 64-bit binary generation commented until possible with launch4j / nsis
     137# build_exe "josm64"  "64" 256 2048
    140138
    141139/bin/rm -f josm-tested.jar 2>/dev/null >/dev/null
  • applications/editors/josm/nsis/josm.nsi

    r30580 r30581  
    44
    55; Set the compression mechanism first.
    6 ; If you get an error here, please update to at least NSIS 2.07!
    76SetCompressor /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+)
     15RequestExecutionLevel admin
    816
    917; Used to refresh the display of file association
     
    1826; ============================================================================
    1927; The name of the installer
    20 !define PROGRAM_NAME "JOSM"
    21 
    22 Name "${PROGRAM_NAME} ${VERSION}"
     28Name "JOSM ${VERSION}"
    2329
    2430; The file to write
     
    3339; ============================================================================
    3440
    35 !include "MUI.nsh"
     41!include "MUI2.nsh"
    3642
    3743; Icon of installer and uninstaller
     
    4551!define MUI_WELCOMEPAGE_TEXT $(JOSM_WELCOME_TEXT)
    4652
    47 !define MUI_FINISHPAGE_RUN "$INSTDIR\${DEST}.exe"
    48 
     53!define MUI_FINISHPAGE_RUN
     54!define MUI_FINISHPAGE_RUN_FUNCTION LaunchJOSM
     55
     56; Function used to Launch JOSM in user (non-elevated) mode
     57Function LaunchJOSM
     58  ${StdUtils.ExecShellAsUser} $0 "$INSTDIR\${DEST}.exe" "open" ""
     59FunctionEnd
    4960
    5061; ============================================================================
     
    5566!insertmacro MUI_PAGE_LICENSE "..\core\LICENSE"
    5667!insertmacro MUI_PAGE_COMPONENTS
    57 ;Page custom DisplayAdditionalTasksPage
    5868!insertmacro MUI_PAGE_DIRECTORY
    5969!insertmacro MUI_PAGE_INSTFILES
     
    7282  ;Remember the installer language
    7383  !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
    74   !define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM"
     84  !define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM"
    7585  !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
    7686 
     
    105115InstType "un.$(un.JOSM_DEFAULT_UNINSTALL)"
    106116InstType "un.$(un.JOSM_FULL_UNINSTALL)"
    107 
    108 ; ============================================================================
    109 ; Reserve Files
    110 ; ============================================================================
    111 
    112   ;Things that need to be extracted on first (keep these lines before any File command!)
    113   ;Only useful for BZIP2 compression
    114 
    115 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
    116117
    117118; ============================================================================
     
    235236
    236237Function .onInit
    237   ;Extract InstallOptions INI files
    238 ;  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
    239238  !insertmacro MUI_LANGDLL_DISPLAY
    240239FunctionEnd
    241240
    242241Function un.onInit
    243 
    244242  !insertmacro MUI_UNGETLANGUAGE
    245  
    246243FunctionEnd
    247244
     
    262259
    263260; Write the uninstall keys for Windows
    264 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayVersion" "${VERSION}"
    265 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayName" "JOSM ${VERSION}"
    266 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "UninstallString" '"$INSTDIR\uninstall.exe"'
    267 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "Publisher" "The OpenStreetMap JOSM developers team, https://josm.openstreetmap.de"
    268 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "HelpLink" "mailto:josm-dev@openstreetmap.org."
    269 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLInfoAbout" "https://josm.openstreetmap.de"
    270 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLUpdateInfo" "https://josm.openstreetmap.de"
    271 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoModify" 1
    272 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoRepair" 1
     261WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "DisplayVersion" "${VERSION}"
     262WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "DisplayName" "JOSM ${VERSION}"
     263WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "UninstallString" '"$INSTDIR\uninstall.exe"'
     264WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "Publisher" "OpenStreetMap JOSM team"
     265WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "HelpLink" "mailto:josm-dev@openstreetmap.org."
     266WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "URLInfoAbout" "https://josm.openstreetmap.de"
     267WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "URLUpdateInfo" "https://josm.openstreetmap.de"
     268WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "NoModify" 1
     269WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM" "NoRepair" 1
    273270WriteUninstaller "uninstall.exe"
    274271
     
    360357SectionEnd
    361358
    362 
    363359Section "-PluginSetting"
    364360;-------------------------------------------
     
    374370FileClose $R0
    375371settings_exists:
    376 
    377 SectionEnd
    378 
     372SectionEnd
    379373
    380374Section "un.$(un.JOSM_SEC_UNINSTALL)" un.SecUinstall
     
    403397Delete "$INSTDIR\uninstall.exe"
    404398
    405 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM"
     399DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\JOSM"
    406400DeleteRegKey HKEY_LOCAL_MACHINE "Software\${DEST}.exe"
    407401DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${DEST}.exe"
     
    446440SectionEnd
    447441
    448 
    449442Section "-Un.Finally"
    450443;-------------------------------------------
     
    455448NoFinalErrorMsg:
    456449SectionEnd
    457 
    458450
    459451; ============================================================================
     
    469461  !insertmacro MUI_DESCRIPTION_TEXT ${SecQuickLaunchIcon} $(JOSM_SECDESC_QUICKLAUNCH_ICON)
    470462  !insertmacro MUI_DESCRIPTION_TEXT ${SecFileExtensions} $(JOSM_SECDESC_FILE_EXTENSIONS)
    471  
    472 
    473463!insertmacro MUI_FUNCTION_DESCRIPTION_END
    474464
  • applications/editors/josm/nsis/locale/english.nsh

    r30108 r30581  
    1111; langmacros.nsh when updating this file
    1212
    13 
    14 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_WELCOME_TEXT "This wizard will guide you through the installation of the JAVA OpenStreetMap editor (JOSM).\r\n\r\nBefore starting the installation, make sure any JOSM applications are not running.\r\n\r\nClick 'Next' to continue."
     13!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_WELCOME_TEXT "This wizard will guide you through the installation of the Java OpenStreetMap Editor (JOSM).$\r$\n$\r$\nBefore starting the installation, make sure any JOSM applications are not running.$\r$\n$\r$\nClick 'Next' to continue."
    1514!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_DIR_TEXT "Choose a directory in which to install JOSM."
    1615
     
    1817!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_JOSM "JOSM"
    1918!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_PLUGINS_GROUP "Plugins"
    20 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_AGPIFOJ_PLUGIN  "AgPifoJ"
    2119!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_TURNRESTRICTIONS_PLUGIN  "TurnRestrictions"
    2220!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_WMS  "WMS Downloader"
     
    2523!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_QUICKLAUNCH_ICON  "Quick Launch Icon"
    2624!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_FILE_EXTENSIONS  "File Extensions"
    27 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_JOSM "JOSM is the JAVA OpenStreetMap editor for .osm files."
     25!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_JOSM "JOSM is the Java OpenStreetMap editor for .osm files."
    2826!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_PLUGINS_GROUP "An assortment of useful JOSM plugins."
    29 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_AGPIFOJ_PLUGIN  "Correlates pictures with GPS tracks or import EXIF geotagged pictures."
    30 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_REMOTECONTROL_PLUGIN  "Let other applications send commands to JOSM."
    3127!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_TURNRESTRICTIONS_PLUGIN  "Allows to enter and maintain information about turn restrictions."
    32 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_VALIDATOR_PLUGIN  "Validates edited data if it conforms to common suggestions."
    3328!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_WMS  "Display background images from Web Map Service (WMS) sources."
    3429!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_STARTMENU  "Add a JOSM start menu entry."
     
    4035!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_UPDATEICONS_ERROR2 "You should install the free 'Microsoft Layer for Unicode' to update JOSM file icons"
    4136
    42 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_LINK_TEXT "JAVA OpenStreetMap - Editor"
     37!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_LINK_TEXT "Java OpenStreetMap - Editor"
    4338
    44 !insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_UNCONFIRMPAGE_TEXT_TOP "The following JAVA OpenStreetMap editor (JOSM) installation will be uninstalled. Click 'Next' to continue."
     39!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_UNCONFIRMPAGE_TEXT_TOP "The following Java OpenStreetMap editor (JOSM) installation will be uninstalled. Click 'Next' to continue."
    4540!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_DEFAULT_UNINSTALL "Default (keep Personal Settings and plugins)"
    4641!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_FULL_UNINSTALL "All (remove all)"
     
    4944!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_INSTDIR_ERROR "Please note: The directory $INSTDIR could not be removed!"
    5045
    51 
    5246!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SEC_UNINSTALL "JOSM"
    5347!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SEC_PERSONAL_SETTINGS "Personal settings"
    5448!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SEC_PLUGINS "Personal plugins"
    5549
    56 
    5750!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SECDESC_UNINSTALL "Uninstall JOSM."
    5851!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SECDESC_PERSONAL_SETTINGS  "Uninstall personal settings from your profile: $PROFILE."
    59 
  • applications/editors/josm/nsis/locale/french.nsh

    r30108 r30581  
    77;;  Author: Vincent Privat <vprivat@openstreetmap.fr>, 2011.
    88;;
    9 ;;
    109
    11 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_WELCOME_TEXT "Cet assistant va vous guider à travers l'installation de l'éditeur Java OpenStreetMap (JOSM).\r\n\r\nAvant de lancer l'installation, assure-vous que JOSM n'est pas déjà en cours d'exécution.\r\n\r\nVeuillez cliquer sur 'Suivant' pour continuer."
     10; Make sure to update the JOSM_MACRO_LANGUAGEFILE_END macro in
     11; langmacros.nsh when updating this file
     12
     13!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_WELCOME_TEXT "Cet assistant va vous guider à travers l'installation de l'éditeur Java OpenStreetMap (JOSM).$\r$\n$\r$\nAvant de lancer l'installation, assurez-vous que JOSM n'est pas déjà en cours d'exécution.$\r$\n$\r$\nVeuillez cliquer sur 'Suivant' pour continuer."
    1214!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_DIR_TEXT "Veuillez choisir un dossier où installer JOSM."
    1315
     
    1517!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_JOSM "JOSM"
    1618!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_PLUGINS_GROUP "Greffons"
    17 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_AGPIFOJ_PLUGIN  "AgPifoJ"
    1819!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_TURNRESTRICTIONS_PLUGIN  "TurnRestrictions"
    1920!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_WMS  "Téléchargement WMS"
     
    2425!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_JOSM "JOSM est l'éditeur Java OpenStreetMap pour les fichiers .osm."
    2526!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_PLUGINS_GROUP "Une sélection de greffons utiles pour JOSM."
    26 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_AGPIFOJ_PLUGIN  "Corrèle des photos avec des traces GPS ou importe des photos géolocalisées EXIF."
    27 ;!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_REMOTECONTROL_PLUGIN  "Let other applications send commands to JOSM."
    2827!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_TURNRESTRICTIONS_PLUGIN  "Permet de saisir et de maintenir des informations sur les restrictions de tourner."
    29 ;!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_VALIDATOR_PLUGIN  "Validates edited data if it conforms to common suggestions."
    3028!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_WMS  "Affiche des images en arrière-plan à partir de sources Web Map Service (WMS)."
    3129!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_STARTMENU  "Ajoute une entrée JOSM au menu démarrer."
     
    4644!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_INSTDIR_ERROR "Attention: Le dossier $INSTDIR n'a pas pu être supprimé !"
    4745
    48 
    4946!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SEC_UNINSTALL "JOSM"
    5047!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SEC_PERSONAL_SETTINGS "Paramètres personnels"
    5148!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SEC_PLUGINS "Greffons personnels"
    5249
    53 
    5450!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SECDESC_UNINSTALL "Désinstaller JOSM."
    5551!insertmacro JOSM_MACRO_DEFAULT_STRING un.JOSM_SECDESC_PERSONAL_SETTINGS  "Désinstaller les paramètres personnels de votre profil: $PROFILE."
    56 
  • applications/editors/josm/nsis/locale/german.nsh

    r30108 r30581  
    77;;  Author: Bjoern Voigt <bjoern@cs.tu-berlin.de>, 2003.
    88;;  Version 2
    9 ;;
    109
    11 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_WELCOME_TEXT "Diese Installationshilfe wird Sie durch den Installationsvorgang des JAVA OpenStreetMap Editors (JOSM) führen.\r\n\r\nBevor Sie die Installation starten, stellen Sie bitte sicher das JOSM nicht bereits läuft.\r\n\r\nAuf 'Weiter' klicken um fortzufahren."
     10; Make sure to update the JOSM_MACRO_LANGUAGEFILE_END macro in
     11; langmacros.nsh when updating this file
     12
     13!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_WELCOME_TEXT "Diese Installationshilfe wird Sie durch den Installationsvorgang des JAVA OpenStreetMap Editors (JOSM) führen.$\r$\n$\r$\nBevor Sie die Installation starten, stellen Sie bitte sicher das JOSM nicht bereits läuft.$\r$\n$\r$\nAuf 'Weiter' klicken um fortzufahren."
    1214!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_DIR_TEXT "Bitte das Verzeichnis auswählen, in das JOSM installiert werden soll."
    1315
     
    1517!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_JOSM "JOSM"
    1618!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_PLUGINS_GROUP "Plugins"
    17 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_AGPIFOJ_PLUGIN  "AgPifoJ"
    1819!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_TURNRESTRICTIONS_PLUGIN  "TurnRestrictions"
    1920!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SEC_WMS  "WMS Downloadprogram"
     
    2425!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_JOSM "JOSM ist der JAVA OpenStreetMap Editor für .osm Dateien."
    2526!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_PLUGINS_GROUP "Eine Auswahl an nützlichen JOSM Plugins."
    26 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_AGPIFOJ_PLUGIN  "Bringt GPS Tracks mit Fotos in Übereinstimmung oder importiert EXIF Fotos"
    27 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_REMOTECONTROL_PLUGIN  "Andere Applikationen können JOSM Kommandos zusenden."
    2827!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_TURNRESTRICTIONS_PLUGIN  "Erleichtert die Eingabe und Pflege von Informationen zu Abbiegebeschränkungen."
    29 !insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_VALIDATOR_PLUGIN  "Validatiert geänderte Daten ob diese mit den üblichen Ratschlägen übereinstimmen."
    3028!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_WMS  "Hintergrundbilder von Web Map Service (WMS) Quellen."
    3129!insertmacro JOSM_MACRO_DEFAULT_STRING JOSM_SECDESC_STARTMENU  "Fügt JOSM zum Startmenü hinzu."
Note: See TracChangeset for help on using the changeset viewer.