msi/tests: Add a trailing '\n' to an ok() call and fix a typo.
[wine/multimedia.git] / dlls / msi / tests / install.c
blobf343c029b7262f98e8cdd4e884d439a00365f8ff
1 /*
2 * Copyright (C) 2006 James Hawkins
4 * A test program for installing MSI products.
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.
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.
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
21 #define _WIN32_MSI 300
22 #define COBJMACROS
24 #include <stdio.h>
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>
35 #include "wine/test.h"
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 UINT (WINAPI *pMsiSourceListGetInfoA)
42 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
43 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
44 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
46 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
47 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
48 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
49 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
51 static HMODULE hsrclient = 0;
52 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
53 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
55 static BOOL is_wow64;
56 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
58 static const char *msifile = "msitest.msi";
59 static const char *msifile2 = "winetest2.msi";
60 static const char *mstfile = "winetest.mst";
61 static CHAR CURR_DIR[MAX_PATH];
62 static CHAR PROG_FILES_DIR[MAX_PATH];
63 static CHAR PROG_FILES_DIR_NATIVE[MAX_PATH];
64 static CHAR COMMON_FILES_DIR[MAX_PATH];
65 static CHAR APP_DATA_DIR[MAX_PATH];
66 static CHAR WINDOWS_DIR[MAX_PATH];
68 /* msi database data */
70 static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
71 "s72\tS38\ts72\ti2\tS255\tS72\n"
72 "Component\tComponent\n"
73 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
74 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
75 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
76 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
77 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
78 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
79 "component\t\tMSITESTDIR\t0\t1\tfile\n"
80 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
82 static const CHAR directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
83 "s72\tS72\tl255\n"
84 "Directory\tDirectory\n"
85 "CABOUTDIR\tMSITESTDIR\tcabout\n"
86 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
87 "FIRSTDIR\tMSITESTDIR\tfirst\n"
88 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
89 "NEWDIR\tCABOUTDIR\tnew\n"
90 "ProgramFilesFolder\tTARGETDIR\t.\n"
91 "TARGETDIR\t\tSourceDir";
93 static const CHAR feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
94 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
95 "Feature\tFeature\n"
96 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
97 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
98 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
99 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
100 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
101 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
102 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
104 static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n"
105 "s38\ts72\n"
106 "FeatureComponents\tFeature_\tComponent_\n"
107 "Five\tFive\n"
108 "Four\tFour\n"
109 "One\tOne\n"
110 "Three\tThree\n"
111 "Two\tTwo\n"
112 "feature\tcomponent\n"
113 "service_feature\tservice_comp\n";
115 static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
116 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
117 "File\tFile\n"
118 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
119 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
120 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
121 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
122 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
123 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
124 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
126 static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
127 "s72\tS255\tI2\n"
128 "InstallExecuteSequence\tAction\n"
129 "AllocateRegistrySpace\tNOT Installed\t1550\n"
130 "CostFinalize\t\t1000\n"
131 "CostInitialize\t\t800\n"
132 "FileCost\t\t900\n"
133 "ResolveSource\t\t950\n"
134 "MoveFiles\t\t1700\n"
135 "InstallFiles\t\t4000\n"
136 "DuplicateFiles\t\t4500\n"
137 "WriteEnvironmentStrings\t\t4550\n"
138 "CreateShortcuts\t\t4600\n"
139 "InstallServices\t\t5000\n"
140 "InstallFinalize\t\t6600\n"
141 "InstallInitialize\t\t1500\n"
142 "InstallValidate\t\t1400\n"
143 "LaunchConditions\t\t100\n"
144 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
146 static const CHAR media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
147 "i2\ti4\tL64\tS255\tS32\tS72\n"
148 "Media\tDiskId\n"
149 "1\t3\t\t\tDISK1\t\n"
150 "2\t5\t\tmsitest.cab\tDISK2\t\n";
152 static const CHAR property_dat[] = "Property\tValue\n"
153 "s72\tl0\n"
154 "Property\tProperty\n"
155 "DefaultUIFont\tDlgFont8\n"
156 "HASUIRUN\t0\n"
157 "INSTALLLEVEL\t3\n"
158 "InstallMode\tTypical\n"
159 "Manufacturer\tWine\n"
160 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
161 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
162 "ProductID\tnone\n"
163 "ProductLanguage\t1033\n"
164 "ProductName\tMSITEST\n"
165 "ProductVersion\t1.1.1\n"
166 "PROMPTROLLBACKCOST\tP\n"
167 "Setup\tSetup\n"
168 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
169 "AdminProperties\tPOSTADMIN\n"
170 "ROOTDRIVE\tC:\\\n"
171 "SERVNAME\tTestService\n"
172 "SERVDISP\tTestServiceDisp\n"
173 "MSIFASTINSTALL\t1\n";
175 static const CHAR aup_property_dat[] = "Property\tValue\n"
176 "s72\tl0\n"
177 "Property\tProperty\n"
178 "DefaultUIFont\tDlgFont8\n"
179 "HASUIRUN\t0\n"
180 "ALLUSERS\t1\n"
181 "INSTALLLEVEL\t3\n"
182 "InstallMode\tTypical\n"
183 "Manufacturer\tWine\n"
184 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
185 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
186 "ProductID\tnone\n"
187 "ProductLanguage\t1033\n"
188 "ProductName\tMSITEST\n"
189 "ProductVersion\t1.1.1\n"
190 "PROMPTROLLBACKCOST\tP\n"
191 "Setup\tSetup\n"
192 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
193 "AdminProperties\tPOSTADMIN\n"
194 "ROOTDRIVE\tC:\\\n"
195 "SERVNAME\tTestService\n"
196 "SERVDISP\tTestServiceDisp\n"
197 "MSIFASTINSTALL\t1\n";
199 static const CHAR aup2_property_dat[] = "Property\tValue\n"
200 "s72\tl0\n"
201 "Property\tProperty\n"
202 "DefaultUIFont\tDlgFont8\n"
203 "HASUIRUN\t0\n"
204 "ALLUSERS\t2\n"
205 "INSTALLLEVEL\t3\n"
206 "InstallMode\tTypical\n"
207 "Manufacturer\tWine\n"
208 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
209 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
210 "ProductID\tnone\n"
211 "ProductLanguage\t1033\n"
212 "ProductName\tMSITEST\n"
213 "ProductVersion\t1.1.1\n"
214 "PROMPTROLLBACKCOST\tP\n"
215 "Setup\tSetup\n"
216 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
217 "AdminProperties\tPOSTADMIN\n"
218 "ROOTDRIVE\tC:\\\n"
219 "SERVNAME\tTestService\n"
220 "SERVDISP\tTestServiceDisp\n"
221 "MSIFASTINSTALL\t1\n";
223 static const CHAR icon_property_dat[] = "Property\tValue\n"
224 "s72\tl0\n"
225 "Property\tProperty\n"
226 "DefaultUIFont\tDlgFont8\n"
227 "HASUIRUN\t0\n"
228 "INSTALLLEVEL\t3\n"
229 "InstallMode\tTypical\n"
230 "Manufacturer\tWine\n"
231 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
232 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
233 "ProductID\tnone\n"
234 "ProductLanguage\t1033\n"
235 "ProductName\tMSITEST\n"
236 "ProductVersion\t1.1.1\n"
237 "PROMPTROLLBACKCOST\tP\n"
238 "Setup\tSetup\n"
239 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
240 "AdminProperties\tPOSTADMIN\n"
241 "ROOTDRIVE\tC:\\\n"
242 "SERVNAME\tTestService\n"
243 "SERVDISP\tTestServiceDisp\n"
244 "MSIFASTINSTALL\t1\n";
246 static const CHAR shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
247 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
248 "Shortcut\tShortcut\n"
249 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
251 static const CHAR condition_dat[] = "Feature_\tLevel\tCondition\n"
252 "s38\ti2\tS255\n"
253 "Condition\tFeature_\tLevel\n"
254 "One\t4\t1\n";
256 static const CHAR up_property_dat[] = "Property\tValue\n"
257 "s72\tl0\n"
258 "Property\tProperty\n"
259 "DefaultUIFont\tDlgFont8\n"
260 "HASUIRUN\t0\n"
261 "INSTALLLEVEL\t3\n"
262 "InstallMode\tTypical\n"
263 "Manufacturer\tWine\n"
264 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
265 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
266 "ProductID\tnone\n"
267 "ProductLanguage\t1033\n"
268 "ProductName\tMSITEST\n"
269 "ProductVersion\t1.1.1\n"
270 "PROMPTROLLBACKCOST\tP\n"
271 "Setup\tSetup\n"
272 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
273 "AdminProperties\tPOSTADMIN\n"
274 "ROOTDRIVE\tC:\\\n"
275 "SERVNAME\tTestService\n"
276 "SERVDISP\tTestServiceDisp\n"
277 "RemovePreviousVersions\t1\n"
278 "MSIFASTINSTALL\t1\n";
280 static const CHAR up2_property_dat[] = "Property\tValue\n"
281 "s72\tl0\n"
282 "Property\tProperty\n"
283 "DefaultUIFont\tDlgFont8\n"
284 "HASUIRUN\t0\n"
285 "INSTALLLEVEL\t3\n"
286 "InstallMode\tTypical\n"
287 "Manufacturer\tWine\n"
288 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
289 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
290 "ProductID\tnone\n"
291 "ProductLanguage\t1033\n"
292 "ProductName\tMSITEST\n"
293 "ProductVersion\t1.1.2\n"
294 "PROMPTROLLBACKCOST\tP\n"
295 "Setup\tSetup\n"
296 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
297 "AdminProperties\tPOSTADMIN\n"
298 "ROOTDRIVE\tC:\\\n"
299 "SERVNAME\tTestService\n"
300 "SERVDISP\tTestServiceDisp\n"
301 "MSIFASTINSTALL\t1\n";
303 static const CHAR up3_property_dat[] = "Property\tValue\n"
304 "s72\tl0\n"
305 "Property\tProperty\n"
306 "DefaultUIFont\tDlgFont8\n"
307 "HASUIRUN\t0\n"
308 "INSTALLLEVEL\t3\n"
309 "InstallMode\tTypical\n"
310 "Manufacturer\tWine\n"
311 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
312 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
313 "ProductID\tnone\n"
314 "ProductLanguage\t1033\n"
315 "ProductName\tMSITEST\n"
316 "ProductVersion\t1.1.2\n"
317 "PROMPTROLLBACKCOST\tP\n"
318 "Setup\tSetup\n"
319 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
320 "AdminProperties\tPOSTADMIN\n"
321 "ROOTDRIVE\tC:\\\n"
322 "SERVNAME\tTestService\n"
323 "SERVDISP\tTestServiceDisp\n"
324 "RemovePreviousVersions\t1\n"
325 "MSIFASTINSTALL\t1\n";
327 static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
328 "s72\ti2\tl255\tL255\tL0\ts72\n"
329 "Registry\tRegistry\n"
330 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
331 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
332 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
333 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
335 static const CHAR service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
336 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
337 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
338 "ServiceInstall\tServiceInstall\n"
339 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
341 static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
342 "s72\tl255\ti2\tL255\tI2\ts72\n"
343 "ServiceControl\tServiceControl\n"
344 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
346 /* tables for test_continuouscabs */
347 static const CHAR cc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
348 "s72\tS38\ts72\ti2\tS255\tS72\n"
349 "Component\tComponent\n"
350 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
351 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
352 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
354 static const CHAR cc2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
355 "s72\tS38\ts72\ti2\tS255\tS72\n"
356 "Component\tComponent\n"
357 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
358 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
359 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
361 static const CHAR cc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
362 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
363 "Feature\tFeature\n"
364 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
366 static const CHAR cc_feature_comp_dat[] = "Feature_\tComponent_\n"
367 "s38\ts72\n"
368 "FeatureComponents\tFeature_\tComponent_\n"
369 "feature\tmaximus\n"
370 "feature\taugustus\n"
371 "feature\tcaesar";
373 static const CHAR cc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
374 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
375 "File\tFile\n"
376 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
377 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
378 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
380 static const CHAR cc2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
381 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
382 "File\tFile\n"
383 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
384 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
385 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
386 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
388 static const CHAR cc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
389 "i2\ti4\tL64\tS255\tS32\tS72\n"
390 "Media\tDiskId\n"
391 "1\t10\t\ttest1.cab\tDISK1\t\n"
392 "2\t2\t\ttest2.cab\tDISK2\t\n"
393 "3\t12\t\ttest3.cab\tDISK3\t\n";
395 static const CHAR cc3_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
396 "i2\ti4\tL64\tS255\tS32\tS72\n"
397 "Media\tDiskId\n"
398 "1\t10\t\ttest1.cab\tDISK1\t\n"
399 "2\t2\t\ttest2_.cab\tDISK2\t\n"
400 "3\t12\t\ttest3.cab\tDISK3\t\n";
402 static const CHAR co_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
403 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
404 "File\tFile\n"
405 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
406 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
407 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
409 static const CHAR co_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
410 "i2\ti4\tL64\tS255\tS32\tS72\n"
411 "Media\tDiskId\n"
412 "1\t10\t\ttest1.cab\tDISK1\t\n"
413 "2\t2\t\ttest2.cab\tDISK2\t\n"
414 "3\t3\t\ttest3.cab\tDISK3\t\n";
416 static const CHAR co2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
417 "i2\ti4\tL64\tS255\tS32\tS72\n"
418 "Media\tDiskId\n"
419 "1\t10\t\ttest1.cab\tDISK1\t\n"
420 "2\t12\t\ttest3.cab\tDISK3\t\n"
421 "3\t2\t\ttest2.cab\tDISK2\t\n";
423 static const CHAR mm_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
424 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
425 "File\tFile\n"
426 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
427 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
428 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
430 static const CHAR mm_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
431 "i2\ti4\tL64\tS255\tS32\tS72\n"
432 "Media\tDiskId\n"
433 "1\t3\t\ttest1.cab\tDISK1\t\n";
435 static const CHAR ss_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
436 "i2\ti4\tL64\tS255\tS32\tS72\n"
437 "Media\tDiskId\n"
438 "1\t2\t\ttest1.cab\tDISK1\t\n"
439 "2\t2\t\ttest2.cab\tDISK2\t\n"
440 "3\t12\t\ttest3.cab\tDISK3\t\n";
442 /* tables for test_uiLevelFlags */
443 static const CHAR ui_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
444 "s72\tS38\ts72\ti2\tS255\tS72\n"
445 "Component\tComponent\n"
446 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
447 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
448 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
450 static const CHAR ui_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
451 "s72\tS255\tI2\n"
452 "InstallUISequence\tAction\n"
453 "SetUIProperty\t\t5\n"
454 "ExecuteAction\t\t1100\n";
456 static const CHAR ui_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
457 "s72\ti2\tS64\tS0\tS255\n"
458 "CustomAction\tAction\n"
459 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
461 static const CHAR rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
462 "s72\tS38\ts72\ti2\tS255\tS72\n"
463 "Component\tComponent\n"
464 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
466 static const CHAR rof_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
467 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
468 "Feature\tFeature\n"
469 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
470 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
472 static const CHAR rof_feature_comp_dat[] = "Feature_\tComponent_\n"
473 "s38\ts72\n"
474 "FeatureComponents\tFeature_\tComponent_\n"
475 "feature\tmaximus\n"
476 "montecristo\tmaximus";
478 static const CHAR rof_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
479 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
480 "File\tFile\n"
481 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
483 static const CHAR rof_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
484 "i2\ti4\tL64\tS255\tS32\tS72\n"
485 "Media\tDiskId\n"
486 "1\t1\t\t\tDISK1\t\n";
488 static const CHAR rofc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
489 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
490 "File\tFile\n"
491 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
493 static const CHAR rofc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
494 "i2\ti4\tL64\tS255\tS32\tS72\n"
495 "Media\tDiskId\n"
496 "1\t1\t\ttest1.cab\tDISK1\t\n";
498 static const CHAR lus2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
499 "i2\ti4\tL64\tS255\tS32\tS72\n"
500 "Media\tDiskId\n"
501 "1\t1\t\t#test1.cab\tDISK1\t\n";
503 static const CHAR sdp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
504 "s72\tS255\tI2\n"
505 "InstallExecuteSequence\tAction\n"
506 "AllocateRegistrySpace\tNOT Installed\t1550\n"
507 "CostFinalize\t\t1000\n"
508 "CostInitialize\t\t800\n"
509 "FileCost\t\t900\n"
510 "InstallFiles\t\t4000\n"
511 "InstallFinalize\t\t6600\n"
512 "InstallInitialize\t\t1500\n"
513 "InstallValidate\t\t1400\n"
514 "LaunchConditions\t\t100\n"
515 "SetDirProperty\t\t950";
517 static const CHAR sdp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
518 "s72\ti2\tS64\tS0\tS255\n"
519 "CustomAction\tAction\n"
520 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
522 static const CHAR pv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
523 "s72\tS255\tI2\n"
524 "InstallExecuteSequence\tAction\n"
525 "LaunchConditions\t\t100\n"
526 "CostInitialize\t\t800\n"
527 "FileCost\t\t900\n"
528 "CostFinalize\t\t1000\n"
529 "InstallValidate\t\t1400\n"
530 "InstallInitialize\t\t1500\n"
531 "InstallFiles\t\t4000\n"
532 "InstallFinalize\t\t6600\n";
534 static const CHAR cie_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
535 "s72\tS38\ts72\ti2\tS255\tS72\n"
536 "Component\tComponent\n"
537 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
538 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
539 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
540 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
542 static const CHAR cie_feature_comp_dat[] = "Feature_\tComponent_\n"
543 "s38\ts72\n"
544 "FeatureComponents\tFeature_\tComponent_\n"
545 "feature\tmaximus\n"
546 "feature\taugustus\n"
547 "feature\tcaesar\n"
548 "feature\tgaius";
550 static const CHAR cie_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
551 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
552 "File\tFile\n"
553 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
554 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
555 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
556 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
558 static const CHAR cie_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
559 "i2\ti4\tL64\tS255\tS32\tS72\n"
560 "Media\tDiskId\n"
561 "1\t1\t\ttest1.cab\tDISK1\t\n"
562 "2\t2\t\ttest2.cab\tDISK2\t\n"
563 "3\t12\t\ttest3.cab\tDISK3\t\n";
565 static const CHAR ci_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
566 "s72\tS255\tI2\n"
567 "InstallExecuteSequence\tAction\n"
568 "CostFinalize\t\t1000\n"
569 "CostInitialize\t\t800\n"
570 "FileCost\t\t900\n"
571 "InstallFiles\t\t4000\n"
572 "InstallServices\t\t5000\n"
573 "InstallFinalize\t\t6600\n"
574 "InstallInitialize\t\t1500\n"
575 "RunInstall\t\t1600\n"
576 "InstallValidate\t\t1400\n"
577 "LaunchConditions\t\t100";
579 static const CHAR ci_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
580 "s72\ti2\tS64\tS0\tS255\n"
581 "CustomAction\tAction\n"
582 "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n";
584 static const CHAR ci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
585 "s72\tS38\ts72\ti2\tS255\tS72\n"
586 "Component\tComponent\n"
587 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
589 static const CHAR ci2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
590 "s72\tS38\ts72\ti2\tS255\tS72\n"
591 "Component\tComponent\n"
592 "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n";
594 static const CHAR ci2_feature_comp_dat[] = "Feature_\tComponent_\n"
595 "s38\ts72\n"
596 "FeatureComponents\tFeature_\tComponent_\n"
597 "feature\taugustus";
599 static const CHAR ci2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
600 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
601 "File\tFile\n"
602 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
604 static const CHAR spf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
605 "s72\ti2\tS64\tS0\tS255\n"
606 "CustomAction\tAction\n"
607 "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n";
609 static const CHAR spf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
610 "s72\tS255\tI2\n"
611 "InstallExecuteSequence\tAction\n"
612 "CostFinalize\t\t1000\n"
613 "CostInitialize\t\t800\n"
614 "FileCost\t\t900\n"
615 "SetFolderProp\t\t950\n"
616 "InstallFiles\t\t4000\n"
617 "InstallServices\t\t5000\n"
618 "InstallFinalize\t\t6600\n"
619 "InstallInitialize\t\t1500\n"
620 "InstallValidate\t\t1400\n"
621 "LaunchConditions\t\t100";
623 static const CHAR spf_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
624 "s72\tS255\tI2\n"
625 "InstallUISequence\tAction\n"
626 "CostInitialize\t\t800\n"
627 "FileCost\t\t900\n"
628 "CostFinalize\t\t1000\n"
629 "ExecuteAction\t\t1100\n";
631 static const CHAR pp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
632 "s72\tS255\tI2\n"
633 "InstallExecuteSequence\tAction\n"
634 "ValidateProductID\t\t700\n"
635 "CostInitialize\t\t800\n"
636 "FileCost\t\t900\n"
637 "CostFinalize\t\t1000\n"
638 "InstallValidate\t\t1400\n"
639 "InstallInitialize\t\t1500\n"
640 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
641 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
642 "RemoveFiles\t\t3500\n"
643 "InstallFiles\t\t4000\n"
644 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
645 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
646 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
647 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
648 "InstallFinalize\t\t6600";
650 static const CHAR tp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
651 "s72\tS38\ts72\ti2\tS255\tS72\n"
652 "Component\tComponent\n"
653 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
655 static const CHAR cwd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
656 "s72\tS38\ts72\ti2\tS255\tS72\n"
657 "Component\tComponent\n"
658 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
660 static const CHAR adm_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
661 "s72\tS38\ts72\ti2\tS255\tS72\n"
662 "Component\tComponent\n"
663 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
665 static const CHAR adm_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
666 "s72\ti2\tS64\tS0\tS255\n"
667 "CustomAction\tAction\n"
668 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
670 static const CHAR adm_admin_exec_seq_dat[] = "Action\tCondition\tSequence\n"
671 "s72\tS255\tI2\n"
672 "AdminExecuteSequence\tAction\n"
673 "CostFinalize\t\t1000\n"
674 "CostInitialize\t\t800\n"
675 "FileCost\t\t900\n"
676 "SetPOSTADMIN\t\t950\n"
677 "InstallFiles\t\t4000\n"
678 "InstallFinalize\t\t6600\n"
679 "InstallInitialize\t\t1500\n"
680 "InstallValidate\t\t1400\n"
681 "LaunchConditions\t\t100";
683 static const CHAR amp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
684 "s72\tS38\ts72\ti2\tS255\tS72\n"
685 "Component\tComponent\n"
686 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
688 static const CHAR rem_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
689 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
690 "File\tFile\n"
691 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
692 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
693 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
695 static const CHAR rem_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
696 "s72\tS255\tI2\n"
697 "InstallExecuteSequence\tAction\n"
698 "ValidateProductID\t\t700\n"
699 "CostInitialize\t\t800\n"
700 "FileCost\t\t900\n"
701 "CostFinalize\t\t1000\n"
702 "InstallValidate\t\t1400\n"
703 "InstallInitialize\t\t1500\n"
704 "ProcessComponents\t\t1600\n"
705 "UnpublishFeatures\t\t1800\n"
706 "RemoveFiles\t\t3500\n"
707 "InstallFiles\t\t4000\n"
708 "RegisterProduct\t\t6100\n"
709 "PublishFeatures\t\t6300\n"
710 "PublishProduct\t\t6400\n"
711 "InstallFinalize\t\t6600";
713 static const CHAR mc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
714 "s72\tS38\ts72\ti2\tS255\tS72\n"
715 "Component\tComponent\n"
716 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
717 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
718 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
719 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
720 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
722 static const CHAR mc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
723 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
724 "File\tFile\n"
725 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
726 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
727 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
728 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
729 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
731 static const CHAR mc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
732 "i2\ti4\tL64\tS255\tS32\tS72\n"
733 "Media\tDiskId\n"
734 "1\t1\t\ttest1.cab\tDISK1\t\n"
735 "2\t2\t\ttest2.cab\tDISK2\t\n"
736 "3\t3\t\ttest3.cab\tDISK3\t\n"
737 "4\t4\t\ttest3.cab\tDISK3\t\n"
738 "5\t5\t\ttest4.cab\tDISK4\t\n";
740 static const CHAR mc_file_hash_dat[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
741 "s72\ti2\ti4\ti4\ti4\ti4\n"
742 "MsiFileHash\tFile_\n"
743 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
745 static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
746 "s72\tS38\ts72\ti2\tS255\tS72\n"
747 "Component\tComponent\n"
748 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
750 static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
751 "s72\tS38\ts72\ti2\tS255\tS72\n"
752 "Component\tComponent\n"
753 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
755 static const CHAR ca51_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
756 "s72\tS255\tI2\n"
757 "InstallExecuteSequence\tAction\n"
758 "ValidateProductID\t\t700\n"
759 "GoodSetProperty\t\t725\n"
760 "BadSetProperty\t\t750\n"
761 "CostInitialize\t\t800\n"
762 "ResolveSource\t\t810\n"
763 "FileCost\t\t900\n"
764 "SetSourceDir\tSRCDIR\t910\n"
765 "CostFinalize\t\t1000\n"
766 "InstallValidate\t\t1400\n"
767 "InstallInitialize\t\t1500\n"
768 "InstallFiles\t\t4000\n"
769 "InstallFinalize\t\t6600";
771 static const CHAR ca51_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
772 "s72\ti2\tS64\tS0\n"
773 "CustomAction\tAction\n"
774 "GoodSetProperty\t51\tMYPROP\t42\n"
775 "BadSetProperty\t51\t\tMYPROP\n"
776 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
778 static const CHAR is_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
779 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
780 "Feature\tFeature\n"
781 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
782 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
783 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
784 "four\t\t\t\t2\t0\t\t0"; /* disabled */
786 static const CHAR is_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
787 "s72\tS38\ts72\ti2\tS255\tS72\n"
788 "Component\tComponent\n"
789 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
790 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
791 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
792 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
793 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
794 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
795 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
796 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
797 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
798 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
799 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
800 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
802 static const CHAR is_feature_comp_dat[] = "Feature_\tComponent_\n"
803 "s38\ts72\n"
804 "FeatureComponents\tFeature_\tComponent_\n"
805 "one\talpha\n"
806 "one\tbeta\n"
807 "one\tgamma\n"
808 "two\ttheta\n"
809 "two\tdelta\n"
810 "two\tepsilon\n"
811 "three\tzeta\n"
812 "three\tiota\n"
813 "three\teta\n"
814 "four\tkappa\n"
815 "four\tlambda\n"
816 "four\tmu";
818 static const CHAR is_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
819 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
820 "File\tFile\n"
821 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
822 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
823 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
824 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
825 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
826 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
827 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
828 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
829 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
830 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
831 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
832 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
834 static const CHAR is_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
835 "i2\ti4\tL64\tS255\tS32\tS72\n"
836 "Media\tDiskId\n"
837 "1\t12\t\t\tDISK1\t\n";
839 static const CHAR sp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
840 "s72\tS38\ts72\ti2\tS255\tS72\n"
841 "Component\tComponent\n"
842 "augustus\t\tTWODIR\t0\t\taugustus\n";
844 static const CHAR sp_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
845 "s72\tS72\tl255\n"
846 "Directory\tDirectory\n"
847 "TARGETDIR\t\tSourceDir\n"
848 "ProgramFilesFolder\tTARGETDIR\t.\n"
849 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
850 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
851 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
853 static const CHAR mcp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
854 "s72\tS38\ts72\ti2\tS255\tS72\n"
855 "Component\tComponent\n"
856 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
857 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
858 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
860 static const CHAR mcp_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
861 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
862 "Feature\tFeature\n"
863 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
864 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
865 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
867 static const CHAR mcp_feature_comp_dat[] = "Feature_\tComponent_\n"
868 "s38\ts72\n"
869 "FeatureComponents\tFeature_\tComponent_\n"
870 "hydroxyl\thydrogen\n"
871 "heliox\thelium\n"
872 "lithia\tlithium";
874 static const CHAR mcp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
875 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
876 "File\tFile\n"
877 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
878 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
879 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
880 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
882 static const CHAR ai_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
883 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
884 "File\tFile\n"
885 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
886 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
887 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
888 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
889 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
890 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
891 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
893 static const CHAR ip_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
894 "s72\tS255\tI2\n"
895 "InstallExecuteSequence\tAction\n"
896 "CostFinalize\t\t1000\n"
897 "ValidateProductID\t\t700\n"
898 "CostInitialize\t\t800\n"
899 "FileCost\t\t900\n"
900 "RemoveFiles\t\t3500\n"
901 "InstallFiles\t\t4000\n"
902 "RegisterUser\t\t6000\n"
903 "RegisterProduct\t\t6100\n"
904 "PublishFeatures\t\t6300\n"
905 "PublishProduct\t\t6400\n"
906 "InstallFinalize\t\t6600\n"
907 "InstallInitialize\t\t1500\n"
908 "ProcessComponents\t\t1600\n"
909 "UnpublishFeatures\t\t1800\n"
910 "InstallValidate\t\t1400\n"
911 "LaunchConditions\t\t100\n"
912 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
914 static const CHAR ip_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
915 "s72\ti2\tS64\tS0\tS255\n"
916 "CustomAction\tAction\n"
917 "TestInstalledProp\t19\t\tTest failed\t\n";
919 static const CHAR aup_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
920 "s72\tS255\tI2\n"
921 "InstallExecuteSequence\tAction\n"
922 "CostFinalize\t\t1000\n"
923 "ValidateProductID\t\t700\n"
924 "CostInitialize\t\t800\n"
925 "FileCost\t\t900\n"
926 "RemoveFiles\t\t3500\n"
927 "InstallFiles\t\t4000\n"
928 "RegisterUser\t\t6000\n"
929 "RegisterProduct\t\t6100\n"
930 "PublishFeatures\t\t6300\n"
931 "PublishProduct\t\t6400\n"
932 "InstallFinalize\t\t6600\n"
933 "InstallInitialize\t\t1500\n"
934 "ProcessComponents\t\t1600\n"
935 "UnpublishFeatures\t\t1800\n"
936 "InstallValidate\t\t1400\n"
937 "LaunchConditions\t\t100\n"
938 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
940 static const CHAR aup2_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
941 "s72\tS255\tI2\n"
942 "InstallExecuteSequence\tAction\n"
943 "CostFinalize\t\t1000\n"
944 "ValidateProductID\t\t700\n"
945 "CostInitialize\t\t800\n"
946 "FileCost\t\t900\n"
947 "RemoveFiles\t\t3500\n"
948 "InstallFiles\t\t4000\n"
949 "RegisterUser\t\t6000\n"
950 "RegisterProduct\t\t6100\n"
951 "PublishFeatures\t\t6300\n"
952 "PublishProduct\t\t6400\n"
953 "InstallFinalize\t\t6600\n"
954 "InstallInitialize\t\t1500\n"
955 "ProcessComponents\t\t1600\n"
956 "UnpublishFeatures\t\t1800\n"
957 "InstallValidate\t\t1400\n"
958 "LaunchConditions\t\t100\n"
959 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
961 static const CHAR aup3_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
962 "s72\tS255\tI2\n"
963 "InstallExecuteSequence\tAction\n"
964 "CostFinalize\t\t1000\n"
965 "ValidateProductID\t\t700\n"
966 "CostInitialize\t\t800\n"
967 "FileCost\t\t900\n"
968 "RemoveFiles\t\t3500\n"
969 "InstallFiles\t\t4000\n"
970 "RegisterUser\t\t6000\n"
971 "RegisterProduct\t\t6100\n"
972 "PublishFeatures\t\t6300\n"
973 "PublishProduct\t\t6400\n"
974 "InstallFinalize\t\t6600\n"
975 "InstallInitialize\t\t1500\n"
976 "ProcessComponents\t\t1600\n"
977 "UnpublishFeatures\t\t1800\n"
978 "InstallValidate\t\t1400\n"
979 "LaunchConditions\t\t100\n"
980 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
982 static const CHAR aup_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
983 "s72\ti2\tS64\tS0\tS255\n"
984 "CustomAction\tAction\n"
985 "TestAllUsersProp\t19\t\tTest failed\t\n";
987 static const CHAR fo_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
988 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
989 "File\tFile\n"
990 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
991 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
992 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
994 static const CHAR fo_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
995 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
996 "Feature\tFeature\n"
997 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
998 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
999 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
1001 static const CHAR fo_condition_dat[] = "Feature_\tLevel\tCondition\n"
1002 "s38\ti2\tS255\n"
1003 "Condition\tFeature_\tLevel\n"
1004 "preselected\t0\tPreselected\n"
1005 "notpreselected\t0\tNOT Preselected\n";
1007 static const CHAR fo_feature_comp_dat[] = "Feature_\tComponent_\n"
1008 "s38\ts72\n"
1009 "FeatureComponents\tFeature_\tComponent_\n"
1010 "override\toverride\n"
1011 "preselected\tpreselected\n"
1012 "notpreselected\tnotpreselected\n";
1014 static const CHAR fo_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1015 "s72\tS38\ts72\ti2\tS255\tS72\n"
1016 "Component\tComponent\n"
1017 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
1018 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
1019 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
1021 static const CHAR fo_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1022 "s72\ti2\tS64\tS0\tS255\n"
1023 "CustomAction\tAction\n"
1024 "SetPreselected\t51\tPreselected\t1\t\n";
1026 static const CHAR fo_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1027 "s72\tS255\tI2\n"
1028 "InstallExecuteSequence\tAction\n"
1029 "LaunchConditions\t\t100\n"
1030 "SetPreselected\tpreselect=1\t200\n"
1031 "CostInitialize\t\t800\n"
1032 "FileCost\t\t900\n"
1033 "CostFinalize\t\t1000\n"
1034 "InstallValidate\t\t1400\n"
1035 "InstallInitialize\t\t1500\n"
1036 "ProcessComponents\t\t1600\n"
1037 "RemoveFiles\t\t1700\n"
1038 "InstallFiles\t\t2000\n"
1039 "RegisterProduct\t\t5000\n"
1040 "PublishFeatures\t\t5100\n"
1041 "PublishProduct\t\t5200\n"
1042 "InstallFinalize\t\t6000\n";
1044 static const CHAR sd_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1045 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1046 "File\tFile\n"
1047 "sourcedir.txt\tsourcedir\tsourcedir.txt\t1000\t\t\t8192\t1\n";
1049 static const CHAR sd_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1050 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1051 "Feature\tFeature\n"
1052 "sourcedir\t\t\tsourcedir feature\t1\t2\tMSITESTDIR\t0\n";
1054 static const CHAR sd_feature_comp_dat[] = "Feature_\tComponent_\n"
1055 "s38\ts72\n"
1056 "FeatureComponents\tFeature_\tComponent_\n"
1057 "sourcedir\tsourcedir\n";
1059 static const CHAR sd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1060 "s72\tS38\ts72\ti2\tS255\tS72\n"
1061 "Component\tComponent\n"
1062 "sourcedir\t{DD422F92-3ED8-49B5-A0B7-F266F98357DF}\tMSITESTDIR\t0\t\tsourcedir.txt\n";
1064 static const CHAR sd_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
1065 "s72\tS255\tI2\n"
1066 "InstallUISequence\tAction\n"
1067 "TestSourceDirProp1\tnot SourceDir and not SOURCEDIR and not Installed\t99\n"
1068 "AppSearch\t\t100\n"
1069 "TestSourceDirProp2\tnot SourceDir and not SOURCEDIR and not Installed\t101\n"
1070 "LaunchConditions\tnot Installed \t110\n"
1071 "TestSourceDirProp3\tnot SourceDir and not SOURCEDIR and not Installed\t111\n"
1072 "FindRelatedProducts\t\t120\n"
1073 "TestSourceDirProp4\tnot SourceDir and not SOURCEDIR and not Installed\t121\n"
1074 "CCPSearch\t\t130\n"
1075 "TestSourceDirProp5\tnot SourceDir and not SOURCEDIR and not Installed\t131\n"
1076 "RMCCPSearch\t\t140\n"
1077 "TestSourceDirProp6\tnot SourceDir and not SOURCEDIR and not Installed\t141\n"
1078 "ValidateProductID\t\t150\n"
1079 "TestSourceDirProp7\tnot SourceDir and not SOURCEDIR and not Installed\t151\n"
1080 "CostInitialize\t\t800\n"
1081 "TestSourceDirProp8\tnot SourceDir and not SOURCEDIR and not Installed\t801\n"
1082 "FileCost\t\t900\n"
1083 "TestSourceDirProp9\tnot SourceDir and not SOURCEDIR and not Installed\t901\n"
1084 "IsolateComponents\t\t1000\n"
1085 "TestSourceDirProp10\tnot SourceDir and not SOURCEDIR and not Installed\t1001\n"
1086 "CostFinalize\t\t1100\n"
1087 "TestSourceDirProp11\tnot SourceDir and not SOURCEDIR and not Installed\t1101\n"
1088 "MigrateFeatureStates\t\t1200\n"
1089 "TestSourceDirProp12\tnot SourceDir and not SOURCEDIR and not Installed\t1201\n"
1090 "ExecuteAction\t\t1300\n"
1091 "TestSourceDirProp13\tnot SourceDir and not SOURCEDIR and not Installed\t1301\n";
1093 static const CHAR sd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1094 "s72\tS255\tI2\n"
1095 "InstallExecuteSequence\tAction\n"
1096 "TestSourceDirProp14\tSourceDir and SOURCEDIR and not Installed\t99\n"
1097 "LaunchConditions\t\t100\n"
1098 "TestSourceDirProp15\tSourceDir and SOURCEDIR and not Installed\t101\n"
1099 "ValidateProductID\t\t700\n"
1100 "TestSourceDirProp16\tSourceDir and SOURCEDIR and not Installed\t701\n"
1101 "CostInitialize\t\t800\n"
1102 "TestSourceDirProp17\tSourceDir and SOURCEDIR and not Installed\t801\n"
1103 "ResolveSource\tResolveSource and not Installed\t850\n"
1104 "TestSourceDirProp18\tResolveSource and not SourceDir and not SOURCEDIR and not Installed\t851\n"
1105 "TestSourceDirProp19\tnot ResolveSource and SourceDir and SOURCEDIR and not Installed\t852\n"
1106 "FileCost\t\t900\n"
1107 "TestSourceDirProp20\tSourceDir and SOURCEDIR and not Installed\t901\n"
1108 "IsolateComponents\t\t1000\n"
1109 "TestSourceDirProp21\tSourceDir and SOURCEDIR and not Installed\t1001\n"
1110 "CostFinalize\t\t1100\n"
1111 "TestSourceDirProp22\tSourceDir and SOURCEDIR and not Installed\t1101\n"
1112 "MigrateFeatureStates\t\t1200\n"
1113 "TestSourceDirProp23\tSourceDir and SOURCEDIR and not Installed\t1201\n"
1114 "InstallValidate\t\t1400\n"
1115 "TestSourceDirProp24\tSourceDir and SOURCEDIR and not Installed\t1401\n"
1116 "InstallInitialize\t\t1500\n"
1117 "TestSourceDirProp25\tSourceDir and SOURCEDIR and not Installed\t1501\n"
1118 "ProcessComponents\t\t1600\n"
1119 "TestSourceDirProp26\tnot SourceDir and not SOURCEDIR and not Installed\t1601\n"
1120 "UnpublishFeatures\t\t1800\n"
1121 "TestSourceDirProp27\tnot SourceDir and not SOURCEDIR and not Installed\t1801\n"
1122 "RemoveFiles\t\t3500\n"
1123 "TestSourceDirProp28\tnot SourceDir and not SOURCEDIR and not Installed\t3501\n"
1124 "InstallFiles\t\t4000\n"
1125 "TestSourceDirProp29\tnot SourceDir and not SOURCEDIR and not Installed\t4001\n"
1126 "RegisterUser\t\t6000\n"
1127 "TestSourceDirProp30\tnot SourceDir and not SOURCEDIR and not Installed\t6001\n"
1128 "RegisterProduct\t\t6100\n"
1129 "TestSourceDirProp31\tnot SourceDir and not SOURCEDIR and not Installed\t6101\n"
1130 "PublishFeatures\t\t6300\n"
1131 "TestSourceDirProp32\tnot SourceDir and not SOURCEDIR and not Installed\t6301\n"
1132 "PublishProduct\t\t6400\n"
1133 "TestSourceDirProp33\tnot SourceDir and not SOURCEDIR and not Installed\t6401\n"
1134 "InstallExecute\t\t6500\n"
1135 "TestSourceDirProp34\tnot SourceDir and not SOURCEDIR and not Installed\t6501\n"
1136 "InstallFinalize\t\t6600\n"
1137 "TestSourceDirProp35\tnot SourceDir and not SOURCEDIR and not Installed\t6601\n";
1139 static const CHAR sd_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1140 "s72\ti2\tS64\tS0\tS255\n"
1141 "CustomAction\tAction\n"
1142 "TestSourceDirProp1\t19\t\tTest 1 failed\t\n"
1143 "TestSourceDirProp2\t19\t\tTest 2 failed\t\n"
1144 "TestSourceDirProp3\t19\t\tTest 3 failed\t\n"
1145 "TestSourceDirProp4\t19\t\tTest 4 failed\t\n"
1146 "TestSourceDirProp5\t19\t\tTest 5 failed\t\n"
1147 "TestSourceDirProp6\t19\t\tTest 6 failed\t\n"
1148 "TestSourceDirProp7\t19\t\tTest 7 failed\t\n"
1149 "TestSourceDirProp8\t19\t\tTest 8 failed\t\n"
1150 "TestSourceDirProp9\t19\t\tTest 9 failed\t\n"
1151 "TestSourceDirProp10\t19\t\tTest 10 failed\t\n"
1152 "TestSourceDirProp11\t19\t\tTest 11 failed\t\n"
1153 "TestSourceDirProp12\t19\t\tTest 12 failed\t\n"
1154 "TestSourceDirProp13\t19\t\tTest 13 failed\t\n"
1155 "TestSourceDirProp14\t19\t\tTest 14 failed\t\n"
1156 "TestSourceDirProp15\t19\t\tTest 15 failed\t\n"
1157 "TestSourceDirProp16\t19\t\tTest 16 failed\t\n"
1158 "TestSourceDirProp17\t19\t\tTest 17 failed\t\n"
1159 "TestSourceDirProp18\t19\t\tTest 18 failed\t\n"
1160 "TestSourceDirProp19\t19\t\tTest 19 failed\t\n"
1161 "TestSourceDirProp20\t19\t\tTest 20 failed\t\n"
1162 "TestSourceDirProp21\t19\t\tTest 21 failed\t\n"
1163 "TestSourceDirProp22\t19\t\tTest 22 failed\t\n"
1164 "TestSourceDirProp23\t19\t\tTest 23 failed\t\n"
1165 "TestSourceDirProp24\t19\t\tTest 24 failed\t\n"
1166 "TestSourceDirProp25\t19\t\tTest 25 failed\t\n"
1167 "TestSourceDirProp26\t19\t\tTest 26 failed\t\n"
1168 "TestSourceDirProp27\t19\t\tTest 27 failed\t\n"
1169 "TestSourceDirProp28\t19\t\tTest 28 failed\t\n"
1170 "TestSourceDirProp29\t19\t\tTest 29 failed\t\n"
1171 "TestSourceDirProp30\t19\t\tTest 30 failed\t\n"
1172 "TestSourceDirProp31\t19\t\tTest 31 failed\t\n"
1173 "TestSourceDirProp32\t19\t\tTest 32 failed\t\n"
1174 "TestSourceDirProp33\t19\t\tTest 33 failed\t\n"
1175 "TestSourceDirProp34\t19\t\tTest 34 failed\t\n"
1176 "TestSourceDirProp35\t19\t\tTest 35 failed\t\n";
1178 static const CHAR cl_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1179 "s72\ti2\tS64\tS0\tS255\n"
1180 "CustomAction\tAction\n"
1181 "TestCommandlineProp\t19\t\tTest1\t\n";
1183 static const CHAR cl_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1184 "s72\tS255\tI2\n"
1185 "InstallExecuteSequence\tAction\n"
1186 "LaunchConditions\t\t100\n"
1187 "ValidateProductID\t\t700\n"
1188 "CostInitialize\t\t800\n"
1189 "FileCost\t\t900\n"
1190 "CostFinalize\t\t1000\n"
1191 "TestCommandlineProp\tP=\"one\"\t1100\n"
1192 "InstallInitialize\t\t1500\n"
1193 "ProcessComponents\t\t1600\n"
1194 "InstallValidate\t\t1400\n"
1195 "InstallFinalize\t\t5000\n";
1197 static const CHAR uc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1198 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1199 "File\tFile\n"
1200 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
1202 static const CHAR uc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1203 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1204 "Feature\tFeature\n"
1205 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
1207 static const CHAR uc_feature_comp_dat[] = "Feature_\tComponent_\n"
1208 "s38\ts72\n"
1209 "FeatureComponents\tFeature_\tComponent_\n"
1210 "upgradecode\tupgradecode\n";
1212 static const CHAR uc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1213 "s72\tS38\ts72\ti2\tS255\tS72\n"
1214 "Component\tComponent\n"
1215 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
1217 static const CHAR uc_property_dat[] = "Property\tValue\n"
1218 "s72\tl0\n"
1219 "Property\tProperty\n"
1220 "INSTALLLEVEL\t3\n"
1221 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
1222 "ProductName\tMSITEST\n"
1223 "ProductVersion\t1.1.1\n"
1224 "UpgradeCode\t#UPGEADECODE#\n"
1225 "MSIFASTINSTALL\t1\n";
1227 static const CHAR uc_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1228 "s72\tS255\tI2\n"
1229 "InstallExecuteSequence\tAction\n"
1230 "LaunchConditions\t\t100\n"
1231 "CostInitialize\t\t200\n"
1232 "FileCost\t\t300\n"
1233 "CostFinalize\t\t400\n"
1234 "InstallInitialize\t\t500\n"
1235 "ProcessComponents\t\t600\n"
1236 "InstallValidate\t\t700\n"
1237 "RemoveFiles\t\t800\n"
1238 "InstallFiles\t\t900\n"
1239 "RegisterProduct\t\t1000\n"
1240 "PublishFeatures\t\t1100\n"
1241 "PublishProduct\t\t1200\n"
1242 "InstallFinalize\t\t1300\n";
1244 static const char mixed_feature_dat[] =
1245 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1246 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1247 "Feature\tFeature\n"
1248 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1249 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1251 static const char mixed_feature_comp_dat[] =
1252 "Feature_\tComponent_\n"
1253 "s38\ts72\n"
1254 "FeatureComponents\tFeature_\tComponent_\n"
1255 "feature1\tcomp1\n"
1256 "feature2\tcomp2\n";
1258 static const char mixed_component_dat[] =
1259 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1260 "s72\tS38\ts72\ti2\tS255\tS72\n"
1261 "Component\tComponent\n"
1262 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1263 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1265 static const char mixed_registry_dat[] =
1266 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1267 "s72\ti2\tl255\tL255\tL0\ts72\n"
1268 "Registry\tRegistry\n"
1269 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1270 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n";
1272 static const char mixed_install_exec_seq_dat[] =
1273 "Action\tCondition\tSequence\n"
1274 "s72\tS255\tI2\n"
1275 "InstallExecuteSequence\tAction\n"
1276 "LaunchConditions\t\t100\n"
1277 "CostInitialize\t\t200\n"
1278 "FileCost\t\t300\n"
1279 "CostFinalize\t\t400\n"
1280 "InstallValidate\t\t500\n"
1281 "InstallInitialize\t\t600\n"
1282 "ProcessComponents\t\t700\n"
1283 "UnpublishFeatures\t\t800\n"
1284 "RemoveRegistryValues\t\t900\n"
1285 "WriteRegistryValues\t\t1000\n"
1286 "RegisterProduct\t\t1100\n"
1287 "PublishFeatures\t\t1200\n"
1288 "PublishProduct\t\t1300\n"
1289 "InstallFinalize\t\t1400\n";
1291 typedef struct _msi_table
1293 const CHAR *filename;
1294 const CHAR *data;
1295 int size;
1296 } msi_table;
1298 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1300 static const msi_table tables[] =
1302 ADD_TABLE(component),
1303 ADD_TABLE(directory),
1304 ADD_TABLE(feature),
1305 ADD_TABLE(feature_comp),
1306 ADD_TABLE(file),
1307 ADD_TABLE(install_exec_seq),
1308 ADD_TABLE(media),
1309 ADD_TABLE(property),
1310 ADD_TABLE(registry),
1311 ADD_TABLE(service_install),
1312 ADD_TABLE(service_control)
1315 static const msi_table sc_tables[] =
1317 ADD_TABLE(component),
1318 ADD_TABLE(directory),
1319 ADD_TABLE(feature),
1320 ADD_TABLE(feature_comp),
1321 ADD_TABLE(file),
1322 ADD_TABLE(install_exec_seq),
1323 ADD_TABLE(media),
1324 ADD_TABLE(property),
1325 ADD_TABLE(shortcut)
1328 static const msi_table ps_tables[] =
1330 ADD_TABLE(component),
1331 ADD_TABLE(directory),
1332 ADD_TABLE(feature),
1333 ADD_TABLE(feature_comp),
1334 ADD_TABLE(file),
1335 ADD_TABLE(install_exec_seq),
1336 ADD_TABLE(media),
1337 ADD_TABLE(property),
1338 ADD_TABLE(condition)
1341 static const msi_table up_tables[] =
1343 ADD_TABLE(component),
1344 ADD_TABLE(directory),
1345 ADD_TABLE(feature),
1346 ADD_TABLE(feature_comp),
1347 ADD_TABLE(file),
1348 ADD_TABLE(install_exec_seq),
1349 ADD_TABLE(media),
1350 ADD_TABLE(up_property),
1351 ADD_TABLE(registry),
1352 ADD_TABLE(service_install),
1353 ADD_TABLE(service_control)
1356 static const msi_table up2_tables[] =
1358 ADD_TABLE(component),
1359 ADD_TABLE(directory),
1360 ADD_TABLE(feature),
1361 ADD_TABLE(feature_comp),
1362 ADD_TABLE(file),
1363 ADD_TABLE(install_exec_seq),
1364 ADD_TABLE(media),
1365 ADD_TABLE(up2_property),
1366 ADD_TABLE(registry),
1367 ADD_TABLE(service_install),
1368 ADD_TABLE(service_control)
1371 static const msi_table up3_tables[] =
1373 ADD_TABLE(component),
1374 ADD_TABLE(directory),
1375 ADD_TABLE(feature),
1376 ADD_TABLE(feature_comp),
1377 ADD_TABLE(file),
1378 ADD_TABLE(install_exec_seq),
1379 ADD_TABLE(media),
1380 ADD_TABLE(up3_property),
1381 ADD_TABLE(registry),
1382 ADD_TABLE(service_install),
1383 ADD_TABLE(service_control)
1386 static const msi_table up4_tables[] =
1388 ADD_TABLE(component),
1389 ADD_TABLE(directory),
1390 ADD_TABLE(feature),
1391 ADD_TABLE(feature_comp),
1392 ADD_TABLE(file),
1393 ADD_TABLE(pp_install_exec_seq),
1394 ADD_TABLE(media),
1395 ADD_TABLE(property),
1396 ADD_TABLE(registry),
1397 ADD_TABLE(service_install),
1398 ADD_TABLE(service_control)
1401 static const msi_table up5_tables[] =
1403 ADD_TABLE(component),
1404 ADD_TABLE(directory),
1405 ADD_TABLE(feature),
1406 ADD_TABLE(feature_comp),
1407 ADD_TABLE(file),
1408 ADD_TABLE(pp_install_exec_seq),
1409 ADD_TABLE(media),
1410 ADD_TABLE(up_property),
1411 ADD_TABLE(registry),
1412 ADD_TABLE(service_install),
1413 ADD_TABLE(service_control)
1416 static const msi_table up6_tables[] =
1418 ADD_TABLE(component),
1419 ADD_TABLE(directory),
1420 ADD_TABLE(feature),
1421 ADD_TABLE(feature_comp),
1422 ADD_TABLE(file),
1423 ADD_TABLE(pp_install_exec_seq),
1424 ADD_TABLE(media),
1425 ADD_TABLE(up2_property),
1426 ADD_TABLE(registry),
1427 ADD_TABLE(service_install),
1428 ADD_TABLE(service_control)
1431 static const msi_table up7_tables[] =
1433 ADD_TABLE(component),
1434 ADD_TABLE(directory),
1435 ADD_TABLE(feature),
1436 ADD_TABLE(feature_comp),
1437 ADD_TABLE(file),
1438 ADD_TABLE(pp_install_exec_seq),
1439 ADD_TABLE(media),
1440 ADD_TABLE(up3_property),
1441 ADD_TABLE(registry),
1442 ADD_TABLE(service_install),
1443 ADD_TABLE(service_control)
1446 static const msi_table cc_tables[] =
1448 ADD_TABLE(cc_component),
1449 ADD_TABLE(directory),
1450 ADD_TABLE(cc_feature),
1451 ADD_TABLE(cc_feature_comp),
1452 ADD_TABLE(cc_file),
1453 ADD_TABLE(install_exec_seq),
1454 ADD_TABLE(cc_media),
1455 ADD_TABLE(property),
1458 static const msi_table cc2_tables[] =
1460 ADD_TABLE(cc2_component),
1461 ADD_TABLE(directory),
1462 ADD_TABLE(cc_feature),
1463 ADD_TABLE(cc_feature_comp),
1464 ADD_TABLE(cc2_file),
1465 ADD_TABLE(install_exec_seq),
1466 ADD_TABLE(cc_media),
1467 ADD_TABLE(property),
1470 static const msi_table cc3_tables[] =
1472 ADD_TABLE(cc_component),
1473 ADD_TABLE(directory),
1474 ADD_TABLE(cc_feature),
1475 ADD_TABLE(cc_feature_comp),
1476 ADD_TABLE(cc_file),
1477 ADD_TABLE(install_exec_seq),
1478 ADD_TABLE(cc3_media),
1479 ADD_TABLE(property),
1482 static const msi_table co_tables[] =
1484 ADD_TABLE(cc_component),
1485 ADD_TABLE(directory),
1486 ADD_TABLE(cc_feature),
1487 ADD_TABLE(cc_feature_comp),
1488 ADD_TABLE(co_file),
1489 ADD_TABLE(install_exec_seq),
1490 ADD_TABLE(co_media),
1491 ADD_TABLE(property),
1494 static const msi_table co2_tables[] =
1496 ADD_TABLE(cc_component),
1497 ADD_TABLE(directory),
1498 ADD_TABLE(cc_feature),
1499 ADD_TABLE(cc_feature_comp),
1500 ADD_TABLE(cc_file),
1501 ADD_TABLE(install_exec_seq),
1502 ADD_TABLE(co2_media),
1503 ADD_TABLE(property),
1506 static const msi_table mm_tables[] =
1508 ADD_TABLE(cc_component),
1509 ADD_TABLE(directory),
1510 ADD_TABLE(cc_feature),
1511 ADD_TABLE(cc_feature_comp),
1512 ADD_TABLE(mm_file),
1513 ADD_TABLE(install_exec_seq),
1514 ADD_TABLE(mm_media),
1515 ADD_TABLE(property),
1518 static const msi_table ss_tables[] =
1520 ADD_TABLE(cc_component),
1521 ADD_TABLE(directory),
1522 ADD_TABLE(cc_feature),
1523 ADD_TABLE(cc_feature_comp),
1524 ADD_TABLE(cc_file),
1525 ADD_TABLE(install_exec_seq),
1526 ADD_TABLE(ss_media),
1527 ADD_TABLE(property),
1530 static const msi_table ui_tables[] =
1532 ADD_TABLE(ui_component),
1533 ADD_TABLE(directory),
1534 ADD_TABLE(cc_feature),
1535 ADD_TABLE(cc_feature_comp),
1536 ADD_TABLE(cc_file),
1537 ADD_TABLE(install_exec_seq),
1538 ADD_TABLE(ui_install_ui_seq),
1539 ADD_TABLE(ui_custom_action),
1540 ADD_TABLE(cc_media),
1541 ADD_TABLE(property),
1544 static const msi_table rof_tables[] =
1546 ADD_TABLE(rof_component),
1547 ADD_TABLE(directory),
1548 ADD_TABLE(rof_feature),
1549 ADD_TABLE(rof_feature_comp),
1550 ADD_TABLE(rof_file),
1551 ADD_TABLE(install_exec_seq),
1552 ADD_TABLE(rof_media),
1553 ADD_TABLE(property),
1556 static const msi_table rofc_tables[] =
1558 ADD_TABLE(rof_component),
1559 ADD_TABLE(directory),
1560 ADD_TABLE(rof_feature),
1561 ADD_TABLE(rof_feature_comp),
1562 ADD_TABLE(rofc_file),
1563 ADD_TABLE(install_exec_seq),
1564 ADD_TABLE(rofc_media),
1565 ADD_TABLE(property),
1568 static const msi_table sdp_tables[] =
1570 ADD_TABLE(rof_component),
1571 ADD_TABLE(directory),
1572 ADD_TABLE(rof_feature),
1573 ADD_TABLE(rof_feature_comp),
1574 ADD_TABLE(rof_file),
1575 ADD_TABLE(sdp_install_exec_seq),
1576 ADD_TABLE(sdp_custom_action),
1577 ADD_TABLE(rof_media),
1578 ADD_TABLE(property),
1581 static const msi_table cie_tables[] =
1583 ADD_TABLE(cie_component),
1584 ADD_TABLE(directory),
1585 ADD_TABLE(cc_feature),
1586 ADD_TABLE(cie_feature_comp),
1587 ADD_TABLE(cie_file),
1588 ADD_TABLE(install_exec_seq),
1589 ADD_TABLE(cie_media),
1590 ADD_TABLE(property),
1593 static const msi_table ci_tables[] =
1595 ADD_TABLE(ci_component),
1596 ADD_TABLE(directory),
1597 ADD_TABLE(rof_feature),
1598 ADD_TABLE(rof_feature_comp),
1599 ADD_TABLE(rof_file),
1600 ADD_TABLE(ci_install_exec_seq),
1601 ADD_TABLE(rof_media),
1602 ADD_TABLE(property),
1603 ADD_TABLE(ci_custom_action),
1606 static const msi_table ci2_tables[] =
1608 ADD_TABLE(ci2_component),
1609 ADD_TABLE(directory),
1610 ADD_TABLE(rof_feature),
1611 ADD_TABLE(ci2_feature_comp),
1612 ADD_TABLE(ci2_file),
1613 ADD_TABLE(install_exec_seq),
1614 ADD_TABLE(rof_media),
1615 ADD_TABLE(property),
1618 static const msi_table spf_tables[] =
1620 ADD_TABLE(ci_component),
1621 ADD_TABLE(directory),
1622 ADD_TABLE(rof_feature),
1623 ADD_TABLE(rof_feature_comp),
1624 ADD_TABLE(rof_file),
1625 ADD_TABLE(spf_install_exec_seq),
1626 ADD_TABLE(rof_media),
1627 ADD_TABLE(property),
1628 ADD_TABLE(spf_custom_action),
1629 ADD_TABLE(spf_install_ui_seq),
1632 static const msi_table lus0_tables[] =
1634 ADD_TABLE(ci_component),
1635 ADD_TABLE(directory),
1636 ADD_TABLE(rof_feature),
1637 ADD_TABLE(rof_feature_comp),
1638 ADD_TABLE(rof_file),
1639 ADD_TABLE(pp_install_exec_seq),
1640 ADD_TABLE(rof_media),
1641 ADD_TABLE(property),
1644 static const msi_table lus1_tables[] =
1646 ADD_TABLE(ci_component),
1647 ADD_TABLE(directory),
1648 ADD_TABLE(rof_feature),
1649 ADD_TABLE(rof_feature_comp),
1650 ADD_TABLE(rof_file),
1651 ADD_TABLE(pp_install_exec_seq),
1652 ADD_TABLE(rofc_media),
1653 ADD_TABLE(property),
1656 static const msi_table lus2_tables[] =
1658 ADD_TABLE(ci_component),
1659 ADD_TABLE(directory),
1660 ADD_TABLE(rof_feature),
1661 ADD_TABLE(rof_feature_comp),
1662 ADD_TABLE(rof_file),
1663 ADD_TABLE(pp_install_exec_seq),
1664 ADD_TABLE(lus2_media),
1665 ADD_TABLE(property),
1668 static const msi_table tp_tables[] =
1670 ADD_TABLE(tp_component),
1671 ADD_TABLE(directory),
1672 ADD_TABLE(rof_feature),
1673 ADD_TABLE(ci2_feature_comp),
1674 ADD_TABLE(ci2_file),
1675 ADD_TABLE(install_exec_seq),
1676 ADD_TABLE(rof_media),
1677 ADD_TABLE(property),
1680 static const msi_table cwd_tables[] =
1682 ADD_TABLE(cwd_component),
1683 ADD_TABLE(directory),
1684 ADD_TABLE(rof_feature),
1685 ADD_TABLE(ci2_feature_comp),
1686 ADD_TABLE(ci2_file),
1687 ADD_TABLE(install_exec_seq),
1688 ADD_TABLE(rof_media),
1689 ADD_TABLE(property),
1692 static const msi_table adm_tables[] =
1694 ADD_TABLE(adm_component),
1695 ADD_TABLE(directory),
1696 ADD_TABLE(rof_feature),
1697 ADD_TABLE(ci2_feature_comp),
1698 ADD_TABLE(ci2_file),
1699 ADD_TABLE(install_exec_seq),
1700 ADD_TABLE(rof_media),
1701 ADD_TABLE(property),
1702 ADD_TABLE(adm_custom_action),
1703 ADD_TABLE(adm_admin_exec_seq),
1706 static const msi_table amp_tables[] =
1708 ADD_TABLE(amp_component),
1709 ADD_TABLE(directory),
1710 ADD_TABLE(rof_feature),
1711 ADD_TABLE(ci2_feature_comp),
1712 ADD_TABLE(ci2_file),
1713 ADD_TABLE(install_exec_seq),
1714 ADD_TABLE(rof_media),
1715 ADD_TABLE(property),
1718 static const msi_table mc_tables[] =
1720 ADD_TABLE(mc_component),
1721 ADD_TABLE(directory),
1722 ADD_TABLE(cc_feature),
1723 ADD_TABLE(cie_feature_comp),
1724 ADD_TABLE(mc_file),
1725 ADD_TABLE(install_exec_seq),
1726 ADD_TABLE(mc_media),
1727 ADD_TABLE(property),
1728 ADD_TABLE(mc_file_hash),
1731 static const msi_table sf_tables[] =
1733 ADD_TABLE(wrv_component),
1734 ADD_TABLE(directory),
1735 ADD_TABLE(rof_feature),
1736 ADD_TABLE(ci2_feature_comp),
1737 ADD_TABLE(ci2_file),
1738 ADD_TABLE(install_exec_seq),
1739 ADD_TABLE(rof_media),
1740 ADD_TABLE(property),
1743 static const msi_table ca51_tables[] =
1745 ADD_TABLE(ca51_component),
1746 ADD_TABLE(directory),
1747 ADD_TABLE(rof_feature),
1748 ADD_TABLE(ci2_feature_comp),
1749 ADD_TABLE(ci2_file),
1750 ADD_TABLE(ca51_install_exec_seq),
1751 ADD_TABLE(rof_media),
1752 ADD_TABLE(property),
1753 ADD_TABLE(ca51_custom_action),
1756 static const msi_table is_tables[] =
1758 ADD_TABLE(is_component),
1759 ADD_TABLE(directory),
1760 ADD_TABLE(is_feature),
1761 ADD_TABLE(is_feature_comp),
1762 ADD_TABLE(is_file),
1763 ADD_TABLE(install_exec_seq),
1764 ADD_TABLE(is_media),
1765 ADD_TABLE(property),
1768 static const msi_table sp_tables[] =
1770 ADD_TABLE(sp_component),
1771 ADD_TABLE(sp_directory),
1772 ADD_TABLE(rof_feature),
1773 ADD_TABLE(ci2_feature_comp),
1774 ADD_TABLE(ci2_file),
1775 ADD_TABLE(install_exec_seq),
1776 ADD_TABLE(rof_media),
1777 ADD_TABLE(property),
1780 static const msi_table mcp_tables[] =
1782 ADD_TABLE(mcp_component),
1783 ADD_TABLE(directory),
1784 ADD_TABLE(mcp_feature),
1785 ADD_TABLE(mcp_feature_comp),
1786 ADD_TABLE(mcp_file),
1787 ADD_TABLE(rem_install_exec_seq),
1788 ADD_TABLE(rof_media),
1789 ADD_TABLE(property),
1792 static const msi_table ai_tables[] =
1794 ADD_TABLE(component),
1795 ADD_TABLE(directory),
1796 ADD_TABLE(feature),
1797 ADD_TABLE(feature_comp),
1798 ADD_TABLE(ai_file),
1799 ADD_TABLE(install_exec_seq),
1800 ADD_TABLE(media),
1801 ADD_TABLE(property)
1804 static const msi_table pc_tables[] =
1806 ADD_TABLE(ca51_component),
1807 ADD_TABLE(directory),
1808 ADD_TABLE(rof_feature),
1809 ADD_TABLE(ci2_feature_comp),
1810 ADD_TABLE(ci2_file),
1811 ADD_TABLE(install_exec_seq),
1812 ADD_TABLE(rof_media),
1813 ADD_TABLE(property)
1816 static const msi_table ip_tables[] =
1818 ADD_TABLE(component),
1819 ADD_TABLE(directory),
1820 ADD_TABLE(feature),
1821 ADD_TABLE(feature_comp),
1822 ADD_TABLE(file),
1823 ADD_TABLE(ip_install_exec_seq),
1824 ADD_TABLE(ip_custom_action),
1825 ADD_TABLE(media),
1826 ADD_TABLE(property)
1829 static const msi_table aup_tables[] =
1831 ADD_TABLE(component),
1832 ADD_TABLE(directory),
1833 ADD_TABLE(feature),
1834 ADD_TABLE(feature_comp),
1835 ADD_TABLE(file),
1836 ADD_TABLE(aup_install_exec_seq),
1837 ADD_TABLE(aup_custom_action),
1838 ADD_TABLE(media),
1839 ADD_TABLE(property)
1842 static const msi_table aup2_tables[] =
1844 ADD_TABLE(component),
1845 ADD_TABLE(directory),
1846 ADD_TABLE(feature),
1847 ADD_TABLE(feature_comp),
1848 ADD_TABLE(file),
1849 ADD_TABLE(aup2_install_exec_seq),
1850 ADD_TABLE(aup_custom_action),
1851 ADD_TABLE(media),
1852 ADD_TABLE(aup_property)
1855 static const msi_table aup3_tables[] =
1857 ADD_TABLE(component),
1858 ADD_TABLE(directory),
1859 ADD_TABLE(feature),
1860 ADD_TABLE(feature_comp),
1861 ADD_TABLE(file),
1862 ADD_TABLE(aup2_install_exec_seq),
1863 ADD_TABLE(aup_custom_action),
1864 ADD_TABLE(media),
1865 ADD_TABLE(aup2_property)
1868 static const msi_table aup4_tables[] =
1870 ADD_TABLE(component),
1871 ADD_TABLE(directory),
1872 ADD_TABLE(feature),
1873 ADD_TABLE(feature_comp),
1874 ADD_TABLE(file),
1875 ADD_TABLE(aup3_install_exec_seq),
1876 ADD_TABLE(aup_custom_action),
1877 ADD_TABLE(media),
1878 ADD_TABLE(aup2_property)
1881 static const msi_table fiu_tables[] =
1883 ADD_TABLE(rof_component),
1884 ADD_TABLE(directory),
1885 ADD_TABLE(rof_feature),
1886 ADD_TABLE(rof_feature_comp),
1887 ADD_TABLE(rof_file),
1888 ADD_TABLE(pp_install_exec_seq),
1889 ADD_TABLE(rof_media),
1890 ADD_TABLE(property),
1893 static const msi_table fiuc_tables[] =
1895 ADD_TABLE(rof_component),
1896 ADD_TABLE(directory),
1897 ADD_TABLE(rof_feature),
1898 ADD_TABLE(rof_feature_comp),
1899 ADD_TABLE(rofc_file),
1900 ADD_TABLE(pp_install_exec_seq),
1901 ADD_TABLE(rofc_media),
1902 ADD_TABLE(property),
1905 static const msi_table sd_tables[] =
1907 ADD_TABLE(directory),
1908 ADD_TABLE(sd_component),
1909 ADD_TABLE(sd_feature),
1910 ADD_TABLE(sd_feature_comp),
1911 ADD_TABLE(sd_file),
1912 ADD_TABLE(sd_install_exec_seq),
1913 ADD_TABLE(sd_install_ui_seq),
1914 ADD_TABLE(sd_custom_action),
1915 ADD_TABLE(media),
1916 ADD_TABLE(property)
1919 static const msi_table fo_tables[] =
1921 ADD_TABLE(directory),
1922 ADD_TABLE(fo_file),
1923 ADD_TABLE(fo_component),
1924 ADD_TABLE(fo_feature),
1925 ADD_TABLE(fo_condition),
1926 ADD_TABLE(fo_feature_comp),
1927 ADD_TABLE(fo_custom_action),
1928 ADD_TABLE(fo_install_exec_seq),
1929 ADD_TABLE(media),
1930 ADD_TABLE(property)
1933 static const msi_table icon_base_tables[] =
1935 ADD_TABLE(ci_component),
1936 ADD_TABLE(directory),
1937 ADD_TABLE(rof_feature),
1938 ADD_TABLE(rof_feature_comp),
1939 ADD_TABLE(rof_file),
1940 ADD_TABLE(pp_install_exec_seq),
1941 ADD_TABLE(rof_media),
1942 ADD_TABLE(icon_property),
1945 static const msi_table pv_tables[] =
1947 ADD_TABLE(rof_component),
1948 ADD_TABLE(directory),
1949 ADD_TABLE(rof_feature),
1950 ADD_TABLE(rof_feature_comp),
1951 ADD_TABLE(rof_file),
1952 ADD_TABLE(pv_install_exec_seq),
1953 ADD_TABLE(rof_media),
1954 ADD_TABLE(property)
1957 static const msi_table cl_tables[] =
1959 ADD_TABLE(component),
1960 ADD_TABLE(directory),
1961 ADD_TABLE(feature),
1962 ADD_TABLE(feature_comp),
1963 ADD_TABLE(file),
1964 ADD_TABLE(cl_custom_action),
1965 ADD_TABLE(cl_install_exec_seq),
1966 ADD_TABLE(media),
1967 ADD_TABLE(property)
1970 static const msi_table uc_tables[] =
1972 ADD_TABLE(directory),
1973 ADD_TABLE(uc_component),
1974 ADD_TABLE(uc_feature),
1975 ADD_TABLE(uc_feature_comp),
1976 ADD_TABLE(uc_file),
1977 ADD_TABLE(uc_install_exec_seq),
1978 ADD_TABLE(media),
1979 ADD_TABLE(uc_property)
1982 static const msi_table mixed_tables[] =
1984 ADD_TABLE(directory),
1985 ADD_TABLE(mixed_component),
1986 ADD_TABLE(mixed_feature),
1987 ADD_TABLE(mixed_feature_comp),
1988 ADD_TABLE(mixed_install_exec_seq),
1989 ADD_TABLE(mixed_registry),
1990 ADD_TABLE(media),
1991 ADD_TABLE(property)
1994 /* cabinet definitions */
1996 /* make the max size large so there is only one cab file */
1997 #define MEDIA_SIZE 0x7FFFFFFF
1998 #define FOLDER_THRESHOLD 900000
2000 /* the FCI callbacks */
2002 static void * CDECL mem_alloc(ULONG cb)
2004 return HeapAlloc(GetProcessHeap(), 0, cb);
2007 static void CDECL mem_free(void *memory)
2009 HeapFree(GetProcessHeap(), 0, memory);
2012 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
2014 sprintf(pccab->szCab, pv, pccab->iCab);
2015 return TRUE;
2018 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
2020 return 0;
2023 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
2024 BOOL fContinuation, void *pv)
2026 return 0;
2029 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
2031 HANDLE handle;
2032 DWORD dwAccess = 0;
2033 DWORD dwShareMode = 0;
2034 DWORD dwCreateDisposition = OPEN_EXISTING;
2036 dwAccess = GENERIC_READ | GENERIC_WRITE;
2037 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
2038 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
2040 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
2041 dwCreateDisposition = OPEN_EXISTING;
2042 else
2043 dwCreateDisposition = CREATE_NEW;
2045 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
2046 dwCreateDisposition, 0, NULL);
2048 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
2050 return (INT_PTR)handle;
2053 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2055 HANDLE handle = (HANDLE)hf;
2056 DWORD dwRead;
2057 BOOL res;
2059 res = ReadFile(handle, memory, cb, &dwRead, NULL);
2060 ok(res, "Failed to ReadFile\n");
2062 return dwRead;
2065 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2067 HANDLE handle = (HANDLE)hf;
2068 DWORD dwWritten;
2069 BOOL res;
2071 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
2072 ok(res, "Failed to WriteFile\n");
2074 return dwWritten;
2077 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
2079 HANDLE handle = (HANDLE)hf;
2080 ok(CloseHandle(handle), "Failed to CloseHandle\n");
2082 return 0;
2085 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
2087 HANDLE handle = (HANDLE)hf;
2088 DWORD ret;
2090 ret = SetFilePointer(handle, dist, NULL, seektype);
2091 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
2093 return ret;
2096 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
2098 BOOL ret = DeleteFileA(pszFile);
2099 ok(ret, "Failed to DeleteFile %s\n", pszFile);
2101 return 0;
2104 static void init_functionpointers(void)
2106 HMODULE hmsi = GetModuleHandleA("msi.dll");
2107 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2108 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2110 #define GET_PROC(mod, func) \
2111 p ## func = (void*)GetProcAddress(mod, #func); \
2112 if(!p ## func) \
2113 trace("GetProcAddress(%s) failed\n", #func);
2115 GET_PROC(hmsi, MsiQueryComponentStateA);
2116 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
2117 GET_PROC(hmsi, MsiSourceListGetInfoA);
2118 GET_PROC(hmsi, MsiGetComponentPathExA);
2120 GET_PROC(hadvapi32, ConvertSidToStringSidA);
2121 GET_PROC(hadvapi32, OpenProcessToken);
2122 GET_PROC(hadvapi32, RegDeleteKeyExA)
2123 GET_PROC(hkernel32, IsWow64Process)
2125 hsrclient = LoadLibraryA("srclient.dll");
2126 GET_PROC(hsrclient, SRRemoveRestorePoint);
2127 GET_PROC(hsrclient, SRSetRestorePointA);
2129 #undef GET_PROC
2132 static BOOL is_process_limited(void)
2134 HANDLE token;
2136 if (!pOpenProcessToken) return FALSE;
2138 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
2140 BOOL ret;
2141 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
2142 DWORD size;
2144 ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
2145 CloseHandle(token);
2146 return (ret && type == TokenElevationTypeLimited);
2148 return FALSE;
2151 static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val)
2153 CHAR buffer[0x20];
2154 UINT r;
2155 DWORD sz;
2157 sz = sizeof buffer;
2158 r = MsiRecordGetString(rec, field, buffer, &sz);
2159 return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
2162 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
2164 LPSTR tempname;
2166 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
2167 GetTempFileNameA(".", "xx", 0, tempname);
2169 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2171 lstrcpyA(pszTempName, tempname);
2172 HeapFree(GetProcessHeap(), 0, tempname);
2173 return TRUE;
2176 HeapFree(GetProcessHeap(), 0, tempname);
2178 return FALSE;
2181 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
2182 USHORT *pattribs, int *err, void *pv)
2184 BY_HANDLE_FILE_INFORMATION finfo;
2185 FILETIME filetime;
2186 HANDLE handle;
2187 DWORD attrs;
2188 BOOL res;
2190 handle = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
2191 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
2193 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2195 res = GetFileInformationByHandle(handle, &finfo);
2196 ok(res, "Expected GetFileInformationByHandle to succeed\n");
2198 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
2199 FileTimeToDosDateTime(&filetime, pdate, ptime);
2201 attrs = GetFileAttributes(pszName);
2202 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2204 return (INT_PTR)handle;
2207 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
2209 char path[MAX_PATH];
2210 char filename[MAX_PATH];
2212 lstrcpyA(path, CURR_DIR);
2213 lstrcatA(path, "\\");
2214 lstrcatA(path, file);
2216 lstrcpyA(filename, file);
2218 return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
2219 progress, get_open_info, compress);
2222 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
2224 ZeroMemory(pCabParams, sizeof(CCAB));
2226 pCabParams->cb = max_size;
2227 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2228 pCabParams->setID = 0xbeef;
2229 pCabParams->iCab = 1;
2230 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2231 lstrcatA(pCabParams->szCabPath, "\\");
2232 lstrcpyA(pCabParams->szCab, name);
2235 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
2237 CCAB cabParams;
2238 LPCSTR ptr;
2239 HFCI hfci;
2240 ERF erf;
2241 BOOL res;
2243 set_cab_parameters(&cabParams, name, max_size);
2245 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
2246 fci_read, fci_write, fci_close, fci_seek, fci_delete,
2247 get_temp_file, &cabParams, NULL);
2249 ok(hfci != NULL, "Failed to create an FCI context\n");
2251 ptr = files;
2252 while (*ptr)
2254 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2255 ok(res, "Failed to add file: %s\n", ptr);
2256 ptr += lstrlen(ptr) + 1;
2259 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
2260 ok(res, "Failed to flush the cabinet\n");
2262 res = FCIDestroy(hfci);
2263 ok(res, "Failed to destroy the cabinet\n");
2266 static BOOL get_user_dirs(void)
2268 HKEY hkey;
2269 DWORD type, size;
2271 if(RegOpenKey(HKEY_CURRENT_USER,
2272 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
2273 &hkey))
2274 return FALSE;
2276 size = MAX_PATH;
2277 if(RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size)){
2278 RegCloseKey(hkey);
2279 return FALSE;
2282 RegCloseKey(hkey);
2283 return TRUE;
2286 static BOOL get_system_dirs(void)
2288 HKEY hkey;
2289 DWORD type, size;
2291 if (RegOpenKey(HKEY_LOCAL_MACHINE,
2292 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
2293 return FALSE;
2295 size = MAX_PATH;
2296 if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
2297 RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size)) {
2298 RegCloseKey(hkey);
2299 return FALSE;
2302 size = MAX_PATH;
2303 if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
2304 RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size)) {
2305 RegCloseKey(hkey);
2306 return FALSE;
2309 size = MAX_PATH;
2310 if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR_NATIVE, &size)) {
2311 RegCloseKey(hkey);
2312 return FALSE;
2315 RegCloseKey(hkey);
2317 if(!GetWindowsDirectoryA(WINDOWS_DIR, MAX_PATH))
2318 return FALSE;
2320 return TRUE;
2323 static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
2325 HANDLE file;
2326 DWORD written;
2328 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
2329 if (file == INVALID_HANDLE_VALUE)
2330 return;
2332 WriteFile(file, data, strlen(data), &written, NULL);
2334 if (size)
2336 SetFilePointer(file, size, NULL, FILE_BEGIN);
2337 SetEndOfFile(file);
2340 CloseHandle(file);
2343 #define create_file(name, size) create_file_data(name, name, size)
2345 static void create_test_files(void)
2347 CreateDirectoryA("msitest", NULL);
2348 create_file("msitest\\one.txt", 100);
2349 CreateDirectoryA("msitest\\first", NULL);
2350 create_file("msitest\\first\\two.txt", 100);
2351 CreateDirectoryA("msitest\\second", NULL);
2352 create_file("msitest\\second\\three.txt", 100);
2354 create_file("four.txt", 100);
2355 create_file("five.txt", 100);
2356 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2358 create_file("msitest\\filename", 100);
2359 create_file("msitest\\service.exe", 100);
2361 DeleteFileA("four.txt");
2362 DeleteFileA("five.txt");
2365 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
2367 CHAR path[MAX_PATH];
2369 lstrcpyA(path, PROG_FILES_DIR);
2370 lstrcatA(path, "\\");
2371 lstrcatA(path, rel_path);
2373 if (is_file)
2374 return DeleteFileA(path);
2375 else
2376 return RemoveDirectoryA(path);
2379 static BOOL delete_pf_native(const CHAR *rel_path, BOOL is_file)
2381 CHAR path[MAX_PATH];
2383 lstrcpyA(path, PROG_FILES_DIR_NATIVE);
2384 lstrcatA(path, "\\");
2385 lstrcatA(path, rel_path);
2387 if (is_file)
2388 return DeleteFileA(path);
2389 else
2390 return RemoveDirectoryA(path);
2393 static BOOL delete_cf(const CHAR *rel_path, BOOL is_file)
2395 CHAR path[MAX_PATH];
2397 lstrcpyA(path, COMMON_FILES_DIR);
2398 lstrcatA(path, "\\");
2399 lstrcatA(path, rel_path);
2401 if (is_file)
2402 return DeleteFileA(path);
2403 else
2404 return RemoveDirectoryA(path);
2407 static BOOL compare_pf_data(const char *filename, const char *data, DWORD size)
2409 DWORD read;
2410 HANDLE handle;
2411 BOOL ret = FALSE;
2412 char *buffer, path[MAX_PATH];
2414 lstrcpyA(path, PROG_FILES_DIR);
2415 lstrcatA(path, "\\");
2416 lstrcatA(path, filename);
2418 handle = CreateFileA(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2419 buffer = HeapAlloc(GetProcessHeap(), 0, size);
2420 if (buffer)
2422 ReadFile(handle, buffer, size, &read, NULL);
2423 if (read == size && !memcmp(data, buffer, size)) ret = TRUE;
2424 HeapFree(GetProcessHeap(), 0, buffer);
2426 CloseHandle(handle);
2427 return ret;
2430 static void delete_test_files(void)
2432 DeleteFileA("msitest.msi");
2433 DeleteFileA("msitest.cab");
2434 DeleteFileA("msitest\\second\\three.txt");
2435 DeleteFileA("msitest\\first\\two.txt");
2436 DeleteFileA("msitest\\one.txt");
2437 DeleteFileA("msitest\\service.exe");
2438 DeleteFileA("msitest\\filename");
2439 RemoveDirectoryA("msitest\\second");
2440 RemoveDirectoryA("msitest\\first");
2441 RemoveDirectoryA("msitest");
2444 static void write_file(const CHAR *filename, const char *data, int data_size)
2446 DWORD size;
2448 HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
2449 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
2451 WriteFile(hf, data, data_size, &size, NULL);
2452 CloseHandle(hf);
2455 static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template)
2457 MSIHANDLE summary;
2458 UINT r;
2460 r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
2461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2463 r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template);
2464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2466 r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL,
2467 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2468 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2470 r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, version, NULL, NULL);
2471 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2473 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
2474 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2476 r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
2477 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2479 /* write the summary changes back to the stream */
2480 r = MsiSummaryInfoPersist(summary);
2481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2483 MsiCloseHandle(summary);
2486 #define create_database(name, tables, num_tables) \
2487 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2489 #define create_database_template(name, tables, num_tables, version, template) \
2490 create_database_wordcount(name, tables, num_tables, version, 0, template);
2492 static void create_database_wordcount(const CHAR *name, const msi_table *tables,
2493 int num_tables, INT version, INT wordcount,
2494 const char *template)
2496 MSIHANDLE db;
2497 UINT r;
2498 int j;
2500 r = MsiOpenDatabaseA(name, MSIDBOPEN_CREATE, &db);
2501 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2503 /* import the tables into the database */
2504 for (j = 0; j < num_tables; j++)
2506 const msi_table *table = &tables[j];
2508 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2510 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2513 DeleteFileA(table->filename);
2516 write_msi_summary_info(db, version, wordcount, template);
2518 r = MsiDatabaseCommit(db);
2519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2521 MsiCloseHandle(db);
2524 static void check_service_is_installed(void)
2526 SC_HANDLE scm, service;
2527 BOOL res;
2529 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
2530 ok(scm != NULL, "Failed to open the SC Manager\n");
2532 service = OpenService(scm, "TestService", SC_MANAGER_ALL_ACCESS);
2533 ok(service != NULL, "Failed to open TestService\n");
2535 res = DeleteService(service);
2536 ok(res, "Failed to delete TestService\n");
2538 CloseServiceHandle(service);
2539 CloseServiceHandle(scm);
2542 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
2544 RESTOREPOINTINFOA spec;
2546 spec.dwEventType = event_type;
2547 spec.dwRestorePtType = APPLICATION_INSTALL;
2548 spec.llSequenceNumber = status->llSequenceNumber;
2549 lstrcpyA(spec.szDescription, "msitest restore point");
2551 return pSRSetRestorePointA(&spec, status);
2554 static void remove_restore_point(DWORD seq_number)
2556 DWORD res;
2558 res = pSRRemoveRestorePoint(seq_number);
2559 if (res != ERROR_SUCCESS)
2560 trace("Failed to remove the restore point : %08x\n", res);
2563 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
2565 if (pRegDeleteKeyExA)
2566 return pRegDeleteKeyExA( key, subkey, access, 0 );
2567 return RegDeleteKeyA( key, subkey );
2570 static void test_MsiInstallProduct(void)
2572 UINT r;
2573 CHAR path[MAX_PATH];
2574 LONG res;
2575 HKEY hkey;
2576 DWORD num, size, type;
2577 REGSAM access = KEY_ALL_ACCESS;
2579 if (is_process_limited())
2581 skip("process is limited\n");
2582 return;
2585 if (is_wow64)
2586 access |= KEY_WOW64_64KEY;
2588 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
2590 /* szPackagePath is NULL */
2591 r = MsiInstallProductA(NULL, "INSTALL=ALL");
2592 ok(r == ERROR_INVALID_PARAMETER,
2593 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2595 /* both szPackagePath and szCommandLine are NULL */
2596 r = MsiInstallProductA(NULL, NULL);
2597 ok(r == ERROR_INVALID_PARAMETER,
2598 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
2600 /* szPackagePath is empty */
2601 r = MsiInstallProductA("", "INSTALL=ALL");
2602 ok(r == ERROR_PATH_NOT_FOUND,
2603 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r);
2605 create_test_files();
2606 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
2608 /* install, don't publish */
2609 r = MsiInstallProductA(msifile, NULL);
2610 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2612 skip("Not enough rights to perform tests\n");
2613 goto error;
2615 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2617 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2618 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2619 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2620 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2621 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2622 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2623 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2624 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2625 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2626 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2627 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2628 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2630 res = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", 0, access, &hkey);
2631 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2633 size = MAX_PATH;
2634 type = REG_SZ;
2635 res = RegQueryValueExA(hkey, "Name", NULL, &type, (LPBYTE)path, &size);
2636 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2637 ok(!lstrcmpA(path, "imaname"), "Expected imaname, got %s\n", path);
2639 size = MAX_PATH;
2640 type = REG_SZ;
2641 res = RegQueryValueExA(hkey, "blah", NULL, &type, (LPBYTE)path, &size);
2642 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2644 size = sizeof(num);
2645 type = REG_DWORD;
2646 res = RegQueryValueExA(hkey, "number", NULL, &type, (LPBYTE)&num, &size);
2647 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2648 ok(num == 314, "Expected 314, got %d\n", num);
2650 size = MAX_PATH;
2651 type = REG_SZ;
2652 res = RegQueryValueExA(hkey, "OrderTestName", NULL, &type, (LPBYTE)path, &size);
2653 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2654 ok(!lstrcmpA(path, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path);
2656 check_service_is_installed();
2658 delete_key(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access);
2660 /* not published, reinstall */
2661 r = MsiInstallProductA(msifile, NULL);
2662 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2664 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2665 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2666 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2667 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2668 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2669 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2670 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2671 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2672 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2673 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2674 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2675 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2677 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2678 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2679 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
2681 create_database(msifile, up_tables, sizeof(up_tables) / sizeof(msi_table));
2683 /* not published, RemovePreviousVersions set */
2684 r = MsiInstallProductA(msifile, NULL);
2685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2687 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2688 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2689 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2690 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2691 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2692 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2693 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2694 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2695 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2696 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2697 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2698 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2700 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2701 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2702 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
2704 create_database(msifile, up2_tables, sizeof(up2_tables) / sizeof(msi_table));
2706 /* not published, version number bumped */
2707 r = MsiInstallProductA(msifile, NULL);
2708 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2710 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2711 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2712 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2713 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2714 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2715 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2716 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2717 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2718 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2719 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2720 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2721 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2723 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2724 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2725 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
2727 create_database(msifile, up3_tables, sizeof(up3_tables) / sizeof(msi_table));
2729 /* not published, RemovePreviousVersions set and version number bumped */
2730 r = MsiInstallProductA(msifile, NULL);
2731 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2733 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2734 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2735 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2736 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2737 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2738 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2739 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2740 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2741 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2742 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2743 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2744 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2746 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2747 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2748 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
2750 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
2752 /* install, publish product */
2753 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
2754 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2756 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2757 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2758 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2759 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2760 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2761 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2762 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2763 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2764 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2765 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2766 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2767 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2769 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2770 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2772 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
2774 /* published, reinstall */
2775 r = MsiInstallProductA(msifile, NULL);
2776 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2778 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2779 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2780 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2781 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2782 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2783 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2784 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2785 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2786 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2787 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2788 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2789 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2791 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2792 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2794 create_database(msifile, up5_tables, sizeof(up5_tables) / sizeof(msi_table));
2796 /* published product, RemovePreviousVersions set */
2797 r = MsiInstallProductA(msifile, NULL);
2798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2800 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2801 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2802 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2803 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2804 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2805 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2806 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2807 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2808 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2809 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2810 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2811 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2813 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2814 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2816 create_database(msifile, up6_tables, sizeof(up6_tables) / sizeof(msi_table));
2818 /* published product, version number bumped */
2819 r = MsiInstallProductA(msifile, NULL);
2820 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2822 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2823 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2824 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2825 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2826 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2827 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2828 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2829 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2830 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2831 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2832 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2833 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2835 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2836 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2838 create_database(msifile, up7_tables, sizeof(up7_tables) / sizeof(msi_table));
2840 /* published product, RemovePreviousVersions set and version number bumped */
2841 r = MsiInstallProductA(msifile, NULL);
2842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2844 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2845 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2846 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2847 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2848 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2849 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2850 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2851 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2852 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2853 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2854 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
2855 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2857 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
2858 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2860 r = MsiInstallProductA(msifile, "REMOVE=ALL");
2861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2863 error:
2864 delete_test_files();
2865 DeleteFileA(msifile);
2868 static void test_MsiSetComponentState(void)
2870 INSTALLSTATE installed, action;
2871 MSIHANDLE package;
2872 char path[MAX_PATH];
2873 UINT r;
2875 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
2877 CoInitialize(NULL);
2879 lstrcpy(path, CURR_DIR);
2880 lstrcat(path, "\\");
2881 lstrcat(path, msifile);
2883 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
2885 r = MsiOpenPackage(path, &package);
2886 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2888 skip("Not enough rights to perform tests\n");
2889 goto error;
2891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2893 r = MsiDoAction(package, "CostInitialize");
2894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2896 r = MsiDoAction(package, "FileCost");
2897 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2899 r = MsiDoAction(package, "CostFinalize");
2900 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2902 r = MsiGetComponentState(package, "dangler", &installed, &action);
2903 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2904 ok(installed == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", installed);
2905 ok(action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
2907 r = MsiSetComponentState(package, "dangler", INSTALLSTATE_SOURCE);
2908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2910 MsiCloseHandle(package);
2912 error:
2913 CoUninitialize();
2914 DeleteFileA(msifile);
2917 static void test_packagecoltypes(void)
2919 MSIHANDLE hdb, view, rec;
2920 char path[MAX_PATH];
2921 LPCSTR query;
2922 UINT r, count;
2924 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
2926 CoInitialize(NULL);
2928 lstrcpy(path, CURR_DIR);
2929 lstrcat(path, "\\");
2930 lstrcat(path, msifile);
2932 r = MsiOpenDatabase(path, MSIDBOPEN_READONLY, &hdb);
2933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2935 query = "SELECT * FROM `Media`";
2936 r = MsiDatabaseOpenView( hdb, query, &view );
2937 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
2939 r = MsiViewGetColumnInfo( view, MSICOLINFO_NAMES, &rec );
2940 count = MsiRecordGetFieldCount( rec );
2941 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
2942 ok(count == 6, "Expected 6, got %d\n", count);
2943 ok(check_record(rec, 1, "DiskId"), "wrong column label\n");
2944 ok(check_record(rec, 2, "LastSequence"), "wrong column label\n");
2945 ok(check_record(rec, 3, "DiskPrompt"), "wrong column label\n");
2946 ok(check_record(rec, 4, "Cabinet"), "wrong column label\n");
2947 ok(check_record(rec, 5, "VolumeLabel"), "wrong column label\n");
2948 ok(check_record(rec, 6, "Source"), "wrong column label\n");
2949 MsiCloseHandle(rec);
2951 r = MsiViewGetColumnInfo( view, MSICOLINFO_TYPES, &rec );
2952 count = MsiRecordGetFieldCount( rec );
2953 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
2954 ok(count == 6, "Expected 6, got %d\n", count);
2955 ok(check_record(rec, 1, "i2"), "wrong column label\n");
2956 ok(check_record(rec, 2, "i4"), "wrong column label\n");
2957 ok(check_record(rec, 3, "L64"), "wrong column label\n");
2958 ok(check_record(rec, 4, "S255"), "wrong column label\n");
2959 ok(check_record(rec, 5, "S32"), "wrong column label\n");
2960 ok(check_record(rec, 6, "S72"), "wrong column label\n");
2962 MsiCloseHandle(rec);
2963 MsiCloseHandle(view);
2964 MsiCloseHandle(hdb);
2965 CoUninitialize();
2967 DeleteFile(msifile);
2970 static void create_cc_test_files(void)
2972 CCAB cabParams;
2973 HFCI hfci;
2974 ERF erf;
2975 static CHAR cab_context[] = "test%d.cab";
2976 BOOL res;
2978 create_file("maximus", 500);
2979 create_file("augustus", 50000);
2980 create_file("tiberius", 500);
2981 create_file("caesar", 500);
2983 set_cab_parameters(&cabParams, "test1.cab", 40000);
2985 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
2986 fci_read, fci_write, fci_close, fci_seek, fci_delete,
2987 get_temp_file, &cabParams, cab_context);
2988 ok(hfci != NULL, "Failed to create an FCI context\n");
2990 res = add_file(hfci, "maximus", tcompTYPE_NONE);
2991 ok(res, "Failed to add file maximus\n");
2993 res = add_file(hfci, "augustus", tcompTYPE_NONE);
2994 ok(res, "Failed to add file augustus\n");
2996 res = add_file(hfci, "tiberius", tcompTYPE_NONE);
2997 ok(res, "Failed to add file tiberius\n");
2999 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
3000 ok(res, "Failed to flush the cabinet\n");
3002 res = FCIDestroy(hfci);
3003 ok(res, "Failed to destroy the cabinet\n");
3005 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3007 DeleteFile("maximus");
3008 DeleteFile("augustus");
3009 DeleteFile("tiberius");
3010 DeleteFile("caesar");
3013 static void delete_cab_files(void)
3015 SHFILEOPSTRUCT shfl;
3016 CHAR path[MAX_PATH+10];
3018 lstrcpyA(path, CURR_DIR);
3019 lstrcatA(path, "\\*.cab");
3020 path[strlen(path) + 1] = '\0';
3022 shfl.hwnd = NULL;
3023 shfl.wFunc = FO_DELETE;
3024 shfl.pFrom = path;
3025 shfl.pTo = NULL;
3026 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT;
3028 SHFileOperation(&shfl);
3031 static void test_continuouscabs(void)
3033 UINT r;
3035 if (is_process_limited())
3037 skip("process is limited\n");
3038 return;
3041 create_cc_test_files();
3042 create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
3044 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3046 r = MsiInstallProductA(msifile, NULL);
3047 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3049 skip("Not enough rights to perform tests\n");
3051 else
3053 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3054 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3055 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3056 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3057 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3060 delete_cab_files();
3061 DeleteFile(msifile);
3063 create_cc_test_files();
3064 create_database(msifile, cc2_tables, sizeof(cc2_tables) / sizeof(msi_table));
3066 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3068 r = MsiInstallProductA(msifile, NULL);
3069 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3071 skip("Not enough rights to perform tests\n");
3073 else
3075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3076 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3077 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3078 ok(delete_pf("msitest\\tiberius", TRUE), "File not installed\n");
3079 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3080 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3083 delete_cab_files();
3084 DeleteFile(msifile);
3086 /* Tests to show that only msi cab filename is taken in case of mismatch with the one given by previous cab */
3088 /* Filename from cab is right and the one from msi is wrong */
3089 create_cc_test_files();
3090 create_database(msifile, cc3_tables, sizeof(cc3_tables) / sizeof(msi_table));
3092 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3094 r = MsiInstallProductA(msifile, NULL);
3095 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3097 skip("Not enough rights to perform tests\n");
3099 else
3101 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAIRE, got %u\n", r);
3102 todo_wine ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3103 ok(!delete_pf("msitest\\caesar", TRUE), "File installed\n");
3104 todo_wine ok(!delete_pf("msitest\\maximus", TRUE), "File installed\n");
3105 todo_wine ok(!delete_pf("msitest", FALSE), "Directory created\n");
3108 delete_cab_files();
3109 DeleteFile(msifile);
3111 /* Filename from msi is right and the one from cab is wrong */
3112 create_cc_test_files();
3113 ok(MoveFile("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
3114 create_database(msifile, cc3_tables, sizeof(cc3_tables) / sizeof(msi_table));
3116 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3118 r = MsiInstallProductA(msifile, NULL);
3119 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3121 skip("Not enough rights to perform tests\n");
3123 else
3125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3126 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3127 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3128 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3129 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3132 delete_cab_files();
3133 DeleteFile(msifile);
3136 static void test_caborder(void)
3138 UINT r;
3140 create_file("imperator", 100);
3141 create_file("maximus", 500);
3142 create_file("augustus", 50000);
3143 create_file("caesar", 500);
3145 create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
3147 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3149 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
3150 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
3151 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3153 r = MsiInstallProductA(msifile, NULL);
3154 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3156 skip("Not enough rights to perform tests\n");
3157 goto error;
3159 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3160 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3161 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3162 todo_wine
3164 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3165 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3168 delete_cab_files();
3170 create_cab_file("test1.cab", MEDIA_SIZE, "imperator\0");
3171 create_cab_file("test2.cab", MEDIA_SIZE, "maximus\0augustus\0");
3172 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3174 r = MsiInstallProductA(msifile, NULL);
3175 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3176 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3177 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3178 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3179 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3181 delete_cab_files();
3182 DeleteFile(msifile);
3184 create_cc_test_files();
3185 create_database(msifile, co_tables, sizeof(co_tables) / sizeof(msi_table));
3187 r = MsiInstallProductA(msifile, NULL);
3188 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3189 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3190 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3191 todo_wine
3193 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3194 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3197 delete_cab_files();
3198 DeleteFile(msifile);
3200 create_cc_test_files();
3201 create_database(msifile, co2_tables, sizeof(co2_tables) / sizeof(msi_table));
3203 r = MsiInstallProductA(msifile, NULL);
3204 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3205 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3206 todo_wine
3208 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3209 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3210 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3213 error:
3214 delete_cab_files();
3215 DeleteFile("imperator");
3216 DeleteFile("maximus");
3217 DeleteFile("augustus");
3218 DeleteFile("caesar");
3219 DeleteFile(msifile);
3222 static void test_mixedmedia(void)
3224 UINT r;
3226 if (is_process_limited())
3228 skip("process is limited\n");
3229 return;
3232 CreateDirectoryA("msitest", NULL);
3233 create_file("msitest\\maximus", 500);
3234 create_file("msitest\\augustus", 500);
3235 create_file("caesar", 500);
3237 create_database(msifile, mm_tables, sizeof(mm_tables) / sizeof(msi_table));
3239 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3241 create_cab_file("test1.cab", MEDIA_SIZE, "caesar\0");
3243 r = MsiInstallProductA(msifile, NULL);
3244 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3246 skip("Not enough rights to perform tests\n");
3247 goto error;
3249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3250 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3251 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3252 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3253 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3255 error:
3256 /* Delete the files in the temp (current) folder */
3257 DeleteFile("msitest\\maximus");
3258 DeleteFile("msitest\\augustus");
3259 RemoveDirectory("msitest");
3260 DeleteFile("caesar");
3261 DeleteFile("test1.cab");
3262 DeleteFile(msifile);
3265 static void test_samesequence(void)
3267 UINT r;
3269 create_cc_test_files();
3270 create_database(msifile, ss_tables, sizeof(ss_tables) / sizeof(msi_table));
3272 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3274 r = MsiInstallProductA(msifile, NULL);
3275 ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE), "Expected ERROR_SUCCESS, got %u\n", r);
3276 if (r == ERROR_SUCCESS)
3278 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3279 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3280 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3281 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3283 delete_cab_files();
3284 DeleteFile(msifile);
3287 static void test_uiLevelFlags(void)
3289 UINT r;
3291 create_cc_test_files();
3292 create_database(msifile, ui_tables, sizeof(ui_tables) / sizeof(msi_table));
3294 MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL);
3296 r = MsiInstallProductA(msifile, NULL);
3297 ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE), "Expected ERROR_SUCCESS, got %u\n", r);
3298 if (r == ERROR_SUCCESS)
3300 ok(!delete_pf("msitest\\maximus", TRUE), "UI install occurred, but execute-only was requested.\n");
3301 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3302 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3303 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3305 delete_cab_files();
3306 DeleteFile(msifile);
3309 static BOOL file_matches(LPSTR path)
3311 CHAR buf[MAX_PATH];
3312 HANDLE file;
3313 DWORD size;
3315 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
3316 NULL, OPEN_EXISTING, 0, NULL);
3318 ZeroMemory(buf, MAX_PATH);
3319 ReadFile(file, buf, 15, &size, NULL);
3320 CloseHandle(file);
3322 return !lstrcmp(buf, "msitest\\maximus");
3325 static void test_readonlyfile(void)
3327 UINT r;
3328 DWORD size;
3329 HANDLE file;
3330 CHAR path[MAX_PATH];
3332 if (is_process_limited())
3334 skip("process is limited\n");
3335 return;
3338 CreateDirectoryA("msitest", NULL);
3339 create_file("msitest\\maximus", 500);
3340 create_database(msifile, rof_tables, sizeof(rof_tables) / sizeof(msi_table));
3342 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3344 lstrcpy(path, PROG_FILES_DIR);
3345 lstrcat(path, "\\msitest");
3346 CreateDirectory(path, NULL);
3348 lstrcat(path, "\\maximus");
3349 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
3350 NULL, CREATE_NEW, FILE_ATTRIBUTE_READONLY, NULL);
3352 WriteFile(file, "readonlyfile", strlen("readonlyfile"), &size, NULL);
3353 CloseHandle(file);
3355 r = MsiInstallProductA(msifile, NULL);
3356 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3358 skip("Not enough rights to perform tests\n");
3359 goto error;
3361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3362 ok(file_matches(path), "Expected file to be overwritten\n");
3363 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3364 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3366 error:
3367 /* Delete the files in the temp (current) folder */
3368 DeleteFile("msitest\\maximus");
3369 RemoveDirectory("msitest");
3370 DeleteFile(msifile);
3373 static void test_readonlyfile_cab(void)
3375 UINT r;
3376 DWORD size;
3377 HANDLE file;
3378 CHAR path[MAX_PATH];
3379 CHAR buf[16];
3381 if (is_process_limited())
3383 skip("process is limited\n");
3384 return;
3387 CreateDirectoryA("msitest", NULL);
3388 create_file("maximus", 500);
3389 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
3390 DeleteFile("maximus");
3392 create_database(msifile, rofc_tables, sizeof(rofc_tables) / sizeof(msi_table));
3394 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3396 lstrcpy(path, PROG_FILES_DIR);
3397 lstrcat(path, "\\msitest");
3398 CreateDirectory(path, NULL);
3400 lstrcat(path, "\\maximus");
3401 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
3402 NULL, CREATE_NEW, FILE_ATTRIBUTE_READONLY, NULL);
3404 WriteFile(file, "readonlyfile", strlen("readonlyfile"), &size, NULL);
3405 CloseHandle(file);
3407 r = MsiInstallProductA(msifile, NULL);
3408 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3410 skip("Not enough rights to perform tests\n");
3411 goto error;
3413 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3415 memset( buf, 0, sizeof(buf) );
3416 if ((file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
3417 NULL, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE)
3419 ReadFile(file, buf, sizeof(buf) - 1, &size, NULL);
3420 CloseHandle(file);
3422 ok(!memcmp( buf, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf);
3423 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3424 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3426 error:
3427 /* Delete the files in the temp (current) folder */
3428 delete_cab_files();
3429 DeleteFile("msitest\\maximus");
3430 RemoveDirectory("msitest");
3431 DeleteFile(msifile);
3434 static BOOL add_cabinet_storage(LPCSTR db, LPCSTR cabinet)
3436 WCHAR dbW[MAX_PATH], cabinetW[MAX_PATH];
3437 IStorage *stg;
3438 IStream *stm;
3439 HRESULT hr;
3440 HANDLE handle;
3442 MultiByteToWideChar(CP_ACP, 0, db, -1, dbW, MAX_PATH);
3443 hr = StgOpenStorage(dbW, NULL, STGM_DIRECT|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, NULL, 0, &stg);
3444 if (FAILED(hr))
3445 return FALSE;
3447 MultiByteToWideChar(CP_ACP, 0, cabinet, -1, cabinetW, MAX_PATH);
3448 hr = IStorage_CreateStream(stg, cabinetW, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
3449 if (FAILED(hr))
3451 IStorage_Release(stg);
3452 return FALSE;
3455 handle = CreateFileW(cabinetW, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
3456 if (handle != INVALID_HANDLE_VALUE)
3458 DWORD count;
3459 char buffer[1024];
3460 if (ReadFile(handle, buffer, sizeof(buffer), &count, NULL))
3461 IStream_Write(stm, buffer, count, &count);
3462 CloseHandle(handle);
3465 IStream_Release(stm);
3466 IStorage_Release(stg);
3468 return TRUE;
3471 static void test_lastusedsource(void)
3473 static char prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3475 UINT r;
3476 char value[MAX_PATH], path[MAX_PATH];
3477 DWORD size;
3479 if (!pMsiSourceListGetInfoA)
3481 win_skip("MsiSourceListGetInfoA is not available\n");
3482 return;
3485 CreateDirectoryA("msitest", NULL);
3486 create_file("maximus", 500);
3487 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
3488 DeleteFile("maximus");
3490 create_database("msifile0.msi", lus0_tables, sizeof(lus0_tables) / sizeof(msi_table));
3491 create_database("msifile1.msi", lus1_tables, sizeof(lus1_tables) / sizeof(msi_table));
3492 create_database("msifile2.msi", lus2_tables, sizeof(lus2_tables) / sizeof(msi_table));
3494 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3496 /* no cabinet file */
3498 size = MAX_PATH;
3499 lstrcpyA(value, "aaa");
3500 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3501 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
3502 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
3503 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
3505 r = MsiInstallProductA("msifile0.msi", "PUBLISH_PRODUCT=1");
3506 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3508 skip("Not enough rights to perform tests\n");
3509 goto error;
3511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3513 lstrcpyA(path, CURR_DIR);
3514 lstrcatA(path, "\\");
3516 size = MAX_PATH;
3517 lstrcpyA(value, "aaa");
3518 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3519 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
3520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3521 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
3522 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
3524 r = MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
3525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3527 /* separate cabinet file */
3529 size = MAX_PATH;
3530 lstrcpyA(value, "aaa");
3531 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3532 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
3533 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
3534 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
3536 r = MsiInstallProductA("msifile1.msi", "PUBLISH_PRODUCT=1");
3537 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3539 lstrcpyA(path, CURR_DIR);
3540 lstrcatA(path, "\\");
3542 size = MAX_PATH;
3543 lstrcpyA(value, "aaa");
3544 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3545 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
3546 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3547 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
3548 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
3550 r = MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
3551 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3553 size = MAX_PATH;
3554 lstrcpyA(value, "aaa");
3555 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3556 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
3557 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
3558 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
3560 /* embedded cabinet stream */
3562 add_cabinet_storage("msifile2.msi", "test1.cab");
3564 r = MsiInstallProductA("msifile2.msi", "PUBLISH_PRODUCT=1");
3565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3567 size = MAX_PATH;
3568 lstrcpyA(value, "aaa");
3569 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3570 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
3571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3572 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
3573 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
3575 r = MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
3576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3578 size = MAX_PATH;
3579 lstrcpyA(value, "aaa");
3580 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3581 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
3582 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
3583 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
3585 error:
3586 /* Delete the files in the temp (current) folder */
3587 delete_cab_files();
3588 DeleteFile("msitest\\maximus");
3589 RemoveDirectory("msitest");
3590 DeleteFile("msifile0.msi");
3591 DeleteFile("msifile1.msi");
3592 DeleteFile("msifile2.msi");
3595 static void test_setdirproperty(void)
3597 UINT r;
3599 if (is_process_limited())
3601 skip("process is limited\n");
3602 return;
3605 CreateDirectoryA("msitest", NULL);
3606 create_file("msitest\\maximus", 500);
3607 create_database(msifile, sdp_tables, sizeof(sdp_tables) / sizeof(msi_table));
3609 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3611 r = MsiInstallProductA(msifile, NULL);
3612 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3614 skip("Not enough rights to perform tests\n");
3615 goto error;
3617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3618 ok(delete_cf("msitest\\maximus", TRUE), "File not installed\n");
3619 ok(delete_cf("msitest", FALSE), "Directory not created\n");
3621 error:
3622 /* Delete the files in the temp (current) folder */
3623 DeleteFile(msifile);
3624 DeleteFile("msitest\\maximus");
3625 RemoveDirectory("msitest");
3628 static void test_cabisextracted(void)
3630 UINT r;
3632 if (is_process_limited())
3634 skip("process is limited\n");
3635 return;
3638 CreateDirectoryA("msitest", NULL);
3639 create_file("msitest\\gaius", 500);
3640 create_file("maximus", 500);
3641 create_file("augustus", 500);
3642 create_file("caesar", 500);
3644 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
3645 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
3646 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3648 create_database(msifile, cie_tables, sizeof(cie_tables) / sizeof(msi_table));
3650 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3652 r = MsiInstallProductA(msifile, NULL);
3653 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3655 skip("Not enough rights to perform tests\n");
3656 goto error;
3658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3659 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3660 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3661 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3662 ok(delete_pf("msitest\\gaius", TRUE), "File not installed\n");
3663 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3665 error:
3666 /* Delete the files in the temp (current) folder */
3667 delete_cab_files();
3668 DeleteFile(msifile);
3669 DeleteFile("maximus");
3670 DeleteFile("augustus");
3671 DeleteFile("caesar");
3672 DeleteFile("msitest\\gaius");
3673 RemoveDirectory("msitest");
3676 static void test_concurrentinstall(void)
3678 UINT r;
3679 CHAR path[MAX_PATH];
3681 if (is_process_limited())
3683 skip("process is limited\n");
3684 return;
3687 CreateDirectoryA("msitest", NULL);
3688 CreateDirectoryA("msitest\\msitest", NULL);
3689 create_file("msitest\\maximus", 500);
3690 create_file("msitest\\msitest\\augustus", 500);
3692 create_database(msifile, ci_tables, sizeof(ci_tables) / sizeof(msi_table));
3694 lstrcpyA(path, CURR_DIR);
3695 lstrcatA(path, "\\msitest\\concurrent.msi");
3696 create_database(path, ci2_tables, sizeof(ci2_tables) / sizeof(msi_table));
3698 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
3700 r = MsiInstallProductA(msifile, NULL);
3701 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3703 skip("Not enough rights to perform tests\n");
3704 DeleteFile(path);
3705 goto error;
3707 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3708 if (!delete_pf("msitest\\augustus", TRUE))
3709 trace("concurrent installs not supported\n");
3710 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3711 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3713 DeleteFile(path);
3715 r = MsiInstallProductA(msifile, NULL);
3716 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3717 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3718 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3719 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3721 error:
3722 DeleteFile(msifile);
3723 DeleteFile("msitest\\msitest\\augustus");
3724 DeleteFile("msitest\\maximus");
3725 RemoveDirectory("msitest\\msitest");
3726 RemoveDirectory("msitest");
3729 static void test_setpropertyfolder(void)
3731 UINT r;
3732 CHAR path[MAX_PATH];
3733 DWORD attr;
3735 if (is_process_limited())
3737 skip("process is limited\n");
3738 return;
3741 lstrcpyA(path, PROG_FILES_DIR);
3742 lstrcatA(path, "\\msitest\\added");
3744 CreateDirectoryA("msitest", NULL);
3745 create_file("msitest\\maximus", 500);
3747 create_database(msifile, spf_tables, sizeof(spf_tables) / sizeof(msi_table));
3749 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
3751 r = MsiInstallProductA(msifile, NULL);
3752 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3754 skip("Not enough rights to perform tests\n");
3755 goto error;
3757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3758 attr = GetFileAttributesA(path);
3759 if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
3761 ok(delete_pf("msitest\\added\\maximus", TRUE), "File not installed\n");
3762 ok(delete_pf("msitest\\added", FALSE), "Directory not created\n");
3763 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3765 else
3767 trace("changing folder property not supported\n");
3768 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3769 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3772 error:
3773 /* Delete the files in the temp (current) folder */
3774 DeleteFile(msifile);
3775 DeleteFile("msitest\\maximus");
3776 RemoveDirectory("msitest");
3779 static BOOL file_exists(LPCSTR file)
3781 return GetFileAttributes(file) != INVALID_FILE_ATTRIBUTES;
3784 static BOOL pf_exists(LPCSTR file)
3786 CHAR path[MAX_PATH];
3788 lstrcpyA(path, PROG_FILES_DIR);
3789 lstrcatA(path, "\\");
3790 lstrcatA(path, file);
3792 return file_exists(path);
3795 static void delete_pfmsitest_files(void)
3797 SHFILEOPSTRUCT shfl;
3798 CHAR path[MAX_PATH+11];
3800 lstrcpyA(path, PROG_FILES_DIR);
3801 lstrcatA(path, "\\msitest\\*");
3802 path[strlen(path) + 1] = '\0';
3804 shfl.hwnd = NULL;
3805 shfl.wFunc = FO_DELETE;
3806 shfl.pFrom = path;
3807 shfl.pTo = NULL;
3808 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
3810 SHFileOperation(&shfl);
3812 lstrcpyA(path, PROG_FILES_DIR);
3813 lstrcatA(path, "\\msitest");
3814 RemoveDirectoryA(path);
3817 static UINT run_query(MSIHANDLE hdb, MSIHANDLE hrec, const char *query)
3819 MSIHANDLE hview = 0;
3820 UINT r;
3822 r = MsiDatabaseOpenView(hdb, query, &hview);
3823 if(r != ERROR_SUCCESS)
3824 return r;
3826 r = MsiViewExecute(hview, hrec);
3827 if(r == ERROR_SUCCESS)
3828 r = MsiViewClose(hview);
3829 MsiCloseHandle(hview);
3830 return r;
3833 static void set_transform_summary_info(void)
3835 UINT r;
3836 MSIHANDLE suminfo = 0;
3838 /* build summary info */
3839 r = MsiGetSummaryInformation(0, mstfile, 3, &suminfo);
3840 ok(r == ERROR_SUCCESS , "Failed to open summaryinfo\n");
3842 r = MsiSummaryInfoSetProperty(suminfo, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
3843 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
3845 r = MsiSummaryInfoSetProperty(suminfo, PID_REVNUMBER, VT_LPSTR, 0, NULL,
3846 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3847 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3848 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3849 ok(r == ERROR_SUCCESS , "Failed to set summary info\n");
3851 r = MsiSummaryInfoSetProperty(suminfo, PID_PAGECOUNT, VT_I4, 100, NULL, NULL);
3852 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
3854 r = MsiSummaryInfoPersist(suminfo);
3855 ok(r == ERROR_SUCCESS , "Failed to make summary info persist\n");
3857 r = MsiCloseHandle(suminfo);
3858 ok(r == ERROR_SUCCESS , "Failed to close suminfo\n");
3861 static void generate_transform(void)
3863 MSIHANDLE hdb1, hdb2;
3864 LPCSTR query;
3865 UINT r;
3867 /* start with two identical databases */
3868 CopyFile(msifile, msifile2, FALSE);
3870 r = MsiOpenDatabase(msifile2, MSIDBOPEN_TRANSACT, &hdb1);
3871 ok(r == ERROR_SUCCESS , "Failed to create database\n");
3873 r = MsiDatabaseCommit(hdb1);
3874 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
3876 r = MsiOpenDatabase(msifile, MSIDBOPEN_READONLY, &hdb2);
3877 ok(r == ERROR_SUCCESS , "Failed to create database\n");
3879 query = "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3880 r = run_query(hdb1, 0, query);
3881 ok(r == ERROR_SUCCESS, "failed to add property\n");
3883 /* database needs to be committed */
3884 MsiDatabaseCommit(hdb1);
3886 r = MsiDatabaseGenerateTransform(hdb1, hdb2, mstfile, 0, 0);
3887 ok(r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r);
3889 r = MsiCreateTransformSummaryInfo(hdb2, hdb2, mstfile, 0, 0);
3890 todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3892 MsiCloseHandle(hdb1);
3893 MsiCloseHandle(hdb2);
3896 /* data for generating a transform */
3898 /* tables transform names - encoded as they would be in an msi database file */
3899 static const WCHAR name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
3900 static const WCHAR name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
3901 static const WCHAR name3[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
3903 /* data in each table */
3904 static const char data1[] = /* _StringData */
3905 "propval"; /* all the strings squashed together */
3907 static const WCHAR data2[] = { /* _StringPool */
3908 /* len, refs */
3909 0, 0, /* string 0 '' */
3910 4, 1, /* string 1 'prop' */
3911 3, 1, /* string 2 'val' */
3914 static const WCHAR data3[] = { /* Property */
3915 0x0201, 0x0001, 0x0002,
3918 static const struct {
3919 LPCWSTR name;
3920 const void *data;
3921 DWORD size;
3922 } table_transform_data[] =
3924 { name1, data1, sizeof data1 - 1 },
3925 { name2, data2, sizeof data2 },
3926 { name3, data3, sizeof data3 },
3929 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3931 static void generate_transform_manual(void)
3933 IStorage *stg = NULL;
3934 IStream *stm;
3935 WCHAR name[0x20];
3936 HRESULT r;
3937 DWORD i, count;
3938 const DWORD mode = STGM_CREATE|STGM_READWRITE|STGM_DIRECT|STGM_SHARE_EXCLUSIVE;
3940 const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3942 MultiByteToWideChar(CP_ACP, 0, mstfile, -1, name, 0x20);
3944 r = StgCreateDocfile(name, mode, 0, &stg);
3945 ok(r == S_OK, "failed to create storage\n");
3946 if (!stg)
3947 return;
3949 r = IStorage_SetClass(stg, &CLSID_MsiTransform);
3950 ok(r == S_OK, "failed to set storage type\n");
3952 for (i=0; i<NUM_TRANSFORM_TABLES; i++)
3954 r = IStorage_CreateStream(stg, table_transform_data[i].name,
3955 STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
3956 if (FAILED(r))
3958 ok(0, "failed to create stream %08x\n", r);
3959 continue;
3962 r = IStream_Write(stm, table_transform_data[i].data,
3963 table_transform_data[i].size, &count);
3964 if (FAILED(r) || count != table_transform_data[i].size)
3965 ok(0, "failed to write stream\n");
3966 IStream_Release(stm);
3969 IStorage_Release(stg);
3971 set_transform_summary_info();
3974 static void test_transformprop(void)
3976 UINT r;
3978 if (is_process_limited())
3980 skip("process is limited\n");
3981 return;
3984 CreateDirectoryA("msitest", NULL);
3985 create_file("msitest\\augustus", 500);
3987 create_database(msifile, tp_tables, sizeof(tp_tables) / sizeof(msi_table));
3989 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3991 r = MsiInstallProductA(msifile, NULL);
3992 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3994 skip("Not enough rights to perform tests\n");
3995 goto error;
3997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3998 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3999 ok(!delete_pf("msitest", FALSE), "Directory created\n");
4001 if (0)
4002 generate_transform();
4003 else
4004 generate_transform_manual();
4006 r = MsiInstallProductA(msifile, "TRANSFORMS=winetest.mst");
4007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4008 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4009 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4011 error:
4012 /* Delete the files in the temp (current) folder */
4013 DeleteFile(msifile);
4014 DeleteFile(msifile2);
4015 DeleteFile(mstfile);
4016 DeleteFile("msitest\\augustus");
4017 RemoveDirectory("msitest");
4020 static void test_currentworkingdir(void)
4022 UINT r;
4023 CHAR drive[MAX_PATH], path[MAX_PATH];
4024 LPSTR ptr;
4026 if (is_process_limited())
4028 skip("process is limited\n");
4029 return;
4032 CreateDirectoryA("msitest", NULL);
4033 create_file("msitest\\augustus", 500);
4035 create_database(msifile, cwd_tables, sizeof(cwd_tables) / sizeof(msi_table));
4037 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4039 CreateDirectoryA("diffdir", NULL);
4040 SetCurrentDirectoryA("diffdir");
4042 sprintf(path, "..\\%s", msifile);
4043 r = MsiInstallProductA(path, NULL);
4044 todo_wine
4046 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
4047 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4048 ok(!delete_pf("msitest", FALSE), "Directory created\n");
4051 sprintf(path, "%s\\%s", CURR_DIR, msifile);
4052 r = MsiInstallProductA(path, NULL);
4053 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4055 skip("Not enough rights to perform tests\n");
4056 goto error;
4058 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4059 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4060 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4062 lstrcpyA(drive, CURR_DIR);
4063 drive[2] = '\\';
4064 drive[3] = '\0';
4065 SetCurrentDirectoryA(drive);
4067 lstrcpy(path, CURR_DIR);
4068 if (path[lstrlenA(path) - 1] != '\\')
4069 lstrcatA(path, "\\");
4070 lstrcatA(path, msifile);
4071 ptr = strchr(path, ':');
4072 ptr +=2;
4074 r = MsiInstallProductA(ptr, NULL);
4075 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4076 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4077 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4079 error:
4080 SetCurrentDirectoryA(CURR_DIR);
4081 DeleteFile(msifile);
4082 DeleteFile("msitest\\augustus");
4083 RemoveDirectory("msitest");
4084 RemoveDirectory("diffdir");
4087 static void set_admin_summary_info(const CHAR *name)
4089 MSIHANDLE db, summary;
4090 UINT r;
4092 r = MsiOpenDatabaseA(name, MSIDBOPEN_DIRECT, &db);
4093 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4095 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
4096 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4098 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, 5, NULL, NULL);
4099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4101 /* write the summary changes back to the stream */
4102 r = MsiSummaryInfoPersist(summary);
4103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4105 MsiCloseHandle(summary);
4107 r = MsiDatabaseCommit(db);
4108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4110 MsiCloseHandle(db);
4113 static void test_admin(void)
4115 UINT r;
4117 CreateDirectoryA("msitest", NULL);
4118 create_file("msitest\\augustus", 500);
4120 create_database(msifile, adm_tables, sizeof(adm_tables) / sizeof(msi_table));
4121 set_admin_summary_info(msifile);
4123 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4125 r = MsiInstallProductA(msifile, NULL);
4126 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4128 skip("Not enough rights to perform tests\n");
4129 goto error;
4131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4132 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4133 ok(!delete_pf("msitest", FALSE), "Directory created\n");
4134 ok(!DeleteFile("c:\\msitest\\augustus"), "File installed\n");
4135 ok(!RemoveDirectory("c:\\msitest"), "File installed\n");
4137 r = MsiInstallProductA(msifile, "ACTION=ADMIN");
4138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4139 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4140 ok(!delete_pf("msitest", FALSE), "Directory created\n");
4141 todo_wine
4143 ok(DeleteFile("c:\\msitest\\augustus"), "File not installed\n");
4144 ok(RemoveDirectory("c:\\msitest"), "File not installed\n");
4147 error:
4148 DeleteFile(msifile);
4149 DeleteFile("msitest\\augustus");
4150 RemoveDirectory("msitest");
4153 static void set_admin_property_stream(LPCSTR file)
4155 IStorage *stg;
4156 IStream *stm;
4157 WCHAR fileW[MAX_PATH];
4158 HRESULT hr;
4159 DWORD count;
4160 const DWORD mode = STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
4162 /* AdminProperties */
4163 static const WCHAR stmname[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
4164 static const WCHAR data[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
4165 'M','y','P','r','o','p','=','4','2',0};
4167 MultiByteToWideChar(CP_ACP, 0, file, -1, fileW, MAX_PATH);
4169 hr = StgOpenStorage(fileW, NULL, mode, NULL, 0, &stg);
4170 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
4171 if (!stg)
4172 return;
4174 hr = IStorage_CreateStream(stg, stmname, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
4175 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
4177 hr = IStream_Write(stm, data, sizeof(data), &count);
4178 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
4180 IStream_Release(stm);
4181 IStorage_Release(stg);
4184 static void test_adminprops(void)
4186 UINT r;
4188 if (is_process_limited())
4190 skip("process is limited\n");
4191 return;
4194 CreateDirectoryA("msitest", NULL);
4195 create_file("msitest\\augustus", 500);
4197 create_database(msifile, amp_tables, sizeof(amp_tables) / sizeof(msi_table));
4198 set_admin_summary_info(msifile);
4199 set_admin_property_stream(msifile);
4201 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4203 r = MsiInstallProductA(msifile, NULL);
4204 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4206 skip("Not enough rights to perform tests\n");
4207 goto error;
4209 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4210 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
4211 ok(delete_pf("msitest", FALSE), "Directory created\n");
4213 error:
4214 DeleteFile(msifile);
4215 DeleteFile("msitest\\augustus");
4216 RemoveDirectory("msitest");
4219 static void create_pf_data(LPCSTR file, LPCSTR data, BOOL is_file)
4221 CHAR path[MAX_PATH];
4223 lstrcpyA(path, PROG_FILES_DIR);
4224 lstrcatA(path, "\\");
4225 lstrcatA(path, file);
4227 if (is_file)
4228 create_file_data(path, data, 500);
4229 else
4230 CreateDirectoryA(path, NULL);
4233 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
4235 static void test_missingcab(void)
4237 UINT r;
4239 if (is_process_limited())
4241 skip("process is limited\n");
4242 return;
4245 CreateDirectoryA("msitest", NULL);
4246 create_file("msitest\\augustus", 500);
4247 create_file("maximus", 500);
4248 create_file("tiberius", 500);
4250 create_database(msifile, mc_tables, sizeof(mc_tables) / sizeof(msi_table));
4252 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4254 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4255 create_cab_file("test4.cab", MEDIA_SIZE, "tiberius\0");
4257 create_pf("msitest", FALSE);
4258 create_pf_data("msitest\\caesar", "abcdefgh", TRUE);
4259 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE);
4261 r = MsiInstallProductA(msifile, NULL);
4262 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4264 skip("Not enough rights to perform tests\n");
4265 goto error;
4267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4268 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4269 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4270 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4271 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
4272 ok(delete_pf("msitest\\tiberius", TRUE), "File not installed\n");
4273 ok(!delete_pf("msitest\\gaius", TRUE), "File installed\n");
4274 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4276 create_pf("msitest", FALSE);
4277 create_pf_data("msitest\\caesar", "abcdefgh", TRUE);
4278 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE);
4279 create_pf("msitest\\gaius", TRUE);
4281 r = MsiInstallProductA(msifile, "GAIUS=1");
4282 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4283 todo_wine
4285 ok(!delete_pf("msitest\\maximus", TRUE), "File installed\n");
4286 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4288 ok(delete_pf("msitest\\caesar", TRUE), "File removed\n");
4289 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
4290 ok(delete_pf("msitest\\tiberius", TRUE), "File removed\n");
4291 ok(delete_pf("msitest\\gaius", TRUE), "File removed\n");
4292 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4294 error:
4295 delete_pf("msitest", FALSE);
4296 DeleteFile("msitest\\augustus");
4297 RemoveDirectory("msitest");
4298 DeleteFile("maximus");
4299 DeleteFile("tiberius");
4300 DeleteFile("test1.cab");
4301 DeleteFile("test4.cab");
4302 DeleteFile(msifile);
4305 static void test_sourcefolder(void)
4307 UINT r;
4309 if (is_process_limited())
4311 skip("process is limited\n");
4312 return;
4315 CreateDirectoryA("msitest", NULL);
4316 create_file("augustus", 500);
4318 create_database(msifile, sf_tables, sizeof(sf_tables) / sizeof(msi_table));
4320 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4322 r = MsiInstallProductA(msifile, NULL);
4323 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4325 skip("Not enough rights to perform tests\n");
4326 goto error;
4328 ok(r == ERROR_INSTALL_FAILURE,
4329 "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4330 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4331 todo_wine
4333 ok(!delete_pf("msitest", FALSE), "Directory created\n");
4335 RemoveDirectoryA("msitest");
4337 r = MsiInstallProductA(msifile, NULL);
4338 ok(r == ERROR_INSTALL_FAILURE,
4339 "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4340 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4341 todo_wine
4343 ok(!delete_pf("msitest", FALSE), "Directory created\n");
4346 error:
4347 DeleteFile(msifile);
4348 DeleteFile("augustus");
4351 static void test_customaction51(void)
4353 UINT r;
4355 if (is_process_limited())
4357 skip("process is limited\n");
4358 return;
4361 CreateDirectoryA("msitest", NULL);
4362 create_file("msitest\\augustus", 500);
4364 create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
4366 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4368 r = MsiInstallProductA(msifile, NULL);
4369 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4371 skip("Not enough rights to perform tests\n");
4372 goto error;
4374 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4375 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
4376 ok(delete_pf("msitest", FALSE), "Directory created\n");
4378 error:
4379 DeleteFile(msifile);
4380 DeleteFile("msitest\\augustus");
4381 RemoveDirectory("msitest");
4384 static void test_installstate(void)
4386 UINT r;
4388 if (is_process_limited())
4390 skip("process is limited\n");
4391 return;
4394 CreateDirectoryA("msitest", NULL);
4395 create_file("msitest\\alpha", 500);
4396 create_file("msitest\\beta", 500);
4397 create_file("msitest\\gamma", 500);
4398 create_file("msitest\\theta", 500);
4399 create_file("msitest\\delta", 500);
4400 create_file("msitest\\epsilon", 500);
4401 create_file("msitest\\zeta", 500);
4402 create_file("msitest\\iota", 500);
4403 create_file("msitest\\eta", 500);
4404 create_file("msitest\\kappa", 500);
4405 create_file("msitest\\lambda", 500);
4406 create_file("msitest\\mu", 500);
4408 create_database(msifile, is_tables, sizeof(is_tables) / sizeof(msi_table));
4410 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4412 r = MsiInstallProductA(msifile, NULL);
4413 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4415 skip("Not enough rights to perform tests\n");
4416 goto error;
4418 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4419 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
4420 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
4421 ok(delete_pf("msitest\\gamma", TRUE), "File not installed\n");
4422 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
4423 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
4424 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
4425 ok(!delete_pf("msitest\\zeta", TRUE), "File installed\n");
4426 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
4427 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
4428 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
4429 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
4430 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
4431 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4433 r = MsiInstallProductA(msifile, "ADDLOCAL=\"one,two,three,four\"");
4434 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4435 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
4436 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
4437 ok(delete_pf("msitest\\gamma", TRUE), "File not installed\n");
4438 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
4439 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
4440 ok(delete_pf("msitest\\epsilon", TRUE), "File not installed\n");
4441 ok(delete_pf("msitest\\zeta", TRUE), "File not installed\n");
4442 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
4443 ok(delete_pf("msitest\\eta", TRUE), "File not installed\n");
4444 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
4445 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
4446 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
4447 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4449 r = MsiInstallProductA(msifile, "ADDSOURCE=\"one,two,three,four\"");
4450 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4451 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
4452 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
4453 ok(!delete_pf("msitest\\gamma", TRUE), "File installed\n");
4454 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
4455 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
4456 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
4457 ok(delete_pf("msitest\\zeta", TRUE), "File not installed\n");
4458 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
4459 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
4460 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
4461 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
4462 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
4463 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4465 r = MsiInstallProductA(msifile, "REMOVE=\"one,two,three,four\"");
4466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4467 ok(!delete_pf("msitest\\alpha", TRUE), "File installed\n");
4468 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
4469 ok(!delete_pf("msitest\\gamma", TRUE), "File installed\n");
4470 ok(!delete_pf("msitest\\theta", TRUE), "File installed\n");
4471 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
4472 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
4473 ok(!delete_pf("msitest\\zeta", TRUE), "File installed\n");
4474 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
4475 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
4476 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
4477 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
4478 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
4479 ok(!delete_pf("msitest", FALSE), "Directory created\n");
4481 error:
4482 DeleteFile(msifile);
4483 DeleteFile("msitest\\alpha");
4484 DeleteFile("msitest\\beta");
4485 DeleteFile("msitest\\gamma");
4486 DeleteFile("msitest\\theta");
4487 DeleteFile("msitest\\delta");
4488 DeleteFile("msitest\\epsilon");
4489 DeleteFile("msitest\\zeta");
4490 DeleteFile("msitest\\iota");
4491 DeleteFile("msitest\\eta");
4492 DeleteFile("msitest\\kappa");
4493 DeleteFile("msitest\\lambda");
4494 DeleteFile("msitest\\mu");
4495 RemoveDirectory("msitest");
4498 static const struct sourcepathmap
4500 BOOL sost; /* shortone\shorttwo */
4501 BOOL solt; /* shortone\longtwo */
4502 BOOL lost; /* longone\shorttwo */
4503 BOOL lolt; /* longone\longtwo */
4504 BOOL soste; /* shortone\shorttwo source exists */
4505 BOOL solte; /* shortone\longtwo source exists */
4506 BOOL loste; /* longone\shorttwo source exists */
4507 BOOL lolte; /* longone\longtwo source exists */
4508 UINT err;
4509 DWORD size;
4510 } spmap[256] =
4512 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4513 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4514 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4515 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4516 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4517 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4518 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4519 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4520 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4521 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4522 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4523 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4524 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4525 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4526 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4527 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4528 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4529 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4530 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4531 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4532 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4533 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4534 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4535 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4536 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4537 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4538 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4539 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4540 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4541 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4542 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4543 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4544 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4545 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4546 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4547 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4548 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4549 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4550 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4551 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4552 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4553 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4554 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4555 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4556 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4557 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4558 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4559 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4560 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4561 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4562 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4563 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4564 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4565 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4566 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4567 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4568 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4569 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4570 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4571 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4572 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4573 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4574 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4575 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4576 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4577 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4578 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4579 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4580 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4581 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4582 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4583 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4584 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4585 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4586 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4587 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4588 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4589 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4590 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4591 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4592 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4593 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4594 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4595 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4596 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4597 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4598 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4599 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4600 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4601 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4602 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4603 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4604 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4605 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4606 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4607 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4608 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4609 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4610 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4611 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4612 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4613 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4614 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4615 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4616 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4617 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4618 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4619 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4620 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4621 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4622 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4623 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4624 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4625 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4626 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4627 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4628 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4629 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4630 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4631 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4632 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4633 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4634 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4635 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4636 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4637 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4638 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4639 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4640 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4641 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4642 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4643 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4644 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4645 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4646 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4647 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4648 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4649 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4650 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4651 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4652 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4653 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4654 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4655 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4656 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4657 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4658 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4659 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4660 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4661 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4662 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4663 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4664 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4665 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4666 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4667 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4668 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4669 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4670 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4671 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4672 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4673 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4674 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4675 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4676 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4677 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4678 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4679 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4680 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4681 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4682 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4683 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4684 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4685 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4686 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4687 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4688 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4689 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4690 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4691 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4692 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4693 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4694 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4695 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4696 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4697 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4698 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4699 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4700 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4701 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4702 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4703 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4704 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4705 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4706 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4707 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4708 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4709 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4710 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4711 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4712 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4713 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4714 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4715 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4716 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4717 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4718 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4719 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4720 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4721 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4722 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4723 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4724 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4725 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4726 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4727 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4728 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4729 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4730 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4731 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4732 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4733 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4734 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4735 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4736 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4737 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4738 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4739 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4740 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4741 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4742 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4743 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4744 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
4745 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4746 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
4747 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4748 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
4749 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4750 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
4751 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4752 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4753 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4754 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4755 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4756 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4757 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4758 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4759 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4760 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4761 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4762 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4763 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4764 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
4765 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
4766 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
4767 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
4770 static DWORD get_pf_file_size(LPCSTR file)
4772 CHAR path[MAX_PATH];
4773 HANDLE hfile;
4774 DWORD size;
4776 lstrcpyA(path, PROG_FILES_DIR);
4777 lstrcatA(path, "\\");
4778 lstrcatA(path, file);
4780 hfile = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
4781 if (hfile == INVALID_HANDLE_VALUE)
4782 return INVALID_FILE_SIZE;
4784 size = GetFileSize(hfile, NULL);
4785 CloseHandle(hfile);
4786 return size;
4789 static void test_sourcepath(void)
4791 UINT r, i;
4793 if (!winetest_interactive)
4795 skip("Run in interactive mode to run source path tests.\n");
4796 return;
4799 create_database(msifile, sp_tables, sizeof(sp_tables) / sizeof(msi_table));
4801 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4803 for (i = 0; i < sizeof(spmap) / sizeof(spmap[0]); i++)
4805 if (spmap[i].sost)
4807 CreateDirectoryA("shortone", NULL);
4808 CreateDirectoryA("shortone\\shorttwo", NULL);
4811 if (spmap[i].solt)
4813 CreateDirectoryA("shortone", NULL);
4814 CreateDirectoryA("shortone\\longtwo", NULL);
4817 if (spmap[i].lost)
4819 CreateDirectoryA("longone", NULL);
4820 CreateDirectoryA("longone\\shorttwo", NULL);
4823 if (spmap[i].lolt)
4825 CreateDirectoryA("longone", NULL);
4826 CreateDirectoryA("longone\\longtwo", NULL);
4829 if (spmap[i].soste)
4830 create_file("shortone\\shorttwo\\augustus", 50);
4831 if (spmap[i].solte)
4832 create_file("shortone\\longtwo\\augustus", 100);
4833 if (spmap[i].loste)
4834 create_file("longone\\shorttwo\\augustus", 150);
4835 if (spmap[i].lolte)
4836 create_file("longone\\longtwo\\augustus", 200);
4838 r = MsiInstallProductA(msifile, NULL);
4839 ok(r == spmap[i].err, "%d: Expected %d, got %d\n", i, spmap[i].err, r);
4840 ok(get_pf_file_size("msitest\\augustus") == spmap[i].size,
4841 "%d: Expected %d, got %d\n", i, spmap[i].size,
4842 get_pf_file_size("msitest\\augustus"));
4844 if (r == ERROR_SUCCESS)
4846 ok(delete_pf("msitest\\augustus", TRUE), "%d: File not installed\n", i);
4847 ok(delete_pf("msitest", FALSE), "%d: Directory not created\n", i);
4849 else
4851 ok(!delete_pf("msitest\\augustus", TRUE), "%d: File installed\n", i);
4852 todo_wine ok(!delete_pf("msitest", FALSE), "%d: Directory installed\n", i);
4855 DeleteFileA("shortone\\shorttwo\\augustus");
4856 DeleteFileA("shortone\\longtwo\\augustus");
4857 DeleteFileA("longone\\shorttwo\\augustus");
4858 DeleteFileA("longone\\longtwo\\augustus");
4859 RemoveDirectoryA("shortone\\shorttwo");
4860 RemoveDirectoryA("shortone\\longtwo");
4861 RemoveDirectoryA("longone\\shorttwo");
4862 RemoveDirectoryA("longone\\longtwo");
4863 RemoveDirectoryA("shortone");
4864 RemoveDirectoryA("longone");
4867 DeleteFileA(msifile);
4870 static void test_missingcomponent(void)
4872 UINT r;
4874 if (is_process_limited())
4876 skip("process is limited\n");
4877 return;
4880 CreateDirectoryA("msitest", NULL);
4881 create_file("msitest\\hydrogen", 500);
4882 create_file("msitest\\helium", 500);
4883 create_file("msitest\\lithium", 500);
4884 create_file("beryllium", 500);
4886 create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
4888 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4890 r = MsiInstallProductA(msifile, "INSTALLLEVEL=10 PROPVAR=42");
4891 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4893 skip("Not enough rights to perform tests\n");
4894 goto error;
4896 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4897 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4898 ok(pf_exists("msitest\\helium"), "File not installed\n");
4899 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4900 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4901 ok(pf_exists("msitest"), "File not installed\n");
4903 r = MsiInstallProductA(msifile, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
4904 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4905 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
4906 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
4907 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
4908 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4909 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
4911 error:
4912 DeleteFileA(msifile);
4913 DeleteFileA("msitest\\hydrogen");
4914 DeleteFileA("msitest\\helium");
4915 DeleteFileA("msitest\\lithium");
4916 DeleteFileA("beryllium");
4917 RemoveDirectoryA("msitest");
4920 static void test_sourcedirprop(void)
4922 UINT r;
4923 CHAR props[MAX_PATH];
4925 if (is_process_limited())
4927 skip("process is limited\n");
4928 return;
4931 CreateDirectoryA("msitest", NULL);
4932 create_file("msitest\\augustus", 500);
4934 create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
4936 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4938 r = MsiInstallProductA(msifile, NULL);
4939 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4941 skip("Not enough rights to perform tests\n");
4942 goto error;
4944 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4945 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
4946 ok(delete_pf("msitest", FALSE), "Directory created\n");
4948 DeleteFile("msitest\\augustus");
4949 RemoveDirectory("msitest");
4951 CreateDirectoryA("altsource", NULL);
4952 CreateDirectoryA("altsource\\msitest", NULL);
4953 create_file("altsource\\msitest\\augustus", 500);
4955 sprintf(props, "SRCDIR=%s\\altsource\\", CURR_DIR);
4957 r = MsiInstallProductA(msifile, props);
4958 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4959 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
4960 ok(delete_pf("msitest", FALSE), "Directory created\n");
4962 DeleteFile("altsource\\msitest\\augustus");
4963 RemoveDirectory("altsource\\msitest");
4964 RemoveDirectory("altsource");
4966 error:
4967 DeleteFile("msitest\\augustus");
4968 RemoveDirectory("msitest");
4969 DeleteFile(msifile);
4972 static void test_adminimage(void)
4974 UINT r;
4976 if (is_process_limited())
4978 skip("process is limited\n");
4979 return;
4982 CreateDirectoryA("msitest", NULL);
4983 CreateDirectoryA("msitest\\first", NULL);
4984 CreateDirectoryA("msitest\\second", NULL);
4985 CreateDirectoryA("msitest\\cabout", NULL);
4986 CreateDirectoryA("msitest\\cabout\\new", NULL);
4987 create_file("msitest\\one.txt", 100);
4988 create_file("msitest\\first\\two.txt", 100);
4989 create_file("msitest\\second\\three.txt", 100);
4990 create_file("msitest\\cabout\\four.txt", 100);
4991 create_file("msitest\\cabout\\new\\five.txt", 100);
4992 create_file("msitest\\filename", 100);
4993 create_file("msitest\\service.exe", 100);
4995 create_database_wordcount(msifile, ai_tables,
4996 sizeof(ai_tables) / sizeof(msi_table),
4997 100, msidbSumInfoSourceTypeAdminImage, ";1033");
4999 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5001 r = MsiInstallProductA(msifile, NULL);
5002 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5004 skip("Not enough rights to perform tests\n");
5005 goto error;
5007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5009 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5010 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5011 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5012 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5013 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5014 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5015 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5016 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5017 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5018 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5019 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5020 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5022 error:
5023 DeleteFileA("msifile");
5024 DeleteFileA("msitest\\cabout\\new\\five.txt");
5025 DeleteFileA("msitest\\cabout\\four.txt");
5026 DeleteFileA("msitest\\second\\three.txt");
5027 DeleteFileA("msitest\\first\\two.txt");
5028 DeleteFileA("msitest\\one.txt");
5029 DeleteFileA("msitest\\service.exe");
5030 DeleteFileA("msitest\\filename");
5031 RemoveDirectoryA("msitest\\cabout\\new");
5032 RemoveDirectoryA("msitest\\cabout");
5033 RemoveDirectoryA("msitest\\second");
5034 RemoveDirectoryA("msitest\\first");
5035 RemoveDirectoryA("msitest");
5038 static void test_propcase(void)
5040 UINT r;
5042 if (is_process_limited())
5044 skip("process is limited\n");
5045 return;
5048 CreateDirectoryA("msitest", NULL);
5049 create_file("msitest\\augustus", 500);
5051 create_database(msifile, pc_tables, sizeof(pc_tables) / sizeof(msi_table));
5053 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5055 r = MsiInstallProductA(msifile, "MyProp=42");
5056 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5058 skip("Not enough rights to perform tests\n");
5059 goto error;
5061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5062 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
5063 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5065 error:
5066 DeleteFile(msifile);
5067 DeleteFile("msitest\\augustus");
5068 RemoveDirectory("msitest");
5071 static void test_int_widths( void )
5073 static const char int0[] = "int0\ni0\nint0\tint0\n1";
5074 static const char int1[] = "int1\ni1\nint1\tint1\n1";
5075 static const char int2[] = "int2\ni2\nint2\tint2\n1";
5076 static const char int3[] = "int3\ni3\nint3\tint3\n1";
5077 static const char int4[] = "int4\ni4\nint4\tint4\n1";
5078 static const char int5[] = "int5\ni5\nint5\tint5\n1";
5079 static const char int8[] = "int8\ni8\nint8\tint8\n1";
5081 static const struct
5083 const char *data;
5084 unsigned int size;
5085 UINT ret;
5087 tests[] =
5089 { int0, sizeof(int0) - 1, ERROR_SUCCESS },
5090 { int1, sizeof(int1) - 1, ERROR_SUCCESS },
5091 { int2, sizeof(int2) - 1, ERROR_SUCCESS },
5092 { int3, sizeof(int3) - 1, ERROR_FUNCTION_FAILED },
5093 { int4, sizeof(int4) - 1, ERROR_SUCCESS },
5094 { int5, sizeof(int5) - 1, ERROR_FUNCTION_FAILED },
5095 { int8, sizeof(int8) - 1, ERROR_FUNCTION_FAILED }
5098 char tmpdir[MAX_PATH], msitable[MAX_PATH], msidb[MAX_PATH];
5099 MSIHANDLE db;
5100 UINT r, i;
5102 GetTempPathA(MAX_PATH, tmpdir);
5103 CreateDirectoryA(tmpdir, NULL);
5105 strcpy(msitable, tmpdir);
5106 strcat(msitable, "\\msitable.idt");
5108 strcpy(msidb, tmpdir);
5109 strcat(msidb, "\\msitest.msi");
5111 r = MsiOpenDatabaseA(msidb, MSIDBOPEN_CREATE, &db);
5112 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5114 for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++)
5116 write_file(msitable, tests[i].data, tests[i].size);
5118 r = MsiDatabaseImportA(db, tmpdir, "msitable.idt");
5119 ok(r == tests[i].ret, " %u expected %u, got %u\n", i, tests[i].ret, r);
5121 r = MsiDatabaseCommit(db);
5122 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5123 DeleteFileA(msitable);
5126 MsiCloseHandle(db);
5127 DeleteFileA(msidb);
5128 RemoveDirectoryA(tmpdir);
5131 static void test_shortcut(void)
5133 UINT r;
5134 HRESULT hr;
5136 if (is_process_limited())
5138 skip("process is limited\n");
5139 return;
5142 create_test_files();
5143 create_database(msifile, sc_tables, sizeof(sc_tables) / sizeof(msi_table));
5145 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5147 r = MsiInstallProductA(msifile, NULL);
5148 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5150 skip("Not enough rights to perform tests\n");
5151 goto error;
5153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5155 hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
5156 ok(SUCCEEDED(hr), "CoInitialize failed 0x%08x\n", hr);
5158 r = MsiInstallProductA(msifile, NULL);
5159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5161 CoUninitialize();
5163 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
5164 ok(SUCCEEDED(hr), "CoInitialize failed 0x%08x\n", hr);
5166 r = MsiInstallProductA(msifile, NULL);
5167 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5169 CoUninitialize();
5171 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5172 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5173 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5174 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5175 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5176 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5177 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5178 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5179 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5180 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5181 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5182 while (!delete_pf("msitest\\Shortcut.lnk", TRUE) && GetLastError() == ERROR_SHARING_VIOLATION) Sleep(1000);
5183 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5185 error:
5186 delete_test_files();
5187 DeleteFile(msifile);
5190 static void test_preselected(void)
5192 UINT r;
5194 if (is_process_limited())
5196 skip("process is limited\n");
5197 return;
5200 create_test_files();
5201 create_database(msifile, ps_tables, sizeof(ps_tables) / sizeof(msi_table));
5203 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5205 r = MsiInstallProductA(msifile, "ADDLOCAL=One");
5206 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5208 skip("Not enough rights to perform tests\n");
5209 goto error;
5211 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5213 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
5214 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
5215 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
5216 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
5217 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
5218 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
5219 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
5220 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
5221 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
5222 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5223 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
5224 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5226 r = MsiInstallProductA(msifile, NULL);
5227 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5229 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5230 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5231 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5232 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5233 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5234 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5235 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5236 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5237 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5238 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
5239 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5240 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5242 error:
5243 delete_test_files();
5244 DeleteFile(msifile);
5247 static void test_installed_prop(void)
5249 static char prodcode[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
5250 UINT r;
5252 if (is_process_limited())
5254 skip("process is limited\n");
5255 return;
5258 create_test_files();
5259 create_database(msifile, ip_tables, sizeof(ip_tables) / sizeof(msi_table));
5261 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5263 r = MsiInstallProductA(msifile, "FULL=1");
5264 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5266 skip("Not enough rights to perform tests\n");
5267 goto error;
5269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5271 r = MsiInstallProductA(msifile, "FULL=1");
5272 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5274 r = MsiConfigureProductExA(prodcode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, "FULL=1");
5275 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5277 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5278 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5279 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5280 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5281 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5282 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5283 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5284 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5285 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5286 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
5287 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5288 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5290 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5291 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5293 error:
5294 delete_test_files();
5295 DeleteFile(msifile);
5298 static void test_allusers_prop(void)
5300 UINT r;
5302 if (is_process_limited())
5304 skip("process is limited\n");
5305 return;
5308 create_test_files();
5309 create_database(msifile, aup_tables, sizeof(aup_tables) / sizeof(msi_table));
5311 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5313 /* ALLUSERS property unset */
5314 r = MsiInstallProductA(msifile, "FULL=1");
5315 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5317 skip("Not enough rights to perform tests\n");
5318 goto error;
5320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5322 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5323 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5324 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5325 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5326 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5327 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5328 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5329 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5330 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5331 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
5332 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5333 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5335 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5338 delete_test_files();
5340 create_test_files();
5341 create_database(msifile, aup2_tables, sizeof(aup2_tables) / sizeof(msi_table));
5343 /* ALLUSERS property set to 1 */
5344 r = MsiInstallProductA(msifile, "FULL=1");
5345 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5347 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5348 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5349 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5350 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5351 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5352 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5353 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5354 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5355 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5356 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
5357 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5358 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5360 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5361 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5363 delete_test_files();
5365 create_test_files();
5366 create_database(msifile, aup3_tables, sizeof(aup3_tables) / sizeof(msi_table));
5368 /* ALLUSERS property set to 2 */
5369 r = MsiInstallProductA(msifile, "FULL=1");
5370 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5372 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5373 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5374 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5375 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5376 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5377 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5378 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5379 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5380 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5381 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
5382 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5383 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5385 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5388 delete_test_files();
5390 create_test_files();
5391 create_database(msifile, aup4_tables, sizeof(aup4_tables) / sizeof(msi_table));
5393 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
5394 r = MsiInstallProductA(msifile, "FULL=1");
5395 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5397 error:
5398 delete_test_files();
5399 DeleteFile(msifile);
5402 static char session_manager[] = "System\\CurrentControlSet\\Control\\Session Manager";
5403 static char rename_ops[] = "PendingFileRenameOperations";
5405 static void process_pending_renames(HKEY hkey)
5407 char *buf, *src, *dst, *buf2, *buf2ptr;
5408 DWORD size;
5409 LONG ret;
5410 BOOL found = FALSE;
5412 ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, NULL, &size);
5413 ok(!ret, "RegQueryValueExA failed %d\n", ret);
5415 buf = HeapAlloc(GetProcessHeap(), 0, size + 1);
5416 buf2ptr = buf2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 1);
5418 ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, (LPBYTE)buf, &size);
5419 buf[size] = 0;
5420 ok(!ret, "RegQueryValueExA failed %d\n", ret);
5421 if (ret) return;
5423 for (src = buf; *src; src = dst + strlen(dst) + 1)
5425 DWORD flags = MOVEFILE_COPY_ALLOWED;
5426 BOOL fileret;
5428 dst = src + strlen(src) + 1;
5430 if (!strstr(src, "msitest"))
5432 lstrcpyA(buf2ptr, src);
5433 buf2ptr += strlen(src) + 1;
5434 lstrcpyA(buf2ptr, dst);
5435 buf2ptr += strlen(dst) + 1;
5436 continue;
5439 found = TRUE;
5441 if (*dst == '!')
5443 flags |= MOVEFILE_REPLACE_EXISTING;
5444 dst++;
5446 if (src[0] == '\\' && src[1] == '?' && src[2] == '?' && src[3] == '\\') src += 4;
5447 if (*dst)
5449 if (dst[0] == '\\' && dst[1] == '?' && dst[2] == '?' && dst[3] == '\\') dst += 4;
5450 fileret = MoveFileExA(src, dst, flags);
5451 ok(fileret, "Failed to move file %s -> %s (%u)\n", src, dst, GetLastError());
5453 else
5455 fileret = DeleteFileA(src);
5456 ok(fileret, "Failed to delete file %s (%u)\n", src, GetLastError());
5460 ok(found, "Expected a 'msitest' entry\n");
5462 if (*buf2)
5463 RegSetValueExA(hkey, rename_ops, 0, REG_MULTI_SZ, (LPBYTE)buf2, buf2ptr + 1 - buf2);
5464 else
5465 RegDeleteValueA(hkey, rename_ops);
5467 HeapFree(GetProcessHeap(), 0, buf);
5468 HeapFree(GetProcessHeap(), 0, buf2);
5471 static BOOL file_matches_data(LPCSTR file, LPCSTR data)
5473 DWORD len, data_len = strlen(data);
5474 HANDLE handle;
5475 char buf[128];
5477 handle = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
5478 ok(handle != INVALID_HANDLE_VALUE, "failed to open %s (%u)\n", file, GetLastError());
5480 if (ReadFile(handle, buf, sizeof(buf), &len, NULL) && len >= data_len)
5482 CloseHandle(handle);
5483 return !memcmp(buf, data, data_len);
5485 CloseHandle(handle);
5486 return FALSE;
5489 static void test_file_in_use(void)
5491 UINT r;
5492 HANDLE file;
5493 HKEY hkey;
5494 char path[MAX_PATH];
5496 if (is_process_limited())
5498 skip("process is limited\n");
5499 return;
5502 RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey);
5504 CreateDirectoryA("msitest", NULL);
5505 create_file("msitest\\maximus", 500);
5506 create_database(msifile, fiu_tables, sizeof(fiu_tables) / sizeof(msi_table));
5508 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5510 lstrcpy(path, PROG_FILES_DIR);
5511 lstrcat(path, "\\msitest");
5512 CreateDirectoryA(path, NULL);
5514 lstrcat(path, "\\maximus");
5515 file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
5517 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
5518 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5520 skip("Not enough rights to perform tests\n");
5521 goto error;
5523 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
5524 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
5525 CloseHandle(file);
5526 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
5528 process_pending_renames(hkey);
5529 RegCloseKey(hkey);
5531 ok(file_matches_data(path, "msitest\\maximus"), "Expected file to match\n");
5532 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
5533 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
5535 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5538 error:
5539 RegCloseKey(hkey);
5541 delete_pf("msitest\\maximus", TRUE);
5542 delete_pf("msitest", FALSE);
5543 DeleteFileA("msitest\\maximus");
5544 delete_test_files();
5545 DeleteFile(msifile);
5548 static void test_file_in_use_cab(void)
5550 UINT r;
5551 HANDLE file;
5552 HKEY hkey;
5553 char path[MAX_PATH];
5555 if (is_process_limited())
5557 skip("process is limited\n");
5558 return;
5561 RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey);
5563 CreateDirectoryA("msitest", NULL);
5564 create_file("maximus", 500);
5565 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
5566 DeleteFile("maximus");
5568 create_database(msifile, fiuc_tables, sizeof(fiuc_tables) / sizeof(msi_table));
5570 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5572 lstrcpy(path, PROG_FILES_DIR);
5573 lstrcat(path, "\\msitest");
5574 CreateDirectoryA(path, NULL);
5576 lstrcat(path, "\\maximus");
5577 file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
5579 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
5580 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5582 skip("Not enough rights to perform tests\n");
5583 goto error;
5585 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
5586 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
5587 CloseHandle(file);
5588 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
5590 process_pending_renames(hkey);
5591 RegCloseKey(hkey);
5593 ok(file_matches_data(path, "maximus"), "Expected file to match\n");
5594 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
5595 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
5597 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5600 error:
5601 RegCloseKey(hkey);
5603 delete_pf("msitest\\maximus", TRUE);
5604 delete_pf("msitest", FALSE);
5605 DeleteFileA("msitest\\maximus");
5606 delete_cab_files();
5607 delete_test_files();
5608 DeleteFile(msifile);
5611 static void test_feature_override(void)
5613 UINT r;
5614 REGSAM access = KEY_ALL_ACCESS;
5616 if (is_process_limited())
5618 skip("process is limited\n");
5619 return;
5622 create_test_files();
5623 create_file("msitest\\override.txt", 1000);
5624 create_file("msitest\\preselected.txt", 1000);
5625 create_file("msitest\\notpreselected.txt", 1000);
5626 create_database(msifile, fo_tables, sizeof(fo_tables) / sizeof(msi_table));
5628 if (is_wow64)
5629 access |= KEY_WOW64_64KEY;
5631 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5633 r = MsiInstallProductA(msifile, "ADDLOCAL=override");
5634 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5636 skip("Not enough rights to perform tests\n");
5637 goto error;
5639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5641 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5642 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
5643 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5645 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5648 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
5650 r = MsiInstallProductA(msifile, "preselect=1");
5651 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5653 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5654 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5655 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5657 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5660 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
5661 todo_wine {
5662 ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
5663 ok(delete_pf("msitest", FALSE), "directory removed\n");
5666 r = MsiInstallProductA(msifile, NULL);
5667 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5669 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5670 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5671 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5673 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5674 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5676 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
5677 todo_wine {
5678 ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
5679 ok(delete_pf("msitest", FALSE), "directory removed\n");
5682 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access);
5684 error:
5685 DeleteFileA("msitest\\override.txt");
5686 DeleteFileA("msitest\\preselected.txt");
5687 DeleteFileA("msitest\\notpreselected.txt");
5688 delete_test_files();
5689 DeleteFile(msifile);
5692 static void test_icon_table(void)
5694 MSIHANDLE hdb = 0, record;
5695 LPCSTR query;
5696 UINT res;
5697 CHAR path[MAX_PATH];
5698 static const char prodcode[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
5700 if (is_process_limited())
5702 skip("process is limited\n");
5703 return;
5706 create_database(msifile, icon_base_tables, sizeof(icon_base_tables) / sizeof(msi_table));
5708 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5710 res = MsiOpenDatabase(msifile, MSIDBOPEN_TRANSACT, &hdb);
5711 ok(res == ERROR_SUCCESS, "failed to open db: %d\n", res);
5713 query = "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
5714 res = run_query( hdb, 0, query );
5715 ok(res == ERROR_SUCCESS, "Can't create Icon table: %d\n", res);
5717 create_file("icon.ico", 100);
5718 record = MsiCreateRecord(1);
5719 res = MsiRecordSetStream(record, 1, "icon.ico");
5720 ok(res == ERROR_SUCCESS, "Failed to add stream data to record: %d\n", res);
5722 query = "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
5723 res = run_query(hdb, record, query);
5724 ok(res == ERROR_SUCCESS, "Insert into Icon table failed: %d\n", res);
5726 res = MsiCloseHandle(record);
5727 ok(res == ERROR_SUCCESS, "Failed to close record handle: %d\n", res);
5728 DeleteFileA("icon.ico");
5729 res = MsiDatabaseCommit(hdb);
5730 ok(res == ERROR_SUCCESS, "Failed to commit database: %d\n", res);
5731 res = MsiCloseHandle(hdb);
5732 ok(res == ERROR_SUCCESS, "Failed to close database: %d\n", res);
5734 /* per-user */
5735 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
5736 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
5738 skip("Not enough rights to perform tests\n");
5739 DeleteFile(msifile);
5740 return;
5742 ok(res == ERROR_SUCCESS, "Failed to do per-user install: %d\n", res);
5744 lstrcpyA(path, APP_DATA_DIR);
5745 lstrcatA(path, "\\");
5746 lstrcatA(path, "Microsoft\\Installer\\");
5747 lstrcatA(path, prodcode);
5748 lstrcatA(path, "\\testicon");
5749 ok(file_exists(path), "Per-user icon file isn't where it's expected (%s)\n", path);
5751 res = MsiInstallProductA(msifile, "REMOVE=ALL");
5752 ok(res == ERROR_SUCCESS, "Failed to uninstall per-user\n");
5753 ok(!file_exists(path), "Per-user icon file not removed (%s)\n", path);
5755 /* system-wide */
5756 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5757 ok(res == ERROR_SUCCESS, "Failed to system-wide install: %d\n", res);
5759 lstrcpyA(path, WINDOWS_DIR);
5760 lstrcatA(path, "\\");
5761 lstrcatA(path, "Installer\\");
5762 lstrcatA(path, prodcode);
5763 lstrcatA(path, "\\testicon");
5764 ok(file_exists(path), "System-wide icon file isn't where it's expected (%s)\n", path);
5766 res = MsiInstallProductA(msifile, "REMOVE=ALL");
5767 ok(res == ERROR_SUCCESS, "Failed to uninstall system-wide\n");
5768 ok(!file_exists(path), "System-wide icon file not removed (%s)\n", path);
5770 delete_pfmsitest_files();
5771 DeleteFile(msifile);
5774 static void test_sourcedir_props(void)
5776 UINT r;
5778 if (is_process_limited())
5780 skip("process is limited\n");
5781 return;
5784 create_test_files();
5785 create_file("msitest\\sourcedir.txt", 1000);
5786 create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table));
5788 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
5790 /* full UI, no ResolveSource action */
5791 r = MsiInstallProductA(msifile, NULL);
5792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5794 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5797 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
5798 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5800 /* full UI, ResolveSource action */
5801 r = MsiInstallProductA(msifile, "ResolveSource=1");
5802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5804 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5805 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5807 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
5808 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5810 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5812 /* no UI, no ResolveSource action */
5813 r = MsiInstallProductA(msifile, NULL);
5814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5816 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5817 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5819 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
5820 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5822 /* no UI, ResolveSource action */
5823 r = MsiInstallProductA(msifile, "ResolveSource=1");
5824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5826 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5829 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
5830 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5832 DeleteFileA("msitest\\sourcedir.txt");
5833 DeleteFile(msifile);
5836 static void test_package_validation(void)
5838 UINT r;
5840 if (is_process_limited())
5842 skip("process is limited\n");
5843 return;
5846 CreateDirectoryA("msitest", NULL);
5847 create_file("msitest\\maximus", 500);
5848 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1033");
5850 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5852 r = MsiInstallProductA(msifile, NULL);
5853 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5855 skip("Not enough rights to perform tests\n");
5856 goto error;
5858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5859 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5860 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5862 DeleteFile(msifile);
5863 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;9999");
5865 r = MsiInstallProductA(msifile, NULL);
5866 ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
5868 DeleteFile(msifile);
5869 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,1033;9999");
5871 r = MsiInstallProductA(msifile, NULL);
5872 ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
5874 DeleteFile(msifile);
5875 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;1033");
5877 r = MsiInstallProductA(msifile, NULL);
5878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5879 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5880 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5882 DeleteFile(msifile);
5883 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel64,9999;1033");
5885 r = MsiInstallProductA(msifile, NULL);
5886 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
5888 DeleteFile(msifile);
5889 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,1033;1033");
5891 r = MsiInstallProductA(msifile, NULL);
5892 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
5894 DeleteFile(msifile);
5895 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,9999;1033");
5897 r = MsiInstallProductA(msifile, NULL);
5898 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
5900 DeleteFile(msifile);
5901 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9999");
5903 r = MsiInstallProductA(msifile, NULL);
5904 ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
5905 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
5906 ok(!delete_pf("msitest", FALSE), "directory exists\n");
5908 if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ))
5910 DeleteFile(msifile);
5911 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9");
5912 r = MsiInstallProductA(msifile, NULL);
5913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5914 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5915 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5917 DeleteFile(msifile);
5918 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1024");
5919 r = MsiInstallProductA(msifile, NULL);
5920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5921 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5922 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5925 DeleteFile(msifile);
5926 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel32;0");
5928 r = MsiInstallProductA(msifile, NULL);
5929 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
5930 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
5931 ok(!delete_pf("msitest", FALSE), "directory exists\n");
5933 if (is_64bit && !is_wow64)
5935 DeleteFile(msifile);
5936 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
5938 r = MsiInstallProductA(msifile, NULL);
5939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5940 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5941 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5943 DeleteFile(msifile);
5944 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
5946 r = MsiInstallProductA(msifile, NULL);
5947 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
5948 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
5949 ok(!delete_pf("msitest", FALSE), "directory exists\n");
5951 DeleteFile(msifile);
5952 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
5954 r = MsiInstallProductA(msifile, NULL);
5955 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5956 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5957 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5959 else if (is_wow64)
5961 DeleteFile(msifile);
5962 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
5964 r = MsiInstallProductA(msifile, NULL);
5965 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5966 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5967 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5969 DeleteFile(msifile);
5970 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
5972 r = MsiInstallProductA(msifile, NULL);
5973 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
5974 ok(!delete_pf_native("msitest\\maximus", TRUE), "file exists\n");
5975 ok(!delete_pf_native("msitest", FALSE), "directory exists\n");
5977 DeleteFile(msifile);
5978 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
5980 r = MsiInstallProductA(msifile, NULL);
5981 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5982 ok(delete_pf_native("msitest\\maximus", TRUE), "file exists\n");
5983 ok(delete_pf_native("msitest", FALSE), "directory exists\n");
5985 else
5987 DeleteFile(msifile);
5988 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
5990 r = MsiInstallProductA(msifile, NULL);
5991 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5992 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
5993 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
5995 DeleteFile(msifile);
5996 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Alpha,Beta,Intel;0");
5998 r = MsiInstallProductA(msifile, NULL);
5999 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6000 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
6001 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
6003 DeleteFile(msifile);
6004 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
6006 r = MsiInstallProductA(msifile, NULL);
6007 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
6008 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
6009 ok(!delete_pf("msitest", FALSE), "directory exists\n");
6011 DeleteFile(msifile);
6012 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
6014 r = MsiInstallProductA(msifile, NULL);
6015 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
6016 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
6017 ok(!delete_pf("msitest", FALSE), "directory exists\n");
6020 error:
6021 /* Delete the files in the temp (current) folder */
6022 DeleteFile(msifile);
6023 DeleteFile("msitest\\maximus");
6024 RemoveDirectory("msitest");
6027 static void test_command_line_parsing(void)
6029 UINT r;
6030 const char *cmd;
6032 if (is_process_limited())
6034 skip("process is limited\n");
6035 return;
6038 create_test_files();
6039 create_database(msifile, cl_tables, sizeof(cl_tables)/sizeof(msi_table));
6041 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6043 cmd = " ";
6044 r = MsiInstallProductA(msifile, cmd);
6045 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6047 cmd = "=";
6048 r = MsiInstallProductA(msifile, cmd);
6049 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6051 cmd = "==";
6052 r = MsiInstallProductA(msifile, cmd);
6053 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6055 cmd = "one";
6056 r = MsiInstallProductA(msifile, cmd);
6057 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6059 cmd = "=one";
6060 r = MsiInstallProductA(msifile, cmd);
6061 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6063 cmd = "P=";
6064 r = MsiInstallProductA(msifile, cmd);
6065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6067 cmd = " P=";
6068 r = MsiInstallProductA(msifile, cmd);
6069 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6071 cmd = "P= ";
6072 r = MsiInstallProductA(msifile, cmd);
6073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6075 cmd = "P=\"";
6076 r = MsiInstallProductA(msifile, cmd);
6077 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6079 cmd = "P=\"\"";
6080 r = MsiInstallProductA(msifile, cmd);
6081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6083 cmd = "P=\"\"\"";
6084 r = MsiInstallProductA(msifile, cmd);
6085 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6087 cmd = "P=\"\"\"\"";
6088 r = MsiInstallProductA(msifile, cmd);
6089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6091 cmd = "P=\" ";
6092 r = MsiInstallProductA(msifile, cmd);
6093 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6095 cmd = "P= \"";
6096 r = MsiInstallProductA(msifile, cmd);
6097 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6099 cmd = "P= \"\" ";
6100 r = MsiInstallProductA(msifile, cmd);
6101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6103 cmd = "P=\" \"";
6104 r = MsiInstallProductA(msifile, cmd);
6105 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6107 cmd = "P=one";
6108 r = MsiInstallProductA(msifile, cmd);
6109 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
6111 cmd = "P= one";
6112 r = MsiInstallProductA(msifile, cmd);
6113 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
6115 cmd = "P=\"one";
6116 r = MsiInstallProductA(msifile, cmd);
6117 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6119 cmd = "P=one\"";
6120 r = MsiInstallProductA(msifile, cmd);
6121 todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6123 cmd = "P=\"one\"";
6124 r = MsiInstallProductA(msifile, cmd);
6125 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
6127 cmd = "P= \"one\" ";
6128 r = MsiInstallProductA(msifile, cmd);
6129 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
6131 cmd = "P=\"one\"\"";
6132 r = MsiInstallProductA(msifile, cmd);
6133 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6135 cmd = "P=\"\"one\"";
6136 r = MsiInstallProductA(msifile, cmd);
6137 ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6139 cmd = "P=\"\"one\"\"";
6140 r = MsiInstallProductA(msifile, cmd);
6141 todo_wine ok(r == ERROR_INVALID_COMMAND_LINE, "Expected ERROR_INVALID_COMMAND_LINE, got %u\n", r);
6143 cmd = "P=\"one two\"";
6144 r = MsiInstallProductA(msifile, cmd);
6145 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6147 cmd = "P=\"\"\"one\"\" two\"";
6148 r = MsiInstallProductA(msifile, cmd);
6149 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6151 cmd = "P=\"\"\"one\"\" two\" Q=three";
6152 r = MsiInstallProductA(msifile, cmd);
6153 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6155 cmd = "P=\"\" Q=\"two\"";
6156 r = MsiInstallProductA(msifile, cmd);
6157 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6159 cmd = "P=\"one\" Q=\"two\"";
6160 r = MsiInstallProductA(msifile, cmd);
6161 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
6163 cmd = "P=\"one=two\"";
6164 r = MsiInstallProductA(msifile, cmd);
6165 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6167 cmd = "Q=\"\" P=\"one\"";
6168 r = MsiInstallProductA(msifile, cmd);
6169 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
6171 cmd = "P=\"\"\"one\"\"\" Q=\"two\"";
6172 r = MsiInstallProductA(msifile, cmd);
6173 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6175 cmd = "P=\"one \"\"two\"\"\" Q=\"three\"";
6176 r = MsiInstallProductA(msifile, cmd);
6177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6179 cmd = "P=\"\"\"one\"\" two\" Q=\"three\"";
6180 r = MsiInstallProductA(msifile, cmd);
6181 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6183 DeleteFile(msifile);
6184 RemoveDirectory("msitest");
6187 static void test_upgrade_code(void)
6189 UINT r;
6191 if (is_process_limited())
6193 skip("process is limited\n");
6194 return;
6197 CreateDirectoryA("msitest", NULL);
6198 create_file("msitest\\upgradecode.txt", 1000);
6199 create_database(msifile, uc_tables, sizeof(uc_tables) / sizeof(msi_table));
6201 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6203 r = MsiInstallProductA(msifile, NULL);
6204 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6206 ok(pf_exists("msitest\\upgradecode.txt"), "file not installed\n");
6208 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6209 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6211 ok(!delete_pf("msitest\\upgradecode.txt", TRUE), "file not removed\n");
6212 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6214 DeleteFileA("msitest\\upgradecode.txt");
6215 RemoveDirectoryA("msitest");
6216 DeleteFile(msifile);
6219 static void test_mixed_package(void)
6221 UINT r;
6222 LONG res;
6223 HKEY hkey;
6225 if (is_process_limited())
6227 skip("process is limited\n");
6228 return;
6230 if (!is_wow64 && !is_64bit)
6232 skip("this test must be run on 64-bit\n");
6233 return;
6235 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6236 create_database_template(msifile, mixed_tables, sizeof(mixed_tables)/sizeof(msi_table), 200, "x64;1033");
6238 r = MsiInstallProductA(msifile, NULL);
6239 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6241 skip("Not enough rights to perform tests\n");
6242 goto error;
6244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6246 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
6247 ok(!res, "can't open 32-bit component key\n");
6248 res = RegQueryValueExA(hkey, "test1", NULL, NULL, NULL, NULL);
6249 ok(!res, "value test1 not found\n");
6250 RegCloseKey(hkey);
6252 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
6253 ok(!res, "can't open 64-bit component key\n");
6254 res = RegQueryValueExA(hkey, "test2", NULL, NULL, NULL, NULL);
6255 ok(!res, "value test2 not found\n");
6256 RegCloseKey(hkey);
6258 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6259 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6261 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
6262 ok(res == ERROR_FILE_NOT_FOUND || broken(!res), "32-bit component key not removed\n");
6264 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
6265 ok(res == ERROR_FILE_NOT_FOUND, "64-bit component key not removed\n");
6267 DeleteFileA( msifile );
6268 create_database_template(msifile, mixed_tables, sizeof(mixed_tables)/sizeof(msi_table), 200, "Intel;1033");
6270 r = MsiInstallProductA(msifile, NULL);
6271 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6273 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
6274 ok(!res, "can't open 32-bit component key\n");
6275 res = RegQueryValueExA(hkey, "test1", NULL, NULL, NULL, NULL);
6276 ok(!res, "value test1 not found\n");
6277 RegCloseKey(hkey);
6279 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
6280 ok(!res, "can't open 64-bit component key\n");
6281 res = RegQueryValueExA(hkey, "test2", NULL, NULL, NULL, NULL);
6282 ok(!res, "value test2 not found\n");
6283 RegCloseKey(hkey);
6285 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6288 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
6289 ok(res == ERROR_FILE_NOT_FOUND || broken(!res), "32-bit component key not removed\n");
6291 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
6292 ok(res == ERROR_FILE_NOT_FOUND, "64-bit component key not removed\n");
6294 error:
6295 DeleteFileA( msifile );
6296 return;
6299 START_TEST(install)
6301 DWORD len;
6302 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6303 STATEMGRSTATUS status;
6304 BOOL ret = FALSE;
6306 init_functionpointers();
6308 if (pIsWow64Process)
6309 pIsWow64Process(GetCurrentProcess(), &is_wow64);
6311 GetCurrentDirectoryA(MAX_PATH, prev_path);
6312 GetTempPath(MAX_PATH, temp_path);
6313 SetCurrentDirectoryA(temp_path);
6315 lstrcpyA(CURR_DIR, temp_path);
6316 len = lstrlenA(CURR_DIR);
6318 if(len && (CURR_DIR[len - 1] == '\\'))
6319 CURR_DIR[len - 1] = 0;
6321 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6322 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6324 /* Create a restore point ourselves so we circumvent the multitude of restore points
6325 * that would have been created by all the installation and removal tests.
6327 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6328 * creation of restore points.
6330 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
6332 memset(&status, 0, sizeof(status));
6333 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
6336 /* Create only one log file and don't append. We have to pass something
6337 * for the log mode for this to work. The logfile needs to have an absolute
6338 * path otherwise we still end up with some extra logfiles as some tests
6339 * change the current directory.
6341 lstrcpyA(log_file, temp_path);
6342 lstrcatA(log_file, "\\msitest.log");
6343 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
6345 test_MsiInstallProduct();
6346 test_MsiSetComponentState();
6347 test_packagecoltypes();
6348 test_continuouscabs();
6349 test_caborder();
6350 test_mixedmedia();
6351 test_samesequence();
6352 test_uiLevelFlags();
6353 test_readonlyfile();
6354 test_readonlyfile_cab();
6355 test_setdirproperty();
6356 test_cabisextracted();
6357 test_concurrentinstall();
6358 test_setpropertyfolder();
6359 test_transformprop();
6360 test_currentworkingdir();
6361 test_admin();
6362 test_adminprops();
6363 test_missingcab();
6364 test_sourcefolder();
6365 test_customaction51();
6366 test_installstate();
6367 test_sourcepath();
6368 test_missingcomponent();
6369 test_sourcedirprop();
6370 test_adminimage();
6371 test_propcase();
6372 test_int_widths();
6373 test_shortcut();
6374 test_lastusedsource();
6375 test_preselected();
6376 test_installed_prop();
6377 test_file_in_use();
6378 test_file_in_use_cab();
6379 test_allusers_prop();
6380 test_feature_override();
6381 test_icon_table();
6382 test_sourcedir_props();
6383 test_package_validation();
6384 test_command_line_parsing();
6385 test_upgrade_code();
6386 test_mixed_package();
6388 DeleteFileA(log_file);
6390 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
6392 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
6393 if (ret)
6394 remove_restore_point(status.llSequenceNumber);
6396 FreeLibrary(hsrclient);
6398 SetCurrentDirectoryA(prev_path);