[MSI_WINETEST] Sync with Wine 3.0. CORE-14225
[reactos.git] / modules / rostests / winetests / msi / install.c
1 /*
2 * Copyright (C) 2006 James Hawkins
3 *
4 * A test program for installing MSI products.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #include "precomp.h"
22
23 static UINT (WINAPI *pMsiQueryComponentStateA)
24 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*);
25 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
26 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
27 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
28 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
29
30 static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL);
31 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
32 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
33 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
34 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
35
36 static HMODULE hsrclient = 0;
37 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
38 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
39
40 static BOOL is_wow64;
41 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
42
43 static const char *msifile = "msitest.msi";
44 static const char *msifile2 = "winetest2.msi";
45 static const char *mstfile = "winetest.mst";
46
47 static const WCHAR msifileW[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
48 static const WCHAR msifile2W[] = {'w','i','n','e','t','e','s','t','2','.','m','s','i',0};
49
50 static CHAR CURR_DIR[MAX_PATH];
51 static CHAR PROG_FILES_DIR[MAX_PATH];
52 static CHAR PROG_FILES_DIR_NATIVE[MAX_PATH];
53 static CHAR COMMON_FILES_DIR[MAX_PATH];
54 static CHAR APP_DATA_DIR[MAX_PATH];
55 static CHAR WINDOWS_DIR[MAX_PATH];
56
57 /* msi database data */
58
59 static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
60 "s72\tS38\ts72\ti2\tS255\tS72\n"
61 "Component\tComponent\n"
62 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
63 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
64 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
65 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
66 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
67 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
68 "component\t\tMSITESTDIR\t0\t1\tfile\n"
69 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
70
71 static const CHAR directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
72 "s72\tS72\tl255\n"
73 "Directory\tDirectory\n"
74 "CABOUTDIR\tMSITESTDIR\tcabout\n"
75 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
76 "FIRSTDIR\tMSITESTDIR\tfirst\n"
77 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
78 "NEWDIR\tCABOUTDIR\tnew\n"
79 "ProgramFilesFolder\tTARGETDIR\t.\n"
80 "TARGETDIR\t\tSourceDir";
81
82 static const CHAR feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
83 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
84 "Feature\tFeature\n"
85 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
86 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
87 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
88 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
89 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
90 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
91 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
92
93 static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n"
94 "s38\ts72\n"
95 "FeatureComponents\tFeature_\tComponent_\n"
96 "Five\tFive\n"
97 "Four\tFour\n"
98 "One\tOne\n"
99 "Three\tThree\n"
100 "Two\tTwo\n"
101 "feature\tcomponent\n"
102 "service_feature\tservice_comp\n";
103
104 static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
105 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
106 "File\tFile\n"
107 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
108 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
109 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
110 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
111 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
112 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
113 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
114
115 static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
116 "s72\tS255\tI2\n"
117 "InstallExecuteSequence\tAction\n"
118 "AllocateRegistrySpace\tNOT Installed\t1550\n"
119 "CostFinalize\t\t1000\n"
120 "CostInitialize\t\t800\n"
121 "FileCost\t\t900\n"
122 "ResolveSource\t\t950\n"
123 "MoveFiles\t\t1700\n"
124 "InstallFiles\t\t4000\n"
125 "DuplicateFiles\t\t4500\n"
126 "WriteEnvironmentStrings\t\t4550\n"
127 "CreateShortcuts\t\t4600\n"
128 "InstallServices\t\t5000\n"
129 "InstallFinalize\t\t6600\n"
130 "InstallInitialize\t\t1500\n"
131 "InstallValidate\t\t1400\n"
132 "LaunchConditions\t\t100\n"
133 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
134
135 static const CHAR media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
136 "i2\ti4\tL64\tS255\tS32\tS72\n"
137 "Media\tDiskId\n"
138 "1\t3\t\t\tDISK1\t\n"
139 "2\t5\t\tmsitest.cab\tDISK2\t\n";
140
141 static const CHAR property_dat[] = "Property\tValue\n"
142 "s72\tl0\n"
143 "Property\tProperty\n"
144 "DefaultUIFont\tDlgFont8\n"
145 "HASUIRUN\t0\n"
146 "INSTALLLEVEL\t3\n"
147 "InstallMode\tTypical\n"
148 "Manufacturer\tWine\n"
149 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
150 "PRIMARYFOLDER\tTARGETDIR\n"
151 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
152 "ProductID\tnone\n"
153 "ProductLanguage\t1033\n"
154 "ProductName\tMSITEST\n"
155 "ProductVersion\t1.1.1\n"
156 "PROMPTROLLBACKCOST\tP\n"
157 "Setup\tSetup\n"
158 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
159 "AdminProperties\tPOSTADMIN\n"
160 "ROOTDRIVE\tC:\\\n"
161 "SERVNAME\tTestService\n"
162 "SERVDISP\tTestServiceDisp\n"
163 "MSIFASTINSTALL\t1\n";
164
165 static const CHAR aup_property_dat[] = "Property\tValue\n"
166 "s72\tl0\n"
167 "Property\tProperty\n"
168 "DefaultUIFont\tDlgFont8\n"
169 "HASUIRUN\t0\n"
170 "ALLUSERS\t1\n"
171 "INSTALLLEVEL\t3\n"
172 "InstallMode\tTypical\n"
173 "Manufacturer\tWine\n"
174 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
175 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
176 "ProductID\tnone\n"
177 "ProductLanguage\t1033\n"
178 "ProductName\tMSITEST\n"
179 "ProductVersion\t1.1.1\n"
180 "PROMPTROLLBACKCOST\tP\n"
181 "Setup\tSetup\n"
182 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
183 "AdminProperties\tPOSTADMIN\n"
184 "ROOTDRIVE\tC:\\\n"
185 "SERVNAME\tTestService\n"
186 "SERVDISP\tTestServiceDisp\n"
187 "MSIFASTINSTALL\t1\n";
188
189 static const CHAR aup2_property_dat[] = "Property\tValue\n"
190 "s72\tl0\n"
191 "Property\tProperty\n"
192 "DefaultUIFont\tDlgFont8\n"
193 "HASUIRUN\t0\n"
194 "ALLUSERS\t2\n"
195 "INSTALLLEVEL\t3\n"
196 "InstallMode\tTypical\n"
197 "Manufacturer\tWine\n"
198 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
199 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
200 "ProductID\tnone\n"
201 "ProductLanguage\t1033\n"
202 "ProductName\tMSITEST\n"
203 "ProductVersion\t1.1.1\n"
204 "PROMPTROLLBACKCOST\tP\n"
205 "Setup\tSetup\n"
206 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
207 "AdminProperties\tPOSTADMIN\n"
208 "ROOTDRIVE\tC:\\\n"
209 "SERVNAME\tTestService\n"
210 "SERVDISP\tTestServiceDisp\n"
211 "MSIFASTINSTALL\t1\n";
212
213 static const CHAR icon_property_dat[] = "Property\tValue\n"
214 "s72\tl0\n"
215 "Property\tProperty\n"
216 "DefaultUIFont\tDlgFont8\n"
217 "HASUIRUN\t0\n"
218 "INSTALLLEVEL\t3\n"
219 "InstallMode\tTypical\n"
220 "Manufacturer\tWine\n"
221 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
222 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
223 "ProductID\tnone\n"
224 "ProductLanguage\t1033\n"
225 "ProductName\tMSITEST\n"
226 "ProductVersion\t1.1.1\n"
227 "PROMPTROLLBACKCOST\tP\n"
228 "Setup\tSetup\n"
229 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
230 "AdminProperties\tPOSTADMIN\n"
231 "ROOTDRIVE\tC:\\\n"
232 "SERVNAME\tTestService\n"
233 "SERVDISP\tTestServiceDisp\n"
234 "MSIFASTINSTALL\t1\n";
235
236 static const CHAR shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
237 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
238 "Shortcut\tShortcut\n"
239 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
240
241 static const CHAR condition_dat[] = "Feature_\tLevel\tCondition\n"
242 "s38\ti2\tS255\n"
243 "Condition\tFeature_\tLevel\n"
244 "One\t4\t1\n";
245
246 static const CHAR up_property_dat[] = "Property\tValue\n"
247 "s72\tl0\n"
248 "Property\tProperty\n"
249 "DefaultUIFont\tDlgFont8\n"
250 "HASUIRUN\t0\n"
251 "INSTALLLEVEL\t3\n"
252 "InstallMode\tTypical\n"
253 "Manufacturer\tWine\n"
254 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
255 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
256 "ProductID\tnone\n"
257 "ProductLanguage\t1033\n"
258 "ProductName\tMSITEST\n"
259 "ProductVersion\t1.1.1\n"
260 "PROMPTROLLBACKCOST\tP\n"
261 "Setup\tSetup\n"
262 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
263 "AdminProperties\tPOSTADMIN\n"
264 "ROOTDRIVE\tC:\\\n"
265 "SERVNAME\tTestService\n"
266 "SERVDISP\tTestServiceDisp\n"
267 "RemovePreviousVersions\t1\n"
268 "MSIFASTINSTALL\t1\n";
269
270 static const CHAR up2_property_dat[] = "Property\tValue\n"
271 "s72\tl0\n"
272 "Property\tProperty\n"
273 "DefaultUIFont\tDlgFont8\n"
274 "HASUIRUN\t0\n"
275 "INSTALLLEVEL\t3\n"
276 "InstallMode\tTypical\n"
277 "Manufacturer\tWine\n"
278 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
279 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
280 "ProductID\tnone\n"
281 "ProductLanguage\t1033\n"
282 "ProductName\tMSITEST\n"
283 "ProductVersion\t1.1.2\n"
284 "PROMPTROLLBACKCOST\tP\n"
285 "Setup\tSetup\n"
286 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
287 "AdminProperties\tPOSTADMIN\n"
288 "ROOTDRIVE\tC:\\\n"
289 "SERVNAME\tTestService\n"
290 "SERVDISP\tTestServiceDisp\n"
291 "MSIFASTINSTALL\t1\n";
292
293 static const CHAR up3_property_dat[] = "Property\tValue\n"
294 "s72\tl0\n"
295 "Property\tProperty\n"
296 "DefaultUIFont\tDlgFont8\n"
297 "HASUIRUN\t0\n"
298 "INSTALLLEVEL\t3\n"
299 "InstallMode\tTypical\n"
300 "Manufacturer\tWine\n"
301 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
302 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
303 "ProductID\tnone\n"
304 "ProductLanguage\t1033\n"
305 "ProductName\tMSITEST\n"
306 "ProductVersion\t1.1.2\n"
307 "PROMPTROLLBACKCOST\tP\n"
308 "Setup\tSetup\n"
309 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
310 "AdminProperties\tPOSTADMIN\n"
311 "ROOTDRIVE\tC:\\\n"
312 "SERVNAME\tTestService\n"
313 "SERVDISP\tTestServiceDisp\n"
314 "RemovePreviousVersions\t1\n"
315 "MSIFASTINSTALL\t1\n";
316
317 static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
318 "s72\ti2\tl255\tL255\tL0\ts72\n"
319 "Registry\tRegistry\n"
320 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
321 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
322 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
323 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
324
325 static const CHAR service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
326 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
327 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
328 "ServiceInstall\tServiceInstall\n"
329 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
330
331 static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
332 "s72\tl255\ti2\tL255\tI2\ts72\n"
333 "ServiceControl\tServiceControl\n"
334 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
335
336 /* tables for test_continuouscabs */
337 static const CHAR cc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
338 "s72\tS38\ts72\ti2\tS255\tS72\n"
339 "Component\tComponent\n"
340 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
341 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
342 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
343
344 static const CHAR cc2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
345 "s72\tS38\ts72\ti2\tS255\tS72\n"
346 "Component\tComponent\n"
347 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
348 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
349 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
350
351 static const CHAR cc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
352 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
353 "Feature\tFeature\n"
354 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
355
356 static const CHAR cc_feature_comp_dat[] = "Feature_\tComponent_\n"
357 "s38\ts72\n"
358 "FeatureComponents\tFeature_\tComponent_\n"
359 "feature\tmaximus\n"
360 "feature\taugustus\n"
361 "feature\tcaesar";
362
363 static const CHAR cc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
364 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
365 "File\tFile\n"
366 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
367 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
368 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
369
370 static const CHAR cc2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
371 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
372 "File\tFile\n"
373 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
374 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
375 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
376 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
377
378 static const CHAR cc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
379 "i2\ti4\tL64\tS255\tS32\tS72\n"
380 "Media\tDiskId\n"
381 "1\t10\t\ttest1.cab\tDISK1\t\n"
382 "2\t2\t\ttest2.cab\tDISK2\t\n"
383 "3\t12\t\ttest3.cab\tDISK3\t\n";
384
385 static const CHAR cc3_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
386 "i2\ti4\tL64\tS255\tS32\tS72\n"
387 "Media\tDiskId\n"
388 "1\t10\t\ttest1.cab\tDISK1\t\n"
389 "2\t2\t\ttest2_.cab\tDISK2\t\n"
390 "3\t12\t\ttest3.cab\tDISK3\t\n";
391
392 static const CHAR co_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
393 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
394 "File\tFile\n"
395 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
396 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
397 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
398
399 static const CHAR co_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
400 "i2\ti4\tL64\tS255\tS32\tS72\n"
401 "Media\tDiskId\n"
402 "1\t10\t\ttest1.cab\tDISK1\t\n"
403 "2\t2\t\ttest2.cab\tDISK2\t\n"
404 "3\t3\t\ttest3.cab\tDISK3\t\n";
405
406 static const CHAR co2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
407 "i2\ti4\tL64\tS255\tS32\tS72\n"
408 "Media\tDiskId\n"
409 "1\t10\t\ttest1.cab\tDISK1\t\n"
410 "2\t12\t\ttest3.cab\tDISK3\t\n"
411 "3\t2\t\ttest2.cab\tDISK2\t\n";
412
413 static const CHAR mm_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
414 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
415 "File\tFile\n"
416 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
417 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
418 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
419
420 static const CHAR mm_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
421 "i2\ti4\tL64\tS255\tS32\tS72\n"
422 "Media\tDiskId\n"
423 "1\t3\t\ttest1.cab\tDISK1\t\n";
424
425 static const CHAR ss_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
426 "i2\ti4\tL64\tS255\tS32\tS72\n"
427 "Media\tDiskId\n"
428 "1\t2\t\ttest1.cab\tDISK1\t\n"
429 "2\t2\t\ttest2.cab\tDISK2\t\n"
430 "3\t12\t\ttest3.cab\tDISK3\t\n";
431
432 /* tables for test_uiLevelFlags */
433 static const CHAR ui_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
434 "s72\tS38\ts72\ti2\tS255\tS72\n"
435 "Component\tComponent\n"
436 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
437 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
438 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
439
440 static const CHAR ui_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
441 "s72\tS255\tI2\n"
442 "InstallUISequence\tAction\n"
443 "SetUIProperty\t\t5\n"
444 "ExecuteAction\t\t1100\n";
445
446 static const CHAR ui_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
447 "s72\ti2\tS64\tS0\tS255\n"
448 "CustomAction\tAction\n"
449 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
450
451 static const CHAR rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
452 "s72\tS38\ts72\ti2\tS255\tS72\n"
453 "Component\tComponent\n"
454 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
455
456 static const CHAR rof_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
457 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
458 "Feature\tFeature\n"
459 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
460 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
461
462 static const CHAR rof_feature_comp_dat[] = "Feature_\tComponent_\n"
463 "s38\ts72\n"
464 "FeatureComponents\tFeature_\tComponent_\n"
465 "feature\tmaximus\n"
466 "montecristo\tmaximus";
467
468 static const CHAR rof_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
469 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
470 "File\tFile\n"
471 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
472
473 static const CHAR rof_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
474 "i2\ti4\tL64\tS255\tS32\tS72\n"
475 "Media\tDiskId\n"
476 "1\t1\t\t\tDISK1\t\n";
477
478 static const CHAR rofc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
479 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
480 "File\tFile\n"
481 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
482
483 static const CHAR rofc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
484 "i2\ti4\tL64\tS255\tS32\tS72\n"
485 "Media\tDiskId\n"
486 "1\t1\t\ttest1.cab\tDISK1\t\n";
487
488 static const CHAR sdp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
489 "s72\tS255\tI2\n"
490 "InstallExecuteSequence\tAction\n"
491 "AllocateRegistrySpace\tNOT Installed\t1550\n"
492 "CostFinalize\t\t1000\n"
493 "CostInitialize\t\t800\n"
494 "FileCost\t\t900\n"
495 "InstallFiles\t\t4000\n"
496 "InstallFinalize\t\t6600\n"
497 "InstallInitialize\t\t1500\n"
498 "InstallValidate\t\t1400\n"
499 "LaunchConditions\t\t100\n"
500 "SetDirProperty\t\t950";
501
502 static const CHAR sdp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
503 "s72\ti2\tS64\tS0\tS255\n"
504 "CustomAction\tAction\n"
505 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
506
507 static const CHAR pv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
508 "s72\tS255\tI2\n"
509 "InstallExecuteSequence\tAction\n"
510 "LaunchConditions\t\t100\n"
511 "CostInitialize\t\t800\n"
512 "FileCost\t\t900\n"
513 "CostFinalize\t\t1000\n"
514 "InstallValidate\t\t1400\n"
515 "InstallInitialize\t\t1500\n"
516 "InstallFiles\t\t4000\n"
517 "InstallFinalize\t\t6600\n";
518
519 static const CHAR cie_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
520 "s72\tS38\ts72\ti2\tS255\tS72\n"
521 "Component\tComponent\n"
522 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
523 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
524 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
525 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
526
527 static const CHAR cie_feature_comp_dat[] = "Feature_\tComponent_\n"
528 "s38\ts72\n"
529 "FeatureComponents\tFeature_\tComponent_\n"
530 "feature\tmaximus\n"
531 "feature\taugustus\n"
532 "feature\tcaesar\n"
533 "feature\tgaius";
534
535 static const CHAR cie_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
536 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
537 "File\tFile\n"
538 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
539 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
540 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
541 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
542
543 static const CHAR cie_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
544 "i2\ti4\tL64\tS255\tS32\tS72\n"
545 "Media\tDiskId\n"
546 "1\t1\t\ttest1.cab\tDISK1\t\n"
547 "2\t2\t\ttest2.cab\tDISK2\t\n"
548 "3\t12\t\ttest3.cab\tDISK3\t\n";
549
550 static const CHAR ci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
551 "s72\tS38\ts72\ti2\tS255\tS72\n"
552 "Component\tComponent\n"
553 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
554
555 static const CHAR ci2_feature_comp_dat[] = "Feature_\tComponent_\n"
556 "s38\ts72\n"
557 "FeatureComponents\tFeature_\tComponent_\n"
558 "feature\taugustus";
559
560 static const CHAR ci2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
561 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
562 "File\tFile\n"
563 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
564
565 static const CHAR pp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
566 "s72\tS255\tI2\n"
567 "InstallExecuteSequence\tAction\n"
568 "ValidateProductID\t\t700\n"
569 "CostInitialize\t\t800\n"
570 "FileCost\t\t900\n"
571 "CostFinalize\t\t1000\n"
572 "InstallValidate\t\t1400\n"
573 "InstallInitialize\t\t1500\n"
574 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
575 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
576 "RemoveFiles\t\t3500\n"
577 "InstallFiles\t\t4000\n"
578 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
579 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
580 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
581 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
582 "InstallFinalize\t\t6600";
583
584 static const CHAR tp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
585 "s72\tS38\ts72\ti2\tS255\tS72\n"
586 "Component\tComponent\n"
587 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
588
589 static const CHAR cwd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
590 "s72\tS38\ts72\ti2\tS255\tS72\n"
591 "Component\tComponent\n"
592 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
593
594 static const CHAR adm_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
595 "s72\tS38\ts72\ti2\tS255\tS72\n"
596 "Component\tComponent\n"
597 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
598
599 static const CHAR adm_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
600 "s72\ti2\tS64\tS0\tS255\n"
601 "CustomAction\tAction\n"
602 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
603
604 static const CHAR adm_admin_exec_seq_dat[] = "Action\tCondition\tSequence\n"
605 "s72\tS255\tI2\n"
606 "AdminExecuteSequence\tAction\n"
607 "CostFinalize\t\t1000\n"
608 "CostInitialize\t\t800\n"
609 "FileCost\t\t900\n"
610 "SetPOSTADMIN\t\t950\n"
611 "InstallFiles\t\t4000\n"
612 "InstallFinalize\t\t6600\n"
613 "InstallInitialize\t\t1500\n"
614 "InstallValidate\t\t1400\n"
615 "LaunchConditions\t\t100";
616
617 static const CHAR amp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
618 "s72\tS38\ts72\ti2\tS255\tS72\n"
619 "Component\tComponent\n"
620 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
621
622 static const CHAR rem_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
623 "s72\tS255\tI2\n"
624 "InstallExecuteSequence\tAction\n"
625 "ValidateProductID\t\t700\n"
626 "CostInitialize\t\t800\n"
627 "FileCost\t\t900\n"
628 "CostFinalize\t\t1000\n"
629 "InstallValidate\t\t1400\n"
630 "InstallInitialize\t\t1500\n"
631 "ProcessComponents\t\t1600\n"
632 "UnpublishFeatures\t\t1800\n"
633 "RemoveFiles\t\t3500\n"
634 "InstallFiles\t\t4000\n"
635 "RegisterProduct\t\t6100\n"
636 "PublishFeatures\t\t6300\n"
637 "PublishProduct\t\t6400\n"
638 "InstallFinalize\t\t6600";
639
640 static const CHAR mc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
641 "s72\tS38\ts72\ti2\tS255\tS72\n"
642 "Component\tComponent\n"
643 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
644 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
645 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
646 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
647 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
648
649 static const CHAR mc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
650 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
651 "File\tFile\n"
652 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
653 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
654 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
655 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
656 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
657
658 static const CHAR mc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
659 "i2\ti4\tL64\tS255\tS32\tS72\n"
660 "Media\tDiskId\n"
661 "1\t1\t\ttest1.cab\tDISK1\t\n"
662 "2\t2\t\ttest2.cab\tDISK2\t\n"
663 "3\t3\t\ttest3.cab\tDISK3\t\n"
664 "4\t4\t\ttest3.cab\tDISK3\t\n"
665 "5\t5\t\ttest4.cab\tDISK4\t\n";
666
667 static const CHAR mc_file_hash_dat[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
668 "s72\ti2\ti4\ti4\ti4\ti4\n"
669 "MsiFileHash\tFile_\n"
670 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
671
672 static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
673 "s72\tS38\ts72\ti2\tS255\tS72\n"
674 "Component\tComponent\n"
675 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
676
677 static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
678 "s72\tS38\ts72\ti2\tS255\tS72\n"
679 "Component\tComponent\n"
680 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
681
682 static const CHAR ca51_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
683 "s72\tS255\tI2\n"
684 "InstallExecuteSequence\tAction\n"
685 "ValidateProductID\t\t700\n"
686 "GoodSetProperty\t\t725\n"
687 "BadSetProperty\t\t750\n"
688 "CostInitialize\t\t800\n"
689 "ResolveSource\t\t810\n"
690 "FileCost\t\t900\n"
691 "SetSourceDir\tSRCDIR\t910\n"
692 "CostFinalize\t\t1000\n"
693 "InstallValidate\t\t1400\n"
694 "InstallInitialize\t\t1500\n"
695 "InstallFiles\t\t4000\n"
696 "InstallFinalize\t\t6600";
697
698 static const CHAR ca51_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
699 "s72\ti2\tS64\tS0\n"
700 "CustomAction\tAction\n"
701 "GoodSetProperty\t51\tMYPROP\t42\n"
702 "BadSetProperty\t51\t\tMYPROP\n"
703 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
704
705 static const CHAR is_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
706 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
707 "Feature\tFeature\n"
708 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
709 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
710 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
711 "four\t\t\t\t2\t0\t\t0"; /* disabled */
712
713 static const CHAR is_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
714 "s72\tS38\ts72\ti2\tS255\tS72\n"
715 "Component\tComponent\n"
716 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
717 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
718 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
719 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
720 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
721 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
722 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
723 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
724 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
725 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
726 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
727 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
728
729 static const CHAR is_feature_comp_dat[] = "Feature_\tComponent_\n"
730 "s38\ts72\n"
731 "FeatureComponents\tFeature_\tComponent_\n"
732 "one\talpha\n"
733 "one\tbeta\n"
734 "one\tgamma\n"
735 "two\ttheta\n"
736 "two\tdelta\n"
737 "two\tepsilon\n"
738 "three\tzeta\n"
739 "three\tiota\n"
740 "three\teta\n"
741 "four\tkappa\n"
742 "four\tlambda\n"
743 "four\tmu";
744
745 static const CHAR is_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
746 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
747 "File\tFile\n"
748 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
749 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
750 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
751 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
752 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
753 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
754 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
755 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
756 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
757 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
758 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
759 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
760
761 static const CHAR is_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
762 "i2\ti4\tL64\tS255\tS32\tS72\n"
763 "Media\tDiskId\n"
764 "1\t12\t\t\tDISK1\t\n";
765
766 static const CHAR sp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
767 "s72\tS38\ts72\ti2\tS255\tS72\n"
768 "Component\tComponent\n"
769 "augustus\t\tTWODIR\t0\t\taugustus\n";
770
771 static const CHAR sp_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
772 "s72\tS72\tl255\n"
773 "Directory\tDirectory\n"
774 "TARGETDIR\t\tSourceDir\n"
775 "ProgramFilesFolder\tTARGETDIR\t.\n"
776 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
777 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
778 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
779
780 static const CHAR mcp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
781 "s72\tS38\ts72\ti2\tS255\tS72\n"
782 "Component\tComponent\n"
783 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
784 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
785 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
786
787 static const CHAR mcp_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
788 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
789 "Feature\tFeature\n"
790 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
791 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
792 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
793
794 static const CHAR mcp_feature_comp_dat[] = "Feature_\tComponent_\n"
795 "s38\ts72\n"
796 "FeatureComponents\tFeature_\tComponent_\n"
797 "hydroxyl\thydrogen\n"
798 "heliox\thelium\n"
799 "lithia\tlithium";
800
801 static const CHAR mcp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
802 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
803 "File\tFile\n"
804 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
805 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
806 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
807 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
808
809 static const CHAR ai_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
810 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
811 "File\tFile\n"
812 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
813 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
814 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
815 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
816 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
817 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
818 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
819
820 static const CHAR ip_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
821 "s72\tS255\tI2\n"
822 "InstallExecuteSequence\tAction\n"
823 "CostFinalize\t\t1000\n"
824 "ValidateProductID\t\t700\n"
825 "CostInitialize\t\t800\n"
826 "FileCost\t\t900\n"
827 "RemoveFiles\t\t3500\n"
828 "InstallFiles\t\t4000\n"
829 "RegisterUser\t\t6000\n"
830 "RegisterProduct\t\t6100\n"
831 "PublishFeatures\t\t6300\n"
832 "PublishProduct\t\t6400\n"
833 "InstallFinalize\t\t6600\n"
834 "InstallInitialize\t\t1500\n"
835 "ProcessComponents\t\t1600\n"
836 "UnpublishFeatures\t\t1800\n"
837 "InstallValidate\t\t1400\n"
838 "LaunchConditions\t\t100\n"
839 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
840
841 static const CHAR ip_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
842 "s72\ti2\tS64\tS0\tS255\n"
843 "CustomAction\tAction\n"
844 "TestInstalledProp\t19\t\tTest failed\t\n";
845
846 static const CHAR aup_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
847 "s72\tS255\tI2\n"
848 "InstallExecuteSequence\tAction\n"
849 "CostFinalize\t\t1000\n"
850 "ValidateProductID\t\t700\n"
851 "CostInitialize\t\t800\n"
852 "FileCost\t\t900\n"
853 "RemoveFiles\t\t3500\n"
854 "InstallFiles\t\t4000\n"
855 "RegisterUser\t\t6000\n"
856 "RegisterProduct\t\t6100\n"
857 "PublishFeatures\t\t6300\n"
858 "PublishProduct\t\t6400\n"
859 "InstallFinalize\t\t6600\n"
860 "InstallInitialize\t\t1500\n"
861 "ProcessComponents\t\t1600\n"
862 "UnpublishFeatures\t\t1800\n"
863 "InstallValidate\t\t1400\n"
864 "LaunchConditions\t\t100\n"
865 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
866
867 static const CHAR aup2_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
868 "s72\tS255\tI2\n"
869 "InstallExecuteSequence\tAction\n"
870 "CostFinalize\t\t1000\n"
871 "ValidateProductID\t\t700\n"
872 "CostInitialize\t\t800\n"
873 "FileCost\t\t900\n"
874 "RemoveFiles\t\t3500\n"
875 "InstallFiles\t\t4000\n"
876 "RegisterUser\t\t6000\n"
877 "RegisterProduct\t\t6100\n"
878 "PublishFeatures\t\t6300\n"
879 "PublishProduct\t\t6400\n"
880 "InstallFinalize\t\t6600\n"
881 "InstallInitialize\t\t1500\n"
882 "ProcessComponents\t\t1600\n"
883 "UnpublishFeatures\t\t1800\n"
884 "InstallValidate\t\t1400\n"
885 "LaunchConditions\t\t100\n"
886 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
887
888 static const CHAR aup3_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
889 "s72\tS255\tI2\n"
890 "InstallExecuteSequence\tAction\n"
891 "CostFinalize\t\t1000\n"
892 "ValidateProductID\t\t700\n"
893 "CostInitialize\t\t800\n"
894 "FileCost\t\t900\n"
895 "RemoveFiles\t\t3500\n"
896 "InstallFiles\t\t4000\n"
897 "RegisterUser\t\t6000\n"
898 "RegisterProduct\t\t6100\n"
899 "PublishFeatures\t\t6300\n"
900 "PublishProduct\t\t6400\n"
901 "InstallFinalize\t\t6600\n"
902 "InstallInitialize\t\t1500\n"
903 "ProcessComponents\t\t1600\n"
904 "UnpublishFeatures\t\t1800\n"
905 "InstallValidate\t\t1400\n"
906 "LaunchConditions\t\t100\n"
907 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
908
909 static const CHAR aup_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
910 "s72\ti2\tS64\tS0\tS255\n"
911 "CustomAction\tAction\n"
912 "TestAllUsersProp\t19\t\tTest failed\t\n";
913
914 static const CHAR fo_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
915 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
916 "File\tFile\n"
917 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
918 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
919 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
920
921 static const CHAR fo_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
922 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
923 "Feature\tFeature\n"
924 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
925 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
926 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
927
928 static const CHAR fo_condition_dat[] = "Feature_\tLevel\tCondition\n"
929 "s38\ti2\tS255\n"
930 "Condition\tFeature_\tLevel\n"
931 "preselected\t0\tPreselected\n"
932 "notpreselected\t0\tNOT Preselected\n";
933
934 static const CHAR fo_feature_comp_dat[] = "Feature_\tComponent_\n"
935 "s38\ts72\n"
936 "FeatureComponents\tFeature_\tComponent_\n"
937 "override\toverride\n"
938 "preselected\tpreselected\n"
939 "notpreselected\tnotpreselected\n";
940
941 static const CHAR fo_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
942 "s72\tS38\ts72\ti2\tS255\tS72\n"
943 "Component\tComponent\n"
944 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
945 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
946 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
947
948 static const CHAR fo_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
949 "s72\ti2\tS64\tS0\tS255\n"
950 "CustomAction\tAction\n"
951 "SetPreselected\t51\tPreselected\t1\t\n";
952
953 static const CHAR fo_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
954 "s72\tS255\tI2\n"
955 "InstallExecuteSequence\tAction\n"
956 "LaunchConditions\t\t100\n"
957 "SetPreselected\tpreselect=1\t200\n"
958 "CostInitialize\t\t800\n"
959 "FileCost\t\t900\n"
960 "CostFinalize\t\t1000\n"
961 "InstallValidate\t\t1400\n"
962 "InstallInitialize\t\t1500\n"
963 "ProcessComponents\t\t1600\n"
964 "RemoveFiles\t\t1700\n"
965 "InstallFiles\t\t2000\n"
966 "RegisterProduct\t\t5000\n"
967 "PublishFeatures\t\t5100\n"
968 "PublishProduct\t\t5200\n"
969 "InstallFinalize\t\t6000\n";
970
971 static const CHAR uc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
972 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
973 "File\tFile\n"
974 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
975
976 static const CHAR uc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
977 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
978 "Feature\tFeature\n"
979 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
980
981 static const CHAR uc_feature_comp_dat[] = "Feature_\tComponent_\n"
982 "s38\ts72\n"
983 "FeatureComponents\tFeature_\tComponent_\n"
984 "upgradecode\tupgradecode\n";
985
986 static const CHAR uc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
987 "s72\tS38\ts72\ti2\tS255\tS72\n"
988 "Component\tComponent\n"
989 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
990
991 static const CHAR uc_property_dat[] = "Property\tValue\n"
992 "s72\tl0\n"
993 "Property\tProperty\n"
994 "INSTALLLEVEL\t3\n"
995 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
996 "ProductName\tMSITEST\n"
997 "ProductVersion\t1.1.1\n"
998 "UpgradeCode\t#UPGEADECODE#\n"
999 "MSIFASTINSTALL\t1\n";
1000
1001 static const CHAR uc_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1002 "s72\tS255\tI2\n"
1003 "InstallExecuteSequence\tAction\n"
1004 "LaunchConditions\t\t100\n"
1005 "CostInitialize\t\t200\n"
1006 "FileCost\t\t300\n"
1007 "CostFinalize\t\t400\n"
1008 "InstallInitialize\t\t500\n"
1009 "ProcessComponents\t\t600\n"
1010 "InstallValidate\t\t700\n"
1011 "RemoveFiles\t\t800\n"
1012 "InstallFiles\t\t900\n"
1013 "RegisterProduct\t\t1000\n"
1014 "PublishFeatures\t\t1100\n"
1015 "PublishProduct\t\t1200\n"
1016 "InstallFinalize\t\t1300\n";
1017
1018 static const char mixed_feature_dat[] =
1019 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1020 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1021 "Feature\tFeature\n"
1022 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1023 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1024
1025 static const char mixed_feature_comp_dat[] =
1026 "Feature_\tComponent_\n"
1027 "s38\ts72\n"
1028 "FeatureComponents\tFeature_\tComponent_\n"
1029 "feature1\tcomp1\n"
1030 "feature2\tcomp2\n";
1031
1032 static const char mixed_component_dat[] =
1033 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1034 "s72\tS38\ts72\ti2\tS255\tS72\n"
1035 "Component\tComponent\n"
1036 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1037 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1038
1039 static const char mixed_registry_dat[] =
1040 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1041 "s72\ti2\tl255\tL255\tL0\ts72\n"
1042 "Registry\tRegistry\n"
1043 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1044 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n"
1045 "regdata3\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest32\tcomp1\n"
1046 "regdata4\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest32.dll\tcomp1\n"
1047 "regdata5\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest64\tcomp2\n"
1048 "regdata6\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest64.dll\tcomp2\n";
1049
1050 static const char mixed_install_exec_seq_dat[] =
1051 "Action\tCondition\tSequence\n"
1052 "s72\tS255\tI2\n"
1053 "InstallExecuteSequence\tAction\n"
1054 "LaunchConditions\t\t100\n"
1055 "CostInitialize\t\t200\n"
1056 "FileCost\t\t300\n"
1057 "CostFinalize\t\t400\n"
1058 "InstallValidate\t\t500\n"
1059 "InstallInitialize\t\t600\n"
1060 "ProcessComponents\t\t700\n"
1061 "UnpublishFeatures\t\t800\n"
1062 "RemoveRegistryValues\t\t900\n"
1063 "WriteRegistryValues\t\t1000\n"
1064 "RegisterProduct\t\t1100\n"
1065 "PublishFeatures\t\t1200\n"
1066 "PublishProduct\t\t1300\n"
1067 "InstallFinalize\t\t1400\n";
1068
1069 static const char vp_file_dat[] =
1070 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1071 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1072 "File\tFile\n"
1073 "volumeprop\tcomp\tvolumeprop.txt\t1000\t\t\t8192\t1\n";
1074
1075 static const char vp_feature_dat[] =
1076 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1077 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1078 "Feature\tFeature\n"
1079 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1080
1081 static const char vp_feature_comp_dat[] =
1082 "Feature_\tComponent_\n"
1083 "s38\ts72\n"
1084 "FeatureComponents\tFeature_\tComponent_\n"
1085 "feature\tcomp\n";
1086
1087 static const char vp_component_dat[] =
1088 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1089 "s72\tS38\ts72\ti2\tS255\tS72\n"
1090 "Component\tComponent\n"
1091 "comp\t{24364AE7-5B7F-496C-AF5A-54893639C567}\tMSITESTDIR\t0\t\tvolumeprop\n";
1092
1093 static const char vp_custom_action_dat[] =
1094 "Action\tType\tSource\tTarget\tISComments\n"
1095 "s72\ti2\tS64\tS0\tS255\n"
1096 "CustomAction\tAction\n"
1097 "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n"
1098 "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n"
1099 "TestPrimaryVolumeSpaceRequired0\t19\t\tPrimaryVolumeSpaceRequired set before CostFinalize\t\n"
1100 "TestPrimaryVolumeSpaceRemaining0\t19\t\tPrimaryVolumeSpaceRemaining set before CostFinalize\t\n"
1101 "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n"
1102 "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n"
1103 "TestPrimaryVolumeSpaceRequired1\t19\t\tPrimaryVolumeSpaceRequired not set before InstallValidate\t\n"
1104 "TestPrimaryVolumeSpaceRemaining1\t19\t\tPrimaryVolumeSpaceRemaining not set before InstallValidate\t\n"
1105 "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n"
1106 "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n"
1107 "TestPrimaryVolumeSpaceRequired2\t19\t\tPrimaryVolumeSpaceRequired not set after InstallValidate\t\n"
1108 "TestPrimaryVolumeSpaceRemaining2\t19\t\tPrimaryVolumeSpaceRemaining not set after InstallValidate\t\n";
1109
1110 static const char vp_install_exec_seq_dat[] =
1111 "Action\tCondition\tSequence\n"
1112 "s72\tS255\tI2\n"
1113 "InstallExecuteSequence\tAction\n"
1114 "LaunchConditions\t\t100\n"
1115 "CostInitialize\t\t200\n"
1116 "FileCost\t\t300\n"
1117 "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n"
1118 "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n"
1119 "TestPrimaryVolumeSpaceRequired0\tPrimaryVolumeSpaceRequired AND NOT REMOVE\t510\n"
1120 "TestPrimaryVolumeSpaceRemaining0\tPrimaryVolumeSpaceRemaining AND NOT REMOVE\t520\n"
1121 "CostFinalize\t\t600\n"
1122 "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n"
1123 "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n"
1124 "TestPrimaryVolumeSpaceRequired1\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t810\n"
1125 "TestPrimaryVolumeSpaceRemaining1\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t820\n"
1126 "InstallValidate\t\t900\n"
1127 "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n"
1128 "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n"
1129 "TestPrimaryVolumeSpaceRequired2\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t1110\n"
1130 "TestPrimaryVolumeSpaceRemaining2\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t1120\n"
1131 "InstallInitialize\t\t1200\n"
1132 "ProcessComponents\t\t1300\n"
1133 "RemoveFiles\t\t1400\n"
1134 "InstallFiles\t\t1500\n"
1135 "RegisterProduct\t\t1600\n"
1136 "PublishFeatures\t\t1700\n"
1137 "PublishProduct\t\t1800\n"
1138 "InstallFinalize\t\t1900\n";
1139
1140 static const char shc_property_dat[] =
1141 "Property\tValue\n"
1142 "s72\tl0\n"
1143 "Property\tProperty\n"
1144 "INSTALLLEVEL\t3\n"
1145 "ProductCode\t{5CD99CD0-69C7-409B-9905-82DD743CC840}\n"
1146 "ProductName\tMSITEST\n"
1147 "ProductVersion\t1.1.1\n"
1148 "MSIFASTINSTALL\t1\n";
1149
1150 static const char shc2_property_dat[] =
1151 "Property\tValue\n"
1152 "s72\tl0\n"
1153 "Property\tProperty\n"
1154 "INSTALLLEVEL\t3\n"
1155 "ProductCode\t{4CEFADE5-DAFB-4C21-8EF2-4ED4F139F340}\n"
1156 "ProductName\tMSITEST2\n"
1157 "ProductVersion\t1.1.1\n"
1158 "MSIFASTINSTALL\t1\n";
1159
1160 static const char shc_file_dat[] =
1161 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1162 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1163 "File\tFile\n"
1164 "sharedcomponent\tsharedcomponent\tsharedcomponent.txt\t1000\t\t\t8192\t1\n";
1165
1166 static const char shc_feature_dat[] =
1167 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1168 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1169 "Feature\tFeature\n"
1170 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1171
1172 static const char shc_feature_comp_dat[] =
1173 "Feature_\tComponent_\n"
1174 "s38\ts72\n"
1175 "FeatureComponents\tFeature_\tComponent_\n"
1176 "feature\tsharedcomponent\n";
1177
1178 static const char shc_component_dat[] =
1179 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1180 "s72\tS38\ts72\ti2\tS255\tS72\n"
1181 "Component\tComponent\n"
1182 "sharedcomponent\t{900A4ACB-DC6F-4795-A04B-81B530183D41}\tMSITESTDIR\t0\t\tsharedcomponent\n";
1183
1184 static const char shc_custom_action_dat[] =
1185 "Action\tType\tSource\tTarget\tISComments\n"
1186 "s72\ti2\tS64\tS0\tS255\n"
1187 "CustomAction\tAction\n"
1188 "TestComponentAction\t19\t\twrong component action on install\t\n";
1189
1190 static const char shc_install_exec_seq_dat[] =
1191 "Action\tCondition\tSequence\n"
1192 "s72\tS255\tI2\n"
1193 "InstallExecuteSequence\tAction\n"
1194 "LaunchConditions\t\t100\n"
1195 "CostInitialize\t\t200\n"
1196 "FileCost\t\t300\n"
1197 "CostFinalize\t\t600\n"
1198 "InstallValidate\t\t900\n"
1199 "InstallInitialize\t\t1200\n"
1200 "ProcessComponents\t\t1300\n"
1201 "RemoveFiles\t\t1400\n"
1202 "InstallFiles\t\t1500\n"
1203 "TestComponentAction\tNOT REMOVE AND ($sharedcomponent <> 3)\t1600\n"
1204 "RegisterProduct\t\t1700\n"
1205 "PublishFeatures\t\t1800\n"
1206 "PublishProduct\t\t1900\n"
1207 "InstallFinalize\t\t2000\n";
1208
1209 static const char ft_file_dat[] =
1210 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1211 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1212 "File\tFile\n"
1213 "featuretree\tcomp\tfeaturetree.txt\t1000\t\t\t8192\t1\n";
1214
1215 static const char ft_comp_dat[] =
1216 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1217 "s72\tS38\ts72\ti2\tS255\tS72\n"
1218 "Component\tComponent\n"
1219 "comp\t{12345678-1234-1234-1234-222222222222}\tTARGETDIR\t0\t\t\n"
1220 "comp2\t{12345678-1234-1234-1234-333333333333}\tTARGETDIR\t0\t\tfeaturetree\n";
1221
1222 static const char ft_feature_dat[] =
1223 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1224 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1225 "Feature\tFeature\n"
1226 "A\t\t\t\t2\t1\t\t0\n"
1227 "C\tB\t\t\t2\t1\t\t0\n"
1228 "B\tA\t\t\t4\t1\t\t0\n"
1229 "D\t\t\t\t2\t1\t\t0\n";
1230
1231 static const char ft_feature_comp_dat[] =
1232 "Feature_\tComponent_\n"
1233 "s38\ts72\n"
1234 "FeatureComponents\tFeature_\tComponent_\n"
1235 "C\tcomp\n"
1236 "D\tcomp2\n";
1237
1238 static const char ft_condition_dat[] =
1239 "Feature_\tLevel\tCondition\n"
1240 "s38\ti2\tS255\n"
1241 "Condition\tFeature_\tLevel\n"
1242 "A\t0\t\"0\"<>INSTALLTYPE\n";
1243
1244 static const char ft_custom_action_dat[] =
1245 "Action\tType\tSource\tTarget\tISComments\n"
1246 "s72\ti2\tS64\tS0\tS255\n"
1247 "CustomAction\tAction\n"
1248 "Run A\t19\t\tA\t\n"
1249 "Run B\t19\t\tB\t\n"
1250 "Run C\t19\t\tC\t\n";
1251
1252 static const char ft_install_exec_seq_dat[] =
1253 "Action\tCondition\tSequence\n"
1254 "s72\tS255\tI2\n"
1255 "InstallExecuteSequence\tAction\n"
1256 "CostInitialize\t\t100\n"
1257 "FileCost\t\t200\n"
1258 "CostFinalize\t\t300\n"
1259 "InstallValidate\t\t400\n"
1260 "InstallInitialize\t\t500\n"
1261 "Run C\t3 = &C AND NOT Installed\t600\n"
1262 "Run B\t3 = &B AND NOT Installed\t700\n"
1263 "Run A\t3 = &A AND NOT Installed\t800\n"
1264 "ProcessComponents\t\t900\n"
1265 "RemoveFiles\t\t1000\n"
1266 "InstallFiles\t\t1100\n"
1267 "RegisterProduct\t\t1200\n"
1268 "PublishFeatures\t\t1300\n"
1269 "PublishProduct\t\t1400\n"
1270 "InstallFinalize\t\t1500\n";
1271
1272 static const char da_custom_action_dat[] =
1273 "Action\tType\tSource\tTarget\tISComments\n"
1274 "s72\ti2\tS64\tS0\tS255\n"
1275 "CustomAction\tAction\n"
1276 "deferred\t1074\tCMDEXE\t/c if exist msitest (exit 0) else (exit 1)\t\n"
1277 "immediate\t50\tCMDEXE\t/c mkdir msitest\t\n"
1278 "cleanup\t50\tCMDEXE\t/c rmdir msitest\t\n";
1279
1280 static const char da_install_exec_seq_dat[] =
1281 "Action\tCondition\tSequence\n"
1282 "s72\tS255\tI2\n"
1283 "InstallExecuteSequence\tAction\n"
1284 "CostInitialize\t\t200\n"
1285 "FileCost\t\t300\n"
1286 "CostFinalize\t\t400\n"
1287 "InstallInitialize\t\t500\n"
1288 "deferred\t\t600\n"
1289 "immediate\t\t700\n"
1290 "InstallFinalize\t\t1100\n"
1291 "cleanup\t\t1200\n";
1292
1293 typedef struct _msi_table
1294 {
1295 const CHAR *filename;
1296 const CHAR *data;
1297 int size;
1298 } msi_table;
1299
1300 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1301
1302 static const msi_table tables[] =
1303 {
1304 ADD_TABLE(component),
1305 ADD_TABLE(directory),
1306 ADD_TABLE(feature),
1307 ADD_TABLE(feature_comp),
1308 ADD_TABLE(file),
1309 ADD_TABLE(install_exec_seq),
1310 ADD_TABLE(media),
1311 ADD_TABLE(property),
1312 ADD_TABLE(registry),
1313 ADD_TABLE(service_install),
1314 ADD_TABLE(service_control)
1315 };
1316
1317 static const msi_table sc_tables[] =
1318 {
1319 ADD_TABLE(component),
1320 ADD_TABLE(directory),
1321 ADD_TABLE(feature),
1322 ADD_TABLE(feature_comp),
1323 ADD_TABLE(file),
1324 ADD_TABLE(install_exec_seq),
1325 ADD_TABLE(media),
1326 ADD_TABLE(property),
1327 ADD_TABLE(shortcut)
1328 };
1329
1330 static const msi_table ps_tables[] =
1331 {
1332 ADD_TABLE(component),
1333 ADD_TABLE(directory),
1334 ADD_TABLE(feature),
1335 ADD_TABLE(feature_comp),
1336 ADD_TABLE(file),
1337 ADD_TABLE(install_exec_seq),
1338 ADD_TABLE(media),
1339 ADD_TABLE(property),
1340 ADD_TABLE(condition)
1341 };
1342
1343 static const msi_table up_tables[] =
1344 {
1345 ADD_TABLE(component),
1346 ADD_TABLE(directory),
1347 ADD_TABLE(feature),
1348 ADD_TABLE(feature_comp),
1349 ADD_TABLE(file),
1350 ADD_TABLE(install_exec_seq),
1351 ADD_TABLE(media),
1352 ADD_TABLE(up_property),
1353 ADD_TABLE(registry),
1354 ADD_TABLE(service_install),
1355 ADD_TABLE(service_control)
1356 };
1357
1358 static const msi_table up2_tables[] =
1359 {
1360 ADD_TABLE(component),
1361 ADD_TABLE(directory),
1362 ADD_TABLE(feature),
1363 ADD_TABLE(feature_comp),
1364 ADD_TABLE(file),
1365 ADD_TABLE(install_exec_seq),
1366 ADD_TABLE(media),
1367 ADD_TABLE(up2_property),
1368 ADD_TABLE(registry),
1369 ADD_TABLE(service_install),
1370 ADD_TABLE(service_control)
1371 };
1372
1373 static const msi_table up3_tables[] =
1374 {
1375 ADD_TABLE(component),
1376 ADD_TABLE(directory),
1377 ADD_TABLE(feature),
1378 ADD_TABLE(feature_comp),
1379 ADD_TABLE(file),
1380 ADD_TABLE(install_exec_seq),
1381 ADD_TABLE(media),
1382 ADD_TABLE(up3_property),
1383 ADD_TABLE(registry),
1384 ADD_TABLE(service_install),
1385 ADD_TABLE(service_control)
1386 };
1387
1388 static const msi_table up4_tables[] =
1389 {
1390 ADD_TABLE(component),
1391 ADD_TABLE(directory),
1392 ADD_TABLE(feature),
1393 ADD_TABLE(feature_comp),
1394 ADD_TABLE(file),
1395 ADD_TABLE(pp_install_exec_seq),
1396 ADD_TABLE(media),
1397 ADD_TABLE(property),
1398 ADD_TABLE(registry),
1399 ADD_TABLE(service_install),
1400 ADD_TABLE(service_control)
1401 };
1402
1403 static const msi_table up5_tables[] =
1404 {
1405 ADD_TABLE(component),
1406 ADD_TABLE(directory),
1407 ADD_TABLE(feature),
1408 ADD_TABLE(feature_comp),
1409 ADD_TABLE(file),
1410 ADD_TABLE(pp_install_exec_seq),
1411 ADD_TABLE(media),
1412 ADD_TABLE(up_property),
1413 ADD_TABLE(registry),
1414 ADD_TABLE(service_install),
1415 ADD_TABLE(service_control)
1416 };
1417
1418 static const msi_table up6_tables[] =
1419 {
1420 ADD_TABLE(component),
1421 ADD_TABLE(directory),
1422 ADD_TABLE(feature),
1423 ADD_TABLE(feature_comp),
1424 ADD_TABLE(file),
1425 ADD_TABLE(pp_install_exec_seq),
1426 ADD_TABLE(media),
1427 ADD_TABLE(up2_property),
1428 ADD_TABLE(registry),
1429 ADD_TABLE(service_install),
1430 ADD_TABLE(service_control)
1431 };
1432
1433 static const msi_table up7_tables[] =
1434 {
1435 ADD_TABLE(component),
1436 ADD_TABLE(directory),
1437 ADD_TABLE(feature),
1438 ADD_TABLE(feature_comp),
1439 ADD_TABLE(file),
1440 ADD_TABLE(pp_install_exec_seq),
1441 ADD_TABLE(media),
1442 ADD_TABLE(up3_property),
1443 ADD_TABLE(registry),
1444 ADD_TABLE(service_install),
1445 ADD_TABLE(service_control)
1446 };
1447
1448 static const msi_table cc_tables[] =
1449 {
1450 ADD_TABLE(cc_component),
1451 ADD_TABLE(directory),
1452 ADD_TABLE(cc_feature),
1453 ADD_TABLE(cc_feature_comp),
1454 ADD_TABLE(cc_file),
1455 ADD_TABLE(install_exec_seq),
1456 ADD_TABLE(cc_media),
1457 ADD_TABLE(property),
1458 };
1459
1460 static const msi_table cc2_tables[] =
1461 {
1462 ADD_TABLE(cc2_component),
1463 ADD_TABLE(directory),
1464 ADD_TABLE(cc_feature),
1465 ADD_TABLE(cc_feature_comp),
1466 ADD_TABLE(cc2_file),
1467 ADD_TABLE(install_exec_seq),
1468 ADD_TABLE(cc_media),
1469 ADD_TABLE(property),
1470 };
1471
1472 static const msi_table cc3_tables[] =
1473 {
1474 ADD_TABLE(cc_component),
1475 ADD_TABLE(directory),
1476 ADD_TABLE(cc_feature),
1477 ADD_TABLE(cc_feature_comp),
1478 ADD_TABLE(cc_file),
1479 ADD_TABLE(install_exec_seq),
1480 ADD_TABLE(cc3_media),
1481 ADD_TABLE(property),
1482 };
1483
1484 static const msi_table co_tables[] =
1485 {
1486 ADD_TABLE(cc_component),
1487 ADD_TABLE(directory),
1488 ADD_TABLE(cc_feature),
1489 ADD_TABLE(cc_feature_comp),
1490 ADD_TABLE(co_file),
1491 ADD_TABLE(install_exec_seq),
1492 ADD_TABLE(co_media),
1493 ADD_TABLE(property),
1494 };
1495
1496 static const msi_table co2_tables[] =
1497 {
1498 ADD_TABLE(cc_component),
1499 ADD_TABLE(directory),
1500 ADD_TABLE(cc_feature),
1501 ADD_TABLE(cc_feature_comp),
1502 ADD_TABLE(cc_file),
1503 ADD_TABLE(install_exec_seq),
1504 ADD_TABLE(co2_media),
1505 ADD_TABLE(property),
1506 };
1507
1508 static const msi_table mm_tables[] =
1509 {
1510 ADD_TABLE(cc_component),
1511 ADD_TABLE(directory),
1512 ADD_TABLE(cc_feature),
1513 ADD_TABLE(cc_feature_comp),
1514 ADD_TABLE(mm_file),
1515 ADD_TABLE(install_exec_seq),
1516 ADD_TABLE(mm_media),
1517 ADD_TABLE(property),
1518 };
1519
1520 static const msi_table ss_tables[] =
1521 {
1522 ADD_TABLE(cc_component),
1523 ADD_TABLE(directory),
1524 ADD_TABLE(cc_feature),
1525 ADD_TABLE(cc_feature_comp),
1526 ADD_TABLE(cc_file),
1527 ADD_TABLE(install_exec_seq),
1528 ADD_TABLE(ss_media),
1529 ADD_TABLE(property),
1530 };
1531
1532 static const msi_table ui_tables[] =
1533 {
1534 ADD_TABLE(ui_component),
1535 ADD_TABLE(directory),
1536 ADD_TABLE(cc_feature),
1537 ADD_TABLE(cc_feature_comp),
1538 ADD_TABLE(cc_file),
1539 ADD_TABLE(install_exec_seq),
1540 ADD_TABLE(ui_install_ui_seq),
1541 ADD_TABLE(ui_custom_action),
1542 ADD_TABLE(cc_media),
1543 ADD_TABLE(property),
1544 };
1545
1546 static const msi_table rof_tables[] =
1547 {
1548 ADD_TABLE(rof_component),
1549 ADD_TABLE(directory),
1550 ADD_TABLE(rof_feature),
1551 ADD_TABLE(rof_feature_comp),
1552 ADD_TABLE(rof_file),
1553 ADD_TABLE(install_exec_seq),
1554 ADD_TABLE(rof_media),
1555 ADD_TABLE(property),
1556 };
1557
1558 static const msi_table rofc_tables[] =
1559 {
1560 ADD_TABLE(rof_component),
1561 ADD_TABLE(directory),
1562 ADD_TABLE(rof_feature),
1563 ADD_TABLE(rof_feature_comp),
1564 ADD_TABLE(rofc_file),
1565 ADD_TABLE(install_exec_seq),
1566 ADD_TABLE(rofc_media),
1567 ADD_TABLE(property),
1568 };
1569
1570 static const msi_table sdp_tables[] =
1571 {
1572 ADD_TABLE(rof_component),
1573 ADD_TABLE(directory),
1574 ADD_TABLE(rof_feature),
1575 ADD_TABLE(rof_feature_comp),
1576 ADD_TABLE(rof_file),
1577 ADD_TABLE(sdp_install_exec_seq),
1578 ADD_TABLE(sdp_custom_action),
1579 ADD_TABLE(rof_media),
1580 ADD_TABLE(property),
1581 };
1582
1583 static const msi_table cie_tables[] =
1584 {
1585 ADD_TABLE(cie_component),
1586 ADD_TABLE(directory),
1587 ADD_TABLE(cc_feature),
1588 ADD_TABLE(cie_feature_comp),
1589 ADD_TABLE(cie_file),
1590 ADD_TABLE(install_exec_seq),
1591 ADD_TABLE(cie_media),
1592 ADD_TABLE(property),
1593 };
1594
1595 static const msi_table tp_tables[] =
1596 {
1597 ADD_TABLE(tp_component),
1598 ADD_TABLE(directory),
1599 ADD_TABLE(rof_feature),
1600 ADD_TABLE(ci2_feature_comp),
1601 ADD_TABLE(ci2_file),
1602 ADD_TABLE(install_exec_seq),
1603 ADD_TABLE(rof_media),
1604 ADD_TABLE(property),
1605 };
1606
1607 static const msi_table cwd_tables[] =
1608 {
1609 ADD_TABLE(cwd_component),
1610 ADD_TABLE(directory),
1611 ADD_TABLE(rof_feature),
1612 ADD_TABLE(ci2_feature_comp),
1613 ADD_TABLE(ci2_file),
1614 ADD_TABLE(install_exec_seq),
1615 ADD_TABLE(rof_media),
1616 ADD_TABLE(property),
1617 };
1618
1619 static const msi_table adm_tables[] =
1620 {
1621 ADD_TABLE(adm_component),
1622 ADD_TABLE(directory),
1623 ADD_TABLE(rof_feature),
1624 ADD_TABLE(ci2_feature_comp),
1625 ADD_TABLE(ci2_file),
1626 ADD_TABLE(install_exec_seq),
1627 ADD_TABLE(rof_media),
1628 ADD_TABLE(property),
1629 ADD_TABLE(adm_custom_action),
1630 ADD_TABLE(adm_admin_exec_seq),
1631 };
1632
1633 static const msi_table amp_tables[] =
1634 {
1635 ADD_TABLE(amp_component),
1636 ADD_TABLE(directory),
1637 ADD_TABLE(rof_feature),
1638 ADD_TABLE(ci2_feature_comp),
1639 ADD_TABLE(ci2_file),
1640 ADD_TABLE(install_exec_seq),
1641 ADD_TABLE(rof_media),
1642 ADD_TABLE(property),
1643 };
1644
1645 static const msi_table mc_tables[] =
1646 {
1647 ADD_TABLE(mc_component),
1648 ADD_TABLE(directory),
1649 ADD_TABLE(cc_feature),
1650 ADD_TABLE(cie_feature_comp),
1651 ADD_TABLE(mc_file),
1652 ADD_TABLE(install_exec_seq),
1653 ADD_TABLE(mc_media),
1654 ADD_TABLE(property),
1655 ADD_TABLE(mc_file_hash),
1656 };
1657
1658 static const msi_table sf_tables[] =
1659 {
1660 ADD_TABLE(wrv_component),
1661 ADD_TABLE(directory),
1662 ADD_TABLE(rof_feature),
1663 ADD_TABLE(ci2_feature_comp),
1664 ADD_TABLE(ci2_file),
1665 ADD_TABLE(install_exec_seq),
1666 ADD_TABLE(rof_media),
1667 ADD_TABLE(property),
1668 };
1669
1670 static const msi_table ca51_tables[] =
1671 {
1672 ADD_TABLE(ca51_component),
1673 ADD_TABLE(directory),
1674 ADD_TABLE(rof_feature),
1675 ADD_TABLE(ci2_feature_comp),
1676 ADD_TABLE(ci2_file),
1677 ADD_TABLE(ca51_install_exec_seq),
1678 ADD_TABLE(rof_media),
1679 ADD_TABLE(property),
1680 ADD_TABLE(ca51_custom_action),
1681 };
1682
1683 static const msi_table is_tables[] =
1684 {
1685 ADD_TABLE(is_component),
1686 ADD_TABLE(directory),
1687 ADD_TABLE(is_feature),
1688 ADD_TABLE(is_feature_comp),
1689 ADD_TABLE(is_file),
1690 ADD_TABLE(install_exec_seq),
1691 ADD_TABLE(is_media),
1692 ADD_TABLE(property),
1693 };
1694
1695 static const msi_table sp_tables[] =
1696 {
1697 ADD_TABLE(sp_component),
1698 ADD_TABLE(sp_directory),
1699 ADD_TABLE(rof_feature),
1700 ADD_TABLE(ci2_feature_comp),
1701 ADD_TABLE(ci2_file),
1702 ADD_TABLE(install_exec_seq),
1703 ADD_TABLE(rof_media),
1704 ADD_TABLE(property),
1705 };
1706
1707 static const msi_table mcp_tables[] =
1708 {
1709 ADD_TABLE(mcp_component),
1710 ADD_TABLE(directory),
1711 ADD_TABLE(mcp_feature),
1712 ADD_TABLE(mcp_feature_comp),
1713 ADD_TABLE(mcp_file),
1714 ADD_TABLE(rem_install_exec_seq),
1715 ADD_TABLE(rof_media),
1716 ADD_TABLE(property),
1717 };
1718
1719 static const msi_table ai_tables[] =
1720 {
1721 ADD_TABLE(component),
1722 ADD_TABLE(directory),
1723 ADD_TABLE(feature),
1724 ADD_TABLE(feature_comp),
1725 ADD_TABLE(ai_file),
1726 ADD_TABLE(install_exec_seq),
1727 ADD_TABLE(media),
1728 ADD_TABLE(property)
1729 };
1730
1731 static const msi_table pc_tables[] =
1732 {
1733 ADD_TABLE(ca51_component),
1734 ADD_TABLE(directory),
1735 ADD_TABLE(rof_feature),
1736 ADD_TABLE(ci2_feature_comp),
1737 ADD_TABLE(ci2_file),
1738 ADD_TABLE(install_exec_seq),
1739 ADD_TABLE(rof_media),
1740 ADD_TABLE(property)
1741 };
1742
1743 static const msi_table ip_tables[] =
1744 {
1745 ADD_TABLE(component),
1746 ADD_TABLE(directory),
1747 ADD_TABLE(feature),
1748 ADD_TABLE(feature_comp),
1749 ADD_TABLE(file),
1750 ADD_TABLE(ip_install_exec_seq),
1751 ADD_TABLE(ip_custom_action),
1752 ADD_TABLE(media),
1753 ADD_TABLE(property)
1754 };
1755
1756 static const msi_table aup_tables[] =
1757 {
1758 ADD_TABLE(component),
1759 ADD_TABLE(directory),
1760 ADD_TABLE(feature),
1761 ADD_TABLE(feature_comp),
1762 ADD_TABLE(file),
1763 ADD_TABLE(aup_install_exec_seq),
1764 ADD_TABLE(aup_custom_action),
1765 ADD_TABLE(media),
1766 ADD_TABLE(property)
1767 };
1768
1769 static const msi_table aup2_tables[] =
1770 {
1771 ADD_TABLE(component),
1772 ADD_TABLE(directory),
1773 ADD_TABLE(feature),
1774 ADD_TABLE(feature_comp),
1775 ADD_TABLE(file),
1776 ADD_TABLE(aup2_install_exec_seq),
1777 ADD_TABLE(aup_custom_action),
1778 ADD_TABLE(media),
1779 ADD_TABLE(aup_property)
1780 };
1781
1782 static const msi_table aup3_tables[] =
1783 {
1784 ADD_TABLE(component),
1785 ADD_TABLE(directory),
1786 ADD_TABLE(feature),
1787 ADD_TABLE(feature_comp),
1788 ADD_TABLE(file),
1789 ADD_TABLE(aup2_install_exec_seq),
1790 ADD_TABLE(aup_custom_action),
1791 ADD_TABLE(media),
1792 ADD_TABLE(aup2_property)
1793 };
1794
1795 static const msi_table aup4_tables[] =
1796 {
1797 ADD_TABLE(component),
1798 ADD_TABLE(directory),
1799 ADD_TABLE(feature),
1800 ADD_TABLE(feature_comp),
1801 ADD_TABLE(file),
1802 ADD_TABLE(aup3_install_exec_seq),
1803 ADD_TABLE(aup_custom_action),
1804 ADD_TABLE(media),
1805 ADD_TABLE(aup2_property)
1806 };
1807
1808 static const msi_table fiu_tables[] =
1809 {
1810 ADD_TABLE(rof_component),
1811 ADD_TABLE(directory),
1812 ADD_TABLE(rof_feature),
1813 ADD_TABLE(rof_feature_comp),
1814 ADD_TABLE(rof_file),
1815 ADD_TABLE(pp_install_exec_seq),
1816 ADD_TABLE(rof_media),
1817 ADD_TABLE(property),
1818 };
1819
1820 static const msi_table fiuc_tables[] =
1821 {
1822 ADD_TABLE(rof_component),
1823 ADD_TABLE(directory),
1824 ADD_TABLE(rof_feature),
1825 ADD_TABLE(rof_feature_comp),
1826 ADD_TABLE(rofc_file),
1827 ADD_TABLE(pp_install_exec_seq),
1828 ADD_TABLE(rofc_media),
1829 ADD_TABLE(property),
1830 };
1831
1832 static const msi_table fo_tables[] =
1833 {
1834 ADD_TABLE(directory),
1835 ADD_TABLE(fo_file),
1836 ADD_TABLE(fo_component),
1837 ADD_TABLE(fo_feature),
1838 ADD_TABLE(fo_condition),
1839 ADD_TABLE(fo_feature_comp),
1840 ADD_TABLE(fo_custom_action),
1841 ADD_TABLE(fo_install_exec_seq),
1842 ADD_TABLE(media),
1843 ADD_TABLE(property)
1844 };
1845
1846 static const msi_table icon_base_tables[] =
1847 {
1848 ADD_TABLE(ci_component),
1849 ADD_TABLE(directory),
1850 ADD_TABLE(rof_feature),
1851 ADD_TABLE(rof_feature_comp),
1852 ADD_TABLE(rof_file),
1853 ADD_TABLE(pp_install_exec_seq),
1854 ADD_TABLE(rof_media),
1855 ADD_TABLE(icon_property),
1856 };
1857
1858 static const msi_table pv_tables[] =
1859 {
1860 ADD_TABLE(rof_component),
1861 ADD_TABLE(directory),
1862 ADD_TABLE(rof_feature),
1863 ADD_TABLE(rof_feature_comp),
1864 ADD_TABLE(rof_file),
1865 ADD_TABLE(pv_install_exec_seq),
1866 ADD_TABLE(rof_media),
1867 ADD_TABLE(property)
1868 };
1869
1870 static const msi_table uc_tables[] =
1871 {
1872 ADD_TABLE(directory),
1873 ADD_TABLE(uc_component),
1874 ADD_TABLE(uc_feature),
1875 ADD_TABLE(uc_feature_comp),
1876 ADD_TABLE(uc_file),
1877 ADD_TABLE(uc_install_exec_seq),
1878 ADD_TABLE(media),
1879 ADD_TABLE(uc_property)
1880 };
1881
1882 static const msi_table mixed_tables[] =
1883 {
1884 ADD_TABLE(directory),
1885 ADD_TABLE(mixed_component),
1886 ADD_TABLE(mixed_feature),
1887 ADD_TABLE(mixed_feature_comp),
1888 ADD_TABLE(mixed_install_exec_seq),
1889 ADD_TABLE(mixed_registry),
1890 ADD_TABLE(media),
1891 ADD_TABLE(property)
1892 };
1893
1894 static const msi_table vp_tables[] =
1895 {
1896 ADD_TABLE(directory),
1897 ADD_TABLE(vp_file),
1898 ADD_TABLE(vp_component),
1899 ADD_TABLE(vp_feature),
1900 ADD_TABLE(vp_feature_comp),
1901 ADD_TABLE(vp_custom_action),
1902 ADD_TABLE(vp_install_exec_seq),
1903 ADD_TABLE(media),
1904 ADD_TABLE(property)
1905 };
1906
1907 static const msi_table shc_tables[] =
1908 {
1909 ADD_TABLE(media),
1910 ADD_TABLE(directory),
1911 ADD_TABLE(shc_file),
1912 ADD_TABLE(shc_component),
1913 ADD_TABLE(shc_feature),
1914 ADD_TABLE(shc_feature_comp),
1915 ADD_TABLE(shc_custom_action),
1916 ADD_TABLE(shc_install_exec_seq),
1917 ADD_TABLE(shc_property)
1918 };
1919
1920 static const msi_table shc2_tables[] =
1921 {
1922 ADD_TABLE(media),
1923 ADD_TABLE(directory),
1924 ADD_TABLE(shc_file),
1925 ADD_TABLE(shc_component),
1926 ADD_TABLE(shc_feature),
1927 ADD_TABLE(shc_feature_comp),
1928 ADD_TABLE(shc_custom_action),
1929 ADD_TABLE(shc_install_exec_seq),
1930 ADD_TABLE(shc2_property)
1931 };
1932
1933 static const msi_table ft_tables[] =
1934 {
1935 ADD_TABLE(media),
1936 ADD_TABLE(directory),
1937 ADD_TABLE(ft_file),
1938 ADD_TABLE(ft_comp),
1939 ADD_TABLE(ft_feature),
1940 ADD_TABLE(ft_feature_comp),
1941 ADD_TABLE(ft_condition),
1942 ADD_TABLE(ft_custom_action),
1943 ADD_TABLE(ft_install_exec_seq),
1944 ADD_TABLE(property)
1945 };
1946
1947 static const msi_table da_tables[] =
1948 {
1949 ADD_TABLE(media),
1950 ADD_TABLE(directory),
1951 ADD_TABLE(file),
1952 ADD_TABLE(component),
1953 ADD_TABLE(feature),
1954 ADD_TABLE(feature_comp),
1955 ADD_TABLE(property),
1956 ADD_TABLE(da_install_exec_seq),
1957 ADD_TABLE(da_custom_action),
1958 };
1959
1960 /* cabinet definitions */
1961
1962 /* make the max size large so there is only one cab file */
1963 #define MEDIA_SIZE 0x7FFFFFFF
1964 #define FOLDER_THRESHOLD 900000
1965
1966 /* the FCI callbacks */
1967
1968 static void * CDECL mem_alloc(ULONG cb)
1969 {
1970 return HeapAlloc(GetProcessHeap(), 0, cb);
1971 }
1972
1973 static void CDECL mem_free(void *memory)
1974 {
1975 HeapFree(GetProcessHeap(), 0, memory);
1976 }
1977
1978 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
1979 {
1980 sprintf(pccab->szCab, pv, pccab->iCab);
1981 return TRUE;
1982 }
1983
1984 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
1985 {
1986 return 0;
1987 }
1988
1989 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
1990 BOOL fContinuation, void *pv)
1991 {
1992 return 0;
1993 }
1994
1995 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
1996 {
1997 HANDLE handle;
1998 DWORD dwAccess = 0;
1999 DWORD dwShareMode = 0;
2000 DWORD dwCreateDisposition = OPEN_EXISTING;
2001
2002 dwAccess = GENERIC_READ | GENERIC_WRITE;
2003 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
2004 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
2005
2006 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
2007 dwCreateDisposition = OPEN_EXISTING;
2008 else
2009 dwCreateDisposition = CREATE_NEW;
2010
2011 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
2012 dwCreateDisposition, 0, NULL);
2013
2014 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
2015
2016 return (INT_PTR)handle;
2017 }
2018
2019 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2020 {
2021 HANDLE handle = (HANDLE)hf;
2022 DWORD dwRead;
2023 BOOL res;
2024
2025 res = ReadFile(handle, memory, cb, &dwRead, NULL);
2026 ok(res, "Failed to ReadFile\n");
2027
2028 return dwRead;
2029 }
2030
2031 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2032 {
2033 HANDLE handle = (HANDLE)hf;
2034 DWORD dwWritten;
2035 BOOL res;
2036
2037 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
2038 ok(res, "Failed to WriteFile\n");
2039
2040 return dwWritten;
2041 }
2042
2043 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
2044 {
2045 HANDLE handle = (HANDLE)hf;
2046 ok(CloseHandle(handle), "Failed to CloseHandle\n");
2047
2048 return 0;
2049 }
2050
2051 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
2052 {
2053 HANDLE handle = (HANDLE)hf;
2054 DWORD ret;
2055
2056 ret = SetFilePointer(handle, dist, NULL, seektype);
2057 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
2058
2059 return ret;
2060 }
2061
2062 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
2063 {
2064 BOOL ret = DeleteFileA(pszFile);
2065 ok(ret, "Failed to DeleteFile %s\n", pszFile);
2066
2067 return 0;
2068 }
2069
2070 static void init_functionpointers(void)
2071 {
2072 HMODULE hmsi = GetModuleHandleA("msi.dll");
2073 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2074 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2075
2076 #define GET_PROC(mod, func) \
2077 p ## func = (void*)GetProcAddress(mod, #func); \
2078 if(!p ## func) \
2079 trace("GetProcAddress(%s) failed\n", #func);
2080
2081 GET_PROC(hmsi, MsiQueryComponentStateA);
2082 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
2083 GET_PROC(hmsi, MsiGetComponentPathExA);
2084
2085 GET_PROC(hadvapi32, CheckTokenMembership);
2086 GET_PROC(hadvapi32, ConvertSidToStringSidA);
2087 GET_PROC(hadvapi32, OpenProcessToken);
2088 GET_PROC(hadvapi32, RegDeleteKeyExA)
2089 GET_PROC(hkernel32, IsWow64Process)
2090
2091 hsrclient = LoadLibraryA("srclient.dll");
2092 GET_PROC(hsrclient, SRRemoveRestorePoint);
2093 GET_PROC(hsrclient, SRSetRestorePointA);
2094
2095 #undef GET_PROC
2096 }
2097
2098 static BOOL is_process_limited(void)
2099 {
2100 SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
2101 PSID Group = NULL;
2102 BOOL IsInGroup;
2103 HANDLE token;
2104
2105 if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
2106
2107 if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
2108 DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
2109 !pCheckTokenMembership(NULL, Group, &IsInGroup))
2110 {
2111 trace("Could not check if the current user is an administrator\n");
2112 FreeSid(Group);
2113 return FALSE;
2114 }
2115 FreeSid(Group);
2116
2117 if (!IsInGroup)
2118 {
2119 /* Only administrators have enough privileges for these tests */
2120 return TRUE;
2121 }
2122
2123 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
2124 {
2125 BOOL ret;
2126 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
2127 DWORD size;
2128
2129 ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
2130 CloseHandle(token);
2131 return (ret && type == TokenElevationTypeLimited);
2132 }
2133 return FALSE;
2134 }
2135
2136 static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val)
2137 {
2138 CHAR buffer[0x20];
2139 UINT r;
2140 DWORD sz;
2141
2142 sz = sizeof buffer;
2143 r = MsiRecordGetStringA(rec, field, buffer, &sz);
2144 return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
2145 }
2146
2147 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
2148 {
2149 LPSTR tempname;
2150
2151 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
2152 GetTempFileNameA(".", "xx", 0, tempname);
2153
2154 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2155 {
2156 lstrcpyA(pszTempName, tempname);
2157 HeapFree(GetProcessHeap(), 0, tempname);
2158 return TRUE;
2159 }
2160
2161 HeapFree(GetProcessHeap(), 0, tempname);
2162
2163 return FALSE;
2164 }
2165
2166 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
2167 USHORT *pattribs, int *err, void *pv)
2168 {
2169 BY_HANDLE_FILE_INFORMATION finfo;
2170 FILETIME filetime;
2171 HANDLE handle;
2172 DWORD attrs;
2173 BOOL res;
2174
2175 handle = CreateFileA(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
2176 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
2177
2178 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2179
2180 res = GetFileInformationByHandle(handle, &finfo);
2181 ok(res, "Expected GetFileInformationByHandle to succeed\n");
2182
2183 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
2184 FileTimeToDosDateTime(&filetime, pdate, ptime);
2185
2186 attrs = GetFileAttributesA(pszName);
2187 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2188
2189 return (INT_PTR)handle;
2190 }
2191
2192 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
2193 {
2194 char path[MAX_PATH];
2195 char filename[MAX_PATH];
2196
2197 lstrcpyA(path, CURR_DIR);
2198 lstrcatA(path, "\\");
2199 lstrcatA(path, file);
2200
2201 lstrcpyA(filename, file);
2202
2203 return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
2204 progress, get_open_info, compress);
2205 }
2206
2207 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
2208 {
2209 ZeroMemory(pCabParams, sizeof(CCAB));
2210
2211 pCabParams->cb = max_size;
2212 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2213 pCabParams->setID = 0xbeef;
2214 pCabParams->iCab = 1;
2215 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2216 lstrcatA(pCabParams->szCabPath, "\\");
2217 lstrcpyA(pCabParams->szCab, name);
2218 }
2219
2220 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
2221 {
2222 CCAB cabParams;
2223 LPCSTR ptr;
2224 HFCI hfci;
2225 ERF erf;
2226 BOOL res;
2227
2228 set_cab_parameters(&cabParams, name, max_size);
2229
2230 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
2231 fci_read, fci_write, fci_close, fci_seek, fci_delete,
2232 get_temp_file, &cabParams, NULL);
2233
2234 ok(hfci != NULL, "Failed to create an FCI context\n");
2235
2236 ptr = files;
2237 while (*ptr)
2238 {
2239 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2240 ok(res, "Failed to add file: %s\n", ptr);
2241 ptr += lstrlenA(ptr) + 1;
2242 }
2243
2244 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
2245 ok(res, "Failed to flush the cabinet\n");
2246
2247 res = FCIDestroy(hfci);
2248 ok(res, "Failed to destroy the cabinet\n");
2249 }
2250
2251 static BOOL get_user_dirs(void)
2252 {
2253 HKEY hkey;
2254 DWORD type, size;
2255
2256 if (RegOpenKeyA(HKEY_CURRENT_USER,
2257 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey))
2258 return FALSE;
2259
2260 size = MAX_PATH;
2261 if(RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size)){
2262 RegCloseKey(hkey);
2263 return FALSE;
2264 }
2265
2266 RegCloseKey(hkey);
2267 return TRUE;
2268 }
2269
2270 static BOOL get_system_dirs(void)
2271 {
2272 HKEY hkey;
2273 DWORD type, size;
2274
2275 if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
2276 return FALSE;
2277
2278 size = MAX_PATH;
2279 if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
2280 RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size)) {
2281 RegCloseKey(hkey);
2282 return FALSE;
2283 }
2284
2285 size = MAX_PATH;
2286 if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
2287 RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size)) {
2288 RegCloseKey(hkey);
2289 return FALSE;
2290 }
2291
2292 size = MAX_PATH;
2293 if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR_NATIVE, &size)) {
2294 RegCloseKey(hkey);
2295 return FALSE;
2296 }
2297
2298 RegCloseKey(hkey);
2299
2300 if(!GetWindowsDirectoryA(WINDOWS_DIR, MAX_PATH))
2301 return FALSE;
2302
2303 return TRUE;
2304 }
2305
2306 static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
2307 {
2308 HANDLE file;
2309 DWORD written;
2310
2311 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
2312 if (file == INVALID_HANDLE_VALUE)
2313 return;
2314
2315 WriteFile(file, data, strlen(data), &written, NULL);
2316
2317 if (size)
2318 {
2319 SetFilePointer(file, size, NULL, FILE_BEGIN);
2320 SetEndOfFile(file);
2321 }
2322
2323 CloseHandle(file);
2324 }
2325
2326 #define create_file(name, size) create_file_data(name, name, size)
2327
2328 static void create_test_files(void)
2329 {
2330 CreateDirectoryA("msitest", NULL);
2331 create_file("msitest\\one.txt", 100);
2332 CreateDirectoryA("msitest\\first", NULL);
2333 create_file("msitest\\first\\two.txt", 100);
2334 CreateDirectoryA("msitest\\second", NULL);
2335 create_file("msitest\\second\\three.txt", 100);
2336
2337 create_file("four.txt", 100);
2338 create_file("five.txt", 100);
2339 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2340
2341 create_file("msitest\\filename", 100);
2342 create_file("msitest\\service.exe", 100);
2343
2344 DeleteFileA("four.txt");
2345 DeleteFileA("five.txt");
2346 }
2347
2348 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
2349 {
2350 CHAR path[MAX_PATH];
2351
2352 lstrcpyA(path, PROG_FILES_DIR);
2353 lstrcatA(path, "\\");
2354 lstrcatA(path, rel_path);
2355
2356 if (is_file)
2357 return DeleteFileA(path);
2358 else
2359 return RemoveDirectoryA(path);
2360 }
2361
2362 static BOOL delete_pf_native(const CHAR *rel_path, BOOL is_file)
2363 {
2364 CHAR path[MAX_PATH];
2365
2366 lstrcpyA(path, PROG_FILES_DIR_NATIVE);
2367 lstrcatA(path, "\\");
2368 lstrcatA(path, rel_path);
2369
2370 if (is_file)
2371 return DeleteFileA(path);
2372 else
2373 return RemoveDirectoryA(path);
2374 }
2375
2376 static BOOL delete_cf(const CHAR *rel_path, BOOL is_file)
2377 {
2378 CHAR path[MAX_PATH];
2379
2380 lstrcpyA(path, COMMON_FILES_DIR);
2381 lstrcatA(path, "\\");
2382 lstrcatA(path, rel_path);
2383
2384 if (is_file)
2385 return DeleteFileA(path);
2386 else
2387 return RemoveDirectoryA(path);
2388 }
2389
2390 static BOOL compare_pf_data(const char *filename, const char *data, DWORD size)
2391 {
2392 DWORD read;
2393 HANDLE handle;
2394 BOOL ret = FALSE;
2395 char *buffer, path[MAX_PATH];
2396
2397 lstrcpyA(path, PROG_FILES_DIR);
2398 lstrcatA(path, "\\");
2399 lstrcatA(path, filename);
2400
2401 handle = CreateFileA(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2402 buffer = HeapAlloc(GetProcessHeap(), 0, size);
2403 if (buffer)
2404 {
2405 ReadFile(handle, buffer, size, &read, NULL);
2406 if (read == size && !memcmp(data, buffer, size)) ret = TRUE;
2407 HeapFree(GetProcessHeap(), 0, buffer);
2408 }
2409 CloseHandle(handle);
2410 return ret;
2411 }
2412
2413 static void delete_test_files(void)
2414 {
2415 DeleteFileA("msitest.msi");
2416 DeleteFileA("msitest.cab");
2417 DeleteFileA("msitest\\second\\three.txt");
2418 DeleteFileA("msitest\\first\\two.txt");
2419 DeleteFileA("msitest\\one.txt");
2420 DeleteFileA("msitest\\service.exe");
2421 DeleteFileA("msitest\\filename");
2422 RemoveDirectoryA("msitest\\second");
2423 RemoveDirectoryA("msitest\\first");
2424 RemoveDirectoryA("msitest");
2425 }
2426
2427 static void delete_pf_files(void)
2428 {
2429 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2430 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2431 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2432 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2433 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2434 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2435 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2436 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2437 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2438 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2439 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2440 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2441 }
2442
2443 static void write_file(const CHAR *filename, const char *data, int data_size)
2444 {
2445 DWORD size;
2446
2447 HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
2448 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
2449 WriteFile(hf, data, data_size, &size, NULL);
2450 CloseHandle(hf);
2451 }
2452
2453 static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount,
2454 const char *template, const char *packagecode)
2455 {
2456 MSIHANDLE summary;
2457 UINT r;
2458
2459 r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
2460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2461
2462 r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template);
2463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2464
2465 r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL, packagecode);
2466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2467
2468 r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, version, NULL, NULL);
2469 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2470
2471 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
2472 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2473
2474 r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
2475 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2476
2477 /* write the summary changes back to the stream */
2478 r = MsiSummaryInfoPersist(summary);
2479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2480
2481 MsiCloseHandle(summary);
2482 }
2483
2484 #define create_database(name, tables, num_tables) \
2485 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033", \
2486 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2487
2488 #define create_database_template(name, tables, num_tables, version, template) \
2489 create_database_wordcount(name, tables, num_tables, version, 0, template, \
2490 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2491
2492 static void create_database_wordcount(const CHAR *name, const msi_table *tables,
2493 int num_tables, INT version, INT wordcount,
2494 const char *template, const char *packagecode)
2495 {
2496 MSIHANDLE db;
2497 UINT r;
2498 WCHAR *nameW;
2499 int j, len;
2500
2501 len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
2502 if (!(nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return;
2503 MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
2504
2505 r = MsiOpenDatabaseW(nameW, MSIDBOPEN_CREATE, &db);
2506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2507
2508 /* import the tables into the database */
2509 for (j = 0; j < num_tables; j++)
2510 {
2511 const msi_table *table = &tables[j];
2512
2513 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2514
2515 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);