View | Details | Raw Unified | Return to issue 66062
Collapse All | Expand All

(-)../../../2.0.2-pristine/build/OOO_2_0_2/scp2/source/ooo/file_library_ooo.scp (+10 lines)
Lines 2414-2416 Link Here
2414
End
2425
End
2415
2426
2416
2427
2428
#ifdef WNT
2429
2430
File gid_File_Lib_sellangmsi
2431
    TXT_FILE_BODY;
2432
    Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
2433
    Dir = gid_Dir_Program;
2434
    Name = "sellangmsi.dll";
2435
End
2436
2437
#endif
(-)../../../2.0.2-pristine/build/OOO_2_0_2/scp2/source/ooo/windowscustomaction_ooo.scp (+10 lines)
Lines 316-318 Link Here
316
      Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\" And Not PATCH", "CostInitialize");
316
      Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\" And Not PATCH", "CostInitialize");
317
      Assignment2 = ("InstallUISequence", "Not REMOVE=\"ALL\" And Not PATCH", "CostInitialize");
317
      Assignment2 = ("InstallUISequence", "Not REMOVE=\"ALL\" And Not PATCH", "CostInitialize");
318
End
318
End
319
320
WindowsCustomAction gid_Customaction_SelectLanguage
321
	Name = "SelectLanguage";
322
	Typ = "321";
323
	Source = "sellangmsi.dll";
324
	Target = "SelectLanguage";
325
	Inbinarytable = 1;
326
	Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\" And Not PATCH", "behind_CostFinalize");
327
	Assignment2 = ("InstallUISequence", "Not REMOVE=\"ALL\" And Not PATCH", "behind_CostFinalize");
328
End
(-)../../../2.0.2-pristine/build/OOO_2_0_2/setup_native/prj/build.lst (-3 / +343 lines)
Lines 5-10 Link Here
5
pk  setup_native\source\win32\customactions\regactivex    nmake   -  w   sn_regactivex NULL
5
pk  setup_native\source\win32\customactions\regactivex    nmake   -  w   sn_regactivex NULL
6
pk  setup_native\source\win32\customactions\reg4msdoc     nmake   -  w   sn_reg4msdoc NULL
6
pk  setup_native\source\win32\customactions\reg4msdoc     nmake   -  w   sn_reg4msdoc NULL
7
pk  setup_native\source\win32\customactions\regpython     nmake   -  w   sn_regpython NULL
7
pk  setup_native\source\win32\customactions\regpython     nmake   -  w   sn_regpython NULL
8
pk  setup_native\source\win32\customactions\sellang       nmake   -  w   sn_sellang NULL
8
pk  setup_native\source\win32\customactions\javafilter    nmake   -  w   sn_javafilter NULL
9
pk  setup_native\source\win32\customactions\javafilter    nmake   -  w   sn_javafilter NULL
9
pk  setup_native\source\win32\customactions\quickstarter  nmake   -  w   sn_quickstarter NULL
10
pk  setup_native\source\win32\customactions\quickstarter  nmake   -  w   sn_quickstarter NULL
10
pk  setup_native\source\win32\customactions\shellextensions nmake   -  w   sn_shellextensions NULL
11
pk  setup_native\source\win32\customactions\shellextensions nmake   -  w   sn_shellextensions NULL
11
-- /dev/null
Line 0 Link Here
0
-- /dev/null
1
SelectLanguage
Line 0 Link Here
0
-- /dev/null
1
#*************************************************************************
2
#
3
#   OpenOffice.org - a multi-platform office productivity suite
4
#
5
#   $RCSfile: win32-multi-lang-installer.diff,v $
6
#
7
#   $Revision: 1.1 $
8
#
9
#   last change: $Author: tml $ $Date: 2006/06/02 20:29:58 $
10
#
11
#   The Contents of this file are made available subject to
12
#   the terms of GNU Lesser General Public License Version 2.1.
13
#
14
#
15
#     GNU Lesser General Public License Version 2.1
16
#     =============================================
17
#     Copyright 2005 by Sun Microsystems, Inc.
18
#     901 San Antonio Road, Palo Alto, CA 94303, USA
19
#
20
#     This library is free software; you can redistribute it and/or
21
#     modify it under the terms of the GNU Lesser General Public
22
#     License version 2.1, as published by the Free Software Foundation.
23
#
24
#     This library is distributed in the hope that it will be useful,
25
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
26
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
#     Lesser General Public License for more details.
28
#
29
#     You should have received a copy of the GNU Lesser General Public
30
#     License along with this library; if not, write to the Free Software
31
#     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
#     MA  02111-1307  USA
33
#
34
#*************************************************************************
35
36
PRJ=..$/..$/..$/..
37
PRJNAME=setup_native
38
TARGET=sellangmsi
39
40
.IF "$(GUI)"=="WNT"
41
42
# --- Settings -----------------------------------------------------
43
44
ENABLE_EXCEPTIONS=TRUE
45
NO_DEFAULT_STL=TRUE
46
DYNAMIC_CRT=
47
USE_DEFFILE=TRUE
48
49
.INCLUDE : settings.mk
50
51
CFLAGS+=-D_STLP_USE_STATIC_LIB
52
53
# --- Files --------------------------------------------------------
54
55
UWINAPILIB=
56
57
SLOFILES = \
58
	$(SLO)$/sellang.obj
