1
1
/**
2
2
* Copyright (C) 2000 - 2009 Silverpeas
3
3
*
4
- * This program is free software: you can redistribute it and/or modify
5
- * it under the terms of the GNU Affero General Public License as
6
- * published by the Free Software Foundation, either version 3 of the
7
- * License, or (at your option) any later version.
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the
5
+ * GNU Affero General Public License as published by the Free Software Foundation, either version 3
6
+ * of the License, or (at your option) any later version.
8
7
*
9
- * As a special exception to the terms and conditions of version 3.0 of
10
- * the GPL, you may redistribute this Program in connection with Free/Libre
11
- * Open Source Software ("FLOSS") applications as described in Silverpeas's
12
- * FLOSS exception. You should have received a copy of the text describing
13
- * the FLOSS exception, and it is also available here:
8
+ * As a special exception to the terms and conditions of version 3.0 of the GPL, you may
9
+ * redistribute this Program in connection with Free/Libre Open Source Software ("FLOSS")
10
+ * applications as described in Silverpeas's FLOSS exception. You should have received a copy of the
11
+ * text describing the FLOSS exception, and it is also available here:
14
12
* "http://repository.silverpeas.com/legal/licensing"
15
13
*
16
- * This program is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU Affero General Public License for more details.
14
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
15
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ * Affero General Public License for more details.
20
17
*
21
- * You should have received a copy of the GNU Affero General Public License
22
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ * You should have received a copy of the GNU Affero General Public License along with this program.
19
+ * If not, see <http://www.gnu.org/licenses/>.
23
20
*/
24
21
package org .silverpeas .openoffice .windows ;
25
22
@@ -43,8 +40,10 @@ public class MsOfficeRegistryHelper implements OfficeFinder {
43
40
static final String POWERPOINT = "Powerpoint.Application" ;
44
41
static final String WORD = "Word.Application" ;
45
42
static final String FRONTPAGE = "FrontPage.Application" ;
43
+ static final String BASE_KEY_OFFICE = "\" HKEY_LOCAL_MACHINE\\ Software\\ Microsoft\\ Office\\ " ;
46
44
static final String BASE_APPLICATION_KEY = "\" HKEY_LOCAL_MACHINE\\ Software\\ Classes\\ " ;
47
- static final String BASE_KEY_64_CLSID = "\" HKEY_LOCAL_MACHINE\\ Software\\ Wow6432Node\\ Classes\\ CLSID\\ " ;
45
+ static final String BASE_KEY_64_CLSID =
46
+ "\" HKEY_LOCAL_MACHINE\\ Software\\ Wow6432Node\\ Classes\\ CLSID\\ " ;
48
47
static final String BASE_KEY_CLSID = "\" HKEY_LOCAL_MACHINE\\ Software\\ Classes\\ CLSID\\ " ;
49
48
static final Pattern AUTOMATION = Pattern .compile (
50
49
"\\ s*/[aA][uU][tT][oO][mM][aA][tT][iI][oO][nN]\\ s*" );
@@ -61,7 +60,11 @@ protected String getPath(String type) {
61
60
path = RegistryKeyReader .readKey (BASE_KEY_64_CLSID + clsid + "\\ LocalServer32\" " );
62
61
}
63
62
if (path != null ) {
64
- return '"' + extractPath (path ) + '"' ;
63
+ String extractedPath = extractPath (path );
64
+ if (!extractedPath .startsWith ("\" " )) {
65
+ extractedPath = '"' + extractedPath + '"' ;
66
+ }
67
+ return extractedPath ;
65
68
}
66
69
}
67
70
return null ;
0 commit comments