|
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 GNU Affero General Public |
| 5 | + * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later |
| 6 | + * 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 redistribute this Program in |
| 9 | + * connection with Free/Libre Open Source Software ("FLOSS") applications as described in Silverpeas's FLOSS exception. You |
| 10 | + * should have received a copy of the text describing the FLOSS exception, and it is also available here: |
14 | 11 | * "http://repository.silverpeas.com/legal/licensing"
|
15 | 12 | *
|
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. |
| 13 | + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
| 14 | + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
| 15 | + * details. |
20 | 16 | *
|
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/>. |
| 17 | + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see |
| 18 | + * <http://www.gnu.org/licenses/>. |
23 | 19 | */
|
24 |
| - |
25 | 20 | package com.silverpeas.openoffice.windows;
|
26 | 21 |
|
27 | 22 | import com.silverpeas.openoffice.util.RegistryKeyReader;
|
@@ -55,7 +50,7 @@ public void testReadKey() throws Exception {
|
55 | 50 | return;
|
56 | 51 | }
|
57 | 52 | String clockFormat = RegistryKeyReader.readKey(
|
58 |
| - "\"HKEY_CURRENT_USER\\Software\\Microsoft\\Clock\" /v iFormat"); |
| 53 | + "\"HKEY_CURRENT_USER\\Control Panel\\International\" /v iTime"); |
59 | 54 | assertNotNull(clockFormat);
|
60 | 55 | assertEquals("1", clockFormat);
|
61 | 56 | }
|
@@ -83,6 +78,17 @@ public void testFindOpenOffice() throws Exception {
|
83 | 78 | WindowsOpenOfficeFinder helper = new WindowsOpenOfficeFinder();
|
84 | 79 | String openOffice = helper.findOpenOffice();
|
85 | 80 | assertNotNull(openOffice);
|
| 81 | + if(is64Bits()) { |
86 | 82 | assertEquals("\"C:\\Program Files (x86)\\OpenOffice.org 3\\program\\soffice.exe\"", openOffice);
|
| 83 | + }else { |
| 84 | + assertEquals("\"C:\\Program Files\\OpenOffice.org 3\\program\\soffice.exe\"", openOffice); |
| 85 | + } |
| 86 | + } |
| 87 | + |
| 88 | + private boolean is64Bits() { |
| 89 | + if (System.getProperty("os.name").contains("Windows")) { |
| 90 | + return (System.getenv("ProgramFiles(x86)") != null); |
| 91 | + } |
| 92 | + return (System.getProperty("os.arch").indexOf("64") != -1); |
87 | 93 | }
|
88 | 94 | }
|
0 commit comments