59
60
SHL1STDLIBS=	kernel32.lib\
61
				user32.lib\
62
				advapi32.lib\
63
				shell32.lib\
64
				msi.lib\
65
				$(LIBSTLPORTST)								
66
67
SHL1LIBS = $(SLB)$/$(TARGET).lib 
68
69
SHL1TARGET = $(TARGET)
70
SHL1IMPLIB = i$(TARGET)
71
72
SHL1DEF = $(MISC)$/$(SHL1TARGET).def
73
SHL1DEPN = $(SLB)$/$(TARGET).lib
74
SHL1BASE = 0x1c000000
75
DEF1NAME=$(SHL1TARGET)
76
DEF1EXPORTFILE=exports.dxp
77
78
# --- Targets --------------------------------------------------------------
79
80
.INCLUDE : target.mk
81
82
# -------------------------------------------------------------------------
83
84
85
.ENDIF
86
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile: win32-multi-lang-installer.diff,v $
6
 *
7
 *  $Revision: 1.1 $
8
 *
9
 *  last change: $Author: tml $ $Date: 2006/06/02 20:29:58 $
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
#define WIN32_LEAN_AND_MEAN
37
#define _WIN32_WINNT 0x0500
38
#define WINVER 0x0500
39
40
#include <windows.h>
41
#include <msiquery.h>
42
#include <malloc.h>
43
44
#ifdef UNICODE
45
#define _UNICODE
46
#define _tstring	wstring
47
#else
48
#define _tstring	string
49
#endif
50
#include <tchar.h>
51
#include <string>
52
#include <stdio.h>
53
54
#include <systools/win32/uwinapi.h>
55
56
extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
57
{
58
	char tem[200], feature[100];
59
	MSIHANDLE database, view, record;
60
	DWORD length;
61
	int nlangs = 0;
62
	/* Keeping this code simple and stupid... won't bother with any
63
	 * dynamic arrays or whatnot. 100 is more than enough for this purpose.
64
	 */
65
	char langs[100][6];
66
67
	database = MsiGetActiveDatabase(handle);
68
69
	if (MsiDatabaseOpenViewA(database, "SELECT Feature from Feature", &view) != ERROR_SUCCESS) {
70
		MsiCloseHandle(database);
71
		return ERROR_SUCCESS;
72
	}
73
74
	// MessageBoxA(NULL, "MsiDatabaseOpenViewA success!", "SelectLanguage", MB_OK);
75
76
	if (MsiViewExecute(view, NULL) != ERROR_SUCCESS) {
77
		MsiCloseHandle(view);
78
		MsiCloseHandle(database);
79
		return ERROR_SUCCESS;
80
	}
81
82
	// MessageBoxA(NULL, "MsiViewExecute success!", "SelectLanguage", MB_OK);
83
84
	while (MsiViewFetch(view, &record) == ERROR_SUCCESS) {
85
		length = sizeof(feature);
86
		if (MsiRecordGetStringA(record, 1, feature, &length) != ERROR_SUCCESS) {
87
			MsiCloseHandle(record);
88
			MsiCloseHandle(view);
89
			MsiCloseHandle(database);
90
			return ERROR_SUCCESS;
91
		}
92
93
		/* Keep track of what languages are included in this installer, if
94
		 * it is a multilangiage one.
95
		 */
96
		if (strncmp (feature, "gm_Dynamic_Language_", strlen ("gm_Dynamic_Language_")) == 0 &&
97
			strcmp(feature, "gm_Dynamic_Language_TOP") != 0 &&
98
			strcmp(feature, "gm_Dynamic_Language_en-US") != 0 &&
99
			strlen(feature) <= strlen("gm_Dynamic_Language_xx-XX"))
100
			strcpy(langs[nlangs++], feature + strlen("gm_Dynamic_Language_"));
101
102
		MsiCloseHandle(record);
103
	}
104
105
	MsiCloseHandle(view);
106
107
	if (nlangs > 0) {
108
		/* Deselect those languages that don't match the system
109
		 * default UI language.
110
		 */
111
112
		int i;
113
		LANGID default_language = GetSystemDefaultUILanguage();
114
		const char *s;
115
		int have_default_lang = 0;
116
117
		/* Map from LANGID to string. Same order as in
118
		 * setup_native/source/win32/msi-encodinglist.txt.
119
		 */
120
		switch (default_language) {
121
#define CASE(primary, sub, name) \
122
		case MAKELANGID(LANG_##primary, SUBLANG_##sub): s = #name; break
123
124
		CASE(ENGLISH, DEFAULT, en-US);
125
		case MAKELANGID(LANG_SERBIAN, 0x05): s = "bs"; break;
126
		CASE(PORTUGUESE, PORTUGUESE, pt);
127
		CASE(RUSSIAN, DEFAULT, ru);
128
		CASE(GREEK, DEFAULT, el);
129
		CASE(DUTCH, DEFAULT, nl);
130
		CASE(FRENCH, DEFAULT, fr);
131
		CASE(FRENCH, FRENCH_CANADIAN, fr-CA);
132
		CASE(SPANISH, DEFAULT, es);
133
		CASE(FINNISH, DEFAULT, fi);
134
		CASE(HUNGARIAN, DEFAULT, hu);
135
		CASE(CATALAN, DEFAULT, ca);
136
		CASE(ITALIAN, DEFAULT, it);
137
		CASE(CZECH, DEFAULT, cs);
138
		CASE(SLOVAK, DEFAULT, sk);
139
		CASE(ENGLISH, ENGLISH_UK, en-GB);
140
		CASE(ENGLISH, ENGLISH_SOUTH_AFRICA, en-ZA);
141
		CASE(DANISH, DEFAULT, da);
142
		CASE(SWEDISH, DEFAULT, sv);
143
		CASE(NORWEGIAN, NORWEGIAN_BOKMAL, nb);
144
		CASE(NORWEGIAN, NORWEGIAN_NYNORSK, nn);
145
		CASE(POLISH, DEFAULT, pl);
146
		CASE(GERMAN, DEFAULT, de);
147
		CASE(PORTUGUESE, PORTUGUESE_BRAZILIAN, pt-BR);
148
		CASE(THAI, DEFAULT, th);
149
		CASE(ESTONIAN, DEFAULT, et);
150
		CASE(JAPANESE, DEFAULT, ja);
151
		CASE(KOREAN, DEFAULT, ko);
152
		// CASE(KHMER, DEFAULT, km);
153
		// CASE(WELSH, DEFAULT, cy);
154
		CASE(CHINESE, CHINESE_SIMPLIFIED, zh-CN);
155
		CASE(CHINESE, CHINESE_TRADITIONAL, zh-TW);
156
		CASE(TURKISH, DEFAULT, tr);
157
		CASE(HINDI, DEFAULT, hi-IN);
158
		CASE(PUNJABI, DEFAULT, pa-IN);
159
		CASE(TAMIL, DEFAULT, ta-IN);
160
		CASE(ARABIC, DEFAULT, ar);
161
		CASE(HEBREW, DEFAULT, he);
162
		CASE(AFRIKAANS, DEFAULT, af);
163
		CASE(ALBANIAN, DEFAULT, sq);
164
		CASE(ARMENIAN, DEFAULT, hy);
165
		CASE(BASQUE, DEFAULT, eu);
166
		CASE(BELARUSIAN, DEFAULT, be-BY);
167
		case MAKELANGID(LANG_BENGALI, 0x02): s = "bn-BD"; break;
168
		CASE(BENGALI, DEFAULT, bn-IN);
169
		CASE(BULGARIAN, DEFAULT, bg);
170
		CASE(ICELANDIC, DEFAULT, is);
171
		CASE(INDONESIAN, DEFAULT, id);
172
		// CASE(LAO, DEFAULT, lo);
173
		CASE(LATVIAN, DEFAULT, lv);
174
		CASE(LITHUANIAN, DEFAULT, lt);
175
		// CASE(MALTESE, DEFAULT, mt);
176
		CASE(MARATHI, DEFAULT, mr);
177
		// CASE(ROMANSH, DEFAULT, rm);
178
		CASE(ROMANIAN, DEFAULT, ro);
179
		// CASE(KINYARWANDA, DEFAULT, rw);
180
		CASE(SANSKRIT, DEFAULT, sa);
181
		// CASE(SERBIAN, SERBIAN_CYRILLIC, sr-SP);
182
		// CASE(SETSWANA, DEFAULT, tn);
183
		CASE(SERBIAN, DEFAULT, hr);
184
		CASE(FARSI, DEFAULT, fa);
185
		CASE(FAEROESE, DEFAULT, fo);
186
		CASE(SLOVENIAN, DEFAULT, sl);
187
		// CASE(SORBIAN, DEFAULT, sb);
188
		// CASE(SUTU, DEFAULT, st);
189
		CASE(SWAHILI, DEFAULT, sw-TZ); // MSFT says Kenya, but OOo has Tanzania
190
		CASE(TATAR, DEFAULT, tt);
191
		// CASE(TSONGA, DEFAULT, ts);
192
		CASE(UKRAINIAN, DEFAULT, uk);
193
		CASE(URDU, DEFAULT, ur);
194
		CASE(VIETNAMESE, DEFAULT, vi);
195
		// CASE(XHOSA, DEFAULT, xh);
196
		// CASE(SOTHO, DEFAULT, ns);
197
		// CASE(YIDDISH, DEFAULT, yi);
198
		// CASE(ZULU, DEFAULT, zu);
199
		CASE(GUJARATI, DEFAULT, gu-IN);
200
		// CASE(BRETON, DEFAULT, br);
201
		CASE(ORIYA, DEFAULT, or);
202
		CASE(NEPALI, DEFAULT, ne);
203
		CASE(SERBIAN, SERBIAN_LATIN, sh-YU);
204
		CASE(SERBIAN, SERBIAN_CYRILLIC, sr-CS);
205
		// CASE(NDEBELE, DEFAULT, nr);
206
		// CASE(SWAZI, DEFAULT, ss);
207
		// CASE(SOTHO, SOTHO_SOUTHERN, st);
208
		// CASE(VENDA, DEFAULT, ve);
209
		// CASE(IRISH, DEFAULT, ga);
210
		CASE(MACEDONIAN, DEFAULT, mk);
211
		CASE(GALICIAN, DEFAULT, gl);
212
		CASE(KANNADA, DEFAULT, kn);
213
		CASE(MALAY, DEFAULT, ms);
214
#undef CASE
215
		default: s = "";
216
		}
217
218
		// sprintf(tem, "GetSystemDefaultUILanguage(): %#x = %s", default_language, s);
219
		// MessageBoxA(NULL, tem, "SelectLanguage", MB_OK);
220
221
		/* If one of the alternative languages in a multi-language installer
222
		 * is the system default UI language, deselect the other languages.
223
		 */
224
		if (s[0]) {
225
			for (i = 0; i < nlangs; i++) {
226
				if (strcmp (s, langs[i]) == 0) {
227
					// sprintf(tem, "We have the default language %s in the installer", s);
228
					// MessageBoxA(NULL, tem, "SelectLanguage", MB_OK);
229
					have_default_lang = 1;
230
				}
231
			}
232
		}
233
234
		if (have_default_lang) {
235
			for (i = 0; i < nlangs; i++) {
236
				if (strcmp(s, langs[i]) != 0) {
237
					UINT rc;
238
					sprintf(feature, "gm_Dynamic_Language_%s", langs[i]);
239
					rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); 
240
					if (rc != ERROR_SUCCESS) {
241
						// sprintf(tem, "MsiSetFeatureStateA %s failed: %d", feature, rc);
242
						// MessageBoxA(NULL, tem, "SelectLanguage", MB_OK);
243
					} else {
244
						// sprintf(tem, "MsiSetFeatureStateA %s OK!", feature);
245
						// MessageBoxA(NULL, tem, "SelectLanguage", MB_OK);
246
					}
247
				}
248
			}
249
		}
250
	}
251
252
	MsiCloseHandle(database);
253
254
	return ERROR_SUCCESS;
255
}

Return to issue 66062