Ignore:
Timestamp:
2020-12-07T15:40:50+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #20143 - make restart work with new macOS package built with jpackage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/RestartAction.java

    r17391 r17396  
    3737
    3838    private static final String APPLE_OSASCRIPT = "/usr/bin/osascript";
     39    private static final String APPLE_APP_PATH = "/JOSM.app/Contents/";
    3940
    4041    // AppleScript to restart OS X package
     
    146147    private static List<String> determineRestartCommands() {
    147148        try {
    148             // special handling for OSX .app package
    149             if (PlatformManager.isPlatformOsx() && getSystemProperty("java.library.path").contains("/JOSM.app/Contents/MacOS")) {
     149            // special handling for OSX .app package (both legacy and jpackage-based)
     150            if (PlatformManager.isPlatformOsx() && (
     151                    getSystemProperty("java.library.path").contains(APPLE_APP_PATH) ||
     152                    getSystemProperty("java.class.path").contains(APPLE_APP_PATH))) {
    150153                return getAppleCommands();
    151154            } else {
Note: See TracChangeset for help on using the changeset viewer.