a3f1897352ed5da396dd07e854a419fc52b65e0f
[reactos.git] / 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 #define _WIN32_MSI 300
22 #define COBJMACROS
23
24 #include <stdio.h>
25
26 #include <windows.h>
27 #include <msiquery.h>
28 #include <msidefs.h>
29 #include <msi.h>
30 #include <fci.h>
31 #include <objidl.h>
32 #include <srrestoreptapi.h>
33
34 #include "wine/test.h"
35
36 static UINT (WINAPI *pMsiQueryComponentStateA)
37 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*);
38 static UINT (WINAPI *pMsiSetExternalUIRecord)
39 (INSTALLUI_HANDLER_RECORD, DWORD, LPVOID, PINSTALLUI_HANDLER_RECORD);
40 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
41 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
42 static UINT (WINAPI *pMsiSourceListGetInfoA)
43 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
44
45 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
46
47 static HMODULE hsrclient = 0;
48 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
49 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
50
51 static BOOL on_win9x = FALSE;
52
53 static const char *msifile = "msitest.msi";
54 static const char *msifile2 = "winetest2.msi";
55 static const char *mstfile = "winetest.mst";
56 static CHAR CURR_DIR[MAX_PATH];
57 static CHAR PROG_FILES_DIR[MAX_PATH];
58 static CHAR COMMON_FILES_DIR[MAX_PATH];
59
60 /* msi database data */
61
62 static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
63 "s72\tS38\ts72\ti2\tS255\tS72\n"
64 "Component\tComponent\n"
65 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
66 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
67 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
68 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
69 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
70 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
71 "component\t\tMSITESTDIR\t0\t1\tfile\n"
72 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
73
74 static const CHAR directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
75 "s72\tS72\tl255\n"
76 "Directory\tDirectory\n"
77 "CABOUTDIR\tMSITESTDIR\tcabout\n"
78 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
79 "FIRSTDIR\tMSITESTDIR\tfirst\n"
80 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
81 "NEWDIR\tCABOUTDIR\tnew\n"
82 "ProgramFilesFolder\tTARGETDIR\t.\n"
83 "TARGETDIR\t\tSourceDir";
84
85 static const CHAR feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
86 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
87 "Feature\tFeature\n"
88 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
89 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
90 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
91 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
92 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
93 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
94 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
95
96 static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n"
97 "s38\ts72\n"
98 "FeatureComponents\tFeature_\tComponent_\n"
99 "Five\tFive\n"
100 "Four\tFour\n"
101 "One\tOne\n"
102 "Three\tThree\n"
103 "Two\tTwo\n"
104 "feature\tcomponent\n"
105 "service_feature\tservice_comp\n";
106
107 static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
108 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
109 "File\tFile\n"
110 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
111 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
112 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
113 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
114 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
115 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
116 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
117
118 static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
119 "s72\tS255\tI2\n"
120 "InstallExecuteSequence\tAction\n"
121 "AllocateRegistrySpace\tNOT Installed\t1550\n"
122 "CostFinalize\t\t1000\n"
123 "CostInitialize\t\t800\n"
124 "FileCost\t\t900\n"
125 "ResolveSource\t\t950\n"
126 "MoveFiles\t\t1700\n"
127 "InstallFiles\t\t4000\n"
128 "DuplicateFiles\t\t4500\n"
129 "WriteEnvironmentStrings\t\t4550\n"
130 "CreateShortcuts\t\t4600\n"
131 "InstallServices\t\t5000\n"
132 "InstallFinalize\t\t6600\n"
133 "InstallInitialize\t\t1500\n"
134 "InstallValidate\t\t1400\n"
135 "LaunchConditions\t\t100\n"
136 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
137
138 static const CHAR media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
139 "i2\ti4\tL64\tS255\tS32\tS72\n"
140 "Media\tDiskId\n"
141 "1\t3\t\t\tDISK1\t\n"
142 "2\t5\t\tmsitest.cab\tDISK2\t\n";
143
144 static const CHAR property_dat[] = "Property\tValue\n"
145 "s72\tl0\n"
146 "Property\tProperty\n"
147 "DefaultUIFont\tDlgFont8\n"
148 "HASUIRUN\t0\n"
149 "INSTALLLEVEL\t3\n"
150 "InstallMode\tTypical\n"
151 "Manufacturer\tWine\n"
152 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
153 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
154 "ProductID\tnone\n"
155 "ProductLanguage\t1033\n"
156 "ProductName\tMSITEST\n"
157 "ProductVersion\t1.1.1\n"
158 "PROMPTROLLBACKCOST\tP\n"
159 "Setup\tSetup\n"
160 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
161 "AdminProperties\tPOSTADMIN\n"
162 "ROOTDRIVE\tC:\\\n"
163 "SERVNAME\tTestService\n"
164 "SERVDISP\tTestServiceDisp\n";
165
166 static const CHAR aup_property_dat[] = "Property\tValue\n"
167 "s72\tl0\n"
168 "Property\tProperty\n"
169 "DefaultUIFont\tDlgFont8\n"
170 "HASUIRUN\t0\n"
171 "ALLUSERS\t1\n"
172 "INSTALLLEVEL\t3\n"
173 "InstallMode\tTypical\n"
174 "Manufacturer\tWine\n"
175 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
176 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
177 "ProductID\tnone\n"
178 "ProductLanguage\t1033\n"
179 "ProductName\tMSITEST\n"
180 "ProductVersion\t1.1.1\n"
181 "PROMPTROLLBACKCOST\tP\n"
182 "Setup\tSetup\n"
183 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
184 "AdminProperties\tPOSTADMIN\n"
185 "ROOTDRIVE\tC:\\\n"
186 "SERVNAME\tTestService\n"
187 "SERVDISP\tTestServiceDisp\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
212 static const CHAR shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
213 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
214 "Shortcut\tShortcut\n"
215 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
216
217 static const CHAR environment_dat[] = "Environment\tName\tValue\tComponent_\n"
218 "s72\tl255\tL255\ts72\n"
219 "Environment\tEnvironment\n"
220 "Var1\t=-MSITESTVAR1\t1\tOne\n"
221 "Var2\tMSITESTVAR2\t1\tOne\n"
222 "Var3\t=-MSITESTVAR3\t1\tOne\n"
223 "Var4\tMSITESTVAR4\t1\tOne\n"
224 "Var5\t-MSITESTVAR5\t\tOne\n"
225 "Var6\tMSITESTVAR6\t\tOne\n"
226 "Var7\t!-MSITESTVAR7\t\tOne\n"
227 "Var8\t!-*MSITESTVAR8\t\tOne\n"
228 "Var9\t=-MSITESTVAR9\t\tOne\n"
229 "Var10\t=MSITESTVAR10\t\tOne\n"
230 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
231 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
232 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
233 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
234 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
235 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
236 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
237 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
238 "Var19\t+-MSITESTVAR17\t1\tOne\n"
239 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
240 "Var21\t+-MSITESTVAR18\t1\tOne\n"
241 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
242 "Var23\t+-MSITESTVAR19\t1\tOne\n"
243 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
244 "Var25\t+-MSITESTVAR20\t1\tOne\n"
245 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n";
246
247 /* Expected results, starting from MSITESTVAR11 onwards */
248 static const CHAR *environment_dat_results[] = {"1;2", /*MSITESTVAR11*/
249 "1", /*MSITESTVAR12*/
250 "1;2", /*MSITESTVAR13*/
251 ";1;", /*MSITESTVAR14*/
252 ";;1;;", /*MSITESTVAR15*/
253 " 1 ", /*MSITESTVAR16*/
254 ";;2;;1", /*MSITESTVAR17*/
255 "1;;2;;", /*MSITESTVAR18*/
256 "1", /*MSITESTVAR19*/
257 "1", /*MSITESTVAR20*/
258 NULL};
259
260 static const CHAR condition_dat[] = "Feature_\tLevel\tCondition\n"
261 "s38\ti2\tS255\n"
262 "Condition\tFeature_\tLevel\n"
263 "One\t4\t1\n";
264
265 static const CHAR up_property_dat[] = "Property\tValue\n"
266 "s72\tl0\n"
267 "Property\tProperty\n"
268 "DefaultUIFont\tDlgFont8\n"
269 "HASUIRUN\t0\n"
270 "INSTALLLEVEL\t3\n"
271 "InstallMode\tTypical\n"
272 "Manufacturer\tWine\n"
273 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
274 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
275 "ProductID\tnone\n"
276 "ProductLanguage\t1033\n"
277 "ProductName\tMSITEST\n"
278 "ProductVersion\t1.1.1\n"
279 "PROMPTROLLBACKCOST\tP\n"
280 "Setup\tSetup\n"
281 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
282 "AdminProperties\tPOSTADMIN\n"
283 "ROOTDRIVE\tC:\\\n"
284 "SERVNAME\tTestService\n"
285 "SERVDISP\tTestServiceDisp\n"
286 "RemovePreviousVersions\t1\n";
287
288 static const CHAR up2_property_dat[] = "Property\tValue\n"
289 "s72\tl0\n"
290 "Property\tProperty\n"
291 "DefaultUIFont\tDlgFont8\n"
292 "HASUIRUN\t0\n"
293 "INSTALLLEVEL\t3\n"
294 "InstallMode\tTypical\n"
295 "Manufacturer\tWine\n"
296 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
297 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
298 "ProductID\tnone\n"
299 "ProductLanguage\t1033\n"
300 "ProductName\tMSITEST\n"
301 "ProductVersion\t1.1.2\n"
302 "PROMPTROLLBACKCOST\tP\n"
303 "Setup\tSetup\n"
304 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
305 "AdminProperties\tPOSTADMIN\n"
306 "ROOTDRIVE\tC:\\\n"
307 "SERVNAME\tTestService\n"
308 "SERVDISP\tTestServiceDisp\n";
309
310 static const CHAR up3_property_dat[] = "Property\tValue\n"
311 "s72\tl0\n"
312 "Property\tProperty\n"
313 "DefaultUIFont\tDlgFont8\n"
314 "HASUIRUN\t0\n"
315 "INSTALLLEVEL\t3\n"
316 "InstallMode\tTypical\n"
317 "Manufacturer\tWine\n"
318 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
319 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
320 "ProductID\tnone\n"
321 "ProductLanguage\t1033\n"
322 "ProductName\tMSITEST\n"
323 "ProductVersion\t1.1.2\n"
324 "PROMPTROLLBACKCOST\tP\n"
325 "Setup\tSetup\n"
326 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
327 "AdminProperties\tPOSTADMIN\n"
328 "ROOTDRIVE\tC:\\\n"
329 "SERVNAME\tTestService\n"
330 "SERVDISP\tTestServiceDisp\n"
331 "RemovePreviousVersions\t1\n";
332
333 static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
334 "s72\ti2\tl255\tL255\tL0\ts72\n"
335 "Registry\tRegistry\n"
336 "Apples\t2\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
337 "Oranges\t2\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
338 "regdata\t2\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
339 "OrderTest\t2\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
340
341 static const CHAR service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
342 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
343 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
344 "ServiceInstall\tServiceInstall\n"
345 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
346
347 static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
348 "s72\tl255\ti2\tL255\tI2\ts72\n"
349 "ServiceControl\tServiceControl\n"
350 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
351
352 static const CHAR sss_service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
353 "s72\tl255\ti2\tL255\tI2\ts72\n"
354 "ServiceControl\tServiceControl\n"
355 "ServiceControl\tSpooler\t1\t\t0\tservice_comp";
356
357 static const CHAR sss_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
358 "s72\tS255\tI2\n"
359 "InstallExecuteSequence\tAction\n"
360 "CostFinalize\t\t1000\n"
361 "CostInitialize\t\t800\n"
362 "FileCost\t\t900\n"
363 "ResolveSource\t\t950\n"
364 "MoveFiles\t\t1700\n"
365 "InstallFiles\t\t4000\n"
366 "DuplicateFiles\t\t4500\n"
367 "WriteEnvironmentStrings\t\t4550\n"
368 "CreateShortcuts\t\t4600\n"
369 "StartServices\t\t5000\n"
370 "DeleteServices\t\t5500\n"
371 "InstallFinalize\t\t6600\n"
372 "InstallInitialize\t\t1500\n"
373 "InstallValidate\t\t1400\n"
374 "LaunchConditions\t\t100\n";
375
376 /* tables for test_continuouscabs */
377 static const CHAR cc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
378 "s72\tS38\ts72\ti2\tS255\tS72\n"
379 "Component\tComponent\n"
380 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
381 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
382 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
383
384 static const CHAR cc2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
385 "s72\tS38\ts72\ti2\tS255\tS72\n"
386 "Component\tComponent\n"
387 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
388 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
389 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
390
391 static const CHAR cc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
392 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
393 "Feature\tFeature\n"
394 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
395
396 static const CHAR cc_feature_comp_dat[] = "Feature_\tComponent_\n"
397 "s38\ts72\n"
398 "FeatureComponents\tFeature_\tComponent_\n"
399 "feature\tmaximus\n"
400 "feature\taugustus\n"
401 "feature\tcaesar";
402
403 static const CHAR cc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
404 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
405 "File\tFile\n"
406 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
407 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
408 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
409
410 static const CHAR cc2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
411 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
412 "File\tFile\n"
413 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
414 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
415 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
416 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
417
418 static const CHAR cc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
419 "i2\ti4\tL64\tS255\tS32\tS72\n"
420 "Media\tDiskId\n"
421 "1\t10\t\ttest1.cab\tDISK1\t\n"
422 "2\t2\t\ttest2.cab\tDISK2\t\n"
423 "3\t12\t\ttest3.cab\tDISK3\t\n";
424
425 static const CHAR co_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
426 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
427 "File\tFile\n"
428 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
429 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
430 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
431
432 static const CHAR co_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
433 "i2\ti4\tL64\tS255\tS32\tS72\n"
434 "Media\tDiskId\n"
435 "1\t10\t\ttest1.cab\tDISK1\t\n"
436 "2\t2\t\ttest2.cab\tDISK2\t\n"
437 "3\t3\t\ttest3.cab\tDISK3\t\n";
438
439 static const CHAR co2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
440 "i2\ti4\tL64\tS255\tS32\tS72\n"
441 "Media\tDiskId\n"
442 "1\t10\t\ttest1.cab\tDISK1\t\n"
443 "2\t12\t\ttest3.cab\tDISK3\t\n"
444 "3\t2\t\ttest2.cab\tDISK2\t\n";
445
446 static const CHAR mm_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
447 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
448 "File\tFile\n"
449 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
450 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
451 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
452
453 static const CHAR mm_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
454 "i2\ti4\tL64\tS255\tS32\tS72\n"
455 "Media\tDiskId\n"
456 "1\t3\t\ttest1.cab\tDISK1\t\n";
457
458 static const CHAR ss_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
459 "i2\ti4\tL64\tS255\tS32\tS72\n"
460 "Media\tDiskId\n"
461 "1\t2\t\ttest1.cab\tDISK1\t\n"
462 "2\t2\t\ttest2.cab\tDISK2\t\n"
463 "3\t12\t\ttest3.cab\tDISK3\t\n";
464
465 /* tables for test_uiLevelFlags */
466 static const CHAR ui_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
467 "s72\tS38\ts72\ti2\tS255\tS72\n"
468 "Component\tComponent\n"
469 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
470 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
471 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
472
473 static const CHAR ui_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
474 "s72\tS255\tI2\n"
475 "InstallUISequence\tAction\n"
476 "SetUIProperty\t\t5\n"
477 "ExecuteAction\t\t1100\n";
478
479 static const CHAR ui_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
480 "s72\ti2\tS64\tS0\tS255\n"
481 "CustomAction\tAction\n"
482 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
483
484 static const CHAR rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
485 "s72\tS38\ts72\ti2\tS255\tS72\n"
486 "Component\tComponent\n"
487 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
488
489 static const CHAR rof_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
490 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
491 "Feature\tFeature\n"
492 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
493 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
494
495 static const CHAR rof_feature_comp_dat[] = "Feature_\tComponent_\n"
496 "s38\ts72\n"
497 "FeatureComponents\tFeature_\tComponent_\n"
498 "feature\tmaximus\n"
499 "montecristo\tmaximus";
500
501 static const CHAR rof_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
502 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
503 "File\tFile\n"
504 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
505
506 static const CHAR rof_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
507 "i2\ti4\tL64\tS255\tS32\tS72\n"
508 "Media\tDiskId\n"
509 "1\t1\t\t\tDISK1\t\n";
510
511 static const CHAR rofc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
512 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
513 "File\tFile\n"
514 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
515
516 static const CHAR rofc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
517 "i2\ti4\tL64\tS255\tS32\tS72\n"
518 "Media\tDiskId\n"
519 "1\t1\t\ttest1.cab\tDISK1\t\n";
520
521 static const CHAR lus2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
522 "i2\ti4\tL64\tS255\tS32\tS72\n"
523 "Media\tDiskId\n"
524 "1\t1\t\t#test1.cab\tDISK1\t\n";
525
526 static const CHAR sdp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
527 "s72\tS255\tI2\n"
528 "InstallExecuteSequence\tAction\n"
529 "AllocateRegistrySpace\tNOT Installed\t1550\n"
530 "CostFinalize\t\t1000\n"
531 "CostInitialize\t\t800\n"
532 "FileCost\t\t900\n"
533 "InstallFiles\t\t4000\n"
534 "InstallFinalize\t\t6600\n"
535 "InstallInitialize\t\t1500\n"
536 "InstallValidate\t\t1400\n"
537 "LaunchConditions\t\t100\n"
538 "SetDirProperty\t\t950";
539
540 static const CHAR sdp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
541 "s72\ti2\tS64\tS0\tS255\n"
542 "CustomAction\tAction\n"
543 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
544
545 static const CHAR cie_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
546 "s72\tS38\ts72\ti2\tS255\tS72\n"
547 "Component\tComponent\n"
548 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
549 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
550 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
551 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
552
553 static const CHAR cie_feature_comp_dat[] = "Feature_\tComponent_\n"
554 "s38\ts72\n"
555 "FeatureComponents\tFeature_\tComponent_\n"
556 "feature\tmaximus\n"
557 "feature\taugustus\n"
558 "feature\tcaesar\n"
559 "feature\tgaius";
560
561 static const CHAR cie_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
562 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
563 "File\tFile\n"
564 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
565 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
566 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
567 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
568
569 static const CHAR cie_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
570 "i2\ti4\tL64\tS255\tS32\tS72\n"
571 "Media\tDiskId\n"
572 "1\t1\t\ttest1.cab\tDISK1\t\n"
573 "2\t2\t\ttest2.cab\tDISK2\t\n"
574 "3\t12\t\ttest3.cab\tDISK3\t\n";
575
576 static const CHAR ci_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
577 "s72\tS255\tI2\n"
578 "InstallExecuteSequence\tAction\n"
579 "CostFinalize\t\t1000\n"
580 "CostInitialize\t\t800\n"
581 "FileCost\t\t900\n"
582 "InstallFiles\t\t4000\n"
583 "InstallServices\t\t5000\n"
584 "InstallFinalize\t\t6600\n"
585 "InstallInitialize\t\t1500\n"
586 "RunInstall\t\t1600\n"
587 "InstallValidate\t\t1400\n"
588 "LaunchConditions\t\t100";
589
590 static const CHAR ci_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
591 "s72\ti2\tS64\tS0\tS255\n"
592 "CustomAction\tAction\n"
593 "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n";
594
595 static const CHAR ci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
596 "s72\tS38\ts72\ti2\tS255\tS72\n"
597 "Component\tComponent\n"
598 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
599
600 static const CHAR ci2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
601 "s72\tS38\ts72\ti2\tS255\tS72\n"
602 "Component\tComponent\n"
603 "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n";
604
605 static const CHAR ci2_feature_comp_dat[] = "Feature_\tComponent_\n"
606 "s38\ts72\n"
607 "FeatureComponents\tFeature_\tComponent_\n"
608 "feature\taugustus";
609
610 static const CHAR ci2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
611 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
612 "File\tFile\n"
613 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
614
615 static const CHAR spf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
616 "s72\ti2\tS64\tS0\tS255\n"
617 "CustomAction\tAction\n"
618 "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n";
619
620 static const CHAR spf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
621 "s72\tS255\tI2\n"
622 "InstallExecuteSequence\tAction\n"
623 "CostFinalize\t\t1000\n"
624 "CostInitialize\t\t800\n"
625 "FileCost\t\t900\n"
626 "SetFolderProp\t\t950\n"
627 "InstallFiles\t\t4000\n"
628 "InstallServices\t\t5000\n"
629 "InstallFinalize\t\t6600\n"
630 "InstallInitialize\t\t1500\n"
631 "InstallValidate\t\t1400\n"
632 "LaunchConditions\t\t100";
633
634 static const CHAR spf_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
635 "s72\tS255\tI2\n"
636 "InstallUISequence\tAction\n"
637 "CostInitialize\t\t800\n"
638 "FileCost\t\t900\n"
639 "CostFinalize\t\t1000\n"
640 "ExecuteAction\t\t1100\n";
641
642 static const CHAR pp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
643 "s72\tS255\tI2\n"
644 "InstallExecuteSequence\tAction\n"
645 "ValidateProductID\t\t700\n"
646 "CostInitialize\t\t800\n"
647 "FileCost\t\t900\n"
648 "CostFinalize\t\t1000\n"
649 "InstallValidate\t\t1400\n"
650 "InstallInitialize\t\t1500\n"
651 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
652 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
653 "RemoveFiles\t\t3500\n"
654 "InstallFiles\t\t4000\n"
655 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
656 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
657 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
658 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
659 "InstallFinalize\t\t6600";
660
661 static const CHAR ppc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
662 "s72\tS38\ts72\ti2\tS255\tS72\n"
663 "Component\tComponent\n"
664 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n"
665 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
666
667 static const CHAR ppc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
668 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
669 "File\tFile\n"
670 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
671 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
672
673 static const CHAR ppc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
674 "i2\ti4\tL64\tS255\tS32\tS72\n"
675 "Media\tDiskId\n"
676 "1\t2\t\t\tDISK1\t\n";
677
678 static const CHAR ppc_feature_comp_dat[] = "Feature_\tComponent_\n"
679 "s38\ts72\n"
680 "FeatureComponents\tFeature_\tComponent_\n"
681 "feature\tmaximus\n"
682 "feature\taugustus\n"
683 "montecristo\tmaximus";
684
685 static const CHAR tp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
686 "s72\tS38\ts72\ti2\tS255\tS72\n"
687 "Component\tComponent\n"
688 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
689
690 static const CHAR cwd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
691 "s72\tS38\ts72\ti2\tS255\tS72\n"
692 "Component\tComponent\n"
693 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
694
695 static const CHAR adm_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
696 "s72\tS38\ts72\ti2\tS255\tS72\n"
697 "Component\tComponent\n"
698 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
699
700 static const CHAR adm_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
701 "s72\ti2\tS64\tS0\tS255\n"
702 "CustomAction\tAction\n"
703 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
704
705 static const CHAR adm_admin_exec_seq_dat[] = "Action\tCondition\tSequence\n"
706 "s72\tS255\tI2\n"
707 "AdminExecuteSequence\tAction\n"
708 "CostFinalize\t\t1000\n"
709 "CostInitialize\t\t800\n"
710 "FileCost\t\t900\n"
711 "SetPOSTADMIN\t\t950\n"
712 "InstallFiles\t\t4000\n"
713 "InstallFinalize\t\t6600\n"
714 "InstallInitialize\t\t1500\n"
715 "InstallValidate\t\t1400\n"
716 "LaunchConditions\t\t100";
717
718 static const CHAR amp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
719 "s72\tS38\ts72\ti2\tS255\tS72\n"
720 "Component\tComponent\n"
721 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
722
723 static const CHAR rem_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
724 "s72\tS38\ts72\ti2\tS255\tS72\n"
725 "Component\tComponent\n"
726 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
727 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
728 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
729
730 static const CHAR rem_feature_comp_dat[] = "Feature_\tComponent_\n"
731 "s38\ts72\n"
732 "FeatureComponents\tFeature_\tComponent_\n"
733 "feature\thydrogen\n"
734 "feature\thelium\n"
735 "feature\tlithium";
736
737 static const CHAR rem_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
738 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
739 "File\tFile\n"
740 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
741 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
742 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
743
744 static const CHAR rem_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
745 "s72\tS255\tI2\n"
746 "InstallExecuteSequence\tAction\n"
747 "ValidateProductID\t\t700\n"
748 "CostInitialize\t\t800\n"
749 "FileCost\t\t900\n"
750 "CostFinalize\t\t1000\n"
751 "InstallValidate\t\t1400\n"
752 "InstallInitialize\t\t1500\n"
753 "ProcessComponents\t\t1600\n"
754 "UnpublishFeatures\t\t1800\n"
755 "RemoveFiles\t\t3500\n"
756 "InstallFiles\t\t4000\n"
757 "RegisterProduct\t\t6100\n"
758 "PublishFeatures\t\t6300\n"
759 "PublishProduct\t\t6400\n"
760 "InstallFinalize\t\t6600";
761
762 static const CHAR rem_remove_files_dat[] = "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
763 "s72\ts72\tS255\ts72\tI2\n"
764 "RemoveFile\tFileKey\n"
765 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
766 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
767 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
768 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
769 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
770 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
771 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
772 "block\thelium\tblock\tMSITESTDIR\t3\n"
773 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
774 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
775
776 static const CHAR mov_move_file_dat[] = "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
777 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
778 "MoveFile\tFileKey\n"
779 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
780 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
781 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
782 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
783 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
784 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
785 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
786 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
787 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
788 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
789 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
790 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
791 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
792 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
793 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
794 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
795 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
796 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
797
798 static const CHAR mc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
799 "s72\tS38\ts72\ti2\tS255\tS72\n"
800 "Component\tComponent\n"
801 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
802 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
803 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
804 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n";
805
806 static const CHAR mc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
807 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
808 "File\tFile\n"
809 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
810 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
811 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
812 "gaius\tgaius\tgaius\t500\t\t\t16384\t4";
813
814 static const CHAR mc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
815 "i2\ti4\tL64\tS255\tS32\tS72\n"
816 "Media\tDiskId\n"
817 "1\t1\t\ttest1.cab\tDISK1\t\n"
818 "2\t2\t\ttest2.cab\tDISK2\t\n"
819 "3\t3\t\ttest3.cab\tDISK3\t\n"
820 "4\t4\t\ttest3.cab\tDISK3\t\n";
821
822 static const CHAR mc_file_hash_dat[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
823 "s72\ti2\ti4\ti4\ti4\ti4\n"
824 "MsiFileHash\tFile_\n"
825 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
826
827 static const CHAR df_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
828 "s72\tS72\tl255\n"
829 "Directory\tDirectory\n"
830 "THIS\tMSITESTDIR\tthis\n"
831 "DOESNOT\tTHIS\tdoesnot\n"
832 "NONEXISTENT\tDOESNOT\texist\n"
833 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
834 "ProgramFilesFolder\tTARGETDIR\t.\n"
835 "TARGETDIR\t\tSourceDir";
836
837 static const CHAR df_duplicate_file_dat[] = "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
838 "s72\ts72\ts72\tS255\tS72\n"
839 "DuplicateFile\tFileKey\n"
840 "maximus\tmaximus\tmaximus\taugustus\t\n"
841 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
842 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
843
844 static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
845 "s72\tS38\ts72\ti2\tS255\tS72\n"
846 "Component\tComponent\n"
847 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
848
849 static const CHAR wrv_registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
850 "s72\ti2\tl255\tL255\tL0\ts72\n"
851 "Registry\tRegistry\n"
852 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus";
853
854 static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
855 "s72\tS38\ts72\ti2\tS255\tS72\n"
856 "Component\tComponent\n"
857 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
858
859 static const CHAR ca51_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
860 "s72\tS255\tI2\n"
861 "InstallExecuteSequence\tAction\n"
862 "ValidateProductID\t\t700\n"
863 "GoodSetProperty\t\t725\n"
864 "BadSetProperty\t\t750\n"
865 "CostInitialize\t\t800\n"
866 "ResolveSource\t\t810\n"
867 "FileCost\t\t900\n"
868 "SetSourceDir\tSRCDIR\t910\n"
869 "CostFinalize\t\t1000\n"
870 "InstallValidate\t\t1400\n"
871 "InstallInitialize\t\t1500\n"
872 "InstallFiles\t\t4000\n"
873 "InstallFinalize\t\t6600";
874
875 static const CHAR ca51_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
876 "s72\ti2\tS64\tS0\n"
877 "CustomAction\tAction\n"
878 "GoodSetProperty\t51\tMYPROP\t42\n"
879 "BadSetProperty\t51\t\tMYPROP\n"
880 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
881
882 static const CHAR is_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
883 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
884 "Feature\tFeature\n"
885 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
886 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
887 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
888 "four\t\t\t\t2\t0\t\t0"; /* disabled */
889
890 static const CHAR is_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
891 "s72\tS38\ts72\ti2\tS255\tS72\n"
892 "Component\tComponent\n"
893 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
894 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
895 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
896 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
897 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
898 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
899 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
900 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
901 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
902 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
903 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
904 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
905
906 static const CHAR is_feature_comp_dat[] = "Feature_\tComponent_\n"
907 "s38\ts72\n"
908 "FeatureComponents\tFeature_\tComponent_\n"
909 "one\talpha\n"
910 "one\tbeta\n"
911 "one\tgamma\n"
912 "two\ttheta\n"
913 "two\tdelta\n"
914 "two\tepsilon\n"
915 "three\tzeta\n"
916 "three\tiota\n"
917 "three\teta\n"
918 "four\tkappa\n"
919 "four\tlambda\n"
920 "four\tmu";
921
922 static const CHAR is_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
923 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
924 "File\tFile\n"
925 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
926 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
927 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
928 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
929 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
930 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
931 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
932 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
933 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
934 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
935 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
936 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
937
938 static const CHAR is_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
939 "i2\ti4\tL64\tS255\tS32\tS72\n"
940 "Media\tDiskId\n"
941 "1\t12\t\t\tDISK1\t\n";
942
943 static const CHAR sp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
944 "s72\tS38\ts72\ti2\tS255\tS72\n"
945 "Component\tComponent\n"
946 "augustus\t\tTWODIR\t0\t\taugustus\n";
947
948 static const CHAR sp_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
949 "s72\tS72\tl255\n"
950 "Directory\tDirectory\n"
951 "TARGETDIR\t\tSourceDir\n"
952 "ProgramFilesFolder\tTARGETDIR\t.\n"
953 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
954 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
955 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
956
957 static const CHAR mcp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
958 "s72\tS38\ts72\ti2\tS255\tS72\n"
959 "Component\tComponent\n"
960 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
961 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
962 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
963
964 static const CHAR mcp_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
965 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
966 "Feature\tFeature\n"
967 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
968 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
969 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
970
971 static const CHAR mcp_feature_comp_dat[] = "Feature_\tComponent_\n"
972 "s38\ts72\n"
973 "FeatureComponents\tFeature_\tComponent_\n"
974 "hydroxyl\thydrogen\n"
975 "heliox\thelium\n"
976 "lithia\tlithium";
977
978 static const CHAR mcomp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
979 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
980 "File\tFile\n"
981 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
982 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
983 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
984 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
985
986 static const CHAR ai_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
987 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
988 "File\tFile\n"
989 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
990 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
991 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
992 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
993 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
994 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
995 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
996
997 static const CHAR ip_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
998 "s72\tS255\tI2\n"
999 "InstallExecuteSequence\tAction\n"
1000 "CostFinalize\t\t1000\n"
1001 "ValidateProductID\t\t700\n"
1002 "CostInitialize\t\t800\n"
1003 "FileCost\t\t900\n"
1004 "RemoveFiles\t\t3500\n"
1005 "InstallFiles\t\t4000\n"
1006 "RegisterUser\t\t6000\n"
1007 "RegisterProduct\t\t6100\n"
1008 "PublishFeatures\t\t6300\n"
1009 "PublishProduct\t\t6400\n"
1010 "InstallFinalize\t\t6600\n"
1011 "InstallInitialize\t\t1500\n"
1012 "ProcessComponents\t\t1600\n"
1013 "UnpublishFeatures\t\t1800\n"
1014 "InstallValidate\t\t1400\n"
1015 "LaunchConditions\t\t100\n"
1016 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
1017
1018 static const CHAR ip_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1019 "s72\ti2\tS64\tS0\tS255\n"
1020 "CustomAction\tAction\n"
1021 "TestInstalledProp\t19\t\tTest failed\t\n";
1022
1023 static const CHAR aup_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1024 "s72\tS255\tI2\n"
1025 "InstallExecuteSequence\tAction\n"
1026 "CostFinalize\t\t1000\n"
1027 "ValidateProductID\t\t700\n"
1028 "CostInitialize\t\t800\n"
1029 "FileCost\t\t900\n"
1030 "RemoveFiles\t\t3500\n"
1031 "InstallFiles\t\t4000\n"
1032 "RegisterUser\t\t6000\n"
1033 "RegisterProduct\t\t6100\n"
1034 "PublishFeatures\t\t6300\n"
1035 "PublishProduct\t\t6400\n"
1036 "InstallFinalize\t\t6600\n"
1037 "InstallInitialize\t\t1500\n"
1038 "ProcessComponents\t\t1600\n"
1039 "UnpublishFeatures\t\t1800\n"
1040 "InstallValidate\t\t1400\n"
1041 "LaunchConditions\t\t100\n"
1042 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
1043
1044 static const CHAR aup2_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1045 "s72\tS255\tI2\n"
1046 "InstallExecuteSequence\tAction\n"
1047 "CostFinalize\t\t1000\n"
1048 "ValidateProductID\t\t700\n"
1049 "CostInitialize\t\t800\n"
1050 "FileCost\t\t900\n"
1051 "RemoveFiles\t\t3500\n"
1052 "InstallFiles\t\t4000\n"
1053 "RegisterUser\t\t6000\n"
1054 "RegisterProduct\t\t6100\n"
1055 "PublishFeatures\t\t6300\n"
1056 "PublishProduct\t\t6400\n"
1057 "InstallFinalize\t\t6600\n"
1058 "InstallInitialize\t\t1500\n"
1059 "ProcessComponents\t\t1600\n"
1060 "UnpublishFeatures\t\t1800\n"
1061 "InstallValidate\t\t1400\n"
1062 "LaunchConditions\t\t100\n"
1063 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
1064
1065 static const CHAR aup3_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1066 "s72\tS255\tI2\n"
1067 "InstallExecuteSequence\tAction\n"
1068 "CostFinalize\t\t1000\n"
1069 "ValidateProductID\t\t700\n"
1070 "CostInitialize\t\t800\n"
1071 "FileCost\t\t900\n"
1072 "RemoveFiles\t\t3500\n"
1073 "InstallFiles\t\t4000\n"
1074 "RegisterUser\t\t6000\n"
1075 "RegisterProduct\t\t6100\n"
1076 "PublishFeatures\t\t6300\n"
1077 "PublishProduct\t\t6400\n"
1078 "InstallFinalize\t\t6600\n"
1079 "InstallInitialize\t\t1500\n"
1080 "ProcessComponents\t\t1600\n"
1081 "UnpublishFeatures\t\t1800\n"
1082 "InstallValidate\t\t1400\n"
1083 "LaunchConditions\t\t100\n"
1084 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
1085
1086 static const CHAR aup_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1087 "s72\ti2\tS64\tS0\tS255\n"
1088 "CustomAction\tAction\n"
1089 "TestAllUsersProp\t19\t\tTest failed\t\n";
1090
1091 static const CHAR cf_create_folders_dat[] = "Directory_\tComponent_\n"
1092 "s72\ts72\n"
1093 "CreateFolder\tDirectory_\tComponent_\n"
1094 "MSITESTDIR\tOne\n";
1095
1096 static const CHAR cf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1097 "s72\tS255\tI2\n"
1098 "InstallExecuteSequence\tAction\n"
1099 "CostFinalize\t\t1000\n"
1100 "ValidateProductID\t\t700\n"
1101 "CostInitialize\t\t800\n"
1102 "FileCost\t\t900\n"
1103 "RemoveFiles\t\t3500\n"
1104 "CreateFolders\t\t3700\n"
1105 "InstallExecute\t\t3800\n"
1106 "TestCreateFolders\t\t3900\n"
1107 "InstallFiles\t\t4000\n"
1108 "RegisterUser\t\t6000\n"
1109 "RegisterProduct\t\t6100\n"
1110 "PublishFeatures\t\t6300\n"
1111 "PublishProduct\t\t6400\n"
1112 "InstallFinalize\t\t6600\n"
1113 "InstallInitialize\t\t1500\n"
1114 "ProcessComponents\t\t1600\n"
1115 "UnpublishFeatures\t\t1800\n"
1116 "InstallValidate\t\t1400\n"
1117 "LaunchConditions\t\t100\n";
1118
1119 static const CHAR cf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1120 "s72\ti2\tS64\tS0\tS255\n"
1121 "CustomAction\tAction\n"
1122 "TestCreateFolders\t19\t\tHalts installation\t\n";
1123
1124 static const CHAR rf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1125 "s72\tS255\tI2\n"
1126 "InstallExecuteSequence\tAction\n"
1127 "CostFinalize\t\t1000\n"
1128 "ValidateProductID\t\t700\n"
1129 "CostInitialize\t\t800\n"
1130 "FileCost\t\t900\n"
1131 "RemoveFiles\t\t3500\n"
1132 "CreateFolders\t\t3600\n"
1133 "RemoveFolders\t\t3700\n"
1134 "InstallExecute\t\t3800\n"
1135 "TestCreateFolders\t\t3900\n"
1136 "InstallFiles\t\t4000\n"
1137 "RegisterUser\t\t6000\n"
1138 "RegisterProduct\t\t6100\n"
1139 "PublishFeatures\t\t6300\n"
1140 "PublishProduct\t\t6400\n"
1141 "InstallFinalize\t\t6600\n"
1142 "InstallInitialize\t\t1500\n"
1143 "ProcessComponents\t\t1600\n"
1144 "UnpublishFeatures\t\t1800\n"
1145 "InstallValidate\t\t1400\n"
1146 "LaunchConditions\t\t100\n";
1147
1148
1149 static const CHAR sr_selfreg_dat[] = "File_\tCost\n"
1150 "s72\tI2\n"
1151 "SelfReg\tFile_\n"
1152 "one.txt\t1\n";
1153
1154 static const CHAR sr_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1155 "s72\tS255\tI2\n"
1156 "InstallExecuteSequence\tAction\n"
1157 "CostFinalize\t\t1000\n"
1158 "CostInitialize\t\t800\n"
1159 "FileCost\t\t900\n"
1160 "ResolveSource\t\t950\n"
1161 "MoveFiles\t\t1700\n"
1162 "SelfUnregModules\t\t3900\n"
1163 "InstallFiles\t\t4000\n"
1164 "DuplicateFiles\t\t4500\n"
1165 "WriteEnvironmentStrings\t\t4550\n"
1166 "CreateShortcuts\t\t4600\n"
1167 "InstallFinalize\t\t6600\n"
1168 "InstallInitialize\t\t1500\n"
1169 "InstallValidate\t\t1400\n"
1170 "LaunchConditions\t\t100\n";
1171
1172 typedef struct _msi_table
1173 {
1174 const CHAR *filename;
1175 const CHAR *data;
1176 int size;
1177 } msi_table;
1178
1179 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1180
1181 static const msi_table tables[] =
1182 {
1183 ADD_TABLE(component),
1184 ADD_TABLE(directory),
1185 ADD_TABLE(feature),
1186 ADD_TABLE(feature_comp),
1187 ADD_TABLE(file),
1188 ADD_TABLE(install_exec_seq),
1189 ADD_TABLE(media),
1190 ADD_TABLE(property),
1191 ADD_TABLE(registry),
1192 ADD_TABLE(service_install),
1193 ADD_TABLE(service_control)
1194 };
1195
1196 static const msi_table sc_tables[] =
1197 {
1198 ADD_TABLE(component),
1199 ADD_TABLE(directory),
1200 ADD_TABLE(feature),
1201 ADD_TABLE(feature_comp),
1202 ADD_TABLE(file),
1203 ADD_TABLE(install_exec_seq),
1204 ADD_TABLE(media),
1205 ADD_TABLE(property),
1206 ADD_TABLE(shortcut)
1207 };
1208
1209 static const msi_table ps_tables[] =
1210 {
1211 ADD_TABLE(component),
1212 ADD_TABLE(directory),
1213 ADD_TABLE(feature),
1214 ADD_TABLE(feature_comp),
1215 ADD_TABLE(file),
1216 ADD_TABLE(install_exec_seq),
1217 ADD_TABLE(media),
1218 ADD_TABLE(property),
1219 ADD_TABLE(condition)
1220 };
1221
1222 static const msi_table env_tables[] =
1223 {
1224 ADD_TABLE(component),
1225 ADD_TABLE(directory),
1226 ADD_TABLE(feature),
1227 ADD_TABLE(feature_comp),
1228 ADD_TABLE(file),
1229 ADD_TABLE(install_exec_seq),
1230 ADD_TABLE(media),
1231 ADD_TABLE(property),
1232 ADD_TABLE(environment)
1233 };
1234
1235 static const msi_table up_tables[] =
1236 {
1237 ADD_TABLE(component),
1238 ADD_TABLE(directory),
1239 ADD_TABLE(feature),
1240 ADD_TABLE(feature_comp),
1241 ADD_TABLE(file),
1242 ADD_TABLE(install_exec_seq),
1243 ADD_TABLE(media),
1244 ADD_TABLE(up_property),
1245 ADD_TABLE(registry),
1246 ADD_TABLE(service_install),
1247 ADD_TABLE(service_control)
1248 };
1249
1250 static const msi_table up2_tables[] =
1251 {
1252 ADD_TABLE(component),
1253 ADD_TABLE(directory),
1254 ADD_TABLE(feature),
1255 ADD_TABLE(feature_comp),
1256 ADD_TABLE(file),
1257 ADD_TABLE(install_exec_seq),
1258 ADD_TABLE(media),
1259 ADD_TABLE(up2_property),
1260 ADD_TABLE(registry),
1261 ADD_TABLE(service_install),
1262 ADD_TABLE(service_control)
1263 };
1264
1265 static const msi_table up3_tables[] =
1266 {
1267 ADD_TABLE(component),
1268 ADD_TABLE(directory),
1269 ADD_TABLE(feature),
1270 ADD_TABLE(feature_comp),
1271 ADD_TABLE(file),
1272 ADD_TABLE(install_exec_seq),
1273 ADD_TABLE(media),
1274 ADD_TABLE(up3_property),
1275 ADD_TABLE(registry),
1276 ADD_TABLE(service_install),
1277 ADD_TABLE(service_control)
1278 };
1279
1280 static const msi_table up4_tables[] =
1281 {
1282 ADD_TABLE(component),
1283 ADD_TABLE(directory),
1284 ADD_TABLE(feature),
1285 ADD_TABLE(feature_comp),
1286 ADD_TABLE(file),
1287 ADD_TABLE(pp_install_exec_seq),
1288 ADD_TABLE(media),
1289 ADD_TABLE(property),
1290 ADD_TABLE(registry),
1291 ADD_TABLE(service_install),
1292 ADD_TABLE(service_control)
1293 };
1294
1295 static const msi_table up5_tables[] =
1296 {
1297 ADD_TABLE(component),
1298 ADD_TABLE(directory),
1299 ADD_TABLE(feature),
1300 ADD_TABLE(feature_comp),
1301 ADD_TABLE(file),
1302 ADD_TABLE(pp_install_exec_seq),
1303 ADD_TABLE(media),
1304 ADD_TABLE(up_property),
1305 ADD_TABLE(registry),
1306 ADD_TABLE(service_install),
1307 ADD_TABLE(service_control)
1308 };
1309
1310 static const msi_table up6_tables[] =
1311 {
1312 ADD_TABLE(component),
1313 ADD_TABLE(directory),
1314 ADD_TABLE(feature),
1315 ADD_TABLE(feature_comp),
1316 ADD_TABLE(file),
1317 ADD_TABLE(pp_install_exec_seq),
1318 ADD_TABLE(media),
1319 ADD_TABLE(up2_property),
1320 ADD_TABLE(registry),
1321 ADD_TABLE(service_install),
1322 ADD_TABLE(service_control)
1323 };
1324
1325 static const msi_table up7_tables[] =
1326 {
1327 ADD_TABLE(component),
1328 ADD_TABLE(directory),
1329 ADD_TABLE(feature),
1330 ADD_TABLE(feature_comp),
1331 ADD_TABLE(file),
1332 ADD_TABLE(pp_install_exec_seq),
1333 ADD_TABLE(media),
1334 ADD_TABLE(up3_property),
1335 ADD_TABLE(registry),
1336 ADD_TABLE(service_install),
1337 ADD_TABLE(service_control)
1338 };
1339
1340 static const msi_table cc_tables[] =
1341 {
1342 ADD_TABLE(cc_component),
1343 ADD_TABLE(directory),
1344 ADD_TABLE(cc_feature),
1345 ADD_TABLE(cc_feature_comp),
1346 ADD_TABLE(cc_file),
1347 ADD_TABLE(install_exec_seq),
1348 ADD_TABLE(cc_media),
1349 ADD_TABLE(property),
1350 };
1351
1352 static const msi_table cc2_tables[] =
1353 {
1354 ADD_TABLE(cc2_component),
1355 ADD_TABLE(directory),
1356 ADD_TABLE(cc_feature),
1357 ADD_TABLE(cc_feature_comp),
1358 ADD_TABLE(cc2_file),
1359 ADD_TABLE(install_exec_seq),
1360 ADD_TABLE(cc_media),
1361 ADD_TABLE(property),
1362 };
1363
1364 static const msi_table co_tables[] =
1365 {
1366 ADD_TABLE(cc_component),
1367 ADD_TABLE(directory),
1368 ADD_TABLE(cc_feature),
1369 ADD_TABLE(cc_feature_comp),
1370 ADD_TABLE(co_file),
1371 ADD_TABLE(install_exec_seq),
1372 ADD_TABLE(co_media),
1373 ADD_TABLE(property),
1374 };
1375
1376 static const msi_table co2_tables[] =
1377 {
1378 ADD_TABLE(cc_component),
1379 ADD_TABLE(directory),
1380 ADD_TABLE(cc_feature),
1381 ADD_TABLE(cc_feature_comp),
1382 ADD_TABLE(cc_file),
1383 ADD_TABLE(install_exec_seq),
1384 ADD_TABLE(co2_media),
1385 ADD_TABLE(property),
1386 };
1387
1388 static const msi_table mm_tables[] =
1389 {
1390 ADD_TABLE(cc_component),
1391 ADD_TABLE(directory),
1392 ADD_TABLE(cc_feature),
1393 ADD_TABLE(cc_feature_comp),
1394 ADD_TABLE(mm_file),
1395 ADD_TABLE(install_exec_seq),
1396 ADD_TABLE(mm_media),
1397 ADD_TABLE(property),
1398 };
1399
1400 static const msi_table ss_tables[] =
1401 {
1402 ADD_TABLE(cc_component),
1403 ADD_TABLE(directory),
1404 ADD_TABLE(cc_feature),
1405 ADD_TABLE(cc_feature_comp),
1406 ADD_TABLE(cc_file),
1407 ADD_TABLE(install_exec_seq),
1408 ADD_TABLE(ss_media),
1409 ADD_TABLE(property),
1410 };
1411
1412 static const msi_table ui_tables[] =
1413 {
1414 ADD_TABLE(ui_component),
1415 ADD_TABLE(directory),
1416 ADD_TABLE(cc_feature),
1417 ADD_TABLE(cc_feature_comp),
1418 ADD_TABLE(cc_file),
1419 ADD_TABLE(install_exec_seq),
1420 ADD_TABLE(ui_install_ui_seq),
1421 ADD_TABLE(ui_custom_action),
1422 ADD_TABLE(cc_media),
1423 ADD_TABLE(property),
1424 };
1425
1426 static const msi_table rof_tables[] =
1427 {
1428 ADD_TABLE(rof_component),
1429 ADD_TABLE(directory),
1430 ADD_TABLE(rof_feature),
1431 ADD_TABLE(rof_feature_comp),
1432 ADD_TABLE(rof_file),
1433 ADD_TABLE(install_exec_seq),
1434 ADD_TABLE(rof_media),
1435 ADD_TABLE(property),
1436 };
1437
1438 static const msi_table rofc_tables[] =
1439 {
1440 ADD_TABLE(rof_component),
1441 ADD_TABLE(directory),
1442 ADD_TABLE(rof_feature),
1443 ADD_TABLE(rof_feature_comp),
1444 ADD_TABLE(rofc_file),
1445 ADD_TABLE(install_exec_seq),
1446 ADD_TABLE(rofc_media),
1447 ADD_TABLE(property),
1448 };
1449
1450 static const msi_table sdp_tables[] =
1451 {
1452 ADD_TABLE(rof_component),
1453 ADD_TABLE(directory),
1454 ADD_TABLE(rof_feature),
1455 ADD_TABLE(rof_feature_comp),
1456 ADD_TABLE(rof_file),
1457 ADD_TABLE(sdp_install_exec_seq),
1458 ADD_TABLE(sdp_custom_action),
1459 ADD_TABLE(rof_media),
1460 ADD_TABLE(property),
1461 };
1462
1463 static const msi_table cie_tables[] =
1464 {
1465 ADD_TABLE(cie_component),
1466 ADD_TABLE(directory),
1467 ADD_TABLE(cc_feature),
1468 ADD_TABLE(cie_feature_comp),
1469 ADD_TABLE(cie_file),
1470 ADD_TABLE(install_exec_seq),
1471 ADD_TABLE(cie_media),
1472 ADD_TABLE(property),
1473 };
1474
1475 static const msi_table ci_tables[] =
1476 {
1477 ADD_TABLE(ci_component),
1478 ADD_TABLE(directory),
1479 ADD_TABLE(rof_feature),
1480 ADD_TABLE(rof_feature_comp),
1481 ADD_TABLE(rof_file),
1482 ADD_TABLE(ci_install_exec_seq),
1483 ADD_TABLE(rof_media),
1484 ADD_TABLE(property),
1485 ADD_TABLE(ci_custom_action),
1486 };
1487
1488 static const msi_table ci2_tables[] =
1489 {
1490 ADD_TABLE(ci2_component),
1491 ADD_TABLE(directory),
1492 ADD_TABLE(rof_feature),
1493 ADD_TABLE(ci2_feature_comp),
1494 ADD_TABLE(ci2_file),
1495 ADD_TABLE(install_exec_seq),
1496 ADD_TABLE(rof_media),
1497 ADD_TABLE(property),
1498 };
1499
1500 static const msi_table spf_tables[] =
1501 {
1502 ADD_TABLE(ci_component),
1503 ADD_TABLE(directory),
1504 ADD_TABLE(rof_feature),
1505 ADD_TABLE(rof_feature_comp),
1506 ADD_TABLE(rof_file),
1507 ADD_TABLE(spf_install_exec_seq),
1508 ADD_TABLE(rof_media),
1509 ADD_TABLE(property),
1510 ADD_TABLE(spf_custom_action),
1511 ADD_TABLE(spf_install_ui_seq),
1512 };
1513
1514 static const msi_table pp_tables[] =
1515 {
1516 ADD_TABLE(ci_component),
1517 ADD_TABLE(directory),
1518 ADD_TABLE(rof_feature),
1519 ADD_TABLE(rof_feature_comp),
1520 ADD_TABLE(rof_file),
1521 ADD_TABLE(pp_install_exec_seq),
1522 ADD_TABLE(rof_media),
1523 ADD_TABLE(property),
1524 };
1525
1526 static const msi_table ppc_tables[] =
1527 {
1528 ADD_TABLE(ppc_component),
1529 ADD_TABLE(directory),
1530 ADD_TABLE(rof_feature),
1531 ADD_TABLE(ppc_feature_comp),
1532 ADD_TABLE(ppc_file),
1533 ADD_TABLE(pp_install_exec_seq),
1534 ADD_TABLE(ppc_media),
1535 ADD_TABLE(property),
1536 };
1537
1538 static const msi_table lus0_tables[] =
1539 {
1540 ADD_TABLE(ci_component),
1541 ADD_TABLE(directory),
1542 ADD_TABLE(rof_feature),
1543 ADD_TABLE(rof_feature_comp),
1544 ADD_TABLE(rof_file),
1545 ADD_TABLE(pp_install_exec_seq),
1546 ADD_TABLE(rof_media),
1547 ADD_TABLE(property),
1548 };
1549
1550 static const msi_table lus1_tables[] =
1551 {
1552 ADD_TABLE(ci_component),
1553 ADD_TABLE(directory),
1554 ADD_TABLE(rof_feature),
1555 ADD_TABLE(rof_feature_comp),
1556 ADD_TABLE(rof_file),
1557 ADD_TABLE(pp_install_exec_seq),
1558 ADD_TABLE(rofc_media),
1559 ADD_TABLE(property),
1560 };
1561
1562 static const msi_table lus2_tables[] =
1563 {
1564 ADD_TABLE(ci_component),
1565 ADD_TABLE(directory),
1566 ADD_TABLE(rof_feature),
1567 ADD_TABLE(rof_feature_comp),
1568 ADD_TABLE(rof_file),
1569 ADD_TABLE(pp_install_exec_seq),
1570 ADD_TABLE(lus2_media),
1571 ADD_TABLE(property),
1572 };
1573
1574 static const msi_table tp_tables[] =
1575 {
1576 ADD_TABLE(tp_component),
1577 ADD_TABLE(directory),
1578 ADD_TABLE(rof_feature),
1579 ADD_TABLE(ci2_feature_comp),
1580 ADD_TABLE(ci2_file),
1581 ADD_TABLE(install_exec_seq),
1582 ADD_TABLE(rof_media),
1583 ADD_TABLE(property),
1584 };
1585
1586 static const msi_table cwd_tables[] =
1587 {
1588 ADD_TABLE(cwd_component),
1589 ADD_TABLE(directory),
1590 ADD_TABLE(rof_feature),
1591 ADD_TABLE(ci2_feature_comp),
1592 ADD_TABLE(ci2_file),
1593 ADD_TABLE(install_exec_seq),
1594 ADD_TABLE(rof_media),
1595 ADD_TABLE(property),
1596 };
1597
1598 static const msi_table adm_tables[] =
1599 {
1600 ADD_TABLE(adm_component),
1601 ADD_TABLE(directory),
1602 ADD_TABLE(rof_feature),
1603 ADD_TABLE(ci2_feature_comp),
1604 ADD_TABLE(ci2_file),
1605 ADD_TABLE(install_exec_seq),
1606 ADD_TABLE(rof_media),
1607 ADD_TABLE(property),
1608 ADD_TABLE(adm_custom_action),
1609 ADD_TABLE(adm_admin_exec_seq),
1610 };
1611
1612 static const msi_table amp_tables[] =
1613 {
1614 ADD_TABLE(amp_component),
1615 ADD_TABLE(directory),
1616 ADD_TABLE(rof_feature),
1617 ADD_TABLE(ci2_feature_comp),
1618 ADD_TABLE(ci2_file),
1619 ADD_TABLE(install_exec_seq),
1620 ADD_TABLE(rof_media),
1621 ADD_TABLE(property),
1622 };
1623
1624 static const msi_table rem_tables[] =
1625 {
1626 ADD_TABLE(rem_component),
1627 ADD_TABLE(directory),
1628 ADD_TABLE(rof_feature),
1629 ADD_TABLE(rem_feature_comp),
1630 ADD_TABLE(rem_file),
1631 ADD_TABLE(rem_install_exec_seq),
1632 ADD_TABLE(rof_media),
1633 ADD_TABLE(property),
1634 ADD_TABLE(rem_remove_files),
1635 };
1636
1637 static const msi_table mov_tables[] =
1638 {
1639 ADD_TABLE(cwd_component),
1640 ADD_TABLE(directory),
1641 ADD_TABLE(rof_feature),
1642 ADD_TABLE(ci2_feature_comp),
1643 ADD_TABLE(ci2_file),
1644 ADD_TABLE(install_exec_seq),
1645 ADD_TABLE(rof_media),
1646 ADD_TABLE(property),
1647 ADD_TABLE(mov_move_file),
1648 };
1649
1650 static const msi_table mc_tables[] =
1651 {
1652 ADD_TABLE(mc_component),
1653 ADD_TABLE(directory),
1654 ADD_TABLE(cc_feature),
1655 ADD_TABLE(cie_feature_comp),
1656 ADD_TABLE(mc_file),
1657 ADD_TABLE(install_exec_seq),
1658 ADD_TABLE(mc_media),
1659 ADD_TABLE(property),
1660 ADD_TABLE(mc_file_hash),
1661 };
1662
1663 static const msi_table df_tables[] =
1664 {
1665 ADD_TABLE(rof_component),
1666 ADD_TABLE(df_directory),
1667 ADD_TABLE(rof_feature),
1668 ADD_TABLE(rof_feature_comp),
1669 ADD_TABLE(rof_file),
1670 ADD_TABLE(install_exec_seq),
1671 ADD_TABLE(rof_media),
1672 ADD_TABLE(property),
1673 ADD_TABLE(df_duplicate_file),
1674 };
1675
1676 static const msi_table wrv_tables[] =
1677 {
1678 ADD_TABLE(wrv_component),
1679 ADD_TABLE(directory),
1680 ADD_TABLE(rof_feature),
1681 ADD_TABLE(ci2_feature_comp),
1682 ADD_TABLE(ci2_file),
1683 ADD_TABLE(install_exec_seq),
1684 ADD_TABLE(rof_media),
1685 ADD_TABLE(property),
1686 ADD_TABLE(wrv_registry),
1687 };
1688
1689 static const msi_table sf_tables[] =
1690 {
1691 ADD_TABLE(wrv_component),
1692 ADD_TABLE(directory),
1693 ADD_TABLE(rof_feature),
1694 ADD_TABLE(ci2_feature_comp),
1695 ADD_TABLE(ci2_file),
1696 ADD_TABLE(install_exec_seq),
1697 ADD_TABLE(rof_media),
1698 ADD_TABLE(property),
1699 };
1700
1701 static const msi_table ca51_tables[] =
1702 {
1703 ADD_TABLE(ca51_component),
1704 ADD_TABLE(directory),
1705 ADD_TABLE(rof_feature),
1706 ADD_TABLE(ci2_feature_comp),
1707 ADD_TABLE(ci2_file),
1708 ADD_TABLE(ca51_install_exec_seq),
1709 ADD_TABLE(rof_media),
1710 ADD_TABLE(property),
1711 ADD_TABLE(ca51_custom_action),
1712 };
1713
1714 static const msi_table is_tables[] =
1715 {
1716 ADD_TABLE(is_component),
1717 ADD_TABLE(directory),
1718 ADD_TABLE(is_feature),
1719 ADD_TABLE(is_feature_comp),
1720 ADD_TABLE(is_file),
1721 ADD_TABLE(install_exec_seq),
1722 ADD_TABLE(is_media),
1723 ADD_TABLE(property),
1724 };
1725
1726 static const msi_table sp_tables[] =
1727 {
1728 ADD_TABLE(sp_component),
1729 ADD_TABLE(sp_directory),
1730 ADD_TABLE(rof_feature),
1731 ADD_TABLE(ci2_feature_comp),
1732 ADD_TABLE(ci2_file),
1733 ADD_TABLE(install_exec_seq),
1734 ADD_TABLE(rof_media),
1735 ADD_TABLE(property),
1736 };
1737
1738 static const msi_table mcp_tables[] =
1739 {
1740 ADD_TABLE(mcp_component),
1741 ADD_TABLE(directory),
1742 ADD_TABLE(mcp_feature),
1743 ADD_TABLE(mcp_feature_comp),
1744 ADD_TABLE(rem_file),
1745 ADD_TABLE(rem_install_exec_seq),
1746 ADD_TABLE(rof_media),
1747 ADD_TABLE(property),
1748 };
1749
1750 static const msi_table mcomp_tables[] =
1751 {
1752 ADD_TABLE(mcp_component),
1753 ADD_TABLE(directory),
1754 ADD_TABLE(mcp_feature),
1755 ADD_TABLE(mcp_feature_comp),
1756 ADD_TABLE(mcomp_file),
1757 ADD_TABLE(rem_install_exec_seq),
1758 ADD_TABLE(rof_media),
1759 ADD_TABLE(property),
1760 };
1761
1762 static const msi_table ai_tables[] =
1763 {
1764 ADD_TABLE(component),
1765 ADD_TABLE(directory),
1766 ADD_TABLE(feature),
1767 ADD_TABLE(feature_comp),
1768 ADD_TABLE(ai_file),
1769 ADD_TABLE(install_exec_seq),
1770 ADD_TABLE(media),
1771 ADD_TABLE(property)
1772 };
1773
1774 static const msi_table pc_tables[] =
1775 {
1776 ADD_TABLE(ca51_component),
1777 ADD_TABLE(directory),
1778 ADD_TABLE(rof_feature),
1779 ADD_TABLE(ci2_feature_comp),
1780 ADD_TABLE(ci2_file),
1781 ADD_TABLE(install_exec_seq),
1782 ADD_TABLE(rof_media),
1783 ADD_TABLE(property)
1784 };
1785
1786 static const msi_table ip_tables[] =
1787 {
1788 ADD_TABLE(component),
1789 ADD_TABLE(directory),
1790 ADD_TABLE(feature),
1791 ADD_TABLE(feature_comp),
1792 ADD_TABLE(file),
1793 ADD_TABLE(ip_install_exec_seq),
1794 ADD_TABLE(ip_custom_action),
1795 ADD_TABLE(media),
1796 ADD_TABLE(property)
1797 };
1798
1799 static const msi_table aup_tables[] =
1800 {
1801 ADD_TABLE(component),
1802 ADD_TABLE(directory),
1803 ADD_TABLE(feature),
1804 ADD_TABLE(feature_comp),
1805 ADD_TABLE(file),
1806 ADD_TABLE(aup_install_exec_seq),
1807 ADD_TABLE(aup_custom_action),
1808 ADD_TABLE(media),
1809 ADD_TABLE(property)
1810 };
1811
1812 static const msi_table aup2_tables[] =
1813 {
1814 ADD_TABLE(component),
1815 ADD_TABLE(directory),
1816 ADD_TABLE(feature),
1817 ADD_TABLE(feature_comp),
1818 ADD_TABLE(file),
1819 ADD_TABLE(aup2_install_exec_seq),
1820 ADD_TABLE(aup_custom_action),
1821 ADD_TABLE(media),
1822 ADD_TABLE(aup_property)
1823 };
1824
1825 static const msi_table aup3_tables[] =
1826 {
1827 ADD_TABLE(component),
1828 ADD_TABLE(directory),
1829 ADD_TABLE(feature),
1830 ADD_TABLE(feature_comp),
1831 ADD_TABLE(file),
1832 ADD_TABLE(aup2_install_exec_seq),
1833 ADD_TABLE(aup_custom_action),
1834 ADD_TABLE(media),
1835 ADD_TABLE(aup2_property)
1836 };
1837
1838 static const msi_table aup4_tables[] =
1839 {
1840 ADD_TABLE(component),
1841 ADD_TABLE(directory),
1842 ADD_TABLE(feature),
1843 ADD_TABLE(feature_comp),
1844 ADD_TABLE(file),
1845 ADD_TABLE(aup3_install_exec_seq),
1846 ADD_TABLE(aup_custom_action),
1847 ADD_TABLE(media),
1848 ADD_TABLE(aup2_property)
1849 };
1850
1851 static const msi_table fiu_tables[] =
1852 {
1853 ADD_TABLE(rof_component),
1854 ADD_TABLE(directory),
1855 ADD_TABLE(rof_feature),
1856 ADD_TABLE(rof_feature_comp),
1857 ADD_TABLE(rof_file),
1858 ADD_TABLE(pp_install_exec_seq),
1859 ADD_TABLE(rof_media),
1860 ADD_TABLE(property),
1861 };
1862
1863 static const msi_table fiuc_tables[] =
1864 {
1865 ADD_TABLE(rof_component),
1866 ADD_TABLE(directory),
1867 ADD_TABLE(rof_feature),
1868 ADD_TABLE(rof_feature_comp),
1869 ADD_TABLE(rofc_file),
1870 ADD_TABLE(pp_install_exec_seq),
1871 ADD_TABLE(rofc_media),
1872 ADD_TABLE(property),
1873 };
1874
1875 static const msi_table cf_tables[] =
1876 {
1877 ADD_TABLE(component),
1878 ADD_TABLE(directory),
1879 ADD_TABLE(feature),
1880 ADD_TABLE(feature_comp),
1881 ADD_TABLE(file),
1882 ADD_TABLE(cf_create_folders),
1883 ADD_TABLE(cf_install_exec_seq),
1884 ADD_TABLE(cf_custom_action),
1885 ADD_TABLE(media),
1886 ADD_TABLE(property)
1887 };
1888
1889 static const msi_table rf_tables[] =
1890 {
1891 ADD_TABLE(component),
1892 ADD_TABLE(directory),
1893 ADD_TABLE(feature),
1894 ADD_TABLE(feature_comp),
1895 ADD_TABLE(file),
1896 ADD_TABLE(cf_create_folders),
1897 ADD_TABLE(rf_install_exec_seq),
1898 ADD_TABLE(cf_custom_action),
1899 ADD_TABLE(media),
1900 ADD_TABLE(property)
1901 };
1902
1903 static const msi_table sss_tables[] =
1904 {
1905 ADD_TABLE(component),
1906 ADD_TABLE(directory),
1907 ADD_TABLE(feature),
1908 ADD_TABLE(feature_comp),
1909 ADD_TABLE(file),
1910 ADD_TABLE(sss_install_exec_seq),
1911 ADD_TABLE(sss_service_control),
1912 ADD_TABLE(media),
1913 ADD_TABLE(property)
1914 };
1915
1916 static const msi_table sds_tables[] =
1917 {
1918 ADD_TABLE(component),
1919 ADD_TABLE(directory),
1920 ADD_TABLE(feature),
1921 ADD_TABLE(feature_comp),
1922 ADD_TABLE(file),
1923 ADD_TABLE(sss_install_exec_seq),
1924 ADD_TABLE(service_control),
1925 ADD_TABLE(media),
1926 ADD_TABLE(property)
1927 };
1928
1929 static const msi_table sr_tables[] =
1930 {
1931 ADD_TABLE(component),
1932 ADD_TABLE(directory),
1933 ADD_TABLE(feature),
1934 ADD_TABLE(feature_comp),
1935 ADD_TABLE(file),
1936 ADD_TABLE(sr_selfreg),
1937 ADD_TABLE(sr_install_exec_seq),
1938 ADD_TABLE(media),
1939 ADD_TABLE(property)
1940 };
1941
1942 /* cabinet definitions */
1943
1944 /* make the max size large so there is only one cab file */
1945 #define MEDIA_SIZE 0x7FFFFFFF
1946 #define FOLDER_THRESHOLD 900000
1947
1948 /* the FCI callbacks */
1949
1950 static void * CDECL mem_alloc(ULONG cb)
1951 {
1952 return HeapAlloc(GetProcessHeap(), 0, cb);
1953 }
1954
1955 static void CDECL mem_free(void *memory)
1956 {
1957 HeapFree(GetProcessHeap(), 0, memory);
1958 }
1959
1960 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
1961 {
1962 sprintf(pccab->szCab, pv, pccab->iCab);
1963 return TRUE;
1964 }
1965
1966 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
1967 {
1968 return 0;
1969 }
1970
1971 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
1972 BOOL fContinuation, void *pv)
1973 {
1974 return 0;
1975 }
1976
1977 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
1978 {
1979 HANDLE handle;
1980 DWORD dwAccess = 0;
1981 DWORD dwShareMode = 0;
1982 DWORD dwCreateDisposition = OPEN_EXISTING;
1983
1984 dwAccess = GENERIC_READ | GENERIC_WRITE;
1985 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1986 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
1987
1988 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
1989 dwCreateDisposition = OPEN_EXISTING;
1990 else
1991 dwCreateDisposition = CREATE_NEW;
1992
1993 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
1994 dwCreateDisposition, 0, NULL);
1995
1996 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
1997
1998 return (INT_PTR)handle;
1999 }
2000
2001 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2002 {
2003 HANDLE handle = (HANDLE)hf;
2004 DWORD dwRead;
2005 BOOL res;
2006
2007 res = ReadFile(handle, memory, cb, &dwRead, NULL);
2008 ok(res, "Failed to ReadFile\n");
2009
2010 return dwRead;
2011 }
2012
2013 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2014 {
2015 HANDLE handle = (HANDLE)hf;
2016 DWORD dwWritten;
2017 BOOL res;
2018
2019 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
2020 ok(res, "Failed to WriteFile\n");
2021
2022 return dwWritten;
2023 }
2024
2025 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
2026 {
2027 HANDLE handle = (HANDLE)hf;
2028 ok(CloseHandle(handle), "Failed to CloseHandle\n");
2029
2030 return 0;
2031 }
2032
2033 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
2034 {
2035 HANDLE handle = (HANDLE)hf;
2036 DWORD ret;
2037
2038 ret = SetFilePointer(handle, dist, NULL, seektype);
2039 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
2040
2041 return ret;
2042 }
2043
2044 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
2045 {
2046 BOOL ret = DeleteFileA(pszFile);
2047 ok(ret, "Failed to DeleteFile %s\n", pszFile);
2048
2049 return 0;
2050 }
2051
2052 static void init_functionpointers(void)
2053 {
2054 HMODULE hmsi = GetModuleHandleA("msi.dll");
2055 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2056
2057 #define GET_PROC(mod, func) \
2058 p ## func = (void*)GetProcAddress(mod, #func); \
2059 if(!p ## func) \
2060 trace("GetProcAddress(%s) failed\n", #func);
2061
2062 GET_PROC(hmsi, MsiQueryComponentStateA);
2063 GET_PROC(hmsi, MsiSetExternalUIRecord);
2064 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
2065 GET_PROC(hmsi, MsiSourceListGetInfoA);
2066
2067 GET_PROC(hadvapi32, ConvertSidToStringSidA);
2068
2069 hsrclient = LoadLibraryA("srclient.dll");
2070 GET_PROC(hsrclient, SRRemoveRestorePoint);
2071 GET_PROC(hsrclient, SRSetRestorePointA);
2072
2073 #undef GET_PROC
2074 }
2075
2076 static BOOL check_win9x(void)
2077 {
2078 SC_HANDLE scm;
2079
2080 scm = OpenSCManager(NULL, NULL, GENERIC_ALL);
2081 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
2082 return TRUE;
2083
2084 CloseServiceHandle(scm);
2085
2086 return FALSE;
2087 }
2088
2089 static LPSTR get_user_sid(LPSTR *usersid)
2090 {
2091 HANDLE token;
2092 BYTE buf[1024];
2093 DWORD size;
2094 PTOKEN_USER user;
2095
2096 if (!pConvertSidToStringSidA)
2097 {
2098 win_skip("ConvertSidToStringSidA is not available\n");
2099 return NULL;
2100 }
2101
2102 *usersid = NULL;
2103 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
2104 size = sizeof(buf);
2105 GetTokenInformation(token, TokenUser, buf, size, &size);
2106 user = (PTOKEN_USER)buf;
2107 pConvertSidToStringSidA(user->User.Sid, usersid);
2108 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
2109 CloseHandle(token);
2110 return *usersid;
2111 }
2112
2113 static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val)
2114 {
2115 CHAR buffer[0x20];
2116 UINT r;
2117 DWORD sz;
2118
2119 sz = sizeof buffer;
2120 r = MsiRecordGetString(rec, field, buffer, &sz);
2121 return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
2122 }
2123
2124 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
2125 {
2126 LPSTR tempname;
2127
2128 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
2129 GetTempFileNameA(".", "xx", 0, tempname);
2130
2131 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2132 {
2133 lstrcpyA(pszTempName, tempname);
2134 HeapFree(GetProcessHeap(), 0, tempname);
2135 return TRUE;
2136 }
2137
2138 HeapFree(GetProcessHeap(), 0, tempname);
2139
2140 return FALSE;
2141 }
2142
2143 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
2144 USHORT *pattribs, int *err, void *pv)
2145 {
2146 BY_HANDLE_FILE_INFORMATION finfo;
2147 FILETIME filetime;
2148 HANDLE handle;
2149 DWORD attrs;
2150 BOOL res;
2151
2152 handle = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
2153 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
2154
2155 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2156
2157 res = GetFileInformationByHandle(handle, &finfo);
2158 ok(res, "Expected GetFileInformationByHandle to succeed\n");
2159
2160 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
2161 FileTimeToDosDateTime(&filetime, pdate, ptime);
2162
2163 attrs = GetFileAttributes(pszName);
2164 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2165
2166 return (INT_PTR)handle;
2167 }
2168
2169 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
2170 {
2171 char path[MAX_PATH];
2172 char filename[MAX_PATH];
2173
2174 lstrcpyA(path, CURR_DIR);
2175 lstrcatA(path, "\\");
2176 lstrcatA(path, file);
2177
2178 lstrcpyA(filename, file);
2179
2180 return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
2181 progress, get_open_info, compress);
2182 }
2183
2184 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
2185 {
2186 ZeroMemory(pCabParams, sizeof(CCAB));
2187
2188 pCabParams->cb = max_size;
2189 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2190 pCabParams->setID = 0xbeef;
2191 pCabParams->iCab = 1;
2192 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2193 lstrcatA(pCabParams->szCabPath, "\\");
2194 lstrcpyA(pCabParams->szCab, name);
2195 }
2196
2197 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
2198 {
2199 CCAB cabParams;
2200 LPCSTR ptr;
2201 HFCI hfci;
2202 ERF erf;
2203 BOOL res;
2204
2205 set_cab_parameters(&cabParams, name, max_size);
2206
2207 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
2208 fci_read, fci_write, fci_close, fci_seek, fci_delete,
2209 get_temp_file, &cabParams, NULL);
2210
2211 ok(hfci != NULL, "Failed to create an FCI context\n");
2212
2213 ptr = files;
2214 while (*ptr)
2215 {
2216 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2217 ok(res, "Failed to add file: %s\n", ptr);
2218 ptr += lstrlen(ptr) + 1;
2219 }
2220
2221 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
2222 ok(res, "Failed to flush the cabinet\n");
2223
2224 res = FCIDestroy(hfci);
2225 ok(res, "Failed to destroy the cabinet\n");
2226 }
2227
2228 static BOOL get_program_files_dir(LPSTR buf, LPSTR buf2)
2229 {
2230 HKEY hkey;
2231 DWORD type, size;
2232
2233 if (RegOpenKey(HKEY_LOCAL_MACHINE,
2234 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
2235 return FALSE;
2236
2237 size = MAX_PATH;
2238 if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)buf, &size)) {
2239 RegCloseKey(hkey);
2240 return FALSE;
2241 }
2242
2243 size = MAX_PATH;
2244 if (RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)buf2, &size)) {
2245 RegCloseKey(hkey);
2246 return FALSE;
2247 }
2248
2249 RegCloseKey(hkey);
2250 return TRUE;
2251 }
2252
2253 static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
2254 {
2255 HANDLE file;
2256 DWORD written;
2257
2258 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
2259 if (file == INVALID_HANDLE_VALUE)
2260 return;
2261
2262 WriteFile(file, data, strlen(data), &written, NULL);
2263
2264 if (size)
2265 {
2266 SetFilePointer(file, size, NULL, FILE_BEGIN);
2267 SetEndOfFile(file);
2268 }
2269
2270 CloseHandle(file);
2271 }
2272
2273 #define create_file(name, size) create_file_data(name, name, size)
2274
2275 static void create_test_files(void)
2276 {
2277 CreateDirectoryA("msitest", NULL);
2278 create_file("msitest\\one.txt", 100);
2279 CreateDirectoryA("msitest\\first", NULL);
2280 create_file("msitest\\first\\two.txt", 100);
2281 CreateDirectoryA("msitest\\second", NULL);
2282 create_file("msitest\\second\\three.txt", 100);
2283
2284 create_file("four.txt", 100);
2285 create_file("five.txt", 100);
2286 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2287
2288 create_file("msitest\\filename", 100);
2289 create_file("msitest\\service.exe", 100);
2290
2291 DeleteFileA("four.txt");
2292 DeleteFileA("five.txt");
2293 }
2294
2295 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
2296 {
2297 CHAR path[MAX_PATH];
2298
2299 lstrcpyA(path, PROG_FILES_DIR);
2300 lstrcatA(path, "\\");
2301 lstrcatA(path, rel_path);
2302
2303 if (is_file)
2304 return DeleteFileA(path);
2305 else
2306 return RemoveDirectoryA(path);
2307 }
2308
2309 static BOOL delete_cf(const CHAR *rel_path, BOOL is_file)
2310 {
2311 CHAR path[MAX_PATH];
2312
2313 lstrcpyA(path, COMMON_FILES_DIR);
2314 lstrcatA(path, "\\");
2315 lstrcatA(path, rel_path);
2316
2317 if (is_file)
2318 return DeleteFileA(path);
2319 else
2320 return RemoveDirectoryA(path);
2321 }
2322
2323 static void delete_test_files(void)
2324 {
2325 DeleteFileA("msitest.msi");
2326 DeleteFileA("msitest.cab");
2327 DeleteFileA("msitest\\second\\three.txt");
2328 DeleteFileA("msitest\\first\\two.txt");
2329 DeleteFileA("msitest\\one.txt");
2330 DeleteFileA("msitest\\service.exe");
2331 DeleteFileA("msitest\\filename");
2332 RemoveDirectoryA("msitest\\second");
2333 RemoveDirectoryA("msitest\\first");
2334 RemoveDirectoryA("msitest");
2335 }
2336
2337 static void write_file(const CHAR *filename, const char *data, int data_size)
2338 {
2339 DWORD size;
2340
2341 HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
2342 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
2343
2344 WriteFile(hf, data, data_size, &size, NULL);
2345 CloseHandle(hf);
2346 }
2347
2348 static void write_msi_summary_info(MSIHANDLE db, INT wordcount)
2349 {
2350 MSIHANDLE summary;
2351 UINT r;
2352
2353 r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
2354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2355
2356 r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, ";1033");
2357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2358
2359 r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL,
2360 "{004757CA-5092-49c2-AD20-28E1CE0DF5F2}");
2361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2362
2363 r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, 100, NULL, NULL);
2364 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2365
2366 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
2367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2368
2369 r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
2370 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2371
2372 /* write the summary changes back to the stream */
2373 r = MsiSummaryInfoPersist(summary);
2374 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2375
2376 MsiCloseHandle(summary);
2377 }
2378
2379 #define create_database(name, tables, num_tables) \
2380 create_database_wordcount(name, tables, num_tables, 0);
2381
2382 static void create_database_wordcount(const CHAR *name, const msi_table *tables,
2383 int num_tables, INT wordcount)
2384 {
2385 MSIHANDLE db;
2386 UINT r;
2387 int j;
2388
2389 r = MsiOpenDatabaseA(name, MSIDBOPEN_CREATE, &db);
2390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2391
2392 /* import the tables into the database */
2393 for (j = 0; j < num_tables; j++)
2394 {
2395 const msi_table *table = &tables[j];
2396
2397 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2398
2399 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2400 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2401
2402 DeleteFileA(table->filename);
2403 }
2404
2405 write_msi_summary_info(db, wordcount);
2406
2407 r = MsiDatabaseCommit(db);
2408 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2409
2410 MsiCloseHandle(db);
2411 }
2412
2413 static void check_service_is_installed(void)
2414 {
2415 SC_HANDLE scm, service;
2416 BOOL res;
2417
2418 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
2419 ok(scm != NULL, "Failed to open the SC Manager\n");
2420
2421 service = OpenService(scm, "TestService", SC_MANAGER_ALL_ACCESS);
2422 ok(service != NULL, "Failed to open TestService\n");
2423
2424 res = DeleteService(service);
2425 ok(res, "Failed to delete TestService\n");
2426
2427 CloseServiceHandle(service);
2428 CloseServiceHandle(scm);
2429 }
2430
2431 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
2432 {
2433 RESTOREPOINTINFOA spec;
2434
2435 spec.dwEventType = event_type;
2436 spec.dwRestorePtType = APPLICATION_INSTALL;
2437 spec.llSequenceNumber = status->llSequenceNumber;
2438 lstrcpyA(spec.szDescription, "msitest restore point");
2439
2440 return pSRSetRestorePointA(&spec, status);
2441 }
2442
2443 static void remove_restore_point(DWORD seq_number)
2444 {
2445 DWORD res;
2446
2447 res = pSRRemoveRestorePoint(seq_number);
2448 if (res != ERROR_SUCCESS)
2449 trace("Failed to remove the restore point : %08x\n", res);
2450 }
2451
2452 static void test_MsiInstallProduct(void)
2453 {
2454 UINT r;
2455 CHAR path[MAX_PATH];
2456 LONG res;
2457 HKEY hkey;
2458 DWORD num, size, type;
2459
2460 if (on_win9x)
2461 {
2462 win_skip("Services are not implemented on Win9x and WinMe\n");
2463 return;
2464 }
2465
2466 /* szPackagePath is NULL */
2467 r = MsiInstallProductA(NULL, "INSTALL=ALL");
2468 ok(r == ERROR_INVALID_PARAMETER,
2469 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2470
2471 /* both szPackagePath and szCommandLine are NULL */
2472 r = MsiInstallProductA(NULL, NULL);
2473 ok(r == ERROR_INVALID_PARAMETER,
2474 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2475
2476 /* szPackagePath is empty */
2477 r = MsiInstallProductA("", "INSTALL=ALL");
2478 ok(r == ERROR_PATH_NOT_FOUND,
2479 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r);
2480
2481 create_test_files();
2482 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
2483
2484 /* install, don't publish */
2485 r = MsiInstallProductA(msifile, NULL);
2486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2487
2488 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2489 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2490 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2491 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2492 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2493 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2494 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2495 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2496 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2497 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2498 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2499 ok(delete_pf("msitest", FALSE), "File not installed\n");
2500
2501 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2502 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2503
2504 size = MAX_PATH;
2505 type = REG_SZ;
2506 res = RegQueryValueExA(hkey, "Name", NULL, &type, (LPBYTE)path, &size);
2507 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2508 ok(!lstrcmpA(path, "imaname"), "Expected imaname, got %s\n", path);
2509
2510 size = MAX_PATH;
2511 type = REG_SZ;
2512 res = RegQueryValueExA(hkey, "blah", NULL, &type, (LPBYTE)path, &size);
2513 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2514
2515 size = sizeof(num);
2516 type = REG_DWORD;
2517 res = RegQueryValueExA(hkey, "number", NULL, &type, (LPBYTE)&num, &size);
2518 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2519 ok(num == 314, "Expected 314, got %d\n", num);
2520
2521 size = MAX_PATH;
2522 type = REG_SZ;
2523 res = RegQueryValueExA(hkey, "OrderTestName", NULL, &type, (LPBYTE)path, &size);
2524 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2525 ok(!lstrcmpA(path, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path);
2526
2527 check_service_is_installed();
2528
2529 RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
2530
2531 /* not published, reinstall */
2532 r = MsiInstallProductA(msifile, NULL);
2533 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2534
2535 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2536 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2537 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2538 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2539 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2540 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2541 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2542 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2543 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2544 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2545 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2546 ok(delete_pf("msitest", FALSE), "File not installed\n");
2547
2548 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2549 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2550 RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
2551
2552 create_database(msifile, up_tables, sizeof(up_tables) / sizeof(msi_table));
2553
2554 /* not published, RemovePreviousVersions set */
2555 r = MsiInstallProductA(msifile, NULL);
2556 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2557
2558 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2559 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2560 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2561 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2562 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2563 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2564 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2565 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2566 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2567 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2568 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2569 ok(delete_pf("msitest", FALSE), "File not installed\n");
2570
2571 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2572 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2573 RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
2574
2575 create_database(msifile, up2_tables, sizeof(up2_tables) / sizeof(msi_table));
2576
2577 /* not published, version number bumped */
2578 r = MsiInstallProductA(msifile, NULL);
2579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2580
2581 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2582 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2583 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2584 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2585 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2586 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2587 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2588 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2589 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2590 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2591 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2592 ok(delete_pf("msitest", FALSE), "File not installed\n");
2593
2594 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2595 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2596 RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
2597
2598 create_database(msifile, up3_tables, sizeof(up3_tables) / sizeof(msi_table));
2599
2600 /* not published, RemovePreviousVersions set and version number bumped */
2601 r = MsiInstallProductA(msifile, NULL);
2602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2603
2604 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2605 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2606 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2607 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2608 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2609 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2610 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2611 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2612 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2613 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2614 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2615 ok(delete_pf("msitest", FALSE), "File not installed\n");
2616
2617 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2618 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2619 RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
2620
2621 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
2622
2623 /* install, publish product */
2624 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
2625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2626
2627 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2628 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2629 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2630 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2631 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2632 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2633 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2634 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2635 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2636 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2637 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2638 ok(delete_pf("msitest", FALSE), "File not installed\n");
2639
2640 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2641 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2642
2643 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
2644
2645 /* published, reinstall */
2646 r = MsiInstallProductA(msifile, NULL);
2647 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2648
2649 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2650 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2651 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2652 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2653 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2654 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2655 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2656 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2657 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2658 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2659 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2660 ok(delete_pf("msitest", FALSE), "File not installed\n");
2661
2662 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2663 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2664
2665 create_database(msifile, up5_tables, sizeof(up5_tables) / sizeof(msi_table));
2666
2667 /* published product, RemovePreviousVersions set */
2668 r = MsiInstallProductA(msifile, NULL);
2669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2670
2671 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2672 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2673 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2674 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2675 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2676 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2677 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2678 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2679 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2680 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2681 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2682 ok(delete_pf("msitest", FALSE), "File not installed\n");
2683
2684 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2685 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2686
2687 create_database(msifile, up6_tables, sizeof(up6_tables) / sizeof(msi_table));
2688
2689 /* published product, version number bumped */
2690 r = MsiInstallProductA(msifile, NULL);
2691 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2692
2693 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2694 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2695 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2696 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2697 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2698 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2699 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2700 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2701 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2702 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2703 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2704 ok(delete_pf("msitest", FALSE), "File not installed\n");
2705
2706 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2707 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2708
2709 create_database(msifile, up7_tables, sizeof(up7_tables) / sizeof(msi_table));
2710
2711 /* published product, RemovePreviousVersions set and version number bumped */
2712 r = MsiInstallProductA(msifile, NULL);
2713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2714
2715 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2716 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
2717 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2718 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
2719 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2720 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
2721 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2722 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
2723 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2724 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2725 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2726 ok(delete_pf("msitest", FALSE), "File not installed\n");
2727
2728 res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
2729 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2730
2731 r = MsiInstallProductA(msifile, "REMOVE=ALL");
2732 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2733
2734 delete_test_files();
2735 }
2736
2737 static void test_MsiSetComponentState(void)
2738 {
2739 INSTALLSTATE installed, action;
2740 MSIHANDLE package;
2741 char path[MAX_PATH];
2742 UINT r;
2743
2744 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
2745
2746 CoInitialize(NULL);
2747
2748 lstrcpy(path, CURR_DIR);
2749 lstrcat(path, "\\");
2750 lstrcat(path, msifile);
2751
2752 r = MsiOpenPackage(path, &package);
2753 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2754
2755 r = MsiDoAction(package, "CostInitialize");
2756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2757
2758 r = MsiDoAction(package, "FileCost");
2759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2760
2761 r = MsiDoAction(package, "CostFinalize");
2762 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2763
2764 r = MsiGetComponentState(package, "dangler", &installed, &action);
2765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2766 ok(installed == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", installed);
2767 ok(action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2768
2769 r = MsiSetComponentState(package, "dangler", INSTALLSTATE_SOURCE);
2770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2771
2772 MsiCloseHandle(package);
2773 CoUninitialize();
2774
2775 DeleteFileA(msifile);
2776 }
2777
2778 static void test_packagecoltypes(void)
2779 {
2780 MSIHANDLE hdb, view, rec;
2781 char path[MAX_PATH];
2782 LPCSTR query;
2783 UINT r, count;
2784
2785 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
2786
2787 CoInitialize(NULL);
2788
2789 lstrcpy(path, CURR_DIR);
2790 lstrcat(path, "\\");
2791 lstrcat(path, msifile);
2792
2793 r = MsiOpenDatabase(path, MSIDBOPEN_READONLY, &hdb);
2794 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2795
2796 query = "SELECT * FROM `Media`";
2797 r = MsiDatabaseOpenView( hdb, query, &view );
2798 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2799
2800 r = MsiViewGetColumnInfo( view, MSICOLINFO_NAMES, &rec );
2801 count = MsiRecordGetFieldCount( rec );
2802 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
2803 ok(count == 6, "Expected 6, got %d\n", count);
2804 ok(check_record(rec, 1, "DiskId"), "wrong column label\n");
2805 ok(check_record(rec, 2, "LastSequence"), "wrong column label\n");
2806 ok(check_record(rec, 3, "DiskPrompt"), "wrong column label\n");
2807 ok(check_record(rec, 4, "Cabinet"), "wrong column label\n");
2808 ok(check_record(rec, 5, "VolumeLabel"), "wrong column label\n");
2809 ok(check_record(rec, 6, "Source"), "wrong column label\n");
2810 MsiCloseHandle(rec);
2811
2812 r = MsiViewGetColumnInfo( view, MSICOLINFO_TYPES, &rec );
2813 count = MsiRecordGetFieldCount( rec );
2814 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
2815 ok(count == 6, "Expected 6, got %d\n", count);
2816 ok(check_record(rec, 1, "i2"), "wrong column label\n");
2817 ok(check_record(rec, 2, "i4"), "wrong column label\n");
2818 ok(check_record(rec, 3, "L64"), "wrong column label\n");
2819 ok(check_record(rec, 4, "S255"), "wrong column label\n");
2820 ok(check_record(rec, 5, "S32"), "wrong column label\n");
2821 ok(check_record(rec, 6, "S72"), "wrong column label\n");
2822
2823 MsiCloseHandle(rec);
2824 MsiCloseHandle(view);
2825 MsiCloseHandle(hdb);
2826 CoUninitialize();
2827
2828 DeleteFile(msifile);
2829 }
2830
2831 static void create_cc_test_files(void)
2832 {
2833 CCAB cabParams;
2834 HFCI hfci;
2835 ERF erf;