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