OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 144 | Rev 180 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 174
Line 100... Line 100...
100
            rootPaths.addAll(Arrays.asList(loRootPaths));
100
            rootPaths.addAll(Arrays.asList(loRootPaths));
101
        } else {
101
        } else {
102
            rootPaths.addAll(Arrays.asList(loRootPaths));
102
            rootPaths.addAll(Arrays.asList(loRootPaths));
103
            rootPaths.addAll(Arrays.asList(ooRootPaths));
103
            rootPaths.addAll(Arrays.asList(ooRootPaths));
104
        }
104
        }
-
 
105
 
105
        for (final String p : rootPaths) {
106
        for (final String p : rootPaths) {
-
 
107
            // On force à chercher dans le registre 64 bits sinon il va chercher dans le registre 32
-
 
108
            // bits si os 64b et VM 32b
106
            if (DesktopEnvironment.test("reg", "query", p))
109
            if (DesktopEnvironment.test("reg", "query", p, "/reg:64"))
107
                return p;
110
                return p;
108
        }
111
        }
-
 
112
 
109
        return null;
113
        return null;
110
    }
114
    }
111
 
115
 
112
    private static File findBundleDir() throws IOException {
116
    private static File findBundleDir() throws IOException {
113
        final Mac de = (Mac) DesktopEnvironment.getDE();
117
        final Mac de = (Mac) DesktopEnvironment.getDE();
Line 121... Line 125...
121
    }
125
    }
122
 
126
 
123
    // all string values for the passed registry path
127
    // all string values for the passed registry path
124
    private static Map<String, String> getStringValues(final String path, final String option) throws IOException {
128
    private static Map<String, String> getStringValues(final String path, final String option) throws IOException {
125
        final Map<String, String> values = new HashMap<String, String>();
129
        final Map<String, String> values = new HashMap<String, String>();
-
 
130
        // On force /reg:64 (utile si on utilise une VM 32 avec un systeme 64 bits)
126
        final String out = DesktopEnvironment.cmdSubstitution(Runtime.getRuntime().exec(new String[] { "reg", "query", path, option }));
131
        final String out = DesktopEnvironment.cmdSubstitution(Runtime.getRuntime().exec(new String[] { "reg", "query", path, option, "/reg:64" }));
127
        final Matcher matcher = stringValuePattern.matcher(out);
132
        final Matcher matcher = stringValuePattern.matcher(out);
128
        while (matcher.find()) {
133
        while (matcher.find()) {
129
            values.put(matcher.group(1), matcher.group(2));
134
            values.put(matcher.group(1), matcher.group(2));
130
        }
135
        }
131
        return values;
136
        return values;