public static boolean updateLocalSettings() {

        //System.setProperty("ru.mrekin.sc.sclauncher.forceSettings", "true");
//      System.getProperty("ru.mrekin.sc.sclauncher.forceSettings", "true");
        boolean forceSettings = Boolean.getBoolean("ru.mrekin.sc.sclauncher.forceSettings");
        log("Force setting is: " + forceSettings);
        //Properties with sorted keys
        XMLConfiguration localSettings;
        XMLConfiguration tempLocalSettings;// = new Properties();
        XMLConfiguration defaultSettings = new XMLConfiguration();
        try {
            File lsf = getLocalSettingsFile();
            log(lsf.getAbsolutePath());
            if (!lsf.exists() || !lsf.isFile()) {
                log("Local settings file " + lsf.getAbsolutePath() + " not found");
                applyDefaultSettings();
            } else {
                localSettings = new XMLConfiguration(lsf);
                tempLocalSettings = (XMLConfiguration) localSettings.clone();
                InputStream dsf = getDefaultSettings();
                if (dsf == null) {
                    log("Can't load default settings. Jar file is corrupted or you need to package project first.");
                    System.exit(1);
                }
                defaultSettings.load(dsf);

                Iterator iterator = defaultSettings.getKeys();
                String key;
                while (iterator.hasNext())
                //for (String key : defaultSettings.stringPropertyNames())
                {
                    key = (String) iterator.next();
                    if (!localSettings.containsKey(key)) {
                        localSettings.addProperty(key, defaultSettings.getProperty(key));
                    } else {
                        if (forceSettings && "true".equals(defaultSettings.getString(key + "[@force]"))) {
                            localSettings.setProperty(key, defaultSettings.getProperty(key));
                            log("Force update property: " + key);
                        }
                    }
                }
                if (!localSettings.equals(tempLocalSettings)) {
                    localSettings.save(lsf);
                }

            }
        } catch (ConfigurationException ce) {
            log(ce.getLocalizedMessage());
            return false;
        }

        return true;
    }