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
23 static UINT (WINAPI
*pMsiQueryComponentStateA
)
24 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
25 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
26 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
27 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
28 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
30 static BOOL (WINAPI
*pCheckTokenMembership
)(HANDLE
,PSID
,PBOOL
);
31 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
32 static BOOL (WINAPI
*pOpenProcessToken
)( HANDLE
, DWORD
, PHANDLE
);
33 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
34 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
36 static HMODULE hsrclient
= 0;
37 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
38 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
41 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
43 static const char *msifile
= "msitest.msi";
44 static const char *msifile2
= "winetest2.msi";
45 static const char *mstfile
= "winetest.mst";
47 static const WCHAR msifileW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
48 static const WCHAR msifile2W
[] = {'w','i','n','e','t','e','s','t','2','.','m','s','i',0};
50 static CHAR CURR_DIR
[MAX_PATH
];
51 static CHAR PROG_FILES_DIR
[MAX_PATH
];
52 static CHAR PROG_FILES_DIR_NATIVE
[MAX_PATH
];
53 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
54 static CHAR APP_DATA_DIR
[MAX_PATH
];
55 static CHAR WINDOWS_DIR
[MAX_PATH
];
57 /* msi database data */
59 static const CHAR component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
60 "s72\tS38\ts72\ti2\tS255\tS72\n"
61 "Component\tComponent\n"
62 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
63 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
64 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
65 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
66 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
67 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
68 "component\t\tMSITESTDIR\t0\t1\tfile\n"
69 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
71 static const CHAR directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
73 "Directory\tDirectory\n"
74 "CABOUTDIR\tMSITESTDIR\tcabout\n"
75 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
76 "FIRSTDIR\tMSITESTDIR\tfirst\n"
77 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
78 "NEWDIR\tCABOUTDIR\tnew\n"
79 "ProgramFilesFolder\tTARGETDIR\t.\n"
80 "TARGETDIR\t\tSourceDir";
82 static const CHAR feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
83 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
85 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
86 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
87 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
88 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
89 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
90 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
91 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
93 static const CHAR feature_comp_dat
[] = "Feature_\tComponent_\n"
95 "FeatureComponents\tFeature_\tComponent_\n"
101 "feature\tcomponent\n"
102 "service_feature\tservice_comp\n";
104 static const CHAR file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
105 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
107 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
108 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
109 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
110 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
111 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
112 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
113 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
115 static const CHAR install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
117 "InstallExecuteSequence\tAction\n"
118 "AllocateRegistrySpace\tNOT Installed\t1550\n"
119 "CostFinalize\t\t1000\n"
120 "CostInitialize\t\t800\n"
122 "ResolveSource\t\t950\n"
123 "MoveFiles\t\t1700\n"
124 "InstallFiles\t\t4000\n"
125 "DuplicateFiles\t\t4500\n"
126 "WriteEnvironmentStrings\t\t4550\n"
127 "CreateShortcuts\t\t4600\n"
128 "InstallServices\t\t5000\n"
129 "InstallFinalize\t\t6600\n"
130 "InstallInitialize\t\t1500\n"
131 "InstallValidate\t\t1400\n"
132 "LaunchConditions\t\t100\n"
133 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
135 static const CHAR media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
136 "i2\ti4\tL64\tS255\tS32\tS72\n"
138 "1\t3\t\t\tDISK1\t\n"
139 "2\t5\t\tmsitest.cab\tDISK2\t\n";
141 static const CHAR property_dat
[] = "Property\tValue\n"
143 "Property\tProperty\n"
144 "DefaultUIFont\tDlgFont8\n"
147 "InstallMode\tTypical\n"
148 "Manufacturer\tWine\n"
149 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
150 "PRIMARYFOLDER\tTARGETDIR\n"
151 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
153 "ProductLanguage\t1033\n"
154 "ProductName\tMSITEST\n"
155 "ProductVersion\t1.1.1\n"
156 "PROMPTROLLBACKCOST\tP\n"
158 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
159 "AdminProperties\tPOSTADMIN\n"
161 "SERVNAME\tTestService\n"
162 "SERVDISP\tTestServiceDisp\n"
163 "MSIFASTINSTALL\t1\n";
165 static const CHAR aup_property_dat
[] = "Property\tValue\n"
167 "Property\tProperty\n"
168 "DefaultUIFont\tDlgFont8\n"
172 "InstallMode\tTypical\n"
173 "Manufacturer\tWine\n"
174 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
175 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
177 "ProductLanguage\t1033\n"
178 "ProductName\tMSITEST\n"
179 "ProductVersion\t1.1.1\n"
180 "PROMPTROLLBACKCOST\tP\n"
182 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
183 "AdminProperties\tPOSTADMIN\n"
185 "SERVNAME\tTestService\n"
186 "SERVDISP\tTestServiceDisp\n"
187 "MSIFASTINSTALL\t1\n";
189 static const CHAR aup2_property_dat
[] = "Property\tValue\n"
191 "Property\tProperty\n"
192 "DefaultUIFont\tDlgFont8\n"
196 "InstallMode\tTypical\n"
197 "Manufacturer\tWine\n"
198 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
199 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
201 "ProductLanguage\t1033\n"
202 "ProductName\tMSITEST\n"
203 "ProductVersion\t1.1.1\n"
204 "PROMPTROLLBACKCOST\tP\n"
206 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
207 "AdminProperties\tPOSTADMIN\n"
209 "SERVNAME\tTestService\n"
210 "SERVDISP\tTestServiceDisp\n"
211 "MSIFASTINSTALL\t1\n";
213 static const CHAR icon_property_dat
[] = "Property\tValue\n"
215 "Property\tProperty\n"
216 "DefaultUIFont\tDlgFont8\n"
219 "InstallMode\tTypical\n"
220 "Manufacturer\tWine\n"
221 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
222 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
224 "ProductLanguage\t1033\n"
225 "ProductName\tMSITEST\n"
226 "ProductVersion\t1.1.1\n"
227 "PROMPTROLLBACKCOST\tP\n"
229 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
230 "AdminProperties\tPOSTADMIN\n"
232 "SERVNAME\tTestService\n"
233 "SERVDISP\tTestServiceDisp\n"
234 "MSIFASTINSTALL\t1\n";
236 static const CHAR shortcut_dat
[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
237 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
238 "Shortcut\tShortcut\n"
239 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
241 static const CHAR condition_dat
[] = "Feature_\tLevel\tCondition\n"
243 "Condition\tFeature_\tLevel\n"
246 static const CHAR up_property_dat
[] = "Property\tValue\n"
248 "Property\tProperty\n"
249 "DefaultUIFont\tDlgFont8\n"
252 "InstallMode\tTypical\n"
253 "Manufacturer\tWine\n"
254 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
255 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
257 "ProductLanguage\t1033\n"
258 "ProductName\tMSITEST\n"
259 "ProductVersion\t1.1.1\n"
260 "PROMPTROLLBACKCOST\tP\n"
262 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
263 "AdminProperties\tPOSTADMIN\n"
265 "SERVNAME\tTestService\n"
266 "SERVDISP\tTestServiceDisp\n"
267 "RemovePreviousVersions\t1\n"
268 "MSIFASTINSTALL\t1\n";
270 static const CHAR up2_property_dat
[] = "Property\tValue\n"
272 "Property\tProperty\n"
273 "DefaultUIFont\tDlgFont8\n"
276 "InstallMode\tTypical\n"
277 "Manufacturer\tWine\n"
278 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
279 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
281 "ProductLanguage\t1033\n"
282 "ProductName\tMSITEST\n"
283 "ProductVersion\t1.1.2\n"
284 "PROMPTROLLBACKCOST\tP\n"
286 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
287 "AdminProperties\tPOSTADMIN\n"
289 "SERVNAME\tTestService\n"
290 "SERVDISP\tTestServiceDisp\n"
291 "MSIFASTINSTALL\t1\n";
293 static const CHAR up3_property_dat
[] = "Property\tValue\n"
295 "Property\tProperty\n"
296 "DefaultUIFont\tDlgFont8\n"
299 "InstallMode\tTypical\n"
300 "Manufacturer\tWine\n"
301 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
302 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
304 "ProductLanguage\t1033\n"
305 "ProductName\tMSITEST\n"
306 "ProductVersion\t1.1.2\n"
307 "PROMPTROLLBACKCOST\tP\n"
309 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
310 "AdminProperties\tPOSTADMIN\n"
312 "SERVNAME\tTestService\n"
313 "SERVDISP\tTestServiceDisp\n"
314 "RemovePreviousVersions\t1\n"
315 "MSIFASTINSTALL\t1\n";
317 static const CHAR registry_dat
[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
318 "s72\ti2\tl255\tL255\tL0\ts72\n"
319 "Registry\tRegistry\n"
320 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
321 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
322 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
323 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
325 static const CHAR service_install_dat
[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
326 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
327 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
328 "ServiceInstall\tServiceInstall\n"
329 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
331 static const CHAR service_control_dat
[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
332 "s72\tl255\ti2\tL255\tI2\ts72\n"
333 "ServiceControl\tServiceControl\n"
334 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
336 /* tables for test_continuouscabs */
337 static const CHAR cc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
338 "s72\tS38\ts72\ti2\tS255\tS72\n"
339 "Component\tComponent\n"
340 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
341 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
342 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
344 static const CHAR cc2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
345 "s72\tS38\ts72\ti2\tS255\tS72\n"
346 "Component\tComponent\n"
347 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
348 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
349 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
351 static const CHAR cc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
352 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
354 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
356 static const CHAR cc_feature_comp_dat
[] = "Feature_\tComponent_\n"
358 "FeatureComponents\tFeature_\tComponent_\n"
360 "feature\taugustus\n"
363 static const CHAR cc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
364 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
366 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
367 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
368 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
370 static const CHAR cc2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
371 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
373 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
374 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
375 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
376 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
378 static const CHAR cc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
379 "i2\ti4\tL64\tS255\tS32\tS72\n"
381 "1\t10\t\ttest1.cab\tDISK1\t\n"
382 "2\t2\t\ttest2.cab\tDISK2\t\n"
383 "3\t12\t\ttest3.cab\tDISK3\t\n";
385 static const CHAR cc3_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
386 "i2\ti4\tL64\tS255\tS32\tS72\n"
388 "1\t10\t\ttest1.cab\tDISK1\t\n"
389 "2\t2\t\ttest2_.cab\tDISK2\t\n"
390 "3\t12\t\ttest3.cab\tDISK3\t\n";
392 static const CHAR co_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
393 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
395 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
396 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
397 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
399 static const CHAR co_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
400 "i2\ti4\tL64\tS255\tS32\tS72\n"
402 "1\t10\t\ttest1.cab\tDISK1\t\n"
403 "2\t2\t\ttest2.cab\tDISK2\t\n"
404 "3\t3\t\ttest3.cab\tDISK3\t\n";
406 static const CHAR co2_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
407 "i2\ti4\tL64\tS255\tS32\tS72\n"
409 "1\t10\t\ttest1.cab\tDISK1\t\n"
410 "2\t12\t\ttest3.cab\tDISK3\t\n"
411 "3\t2\t\ttest2.cab\tDISK2\t\n";
413 static const CHAR mm_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
414 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
416 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
417 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
418 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
420 static const CHAR mm_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
421 "i2\ti4\tL64\tS255\tS32\tS72\n"
423 "1\t3\t\ttest1.cab\tDISK1\t\n";
425 static const CHAR ss_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
426 "i2\ti4\tL64\tS255\tS32\tS72\n"
428 "1\t2\t\ttest1.cab\tDISK1\t\n"
429 "2\t2\t\ttest2.cab\tDISK2\t\n"
430 "3\t12\t\ttest3.cab\tDISK3\t\n";
432 /* tables for test_uiLevelFlags */
433 static const CHAR ui_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
434 "s72\tS38\ts72\ti2\tS255\tS72\n"
435 "Component\tComponent\n"
436 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
437 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
438 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
440 static const CHAR ui_install_ui_seq_dat
[] = "Action\tCondition\tSequence\n"
442 "InstallUISequence\tAction\n"
443 "SetUIProperty\t\t5\n"
444 "ExecuteAction\t\t1100\n";
446 static const CHAR ui_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
447 "s72\ti2\tS64\tS0\tS255\n"
448 "CustomAction\tAction\n"
449 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
451 static const CHAR rof_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
452 "s72\tS38\ts72\ti2\tS255\tS72\n"
453 "Component\tComponent\n"
454 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
456 static const CHAR rof_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
457 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
459 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
460 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
462 static const CHAR rof_feature_comp_dat
[] = "Feature_\tComponent_\n"
464 "FeatureComponents\tFeature_\tComponent_\n"
466 "montecristo\tmaximus";
468 static const CHAR rof_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
469 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
471 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
473 static const CHAR rof_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
474 "i2\ti4\tL64\tS255\tS32\tS72\n"
476 "1\t1\t\t\tDISK1\t\n";
478 static const CHAR rofc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
479 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
481 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
483 static const CHAR rofc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
484 "i2\ti4\tL64\tS255\tS32\tS72\n"
486 "1\t1\t\ttest1.cab\tDISK1\t\n";
488 static const CHAR sdp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
490 "InstallExecuteSequence\tAction\n"
491 "AllocateRegistrySpace\tNOT Installed\t1550\n"
492 "CostFinalize\t\t1000\n"
493 "CostInitialize\t\t800\n"
495 "InstallFiles\t\t4000\n"
496 "InstallFinalize\t\t6600\n"
497 "InstallInitialize\t\t1500\n"
498 "InstallValidate\t\t1400\n"
499 "LaunchConditions\t\t100\n"
500 "SetDirProperty\t\t950";
502 static const CHAR sdp_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
503 "s72\ti2\tS64\tS0\tS255\n"
504 "CustomAction\tAction\n"
505 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
507 static const CHAR pv_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
509 "InstallExecuteSequence\tAction\n"
510 "LaunchConditions\t\t100\n"
511 "CostInitialize\t\t800\n"
513 "CostFinalize\t\t1000\n"
514 "InstallValidate\t\t1400\n"
515 "InstallInitialize\t\t1500\n"
516 "InstallFiles\t\t4000\n"
517 "InstallFinalize\t\t6600\n";
519 static const CHAR cie_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
520 "s72\tS38\ts72\ti2\tS255\tS72\n"
521 "Component\tComponent\n"
522 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
523 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
524 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
525 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
527 static const CHAR cie_feature_comp_dat
[] = "Feature_\tComponent_\n"
529 "FeatureComponents\tFeature_\tComponent_\n"
531 "feature\taugustus\n"
535 static const CHAR cie_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
536 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
538 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
539 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
540 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
541 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
543 static const CHAR cie_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
544 "i2\ti4\tL64\tS255\tS32\tS72\n"
546 "1\t1\t\ttest1.cab\tDISK1\t\n"
547 "2\t2\t\ttest2.cab\tDISK2\t\n"
548 "3\t12\t\ttest3.cab\tDISK3\t\n";
550 static const CHAR ci_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
551 "s72\tS38\ts72\ti2\tS255\tS72\n"
552 "Component\tComponent\n"
553 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
555 static const CHAR ci2_feature_comp_dat
[] = "Feature_\tComponent_\n"
557 "FeatureComponents\tFeature_\tComponent_\n"
560 static const CHAR ci2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
561 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
563 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
565 static const CHAR pp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
567 "InstallExecuteSequence\tAction\n"
568 "ValidateProductID\t\t700\n"
569 "CostInitialize\t\t800\n"
571 "CostFinalize\t\t1000\n"
572 "InstallValidate\t\t1400\n"
573 "InstallInitialize\t\t1500\n"
574 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
575 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
576 "RemoveFiles\t\t3500\n"
577 "InstallFiles\t\t4000\n"
578 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
579 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
580 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
581 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
582 "InstallFinalize\t\t6600";
584 static const CHAR tp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
585 "s72\tS38\ts72\ti2\tS255\tS72\n"
586 "Component\tComponent\n"
587 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
589 static const CHAR cwd_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
590 "s72\tS38\ts72\ti2\tS255\tS72\n"
591 "Component\tComponent\n"
592 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
594 static const CHAR adm_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
595 "s72\tS38\ts72\ti2\tS255\tS72\n"
596 "Component\tComponent\n"
597 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
599 static const CHAR adm_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
600 "s72\ti2\tS64\tS0\tS255\n"
601 "CustomAction\tAction\n"
602 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
604 static const CHAR adm_admin_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
606 "AdminExecuteSequence\tAction\n"
607 "CostFinalize\t\t1000\n"
608 "CostInitialize\t\t800\n"
610 "SetPOSTADMIN\t\t950\n"
611 "InstallFiles\t\t4000\n"
612 "InstallFinalize\t\t6600\n"
613 "InstallInitialize\t\t1500\n"
614 "InstallValidate\t\t1400\n"
615 "LaunchConditions\t\t100";
617 static const CHAR amp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
618 "s72\tS38\ts72\ti2\tS255\tS72\n"
619 "Component\tComponent\n"
620 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
622 static const CHAR rem_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
624 "InstallExecuteSequence\tAction\n"
625 "ValidateProductID\t\t700\n"
626 "CostInitialize\t\t800\n"
628 "CostFinalize\t\t1000\n"
629 "InstallValidate\t\t1400\n"
630 "InstallInitialize\t\t1500\n"
631 "ProcessComponents\t\t1600\n"
632 "UnpublishFeatures\t\t1800\n"
633 "RemoveFiles\t\t3500\n"
634 "InstallFiles\t\t4000\n"
635 "RegisterProduct\t\t6100\n"
636 "PublishFeatures\t\t6300\n"
637 "PublishProduct\t\t6400\n"
638 "InstallFinalize\t\t6600";
640 static const CHAR mc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
641 "s72\tS38\ts72\ti2\tS255\tS72\n"
642 "Component\tComponent\n"
643 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
644 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
645 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
646 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
647 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
649 static const CHAR mc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
650 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
652 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
653 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
654 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
655 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
656 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
658 static const CHAR mc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
659 "i2\ti4\tL64\tS255\tS32\tS72\n"
661 "1\t1\t\ttest1.cab\tDISK1\t\n"
662 "2\t2\t\ttest2.cab\tDISK2\t\n"
663 "3\t3\t\ttest3.cab\tDISK3\t\n"
664 "4\t4\t\ttest3.cab\tDISK3\t\n"
665 "5\t5\t\ttest4.cab\tDISK4\t\n";
667 static const CHAR mc_file_hash_dat
[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
668 "s72\ti2\ti4\ti4\ti4\ti4\n"
669 "MsiFileHash\tFile_\n"
670 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
672 static const CHAR wrv_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
673 "s72\tS38\ts72\ti2\tS255\tS72\n"
674 "Component\tComponent\n"
675 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
677 static const CHAR ca51_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
678 "s72\tS38\ts72\ti2\tS255\tS72\n"
679 "Component\tComponent\n"
680 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
682 static const CHAR ca51_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
684 "InstallExecuteSequence\tAction\n"
685 "ValidateProductID\t\t700\n"
686 "GoodSetProperty\t\t725\n"
687 "BadSetProperty\t\t750\n"
688 "CostInitialize\t\t800\n"
689 "ResolveSource\t\t810\n"
691 "SetSourceDir\tSRCDIR\t910\n"
692 "CostFinalize\t\t1000\n"
693 "InstallValidate\t\t1400\n"
694 "InstallInitialize\t\t1500\n"
695 "InstallFiles\t\t4000\n"
696 "InstallFinalize\t\t6600";
698 static const CHAR ca51_custom_action_dat
[] = "Action\tType\tSource\tTarget\n"
700 "CustomAction\tAction\n"
701 "GoodSetProperty\t51\tMYPROP\t42\n"
702 "BadSetProperty\t51\t\tMYPROP\n"
703 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
705 static const CHAR is_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
706 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
708 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
709 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
710 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
711 "four\t\t\t\t2\t0\t\t0"; /* disabled */
713 static const CHAR is_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
714 "s72\tS38\ts72\ti2\tS255\tS72\n"
715 "Component\tComponent\n"
716 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
717 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
718 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
719 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
720 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
721 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
722 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
723 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
724 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
725 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
726 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
727 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
729 static const CHAR is_feature_comp_dat
[] = "Feature_\tComponent_\n"
731 "FeatureComponents\tFeature_\tComponent_\n"
745 static const CHAR is_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
746 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
748 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
749 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
750 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
751 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
752 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
753 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
754 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
755 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
756 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
757 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
758 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
759 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
761 static const CHAR is_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
762 "i2\ti4\tL64\tS255\tS32\tS72\n"
764 "1\t12\t\t\tDISK1\t\n";
766 static const CHAR sp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
767 "s72\tS38\ts72\ti2\tS255\tS72\n"
768 "Component\tComponent\n"
769 "augustus\t\tTWODIR\t0\t\taugustus\n";
771 static const CHAR sp_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
773 "Directory\tDirectory\n"
774 "TARGETDIR\t\tSourceDir\n"
775 "ProgramFilesFolder\tTARGETDIR\t.\n"
776 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
777 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
778 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
780 static const CHAR mcp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
781 "s72\tS38\ts72\ti2\tS255\tS72\n"
782 "Component\tComponent\n"
783 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
784 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
785 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
787 static const CHAR mcp_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
788 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
790 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
791 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
792 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
794 static const CHAR mcp_feature_comp_dat
[] = "Feature_\tComponent_\n"
796 "FeatureComponents\tFeature_\tComponent_\n"
797 "hydroxyl\thydrogen\n"
801 static const CHAR mcp_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
802 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
804 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
805 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
806 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
807 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
809 static const CHAR ai_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
810 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
812 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
813 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
814 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
815 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
816 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
817 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
818 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
820 static const CHAR ip_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
822 "InstallExecuteSequence\tAction\n"
823 "CostFinalize\t\t1000\n"
824 "ValidateProductID\t\t700\n"
825 "CostInitialize\t\t800\n"
827 "RemoveFiles\t\t3500\n"
828 "InstallFiles\t\t4000\n"
829 "RegisterUser\t\t6000\n"
830 "RegisterProduct\t\t6100\n"
831 "PublishFeatures\t\t6300\n"
832 "PublishProduct\t\t6400\n"
833 "InstallFinalize\t\t6600\n"
834 "InstallInitialize\t\t1500\n"
835 "ProcessComponents\t\t1600\n"
836 "UnpublishFeatures\t\t1800\n"
837 "InstallValidate\t\t1400\n"
838 "LaunchConditions\t\t100\n"
839 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
841 static const CHAR ip_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
842 "s72\ti2\tS64\tS0\tS255\n"
843 "CustomAction\tAction\n"
844 "TestInstalledProp\t19\t\tTest failed\t\n";
846 static const CHAR aup_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
848 "InstallExecuteSequence\tAction\n"
849 "CostFinalize\t\t1000\n"
850 "ValidateProductID\t\t700\n"
851 "CostInitialize\t\t800\n"
853 "RemoveFiles\t\t3500\n"
854 "InstallFiles\t\t4000\n"
855 "RegisterUser\t\t6000\n"
856 "RegisterProduct\t\t6100\n"
857 "PublishFeatures\t\t6300\n"
858 "PublishProduct\t\t6400\n"
859 "InstallFinalize\t\t6600\n"
860 "InstallInitialize\t\t1500\n"
861 "ProcessComponents\t\t1600\n"
862 "UnpublishFeatures\t\t1800\n"
863 "InstallValidate\t\t1400\n"
864 "LaunchConditions\t\t100\n"
865 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
867 static const CHAR aup2_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
869 "InstallExecuteSequence\tAction\n"
870 "CostFinalize\t\t1000\n"
871 "ValidateProductID\t\t700\n"
872 "CostInitialize\t\t800\n"
874 "RemoveFiles\t\t3500\n"
875 "InstallFiles\t\t4000\n"
876 "RegisterUser\t\t6000\n"
877 "RegisterProduct\t\t6100\n"
878 "PublishFeatures\t\t6300\n"
879 "PublishProduct\t\t6400\n"
880 "InstallFinalize\t\t6600\n"
881 "InstallInitialize\t\t1500\n"
882 "ProcessComponents\t\t1600\n"
883 "UnpublishFeatures\t\t1800\n"
884 "InstallValidate\t\t1400\n"
885 "LaunchConditions\t\t100\n"
886 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
888 static const CHAR aup3_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
890 "InstallExecuteSequence\tAction\n"
891 "CostFinalize\t\t1000\n"
892 "ValidateProductID\t\t700\n"
893 "CostInitialize\t\t800\n"
895 "RemoveFiles\t\t3500\n"
896 "InstallFiles\t\t4000\n"
897 "RegisterUser\t\t6000\n"
898 "RegisterProduct\t\t6100\n"
899 "PublishFeatures\t\t6300\n"
900 "PublishProduct\t\t6400\n"
901 "InstallFinalize\t\t6600\n"
902 "InstallInitialize\t\t1500\n"
903 "ProcessComponents\t\t1600\n"
904 "UnpublishFeatures\t\t1800\n"
905 "InstallValidate\t\t1400\n"
906 "LaunchConditions\t\t100\n"
907 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
909 static const CHAR aup_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
910 "s72\ti2\tS64\tS0\tS255\n"
911 "CustomAction\tAction\n"
912 "TestAllUsersProp\t19\t\tTest failed\t\n";
914 static const CHAR fo_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
915 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
917 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
918 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
919 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
921 static const CHAR fo_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
922 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
924 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
925 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
926 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
928 static const CHAR fo_condition_dat
[] = "Feature_\tLevel\tCondition\n"
930 "Condition\tFeature_\tLevel\n"
931 "preselected\t0\tPreselected\n"
932 "notpreselected\t0\tNOT Preselected\n";
934 static const CHAR fo_feature_comp_dat
[] = "Feature_\tComponent_\n"
936 "FeatureComponents\tFeature_\tComponent_\n"
937 "override\toverride\n"
938 "preselected\tpreselected\n"
939 "notpreselected\tnotpreselected\n";
941 static const CHAR fo_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
942 "s72\tS38\ts72\ti2\tS255\tS72\n"
943 "Component\tComponent\n"
944 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
945 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
946 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
948 static const CHAR fo_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
949 "s72\ti2\tS64\tS0\tS255\n"
950 "CustomAction\tAction\n"
951 "SetPreselected\t51\tPreselected\t1\t\n";
953 static const CHAR fo_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
955 "InstallExecuteSequence\tAction\n"
956 "LaunchConditions\t\t100\n"
957 "SetPreselected\tpreselect=1\t200\n"
958 "CostInitialize\t\t800\n"
960 "CostFinalize\t\t1000\n"
961 "InstallValidate\t\t1400\n"
962 "InstallInitialize\t\t1500\n"
963 "ProcessComponents\t\t1600\n"
964 "RemoveFiles\t\t1700\n"
965 "InstallFiles\t\t2000\n"
966 "RegisterProduct\t\t5000\n"
967 "PublishFeatures\t\t5100\n"
968 "PublishProduct\t\t5200\n"
969 "InstallFinalize\t\t6000\n";
971 static const CHAR uc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
972 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
974 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
976 static const CHAR uc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
977 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
979 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
981 static const CHAR uc_feature_comp_dat
[] = "Feature_\tComponent_\n"
983 "FeatureComponents\tFeature_\tComponent_\n"
984 "upgradecode\tupgradecode\n";
986 static const CHAR uc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
987 "s72\tS38\ts72\ti2\tS255\tS72\n"
988 "Component\tComponent\n"
989 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
991 static const CHAR uc_property_dat
[] = "Property\tValue\n"
993 "Property\tProperty\n"
995 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
996 "ProductName\tMSITEST\n"
997 "ProductVersion\t1.1.1\n"
998 "UpgradeCode\t#UPGEADECODE#\n"
999 "MSIFASTINSTALL\t1\n";
1001 static const CHAR uc_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
1003 "InstallExecuteSequence\tAction\n"
1004 "LaunchConditions\t\t100\n"
1005 "CostInitialize\t\t200\n"
1007 "CostFinalize\t\t400\n"
1008 "InstallInitialize\t\t500\n"
1009 "ProcessComponents\t\t600\n"
1010 "InstallValidate\t\t700\n"
1011 "RemoveFiles\t\t800\n"
1012 "InstallFiles\t\t900\n"
1013 "RegisterProduct\t\t1000\n"
1014 "PublishFeatures\t\t1100\n"
1015 "PublishProduct\t\t1200\n"
1016 "InstallFinalize\t\t1300\n";
1018 static const char mixed_feature_dat
[] =
1019 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1020 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1021 "Feature\tFeature\n"
1022 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1023 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1025 static const char mixed_feature_comp_dat
[] =
1026 "Feature_\tComponent_\n"
1028 "FeatureComponents\tFeature_\tComponent_\n"
1030 "feature2\tcomp2\n";
1032 static const char mixed_component_dat
[] =
1033 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1034 "s72\tS38\ts72\ti2\tS255\tS72\n"
1035 "Component\tComponent\n"
1036 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1037 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1039 static const char mixed_registry_dat
[] =
1040 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1041 "s72\ti2\tl255\tL255\tL0\ts72\n"
1042 "Registry\tRegistry\n"
1043 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1044 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n"
1045 "regdata3\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest32\tcomp1\n"
1046 "regdata4\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest32.dll\tcomp1\n"
1047 "regdata5\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest64\tcomp2\n"
1048 "regdata6\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest64.dll\tcomp2\n";
1050 static const char mixed_install_exec_seq_dat
[] =
1051 "Action\tCondition\tSequence\n"
1053 "InstallExecuteSequence\tAction\n"
1054 "LaunchConditions\t\t100\n"
1055 "CostInitialize\t\t200\n"
1057 "CostFinalize\t\t400\n"
1058 "InstallValidate\t\t500\n"
1059 "InstallInitialize\t\t600\n"
1060 "ProcessComponents\t\t700\n"
1061 "UnpublishFeatures\t\t800\n"
1062 "RemoveRegistryValues\t\t900\n"
1063 "WriteRegistryValues\t\t1000\n"
1064 "RegisterProduct\t\t1100\n"
1065 "PublishFeatures\t\t1200\n"
1066 "PublishProduct\t\t1300\n"
1067 "InstallFinalize\t\t1400\n";
1069 static const char vp_file_dat
[] =
1070 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1071 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1073 "volumeprop\tcomp\tvolumeprop.txt\t1000\t\t\t8192\t1\n";
1075 static const char vp_feature_dat
[] =
1076 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1077 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1078 "Feature\tFeature\n"
1079 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1081 static const char vp_feature_comp_dat
[] =
1082 "Feature_\tComponent_\n"
1084 "FeatureComponents\tFeature_\tComponent_\n"
1087 static const char vp_component_dat
[] =
1088 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1089 "s72\tS38\ts72\ti2\tS255\tS72\n"
1090 "Component\tComponent\n"
1091 "comp\t{24364AE7-5B7F-496C-AF5A-54893639C567}\tMSITESTDIR\t0\t\tvolumeprop\n";
1093 static const char vp_custom_action_dat
[] =
1094 "Action\tType\tSource\tTarget\tISComments\n"
1095 "s72\ti2\tS64\tS0\tS255\n"
1096 "CustomAction\tAction\n"
1097 "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n"
1098 "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n"
1099 "TestPrimaryVolumeSpaceRequired0\t19\t\tPrimaryVolumeSpaceRequired set before CostFinalize\t\n"
1100 "TestPrimaryVolumeSpaceRemaining0\t19\t\tPrimaryVolumeSpaceRemaining set before CostFinalize\t\n"
1101 "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n"
1102 "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n"
1103 "TestPrimaryVolumeSpaceRequired1\t19\t\tPrimaryVolumeSpaceRequired not set before InstallValidate\t\n"
1104 "TestPrimaryVolumeSpaceRemaining1\t19\t\tPrimaryVolumeSpaceRemaining not set before InstallValidate\t\n"
1105 "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n"
1106 "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n"
1107 "TestPrimaryVolumeSpaceRequired2\t19\t\tPrimaryVolumeSpaceRequired not set after InstallValidate\t\n"
1108 "TestPrimaryVolumeSpaceRemaining2\t19\t\tPrimaryVolumeSpaceRemaining not set after InstallValidate\t\n";
1110 static const char vp_install_exec_seq_dat
[] =
1111 "Action\tCondition\tSequence\n"
1113 "InstallExecuteSequence\tAction\n"
1114 "LaunchConditions\t\t100\n"
1115 "CostInitialize\t\t200\n"
1117 "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n"
1118 "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n"
1119 "TestPrimaryVolumeSpaceRequired0\tPrimaryVolumeSpaceRequired AND NOT REMOVE\t510\n"
1120 "TestPrimaryVolumeSpaceRemaining0\tPrimaryVolumeSpaceRemaining AND NOT REMOVE\t520\n"
1121 "CostFinalize\t\t600\n"
1122 "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n"
1123 "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n"
1124 "TestPrimaryVolumeSpaceRequired1\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t810\n"
1125 "TestPrimaryVolumeSpaceRemaining1\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t820\n"
1126 "InstallValidate\t\t900\n"
1127 "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n"
1128 "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n"
1129 "TestPrimaryVolumeSpaceRequired2\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t1110\n"
1130 "TestPrimaryVolumeSpaceRemaining2\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t1120\n"
1131 "InstallInitialize\t\t1200\n"
1132 "ProcessComponents\t\t1300\n"
1133 "RemoveFiles\t\t1400\n"
1134 "InstallFiles\t\t1500\n"
1135 "RegisterProduct\t\t1600\n"
1136 "PublishFeatures\t\t1700\n"
1137 "PublishProduct\t\t1800\n"
1138 "InstallFinalize\t\t1900\n";
1140 static const char shc_property_dat
[] =
1143 "Property\tProperty\n"
1145 "ProductCode\t{5CD99CD0-69C7-409B-9905-82DD743CC840}\n"
1146 "ProductName\tMSITEST\n"
1147 "ProductVersion\t1.1.1\n"
1148 "MSIFASTINSTALL\t1\n";
1150 static const char shc2_property_dat
[] =
1153 "Property\tProperty\n"
1155 "ProductCode\t{4CEFADE5-DAFB-4C21-8EF2-4ED4F139F340}\n"
1156 "ProductName\tMSITEST2\n"
1157 "ProductVersion\t1.1.1\n"
1158 "MSIFASTINSTALL\t1\n";
1160 static const char shc_file_dat
[] =
1161 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1162 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1164 "sharedcomponent\tsharedcomponent\tsharedcomponent.txt\t1000\t\t\t8192\t1\n";
1166 static const char shc_feature_dat
[] =
1167 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1168 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1169 "Feature\tFeature\n"
1170 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1172 static const char shc_feature_comp_dat
[] =
1173 "Feature_\tComponent_\n"
1175 "FeatureComponents\tFeature_\tComponent_\n"
1176 "feature\tsharedcomponent\n";
1178 static const char shc_component_dat
[] =
1179 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1180 "s72\tS38\ts72\ti2\tS255\tS72\n"
1181 "Component\tComponent\n"
1182 "sharedcomponent\t{900A4ACB-DC6F-4795-A04B-81B530183D41}\tMSITESTDIR\t0\t\tsharedcomponent\n";
1184 static const char shc_custom_action_dat
[] =
1185 "Action\tType\tSource\tTarget\tISComments\n"
1186 "s72\ti2\tS64\tS0\tS255\n"
1187 "CustomAction\tAction\n"
1188 "TestComponentAction\t19\t\twrong component action on install\t\n";
1190 static const char shc_install_exec_seq_dat
[] =
1191 "Action\tCondition\tSequence\n"
1193 "InstallExecuteSequence\tAction\n"
1194 "LaunchConditions\t\t100\n"
1195 "CostInitialize\t\t200\n"
1197 "CostFinalize\t\t600\n"
1198 "InstallValidate\t\t900\n"
1199 "InstallInitialize\t\t1200\n"
1200 "ProcessComponents\t\t1300\n"
1201 "RemoveFiles\t\t1400\n"
1202 "InstallFiles\t\t1500\n"
1203 "TestComponentAction\tNOT REMOVE AND ($sharedcomponent <> 3)\t1600\n"
1204 "RegisterProduct\t\t1700\n"
1205 "PublishFeatures\t\t1800\n"
1206 "PublishProduct\t\t1900\n"
1207 "InstallFinalize\t\t2000\n";
1209 static const char ft_file_dat
[] =
1210 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1211 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1213 "featuretree\tcomp\tfeaturetree.txt\t1000\t\t\t8192\t1\n";
1215 static const char ft_comp_dat
[] =
1216 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1217 "s72\tS38\ts72\ti2\tS255\tS72\n"
1218 "Component\tComponent\n"
1219 "comp\t{12345678-1234-1234-1234-222222222222}\tTARGETDIR\t0\t\t\n"
1220 "comp2\t{12345678-1234-1234-1234-333333333333}\tTARGETDIR\t0\t\tfeaturetree\n";
1222 static const char ft_feature_dat
[] =
1223 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1224 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1225 "Feature\tFeature\n"
1226 "A\t\t\t\t2\t1\t\t0\n"
1227 "C\tB\t\t\t2\t1\t\t0\n"
1228 "B\tA\t\t\t4\t1\t\t0\n"
1229 "D\t\t\t\t2\t1\t\t0\n";
1231 static const char ft_feature_comp_dat
[] =
1232 "Feature_\tComponent_\n"
1234 "FeatureComponents\tFeature_\tComponent_\n"
1238 static const char ft_condition_dat
[] =
1239 "Feature_\tLevel\tCondition\n"
1241 "Condition\tFeature_\tLevel\n"
1242 "A\t0\t\"0\"<>INSTALLTYPE\n";
1244 static const char ft_custom_action_dat
[] =
1245 "Action\tType\tSource\tTarget\tISComments\n"
1246 "s72\ti2\tS64\tS0\tS255\n"
1247 "CustomAction\tAction\n"
1248 "Run A\t19\t\tA\t\n"
1249 "Run B\t19\t\tB\t\n"
1250 "Run C\t19\t\tC\t\n";
1252 static const char ft_install_exec_seq_dat
[] =
1253 "Action\tCondition\tSequence\n"
1255 "InstallExecuteSequence\tAction\n"
1256 "CostInitialize\t\t100\n"
1258 "CostFinalize\t\t300\n"
1259 "InstallValidate\t\t400\n"
1260 "InstallInitialize\t\t500\n"
1261 "Run C\t3 = &C AND NOT Installed\t600\n"
1262 "Run B\t3 = &B AND NOT Installed\t700\n"
1263 "Run A\t3 = &A AND NOT Installed\t800\n"
1264 "ProcessComponents\t\t900\n"
1265 "RemoveFiles\t\t1000\n"
1266 "InstallFiles\t\t1100\n"
1267 "RegisterProduct\t\t1200\n"
1268 "PublishFeatures\t\t1300\n"
1269 "PublishProduct\t\t1400\n"
1270 "InstallFinalize\t\t1500\n";
1272 typedef struct _msi_table
1274 const CHAR
*filename
;
1279 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1281 static const msi_table tables
[] =
1283 ADD_TABLE(component
),
1284 ADD_TABLE(directory
),
1286 ADD_TABLE(feature_comp
),
1288 ADD_TABLE(install_exec_seq
),
1290 ADD_TABLE(property
),
1291 ADD_TABLE(registry
),
1292 ADD_TABLE(service_install
),
1293 ADD_TABLE(service_control
)
1296 static const msi_table sc_tables
[] =
1298 ADD_TABLE(component
),
1299 ADD_TABLE(directory
),
1301 ADD_TABLE(feature_comp
),
1303 ADD_TABLE(install_exec_seq
),
1305 ADD_TABLE(property
),
1309 static const msi_table ps_tables
[] =
1311 ADD_TABLE(component
),
1312 ADD_TABLE(directory
),
1314 ADD_TABLE(feature_comp
),
1316 ADD_TABLE(install_exec_seq
),
1318 ADD_TABLE(property
),
1319 ADD_TABLE(condition
)
1322 static const msi_table up_tables
[] =
1324 ADD_TABLE(component
),
1325 ADD_TABLE(directory
),
1327 ADD_TABLE(feature_comp
),
1329 ADD_TABLE(install_exec_seq
),
1331 ADD_TABLE(up_property
),
1332 ADD_TABLE(registry
),
1333 ADD_TABLE(service_install
),
1334 ADD_TABLE(service_control
)
1337 static const msi_table up2_tables
[] =
1339 ADD_TABLE(component
),
1340 ADD_TABLE(directory
),
1342 ADD_TABLE(feature_comp
),
1344 ADD_TABLE(install_exec_seq
),
1346 ADD_TABLE(up2_property
),
1347 ADD_TABLE(registry
),
1348 ADD_TABLE(service_install
),
1349 ADD_TABLE(service_control
)
1352 static const msi_table up3_tables
[] =
1354 ADD_TABLE(component
),
1355 ADD_TABLE(directory
),
1357 ADD_TABLE(feature_comp
),
1359 ADD_TABLE(install_exec_seq
),
1361 ADD_TABLE(up3_property
),
1362 ADD_TABLE(registry
),
1363 ADD_TABLE(service_install
),
1364 ADD_TABLE(service_control
)
1367 static const msi_table up4_tables
[] =
1369 ADD_TABLE(component
),
1370 ADD_TABLE(directory
),
1372 ADD_TABLE(feature_comp
),
1374 ADD_TABLE(pp_install_exec_seq
),
1376 ADD_TABLE(property
),
1377 ADD_TABLE(registry
),
1378 ADD_TABLE(service_install
),
1379 ADD_TABLE(service_control
)
1382 static const msi_table up5_tables
[] =
1384 ADD_TABLE(component
),
1385 ADD_TABLE(directory
),
1387 ADD_TABLE(feature_comp
),
1389 ADD_TABLE(pp_install_exec_seq
),
1391 ADD_TABLE(up_property
),
1392 ADD_TABLE(registry
),
1393 ADD_TABLE(service_install
),
1394 ADD_TABLE(service_control
)
1397 static const msi_table up6_tables
[] =
1399 ADD_TABLE(component
),
1400 ADD_TABLE(directory
),
1402 ADD_TABLE(feature_comp
),
1404 ADD_TABLE(pp_install_exec_seq
),
1406 ADD_TABLE(up2_property
),
1407 ADD_TABLE(registry
),
1408 ADD_TABLE(service_install
),
1409 ADD_TABLE(service_control
)
1412 static const msi_table up7_tables
[] =
1414 ADD_TABLE(component
),
1415 ADD_TABLE(directory
),
1417 ADD_TABLE(feature_comp
),
1419 ADD_TABLE(pp_install_exec_seq
),
1421 ADD_TABLE(up3_property
),
1422 ADD_TABLE(registry
),
1423 ADD_TABLE(service_install
),
1424 ADD_TABLE(service_control
)
1427 static const msi_table cc_tables
[] =
1429 ADD_TABLE(cc_component
),
1430 ADD_TABLE(directory
),
1431 ADD_TABLE(cc_feature
),
1432 ADD_TABLE(cc_feature_comp
),
1434 ADD_TABLE(install_exec_seq
),
1435 ADD_TABLE(cc_media
),
1436 ADD_TABLE(property
),
1439 static const msi_table cc2_tables
[] =
1441 ADD_TABLE(cc2_component
),
1442 ADD_TABLE(directory
),
1443 ADD_TABLE(cc_feature
),
1444 ADD_TABLE(cc_feature_comp
),
1445 ADD_TABLE(cc2_file
),
1446 ADD_TABLE(install_exec_seq
),
1447 ADD_TABLE(cc_media
),
1448 ADD_TABLE(property
),
1451 static const msi_table cc3_tables
[] =
1453 ADD_TABLE(cc_component
),
1454 ADD_TABLE(directory
),
1455 ADD_TABLE(cc_feature
),
1456 ADD_TABLE(cc_feature_comp
),
1458 ADD_TABLE(install_exec_seq
),
1459 ADD_TABLE(cc3_media
),
1460 ADD_TABLE(property
),
1463 static const msi_table co_tables
[] =
1465 ADD_TABLE(cc_component
),
1466 ADD_TABLE(directory
),
1467 ADD_TABLE(cc_feature
),
1468 ADD_TABLE(cc_feature_comp
),
1470 ADD_TABLE(install_exec_seq
),
1471 ADD_TABLE(co_media
),
1472 ADD_TABLE(property
),
1475 static const msi_table co2_tables
[] =
1477 ADD_TABLE(cc_component
),
1478 ADD_TABLE(directory
),
1479 ADD_TABLE(cc_feature
),
1480 ADD_TABLE(cc_feature_comp
),
1482 ADD_TABLE(install_exec_seq
),
1483 ADD_TABLE(co2_media
),
1484 ADD_TABLE(property
),
1487 static const msi_table mm_tables
[] =
1489 ADD_TABLE(cc_component
),
1490 ADD_TABLE(directory
),
1491 ADD_TABLE(cc_feature
),
1492 ADD_TABLE(cc_feature_comp
),
1494 ADD_TABLE(install_exec_seq
),
1495 ADD_TABLE(mm_media
),
1496 ADD_TABLE(property
),
1499 static const msi_table ss_tables
[] =
1501 ADD_TABLE(cc_component
),
1502 ADD_TABLE(directory
),
1503 ADD_TABLE(cc_feature
),
1504 ADD_TABLE(cc_feature_comp
),
1506 ADD_TABLE(install_exec_seq
),
1507 ADD_TABLE(ss_media
),
1508 ADD_TABLE(property
),
1511 static const msi_table ui_tables
[] =
1513 ADD_TABLE(ui_component
),
1514 ADD_TABLE(directory
),
1515 ADD_TABLE(cc_feature
),
1516 ADD_TABLE(cc_feature_comp
),
1518 ADD_TABLE(install_exec_seq
),
1519 ADD_TABLE(ui_install_ui_seq
),
1520 ADD_TABLE(ui_custom_action
),
1521 ADD_TABLE(cc_media
),
1522 ADD_TABLE(property
),
1525 static const msi_table rof_tables
[] =
1527 ADD_TABLE(rof_component
),
1528 ADD_TABLE(directory
),
1529 ADD_TABLE(rof_feature
),
1530 ADD_TABLE(rof_feature_comp
),
1531 ADD_TABLE(rof_file
),
1532 ADD_TABLE(install_exec_seq
),
1533 ADD_TABLE(rof_media
),
1534 ADD_TABLE(property
),
1537 static const msi_table rofc_tables
[] =
1539 ADD_TABLE(rof_component
),
1540 ADD_TABLE(directory
),
1541 ADD_TABLE(rof_feature
),
1542 ADD_TABLE(rof_feature_comp
),
1543 ADD_TABLE(rofc_file
),
1544 ADD_TABLE(install_exec_seq
),
1545 ADD_TABLE(rofc_media
),
1546 ADD_TABLE(property
),
1549 static const msi_table sdp_tables
[] =
1551 ADD_TABLE(rof_component
),
1552 ADD_TABLE(directory
),
1553 ADD_TABLE(rof_feature
),
1554 ADD_TABLE(rof_feature_comp
),
1555 ADD_TABLE(rof_file
),
1556 ADD_TABLE(sdp_install_exec_seq
),
1557 ADD_TABLE(sdp_custom_action
),
1558 ADD_TABLE(rof_media
),
1559 ADD_TABLE(property
),
1562 static const msi_table cie_tables
[] =
1564 ADD_TABLE(cie_component
),
1565 ADD_TABLE(directory
),
1566 ADD_TABLE(cc_feature
),
1567 ADD_TABLE(cie_feature_comp
),
1568 ADD_TABLE(cie_file
),
1569 ADD_TABLE(install_exec_seq
),
1570 ADD_TABLE(cie_media
),
1571 ADD_TABLE(property
),
1574 static const msi_table tp_tables
[] =
1576 ADD_TABLE(tp_component
),
1577 ADD_TABLE(directory
),
1578 ADD_TABLE(rof_feature
),
1579 ADD_TABLE(ci2_feature_comp
),
1580 ADD_TABLE(ci2_file
),
1581 ADD_TABLE(install_exec_seq
),
1582 ADD_TABLE(rof_media
),
1583 ADD_TABLE(property
),
1586 static const msi_table cwd_tables
[] =
1588 ADD_TABLE(cwd_component
),
1589 ADD_TABLE(directory
),
1590 ADD_TABLE(rof_feature
),
1591 ADD_TABLE(ci2_feature_comp
),
1592 ADD_TABLE(ci2_file
),
1593 ADD_TABLE(install_exec_seq
),
1594 ADD_TABLE(rof_media
),
1595 ADD_TABLE(property
),
1598 static const msi_table adm_tables
[] =
1600 ADD_TABLE(adm_component
),
1601 ADD_TABLE(directory
),
1602 ADD_TABLE(rof_feature
),
1603 ADD_TABLE(ci2_feature_comp
),
1604 ADD_TABLE(ci2_file
),
1605 ADD_TABLE(install_exec_seq
),
1606 ADD_TABLE(rof_media
),
1607 ADD_TABLE(property
),
1608 ADD_TABLE(adm_custom_action
),
1609 ADD_TABLE(adm_admin_exec_seq
),
1612 static const msi_table amp_tables
[] =
1614 ADD_TABLE(amp_component
),
1615 ADD_TABLE(directory
),
1616 ADD_TABLE(rof_feature
),
1617 ADD_TABLE(ci2_feature_comp
),
1618 ADD_TABLE(ci2_file
),
1619 ADD_TABLE(install_exec_seq
),
1620 ADD_TABLE(rof_media
),
1621 ADD_TABLE(property
),
1624 static const msi_table mc_tables
[] =
1626 ADD_TABLE(mc_component
),
1627 ADD_TABLE(directory
),
1628 ADD_TABLE(cc_feature
),
1629 ADD_TABLE(cie_feature_comp
),
1631 ADD_TABLE(install_exec_seq
),
1632 ADD_TABLE(mc_media
),
1633 ADD_TABLE(property
),
1634 ADD_TABLE(mc_file_hash
),
1637 static const msi_table sf_tables
[] =
1639 ADD_TABLE(wrv_component
),
1640 ADD_TABLE(directory
),
1641 ADD_TABLE(rof_feature
),
1642 ADD_TABLE(ci2_feature_comp
),
1643 ADD_TABLE(ci2_file
),
1644 ADD_TABLE(install_exec_seq
),
1645 ADD_TABLE(rof_media
),
1646 ADD_TABLE(property
),
1649 static const msi_table ca51_tables
[] =
1651 ADD_TABLE(ca51_component
),
1652 ADD_TABLE(directory
),
1653 ADD_TABLE(rof_feature
),
1654 ADD_TABLE(ci2_feature_comp
),
1655 ADD_TABLE(ci2_file
),
1656 ADD_TABLE(ca51_install_exec_seq
),
1657 ADD_TABLE(rof_media
),
1658 ADD_TABLE(property
),
1659 ADD_TABLE(ca51_custom_action
),
1662 static const msi_table is_tables
[] =
1664 ADD_TABLE(is_component
),
1665 ADD_TABLE(directory
),
1666 ADD_TABLE(is_feature
),
1667 ADD_TABLE(is_feature_comp
),
1669 ADD_TABLE(install_exec_seq
),
1670 ADD_TABLE(is_media
),
1671 ADD_TABLE(property
),
1674 static const msi_table sp_tables
[] =
1676 ADD_TABLE(sp_component
),
1677 ADD_TABLE(sp_directory
),
1678 ADD_TABLE(rof_feature
),
1679 ADD_TABLE(ci2_feature_comp
),
1680 ADD_TABLE(ci2_file
),
1681 ADD_TABLE(install_exec_seq
),
1682 ADD_TABLE(rof_media
),
1683 ADD_TABLE(property
),
1686 static const msi_table mcp_tables
[] =
1688 ADD_TABLE(mcp_component
),
1689 ADD_TABLE(directory
),
1690 ADD_TABLE(mcp_feature
),
1691 ADD_TABLE(mcp_feature_comp
),
1692 ADD_TABLE(mcp_file
),
1693 ADD_TABLE(rem_install_exec_seq
),
1694 ADD_TABLE(rof_media
),
1695 ADD_TABLE(property
),
1698 static const msi_table ai_tables
[] =
1700 ADD_TABLE(component
),
1701 ADD_TABLE(directory
),
1703 ADD_TABLE(feature_comp
),
1705 ADD_TABLE(install_exec_seq
),
1710 static const msi_table pc_tables
[] =
1712 ADD_TABLE(ca51_component
),
1713 ADD_TABLE(directory
),
1714 ADD_TABLE(rof_feature
),
1715 ADD_TABLE(ci2_feature_comp
),
1716 ADD_TABLE(ci2_file
),
1717 ADD_TABLE(install_exec_seq
),
1718 ADD_TABLE(rof_media
),
1722 static const msi_table ip_tables
[] =
1724 ADD_TABLE(component
),
1725 ADD_TABLE(directory
),
1727 ADD_TABLE(feature_comp
),
1729 ADD_TABLE(ip_install_exec_seq
),
1730 ADD_TABLE(ip_custom_action
),
1735 static const msi_table aup_tables
[] =
1737 ADD_TABLE(component
),
1738 ADD_TABLE(directory
),
1740 ADD_TABLE(feature_comp
),
1742 ADD_TABLE(aup_install_exec_seq
),
1743 ADD_TABLE(aup_custom_action
),
1748 static const msi_table aup2_tables
[] =
1750 ADD_TABLE(component
),
1751 ADD_TABLE(directory
),
1753 ADD_TABLE(feature_comp
),
1755 ADD_TABLE(aup2_install_exec_seq
),
1756 ADD_TABLE(aup_custom_action
),
1758 ADD_TABLE(aup_property
)
1761 static const msi_table aup3_tables
[] =
1763 ADD_TABLE(component
),
1764 ADD_TABLE(directory
),
1766 ADD_TABLE(feature_comp
),
1768 ADD_TABLE(aup2_install_exec_seq
),
1769 ADD_TABLE(aup_custom_action
),
1771 ADD_TABLE(aup2_property
)
1774 static const msi_table aup4_tables
[] =
1776 ADD_TABLE(component
),
1777 ADD_TABLE(directory
),
1779 ADD_TABLE(feature_comp
),
1781 ADD_TABLE(aup3_install_exec_seq
),
1782 ADD_TABLE(aup_custom_action
),
1784 ADD_TABLE(aup2_property
)
1787 static const msi_table fiu_tables
[] =
1789 ADD_TABLE(rof_component
),
1790 ADD_TABLE(directory
),
1791 ADD_TABLE(rof_feature
),
1792 ADD_TABLE(rof_feature_comp
),
1793 ADD_TABLE(rof_file
),
1794 ADD_TABLE(pp_install_exec_seq
),
1795 ADD_TABLE(rof_media
),
1796 ADD_TABLE(property
),
1799 static const msi_table fiuc_tables
[] =
1801 ADD_TABLE(rof_component
),
1802 ADD_TABLE(directory
),
1803 ADD_TABLE(rof_feature
),
1804 ADD_TABLE(rof_feature_comp
),
1805 ADD_TABLE(rofc_file
),
1806 ADD_TABLE(pp_install_exec_seq
),
1807 ADD_TABLE(rofc_media
),
1808 ADD_TABLE(property
),
1811 static const msi_table fo_tables
[] =
1813 ADD_TABLE(directory
),
1815 ADD_TABLE(fo_component
),
1816 ADD_TABLE(fo_feature
),
1817 ADD_TABLE(fo_condition
),
1818 ADD_TABLE(fo_feature_comp
),
1819 ADD_TABLE(fo_custom_action
),
1820 ADD_TABLE(fo_install_exec_seq
),
1825 static const msi_table icon_base_tables
[] =
1827 ADD_TABLE(ci_component
),
1828 ADD_TABLE(directory
),
1829 ADD_TABLE(rof_feature
),
1830 ADD_TABLE(rof_feature_comp
),
1831 ADD_TABLE(rof_file
),
1832 ADD_TABLE(pp_install_exec_seq
),
1833 ADD_TABLE(rof_media
),
1834 ADD_TABLE(icon_property
),
1837 static const msi_table pv_tables
[] =
1839 ADD_TABLE(rof_component
),
1840 ADD_TABLE(directory
),
1841 ADD_TABLE(rof_feature
),
1842 ADD_TABLE(rof_feature_comp
),
1843 ADD_TABLE(rof_file
),
1844 ADD_TABLE(pv_install_exec_seq
),
1845 ADD_TABLE(rof_media
),
1849 static const msi_table uc_tables
[] =
1851 ADD_TABLE(directory
),
1852 ADD_TABLE(uc_component
),
1853 ADD_TABLE(uc_feature
),
1854 ADD_TABLE(uc_feature_comp
),
1856 ADD_TABLE(uc_install_exec_seq
),
1858 ADD_TABLE(uc_property
)
1861 static const msi_table mixed_tables
[] =
1863 ADD_TABLE(directory
),
1864 ADD_TABLE(mixed_component
),
1865 ADD_TABLE(mixed_feature
),
1866 ADD_TABLE(mixed_feature_comp
),
1867 ADD_TABLE(mixed_install_exec_seq
),
1868 ADD_TABLE(mixed_registry
),
1873 static const msi_table vp_tables
[] =
1875 ADD_TABLE(directory
),
1877 ADD_TABLE(vp_component
),
1878 ADD_TABLE(vp_feature
),
1879 ADD_TABLE(vp_feature_comp
),
1880 ADD_TABLE(vp_custom_action
),
1881 ADD_TABLE(vp_install_exec_seq
),
1886 static const msi_table shc_tables
[] =
1889 ADD_TABLE(directory
),
1890 ADD_TABLE(shc_file
),
1891 ADD_TABLE(shc_component
),
1892 ADD_TABLE(shc_feature
),
1893 ADD_TABLE(shc_feature_comp
),
1894 ADD_TABLE(shc_custom_action
),
1895 ADD_TABLE(shc_install_exec_seq
),
1896 ADD_TABLE(shc_property
)
1899 static const msi_table shc2_tables
[] =
1902 ADD_TABLE(directory
),
1903 ADD_TABLE(shc_file
),
1904 ADD_TABLE(shc_component
),
1905 ADD_TABLE(shc_feature
),
1906 ADD_TABLE(shc_feature_comp
),
1907 ADD_TABLE(shc_custom_action
),
1908 ADD_TABLE(shc_install_exec_seq
),
1909 ADD_TABLE(shc2_property
)
1912 static const msi_table ft_tables
[] =
1915 ADD_TABLE(directory
),
1918 ADD_TABLE(ft_feature
),
1919 ADD_TABLE(ft_feature_comp
),
1920 ADD_TABLE(ft_condition
),
1921 ADD_TABLE(ft_custom_action
),
1922 ADD_TABLE(ft_install_exec_seq
),
1926 /* cabinet definitions */
1928 /* make the max size large so there is only one cab file */
1929 #define MEDIA_SIZE 0x7FFFFFFF
1930 #define FOLDER_THRESHOLD 900000
1932 /* the FCI callbacks */
1934 static void * CDECL
mem_alloc(ULONG cb
)
1936 return HeapAlloc(GetProcessHeap(), 0, cb
);
1939 static void CDECL
mem_free(void *memory
)
1941 HeapFree(GetProcessHeap(), 0, memory
);
1944 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
1946 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
1950 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
1955 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
1956 BOOL fContinuation
, void *pv
)
1961 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
1965 DWORD dwShareMode
= 0;
1966 DWORD dwCreateDisposition
= OPEN_EXISTING
;
1968 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
1969 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1970 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
1972 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
1973 dwCreateDisposition
= OPEN_EXISTING
;
1975 dwCreateDisposition
= CREATE_NEW
;
1977 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
1978 dwCreateDisposition
, 0, NULL
);
1980 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
1982 return (INT_PTR
)handle
;
1985 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1987 HANDLE handle
= (HANDLE
)hf
;
1991 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
1992 ok(res
, "Failed to ReadFile\n");
1997 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1999 HANDLE handle
= (HANDLE
)hf
;
2003 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
2004 ok(res
, "Failed to WriteFile\n");
2009 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
2011 HANDLE handle
= (HANDLE
)hf
;
2012 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
2017 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
2019 HANDLE handle
= (HANDLE
)hf
;
2022 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
2023 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
2028 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
2030 BOOL ret
= DeleteFileA(pszFile
);
2031 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
2036 static void init_functionpointers(void)
2038 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2039 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2040 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2042 #define GET_PROC(mod, func) \
2043 p ## func = (void*)GetProcAddress(mod, #func); \
2045 trace("GetProcAddress(%s) failed\n", #func);
2047 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2048 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2049 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2051 GET_PROC(hadvapi32
, CheckTokenMembership
);
2052 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
2053 GET_PROC(hadvapi32
, OpenProcessToken
);
2054 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2055 GET_PROC(hkernel32
, IsWow64Process
)
2057 hsrclient
= LoadLibraryA("srclient.dll");
2058 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2059 GET_PROC(hsrclient
, SRSetRestorePointA
);
2064 static BOOL
is_process_limited(void)
2066 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2071 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2073 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2074 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0, &Group
) ||
2075 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2077 trace("Could not check if the current user is an administrator\n");
2085 /* Only administrators have enough privileges for these tests */
2089 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2092 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2095 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2097 return (ret
&& type
== TokenElevationTypeLimited
);
2102 static BOOL
check_record(MSIHANDLE rec
, UINT field
, LPCSTR val
)
2109 r
= MsiRecordGetStringA(rec
, field
, buffer
, &sz
);
2110 return (r
== ERROR_SUCCESS
) && !strcmp(val
, buffer
);
2113 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2117 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2118 GetTempFileNameA(".", "xx", 0, tempname
);
2120 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2122 lstrcpyA(pszTempName
, tempname
);
2123 HeapFree(GetProcessHeap(), 0, tempname
);
2127 HeapFree(GetProcessHeap(), 0, tempname
);
2132 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2133 USHORT
*pattribs
, int *err
, void *pv
)
2135 BY_HANDLE_FILE_INFORMATION finfo
;
2141 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2142 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2144 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2146 res
= GetFileInformationByHandle(handle
, &finfo
);
2147 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2149 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2150 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2152 attrs
= GetFileAttributesA(pszName
);
2153 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2155 return (INT_PTR
)handle
;
2158 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2160 char path
[MAX_PATH
];
2161 char filename
[MAX_PATH
];
2163 lstrcpyA(path
, CURR_DIR
);
2164 lstrcatA(path
, "\\");
2165 lstrcatA(path
, file
);
2167 lstrcpyA(filename
, file
);
2169 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2170 progress
, get_open_info
, compress
);
2173 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2175 ZeroMemory(pCabParams
, sizeof(CCAB
));
2177 pCabParams
->cb
= max_size
;
2178 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2179 pCabParams
->setID
= 0xbeef;
2180 pCabParams
->iCab
= 1;
2181 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2182 lstrcatA(pCabParams
->szCabPath
, "\\");
2183 lstrcpyA(pCabParams
->szCab
, name
);
2186 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2194 set_cab_parameters(&cabParams
, name
, max_size
);
2196 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2197 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2198 get_temp_file
, &cabParams
, NULL
);
2200 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2205 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2206 ok(res
, "Failed to add file: %s\n", ptr
);
2207 ptr
+= lstrlenA(ptr
) + 1;
2210 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2211 ok(res
, "Failed to flush the cabinet\n");
2213 res
= FCIDestroy(hfci
);
2214 ok(res
, "Failed to destroy the cabinet\n");
2217 static BOOL
get_user_dirs(void)
2222 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2223 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2227 if(RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
)){
2236 static BOOL
get_system_dirs(void)
2241 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2245 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2246 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
)) {
2252 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2253 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
)) {
2259 if (RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR_NATIVE
, &size
)) {
2266 if(!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2272 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2277 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2278 if (file
== INVALID_HANDLE_VALUE
)
2281 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2285 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2292 #define create_file(name, size) create_file_data(name, name, size)
2294 static void create_test_files(void)
2296 CreateDirectoryA("msitest", NULL
);
2297 create_file("msitest\\one.txt", 100);
2298 CreateDirectoryA("msitest\\first", NULL
);
2299 create_file("msitest\\first\\two.txt", 100);
2300 CreateDirectoryA("msitest\\second", NULL
);
2301 create_file("msitest\\second\\three.txt", 100);
2303 create_file("four.txt", 100);
2304 create_file("five.txt", 100);
2305 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2307 create_file("msitest\\filename", 100);
2308 create_file("msitest\\service.exe", 100);
2310 DeleteFileA("four.txt");
2311 DeleteFileA("five.txt");
2314 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2316 CHAR path
[MAX_PATH
];
2318 lstrcpyA(path
, PROG_FILES_DIR
);
2319 lstrcatA(path
, "\\");
2320 lstrcatA(path
, rel_path
);
2323 return DeleteFileA(path
);
2325 return RemoveDirectoryA(path
);
2328 static BOOL
delete_pf_native(const CHAR
*rel_path
, BOOL is_file
)
2330 CHAR path
[MAX_PATH
];
2332 lstrcpyA(path
, PROG_FILES_DIR_NATIVE
);
2333 lstrcatA(path
, "\\");
2334 lstrcatA(path
, rel_path
);
2337 return DeleteFileA(path
);
2339 return RemoveDirectoryA(path
);
2342 static BOOL
delete_cf(const CHAR
*rel_path
, BOOL is_file
)
2344 CHAR path
[MAX_PATH
];
2346 lstrcpyA(path
, COMMON_FILES_DIR
);
2347 lstrcatA(path
, "\\");
2348 lstrcatA(path
, rel_path
);
2351 return DeleteFileA(path
);
2353 return RemoveDirectoryA(path
);
2356 static BOOL
compare_pf_data(const char *filename
, const char *data
, DWORD size
)
2361 char *buffer
, path
[MAX_PATH
];
2363 lstrcpyA(path
, PROG_FILES_DIR
);
2364 lstrcatA(path
, "\\");
2365 lstrcatA(path
, filename
);
2367 handle
= CreateFileA(path
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2368 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
2371 ReadFile(handle
, buffer
, size
, &read
, NULL
);
2372 if (read
== size
&& !memcmp(data
, buffer
, size
)) ret
= TRUE
;
2373 HeapFree(GetProcessHeap(), 0, buffer
);
2375 CloseHandle(handle
);
2379 static void delete_test_files(void)
2381 DeleteFileA("msitest.msi");
2382 DeleteFileA("msitest.cab");
2383 DeleteFileA("msitest\\second\\three.txt");
2384 DeleteFileA("msitest\\first\\two.txt");
2385 DeleteFileA("msitest\\one.txt");
2386 DeleteFileA("msitest\\service.exe");
2387 DeleteFileA("msitest\\filename");
2388 RemoveDirectoryA("msitest\\second");
2389 RemoveDirectoryA("msitest\\first");
2390 RemoveDirectoryA("msitest");
2393 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2397 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
,
2398 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2399 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2403 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
,
2404 const char *template, const char *packagecode
)
2409 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2410 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2412 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2413 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2415 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
, packagecode
);
2416 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2418 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2419 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2421 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2422 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2424 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2425 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2427 /* write the summary changes back to the stream */
2428 r
= MsiSummaryInfoPersist(summary
);
2429 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2431 MsiCloseHandle(summary
);
2434 #define create_database(name, tables, num_tables) \
2435 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033", \
2436 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2438 #define create_database_template(name, tables, num_tables, version, template) \
2439 create_database_wordcount(name, tables, num_tables, version, 0, template, \
2440 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2442 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2443 int num_tables
, INT version
, INT wordcount
,
2444 const char *template, const char *packagecode
)
2451 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2452 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2453 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2455 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2456 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2458 /* import the tables into the database */
2459 for (j
= 0; j
< num_tables
; j
++)
2461 const msi_table
*table
= &tables
[j
];
2463 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2465 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2466 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2468 DeleteFileA(table
->filename
);
2471 write_msi_summary_info(db
, version
, wordcount
, template, packagecode
);
2473 r
= MsiDatabaseCommit(db
);
2474 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2477 HeapFree( GetProcessHeap(), 0, nameW
);
2480 static void check_service_is_installed(void)
2482 SC_HANDLE scm
, service
;
2485 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
2486 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
2488 service
= OpenServiceA(scm
, "TestService", SC_MANAGER_ALL_ACCESS
);
2489 ok(service
!= NULL
, "Failed to open TestService\n");
2491 res
= DeleteService(service
);
2492 ok(res
, "Failed to delete TestService\n");
2494 CloseServiceHandle(service
);
2495 CloseServiceHandle(scm
);
2498 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2500 RESTOREPOINTINFOA spec
;
2502 spec
.dwEventType
= event_type
;
2503 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2504 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2505 lstrcpyA(spec
.szDescription
, "msitest restore point");
2507 return pSRSetRestorePointA(&spec
, status
);
2510 static void remove_restore_point(DWORD seq_number
)
2514 res
= pSRRemoveRestorePoint(seq_number
);
2515 if (res
!= ERROR_SUCCESS
)
2516 trace("Failed to remove the restore point : %08x\n", res
);
2519 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2521 if (pRegDeleteKeyExA
)
2522 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2523 return RegDeleteKeyA( key
, subkey
);
2526 static void test_MsiInstallProduct(void)
2529 CHAR path
[MAX_PATH
];
2532 DWORD num
, size
, type
;
2533 REGSAM access
= KEY_ALL_ACCESS
;
2535 if (is_process_limited())
2537 skip("process is limited\n");
2542 access
|= KEY_WOW64_64KEY
;
2544 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2546 /* szPackagePath is NULL */
2547 r
= MsiInstallProductA(NULL
, "INSTALL=ALL");
2548 ok(r
== ERROR_INVALID_PARAMETER
,
2549 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2551 /* both szPackagePath and szCommandLine are NULL */
2552 r
= MsiInstallProductA(NULL
, NULL
);
2553 ok(r
== ERROR_INVALID_PARAMETER
,
2554 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2556 /* szPackagePath is empty */
2557 r
= MsiInstallProductA("", "INSTALL=ALL");
2558 ok(r
== ERROR_PATH_NOT_FOUND
,
2559 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r
);
2561 create_test_files();
2562 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2564 /* install, don't publish */
2565 r
= MsiInstallProductA(msifile
, NULL
);
2566 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2568 skip("Not enough rights to perform tests\n");
2571 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2573 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2574 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2575 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2576 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2577 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2578 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2579 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2580 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2581 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2582 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2583 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2584 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2586 res
= RegOpenKeyExA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", 0, access
, &hkey
);
2587 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2591 res
= RegQueryValueExA(hkey
, "Name", NULL
, &type
, (LPBYTE
)path
, &size
);
2592 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2593 ok(!lstrcmpA(path
, "imaname"), "Expected imaname, got %s\n", path
);
2597 res
= RegQueryValueExA(hkey
, "blah", NULL
, &type
, (LPBYTE
)path
, &size
);
2598 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2602 res
= RegQueryValueExA(hkey
, "number", NULL
, &type
, (LPBYTE
)&num
, &size
);
2603 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2604 ok(num
== 314, "Expected 314, got %d\n", num
);
2608 res
= RegQueryValueExA(hkey
, "OrderTestName", NULL
, &type
, (LPBYTE
)path
, &size
);
2609 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2610 ok(!lstrcmpA(path
, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path
);
2612 check_service_is_installed();
2614 delete_key(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", access
);
2616 /* not published, reinstall */
2617 r
= MsiInstallProductA(msifile
, NULL
);
2618 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2620 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2621 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2622 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2623 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2624 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2625 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2626 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2627 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2628 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2629 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2630 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2631 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2633 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2634 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2635 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2637 create_database(msifile
, up_tables
, sizeof(up_tables
) / sizeof(msi_table
));
2639 /* not published, RemovePreviousVersions set */
2640 r
= MsiInstallProductA(msifile
, NULL
);
2641 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2643 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2644 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2645 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2646 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2647 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2648 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2649 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2650 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2651 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2652 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2653 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2654 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2656 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2657 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2658 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2660 create_database(msifile
, up2_tables
, sizeof(up2_tables
) / sizeof(msi_table
));
2662 /* not published, version number bumped */
2663 r
= MsiInstallProductA(msifile
, NULL
);
2664 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2666 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2667 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2668 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2669 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2670 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2671 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2672 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2673 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2674 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2675 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2676 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2677 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2679 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2680 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2681 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2683 create_database(msifile
, up3_tables
, sizeof(up3_tables
) / sizeof(msi_table
));
2685 /* not published, RemovePreviousVersions set and version number bumped */
2686 r
= MsiInstallProductA(msifile
, NULL
);
2687 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2689 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2690 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2691 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2692 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2693 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2694 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2695 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2696 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2697 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2698 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2699 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2700 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2702 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2703 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2704 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2706 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2708 /* install, publish product */
2709 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
2710 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2712 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2713 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2714 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2715 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2716 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2717 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2718 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2719 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2720 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2721 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2722 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2723 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2725 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2726 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2728 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2730 /* published, reinstall */
2731 r
= MsiInstallProductA(msifile
, NULL
);
2732 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2734 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2735 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2736 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2737 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2738 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2739 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2740 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2741 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2742 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2743 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2744 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2745 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2747 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2748 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2750 create_database(msifile
, up5_tables
, sizeof(up5_tables
) / sizeof(msi_table
));
2752 /* published product, RemovePreviousVersions set */
2753 r
= MsiInstallProductA(msifile
, NULL
);
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
, up6_tables
, sizeof(up6_tables
) / sizeof(msi_table
));
2774 /* published product, version number bumped */
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
, up7_tables
, sizeof(up7_tables
) / sizeof(msi_table
));
2796 /* published product, RemovePreviousVersions set and version number bumped */
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 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
2817 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2820 delete_test_files();
2821 DeleteFileA(msifile
);
2824 static void test_MsiSetComponentState(void)
2826 INSTALLSTATE installed
, action
;
2828 char path
[MAX_PATH
];
2831 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2835 lstrcpyA(path
, CURR_DIR
);
2836 lstrcatA(path
, "\\");
2837 lstrcatA(path
, msifile
);
2839 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2841 r
= MsiOpenPackageA(path
, &package
);
2842 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2844 skip("Not enough rights to perform tests\n");
2847 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2849 r
= MsiDoActionA(package
, "CostInitialize");
2850 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2852 r
= MsiDoActionA(package
, "FileCost");
2853 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2855 r
= MsiDoActionA(package
, "CostFinalize");
2856 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2858 r
= MsiGetComponentStateA(package
, "dangler", &installed
, &action
);
2859 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2860 ok(installed
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", installed
);
2861 ok(action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2863 r
= MsiSetComponentStateA(package
, "dangler", INSTALLSTATE_SOURCE
);
2864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2866 MsiCloseHandle(package
);
2870 DeleteFileA(msifile
);
2873 static void test_packagecoltypes(void)
2875 MSIHANDLE hdb
, view
, rec
;
2876 char path
[MAX_PATH
];
2877 WCHAR pathW
[MAX_PATH
];
2881 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2885 lstrcpyA(path
, CURR_DIR
);
2886 lstrcatA(path
, "\\");
2887 lstrcatA(path
, msifile
);
2888 MultiByteToWideChar( CP_ACP
, 0, path
, -1, pathW
, MAX_PATH
);
2890 r
= MsiOpenDatabaseW(pathW
, MSIDBOPEN_READONLY
, &hdb
);
2891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2893 query
= "SELECT * FROM `Media`";
2894 r
= MsiDatabaseOpenViewA( hdb
, query
, &view
);
2895 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2897 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_NAMES
, &rec
);
2898 count
= MsiRecordGetFieldCount( rec
);
2899 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2900 ok(count
== 6, "Expected 6, got %d\n", count
);
2901 ok(check_record(rec
, 1, "DiskId"), "wrong column label\n");
2902 ok(check_record(rec
, 2, "LastSequence"), "wrong column label\n");
2903 ok(check_record(rec
, 3, "DiskPrompt"), "wrong column label\n");
2904 ok(check_record(rec
, 4, "Cabinet"), "wrong column label\n");
2905 ok(check_record(rec
, 5, "VolumeLabel"), "wrong column label\n");
2906 ok(check_record(rec
, 6, "Source"), "wrong column label\n");
2907 MsiCloseHandle(rec
);
2909 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_TYPES
, &rec
);
2910 count
= MsiRecordGetFieldCount( rec
);
2911 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2912 ok(count
== 6, "Expected 6, got %d\n", count
);
2913 ok(check_record(rec
, 1, "i2"), "wrong column label\n");
2914 ok(check_record(rec
, 2, "i4"), "wrong column label\n");
2915 ok(check_record(rec
, 3, "L64"), "wrong column label\n");
2916 ok(check_record(rec
, 4, "S255"), "wrong column label\n");
2917 ok(check_record(rec
, 5, "S32"), "wrong column label\n");
2918 ok(check_record(rec
, 6, "S72"), "wrong column label\n");
2920 MsiCloseHandle(rec
);
2921 MsiCloseHandle(view
);
2922 MsiCloseHandle(hdb
);
2925 DeleteFileA(msifile
);
2928 static void create_cc_test_files(void)
2933 static CHAR cab_context
[] = "test%d.cab";
2936 create_file("maximus", 500);
2937 create_file("augustus", 50000);
2938 create_file("tiberius", 500);
2939 create_file("caesar", 500);
2941 set_cab_parameters(&cabParams
, "test1.cab", 40000);
2943 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2944 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2945 get_temp_file
, &cabParams
, cab_context
);
2946 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2948 res
= add_file(hfci
, "maximus", tcompTYPE_NONE
);
2949 ok(res
, "Failed to add file maximus\n");
2951 res
= add_file(hfci
, "augustus", tcompTYPE_NONE
);
2952 ok(res
, "Failed to add file augustus\n");
2954 res
= add_file(hfci
, "tiberius", tcompTYPE_NONE
);
2955 ok(res
, "Failed to add file tiberius\n");
2957 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2958 ok(res
, "Failed to flush the cabinet\n");
2960 res
= FCIDestroy(hfci
);
2961 ok(res
, "Failed to destroy the cabinet\n");
2963 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2965 DeleteFileA("maximus");
2966 DeleteFileA("augustus");
2967 DeleteFileA("tiberius");
2968 DeleteFileA("caesar");
2971 static void delete_cab_files(void)
2973 SHFILEOPSTRUCTA shfl
;
2974 CHAR path
[MAX_PATH
+10];
2976 lstrcpyA(path
, CURR_DIR
);
2977 lstrcatA(path
, "\\*.cab");
2978 path
[strlen(path
) + 1] = '\0';
2981 shfl
.wFunc
= FO_DELETE
;
2984 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
;
2986 SHFileOperationA(&shfl
);
2989 static void test_continuouscabs(void)
2993 if (is_process_limited())
2995 skip("process is limited\n");
2999 create_cc_test_files();
3000 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
3002 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3004 r
= MsiInstallProductA(msifile
, NULL
);
3005 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3007 skip("Not enough rights to perform tests\n");
3012 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3013 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3014 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3015 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3016 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3020 DeleteFileA(msifile
);
3022 create_cc_test_files();
3023 create_database(msifile
, cc2_tables
, sizeof(cc2_tables
) / sizeof(msi_table
));
3025 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3027 r
= MsiInstallProductA(msifile
, NULL
);
3028 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3030 skip("Not enough rights to perform tests\n");
3034 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3035 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3036 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3037 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3038 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3039 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3043 DeleteFileA(msifile
);
3045 /* Tests to show that only msi cab filename is taken in case of mismatch with the one given by previous cab */
3047 /* Filename from cab is right and the one from msi is wrong */
3048 create_cc_test_files();
3049 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
3051 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3053 r
= MsiInstallProductA(msifile
, NULL
);
3054 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3056 skip("Not enough rights to perform tests\n");
3060 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3061 todo_wine
ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3062 ok(!delete_pf("msitest\\caesar", TRUE
), "File installed\n");
3063 todo_wine
ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3064 todo_wine
ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3068 DeleteFileA(msifile
);
3070 /* Filename from msi is right and the one from cab is wrong */
3071 create_cc_test_files();
3072 ok(MoveFileA("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
3073 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
3075 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3077 r
= MsiInstallProductA(msifile
, NULL
);
3078 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3080 skip("Not enough rights to perform tests\n");
3084 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3085 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3086 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3087 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3088 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3093 DeleteFileA(msifile
);
3096 static void test_caborder(void)
3100 create_file("imperator", 100);
3101 create_file("maximus", 500);
3102 create_file("augustus", 50000);
3103 create_file("caesar", 500);
3105 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
3107 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3109 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3110 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3111 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3113 r
= MsiInstallProductA(msifile
, NULL
);
3114 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3116 skip("Not enough rights to perform tests\n");
3119 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3120 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3121 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3124 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3125 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3130 create_cab_file("test1.cab", MEDIA_SIZE
, "imperator\0");
3131 create_cab_file("test2.cab", MEDIA_SIZE
, "maximus\0augustus\0");
3132 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3134 r
= MsiInstallProductA(msifile
, NULL
);
3135 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3136 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3137 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3138 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3139 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3142 DeleteFileA(msifile
);
3144 create_cc_test_files();
3145 create_database(msifile
, co_tables
, sizeof(co_tables
) / sizeof(msi_table
));
3147 r
= MsiInstallProductA(msifile
, NULL
);
3148 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3149 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3150 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3153 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3154 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3158 DeleteFileA(msifile
);
3160 create_cc_test_files();
3161 create_database(msifile
, co2_tables
, sizeof(co2_tables
) / sizeof(msi_table
));
3163 r
= MsiInstallProductA(msifile
, NULL
);
3164 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3165 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3168 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3169 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3170 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3175 DeleteFileA("imperator");
3176 DeleteFileA("maximus");
3177 DeleteFileA("augustus");
3178 DeleteFileA("caesar");
3179 DeleteFileA(msifile
);
3182 static void test_mixedmedia(void)
3186 if (is_process_limited())
3188 skip("process is limited\n");
3192 CreateDirectoryA("msitest", NULL
);
3193 create_file("msitest\\maximus", 500);
3194 create_file("msitest\\augustus", 500);
3195 create_file("caesar", 500);
3197 create_database(msifile
, mm_tables
, sizeof(mm_tables
) / sizeof(msi_table
));
3199 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3201 create_cab_file("test1.cab", MEDIA_SIZE
, "caesar\0");
3203 r
= MsiInstallProductA(msifile
, NULL
);
3204 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3206 skip("Not enough rights to perform tests\n");
3209 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3210 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3211 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3212 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3213 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3216 /* Delete the files in the temp (current) folder */
3217 DeleteFileA("msitest\\maximus");
3218 DeleteFileA("msitest\\augustus");
3219 RemoveDirectoryA("msitest");
3220 DeleteFileA("caesar");
3221 DeleteFileA("test1.cab");
3222 DeleteFileA(msifile
);
3225 static void test_samesequence(void)
3229 create_cc_test_files();
3230 create_database(msifile
, ss_tables
, sizeof(ss_tables
) / sizeof(msi_table
));
3232 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3234 r
= MsiInstallProductA(msifile
, NULL
);
3235 if (r
== ERROR_INSTALL_FAILURE
)
3237 win_skip("unprivileged user?\n");
3240 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3241 if (r
== ERROR_SUCCESS
)
3243 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3244 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3245 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3246 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3251 DeleteFileA(msifile
);
3254 static void test_uiLevelFlags(void)
3258 create_cc_test_files();
3259 create_database(msifile
, ui_tables
, sizeof(ui_tables
) / sizeof(msi_table
));
3261 MsiSetInternalUI(INSTALLUILEVEL_NONE
| INSTALLUILEVEL_SOURCERESONLY
, NULL
);
3263 r
= MsiInstallProductA(msifile
, NULL
);
3264 if (r
== ERROR_INSTALL_FAILURE
)
3266 win_skip("unprivileged user?\n");
3270 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3271 if (r
== ERROR_SUCCESS
)
3273 ok(!delete_pf("msitest\\maximus", TRUE
), "UI install occurred, but execute-only was requested.\n");
3274 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3275 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3276 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3281 DeleteFileA(msifile
);
3284 static BOOL
file_matches(LPSTR path
)
3290 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3291 NULL
, OPEN_EXISTING
, 0, NULL
);
3292 ZeroMemory(buf
, MAX_PATH
);
3293 ReadFile(file
, buf
, 15, &size
, NULL
);
3296 return !lstrcmpA(buf
, "msitest\\maximus");
3299 static void test_readonlyfile(void)
3304 CHAR path
[MAX_PATH
];
3306 if (is_process_limited())
3308 skip("process is limited\n");
3312 CreateDirectoryA("msitest", NULL
);
3313 create_file("msitest\\maximus", 500);
3314 create_database(msifile
, rof_tables
, sizeof(rof_tables
) / sizeof(msi_table
));
3316 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3318 lstrcpyA(path
, PROG_FILES_DIR
);
3319 lstrcatA(path
, "\\msitest");
3320 CreateDirectoryA(path
, NULL
);
3322 lstrcatA(path
, "\\maximus");
3323 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3324 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3326 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3329 r
= MsiInstallProductA(msifile
, NULL
);
3330 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3332 skip("Not enough rights to perform tests\n");
3335 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3336 ok(file_matches(path
), "Expected file to be overwritten\n");
3337 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3338 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3341 /* Delete the files in the temp (current) folder */
3342 DeleteFileA("msitest\\maximus");
3343 RemoveDirectoryA("msitest");
3344 DeleteFileA(msifile
);
3347 static void test_readonlyfile_cab(void)
3352 CHAR path
[MAX_PATH
];
3355 if (is_process_limited())
3357 skip("process is limited\n");
3361 CreateDirectoryA("msitest", NULL
);
3362 create_file("maximus", 500);
3363 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3364 DeleteFileA("maximus");
3366 create_database(msifile
, rofc_tables
, sizeof(rofc_tables
) / sizeof(msi_table
));
3368 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3370 lstrcpyA(path
, PROG_FILES_DIR
);
3371 lstrcatA(path
, "\\msitest");
3372 CreateDirectoryA(path
, NULL
);
3374 lstrcatA(path
, "\\maximus");
3375 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3376 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3378 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3381 r
= MsiInstallProductA(msifile
, NULL
);
3382 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3384 skip("Not enough rights to perform tests\n");
3387 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3389 memset( buf
, 0, sizeof(buf
) );
3390 if ((file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3391 NULL
, OPEN_EXISTING
, 0, NULL
)) != INVALID_HANDLE_VALUE
)
3393 ReadFile(file
, buf
, sizeof(buf
) - 1, &size
, NULL
);
3396 ok(!memcmp( buf
, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf
);
3397 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3398 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3401 /* Delete the files in the temp (current) folder */
3403 DeleteFileA("msitest\\maximus");
3404 RemoveDirectoryA("msitest");
3405 DeleteFileA(msifile
);
3408 static void test_setdirproperty(void)
3412 if (is_process_limited())
3414 skip("process is limited\n");
3418 CreateDirectoryA("msitest", NULL
);
3419 create_file("msitest\\maximus", 500);
3420 create_database(msifile
, sdp_tables
, sizeof(sdp_tables
) / sizeof(msi_table
));
3422 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3424 r
= MsiInstallProductA(msifile
, NULL
);
3425 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3427 skip("Not enough rights to perform tests\n");
3430 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3431 ok(delete_cf("msitest\\maximus", TRUE
), "File not installed\n");
3432 ok(delete_cf("msitest", FALSE
), "Directory not created\n");
3435 /* Delete the files in the temp (current) folder */
3436 DeleteFileA(msifile
);
3437 DeleteFileA("msitest\\maximus");
3438 RemoveDirectoryA("msitest");
3441 static void test_cabisextracted(void)
3445 if (is_process_limited())
3447 skip("process is limited\n");
3451 CreateDirectoryA("msitest", NULL
);
3452 create_file("msitest\\gaius", 500);
3453 create_file("maximus", 500);
3454 create_file("augustus", 500);
3455 create_file("caesar", 500);
3457 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3458 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3459 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3461 create_database(msifile
, cie_tables
, sizeof(cie_tables
) / sizeof(msi_table
));
3463 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3465 r
= MsiInstallProductA(msifile
, NULL
);
3466 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3468 skip("Not enough rights to perform tests\n");
3471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3472 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3473 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3474 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3475 ok(delete_pf("msitest\\gaius", TRUE
), "File not installed\n");
3476 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3479 /* Delete the files in the temp (current) folder */
3481 DeleteFileA(msifile
);
3482 DeleteFileA("maximus");
3483 DeleteFileA("augustus");
3484 DeleteFileA("caesar");
3485 DeleteFileA("msitest\\gaius");
3486 RemoveDirectoryA("msitest");
3489 static BOOL
file_exists(LPCSTR file
)
3491 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
3494 static BOOL
pf_exists(LPCSTR file
)
3496 CHAR path
[MAX_PATH
];
3498 lstrcpyA(path
, PROG_FILES_DIR
);
3499 lstrcatA(path
, "\\");
3500 lstrcatA(path
, file
);
3502 return file_exists(path
);
3505 static void delete_pfmsitest_files(void)
3507 SHFILEOPSTRUCTA shfl
;
3508 CHAR path
[MAX_PATH
+11];
3510 lstrcpyA(path
, PROG_FILES_DIR
);
3511 lstrcatA(path
, "\\msitest\\*");
3512 path
[strlen(path
) + 1] = '\0';
3515 shfl
.wFunc
= FO_DELETE
;
3518 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
3520 SHFileOperationA(&shfl
);
3522 lstrcpyA(path
, PROG_FILES_DIR
);
3523 lstrcatA(path
, "\\msitest");
3524 RemoveDirectoryA(path
);
3527 static UINT
run_query(MSIHANDLE hdb
, MSIHANDLE hrec
, const char *query
)
3529 MSIHANDLE hview
= 0;
3532 r
= MsiDatabaseOpenViewA(hdb
, query
, &hview
);
3533 if(r
!= ERROR_SUCCESS
)
3536 r
= MsiViewExecute(hview
, hrec
);
3537 if(r
== ERROR_SUCCESS
)
3538 r
= MsiViewClose(hview
);
3539 MsiCloseHandle(hview
);
3543 static void set_transform_summary_info(void)
3546 MSIHANDLE suminfo
= 0;
3548 /* build summary info */
3549 r
= MsiGetSummaryInformationA(0, mstfile
, 3, &suminfo
);
3550 ok(r
== ERROR_SUCCESS
, "Failed to open summaryinfo\n");
3552 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
3553 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3555 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
3556 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3557 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3558 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3559 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3561 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_PAGECOUNT
, VT_I4
, 100, NULL
, NULL
);
3562 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3564 r
= MsiSummaryInfoPersist(suminfo
);
3565 ok(r
== ERROR_SUCCESS
, "Failed to make summary info persist\n");
3567 r
= MsiCloseHandle(suminfo
);
3568 ok(r
== ERROR_SUCCESS
, "Failed to close suminfo\n");
3571 static void generate_transform(void)
3573 MSIHANDLE hdb1
, hdb2
;
3577 /* start with two identical databases */
3578 CopyFileA(msifile
, msifile2
, FALSE
);
3580 r
= MsiOpenDatabaseW(msifile2W
, MSIDBOPEN_TRANSACT
, &hdb1
);
3581 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3583 r
= MsiDatabaseCommit(hdb1
);
3584 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
3586 r
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_READONLY
, &hdb2
);
3587 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3589 query
= "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3590 r
= run_query(hdb1
, 0, query
);
3591 ok(r
== ERROR_SUCCESS
, "failed to add property\n");
3593 /* database needs to be committed */
3594 MsiDatabaseCommit(hdb1
);
3596 r
= MsiDatabaseGenerateTransformA(hdb1
, hdb2
, mstfile
, 0, 0);
3597 ok(r
== ERROR_SUCCESS
, "return code %d, should be ERROR_SUCCESS\n", r
);
3599 r
= MsiCreateTransformSummaryInfoA(hdb2
, hdb2
, mstfile
, 0, 0);
3600 todo_wine
ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3602 MsiCloseHandle(hdb1
);
3603 MsiCloseHandle(hdb2
);
3606 /* data for generating a transform */
3608 /* tables transform names - encoded as they would be in an msi database file */
3609 static const WCHAR name1
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
3610 static const WCHAR name2
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
3611 static const WCHAR name3
[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
3613 /* data in each table */
3614 static const char data1
[] = /* _StringData */
3615 "propval"; /* all the strings squashed together */
3617 static const WCHAR data2
[] = { /* _StringPool */
3619 0, 0, /* string 0 '' */
3620 4, 1, /* string 1 'prop' */
3621 3, 1, /* string 2 'val' */
3624 static const WCHAR data3
[] = { /* Property */
3625 0x0201, 0x0001, 0x0002,
3628 static const struct {
3632 } table_transform_data
[] =
3634 { name1
, data1
, sizeof data1
- 1 },
3635 { name2
, data2
, sizeof data2
},
3636 { name3
, data3
, sizeof data3
},
3639 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3641 static void generate_transform_manual(void)
3643 IStorage
*stg
= NULL
;
3648 const DWORD mode
= STGM_CREATE
|STGM_READWRITE
|STGM_DIRECT
|STGM_SHARE_EXCLUSIVE
;
3650 const CLSID CLSID_MsiTransform
= { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3652 MultiByteToWideChar(CP_ACP
, 0, mstfile
, -1, name
, 0x20);
3654 r
= StgCreateDocfile(name
, mode
, 0, &stg
);
3655 ok(r
== S_OK
, "failed to create storage\n");
3659 r
= IStorage_SetClass(stg
, &CLSID_MsiTransform
);
3660 ok(r
== S_OK
, "failed to set storage type\n");
3662 for (i
=0; i
<NUM_TRANSFORM_TABLES
; i
++)
3664 r
= IStorage_CreateStream(stg
, table_transform_data
[i
].name
,
3665 STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3668 ok(0, "failed to create stream %08x\n", r
);
3672 r
= IStream_Write(stm
, table_transform_data
[i
].data
,
3673 table_transform_data
[i
].size
, &count
);
3674 if (FAILED(r
) || count
!= table_transform_data
[i
].size
)
3675 ok(0, "failed to write stream\n");
3676 IStream_Release(stm
);
3679 IStorage_Release(stg
);
3681 set_transform_summary_info();
3684 static void test_transformprop(void)
3688 if (is_process_limited())
3690 skip("process is limited\n");
3694 CreateDirectoryA("msitest", NULL
);
3695 create_file("msitest\\augustus", 500);
3697 create_database(msifile
, tp_tables
, sizeof(tp_tables
) / sizeof(msi_table
));
3699 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3701 r
= MsiInstallProductA(msifile
, NULL
);
3702 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3704 skip("Not enough rights to perform tests\n");
3707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3708 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3709 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3712 generate_transform();
3714 generate_transform_manual();
3716 r
= MsiInstallProductA(msifile
, "TRANSFORMS=winetest.mst");
3717 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3718 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3719 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3722 /* Delete the files in the temp (current) folder */
3723 DeleteFileA(msifile
);
3724 DeleteFileA(msifile2
);
3725 DeleteFileA(mstfile
);
3726 DeleteFileA("msitest\\augustus");
3727 RemoveDirectoryA("msitest");
3730 static void test_currentworkingdir(void)
3733 CHAR drive
[MAX_PATH
], path
[MAX_PATH
];
3736 if (is_process_limited())
3738 skip("process is limited\n");
3742 CreateDirectoryA("msitest", NULL
);
3743 create_file("msitest\\augustus", 500);
3745 create_database(msifile
, cwd_tables
, sizeof(cwd_tables
) / sizeof(msi_table
));
3747 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3749 CreateDirectoryA("diffdir", NULL
);
3750 SetCurrentDirectoryA("diffdir");
3752 sprintf(path
, "..\\%s", msifile
);
3753 r
= MsiInstallProductA(path
, NULL
);
3756 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
3757 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3758 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3761 sprintf(path
, "%s\\%s", CURR_DIR
, msifile
);
3762 r
= MsiInstallProductA(path
, NULL
);
3763 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3765 skip("Not enough rights to perform tests\n");
3768 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3769 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3770 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3772 lstrcpyA(drive
, CURR_DIR
);
3775 SetCurrentDirectoryA(drive
);
3777 lstrcpyA(path
, CURR_DIR
);
3778 if (path
[lstrlenA(path
) - 1] != '\\') lstrcatA(path
, "\\");
3779 lstrcatA(path
, msifile
);
3780 ptr
= strchr(path
, ':');
3783 r
= MsiInstallProductA(ptr
, NULL
);
3784 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3785 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3786 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3789 SetCurrentDirectoryA(CURR_DIR
);
3790 DeleteFileA(msifile
);
3791 DeleteFileA("msitest\\augustus");
3792 RemoveDirectoryA("msitest");
3793 RemoveDirectoryA("diffdir");
3796 static void set_admin_summary_info(const WCHAR
*name
)
3798 MSIHANDLE db
, summary
;
3801 r
= MsiOpenDatabaseW(name
, MSIDBOPEN_DIRECT
, &db
);
3802 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3804 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
3805 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3807 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, 5, NULL
, NULL
);
3808 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3810 /* write the summary changes back to the stream */
3811 r
= MsiSummaryInfoPersist(summary
);
3812 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3814 MsiCloseHandle(summary
);
3816 r
= MsiDatabaseCommit(db
);
3817 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3822 static void test_admin(void)
3826 CreateDirectoryA("msitest", NULL
);
3827 create_file("msitest\\augustus", 500);
3829 create_database(msifile
, adm_tables
, sizeof(adm_tables
) / sizeof(msi_table
));
3830 set_admin_summary_info(msifileW
);
3832 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3834 r
= MsiInstallProductA(msifile
, NULL
);
3835 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3837 skip("Not enough rights to perform tests\n");
3840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3841 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3842 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3843 ok(!DeleteFileA("c:\\msitest\\augustus"), "File installed\n");
3844 ok(!RemoveDirectoryA("c:\\msitest"), "File installed\n");
3846 r
= MsiInstallProductA(msifile
, "ACTION=ADMIN");
3847 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3848 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3849 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3852 ok(DeleteFileA("c:\\msitest\\augustus"), "File not installed\n");
3853 ok(RemoveDirectoryA("c:\\msitest"), "File not installed\n");
3857 DeleteFileA(msifile
);
3858 DeleteFileA("msitest\\augustus");
3859 RemoveDirectoryA("msitest");
3862 static void set_admin_property_stream(LPCSTR file
)
3866 WCHAR fileW
[MAX_PATH
];
3869 const DWORD mode
= STGM_DIRECT
| STGM_READWRITE
| STGM_SHARE_EXCLUSIVE
;
3871 /* AdminProperties */
3872 static const WCHAR stmname
[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
3873 static const WCHAR data
[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
3874 'M','y','P','r','o','p','=','4','2',0};
3876 MultiByteToWideChar(CP_ACP
, 0, file
, -1, fileW
, MAX_PATH
);
3878 hr
= StgOpenStorage(fileW
, NULL
, mode
, NULL
, 0, &stg
);
3879 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3883 hr
= IStorage_CreateStream(stg
, stmname
, STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3884 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3886 hr
= IStream_Write(stm
, data
, sizeof(data
), &count
);
3887 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3889 IStream_Release(stm
);
3890 IStorage_Release(stg
);
3893 static void test_adminprops(void)
3897 if (is_process_limited())
3899 skip("process is limited\n");
3903 CreateDirectoryA("msitest", NULL
);
3904 create_file("msitest\\augustus", 500);
3906 create_database(msifile
, amp_tables
, sizeof(amp_tables
) / sizeof(msi_table
));
3907 set_admin_summary_info(msifileW
);
3908 set_admin_property_stream(msifile
);
3910 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3912 r
= MsiInstallProductA(msifile
, NULL
);
3913 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3915 skip("Not enough rights to perform tests\n");
3918 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3919 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3920 ok(delete_pf("msitest", FALSE
), "Directory created\n");
3923 DeleteFileA(msifile
);
3924 DeleteFileA("msitest\\augustus");
3925 RemoveDirectoryA("msitest");
3928 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
3930 CHAR path
[MAX_PATH
];
3932 lstrcpyA(path
, PROG_FILES_DIR
);
3933 lstrcatA(path
, "\\");
3934 lstrcatA(path
, file
);
3937 create_file_data(path
, data
, 500);
3939 CreateDirectoryA(path
, NULL
);
3942 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
3944 static void test_missingcab(void)
3948 if (is_process_limited())
3950 skip("process is limited\n");
3954 CreateDirectoryA("msitest", NULL
);
3955 create_file("msitest\\augustus", 500);
3956 create_file("maximus", 500);
3957 create_file("tiberius", 500);
3959 create_database(msifile
, mc_tables
, sizeof(mc_tables
) / sizeof(msi_table
));
3961 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3963 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3964 create_cab_file("test4.cab", MEDIA_SIZE
, "tiberius\0");
3966 create_pf("msitest", FALSE
);
3967 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3968 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3970 r
= MsiInstallProductA(msifile
, NULL
);
3971 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3973 skip("Not enough rights to perform tests\n");
3976 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3977 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3978 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3979 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3980 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3981 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3982 ok(!delete_pf("msitest\\gaius", TRUE
), "File installed\n");
3983 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3985 create_pf("msitest", FALSE
);
3986 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3987 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3988 create_pf("msitest\\gaius", TRUE
);
3990 r
= MsiInstallProductA(msifile
, "GAIUS=1");
3991 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3994 ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3995 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3997 ok(delete_pf("msitest\\caesar", TRUE
), "File removed\n");
3998 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3999 ok(delete_pf("msitest\\tiberius", TRUE
), "File removed\n");
4000 ok(delete_pf("msitest\\gaius", TRUE
), "File removed\n");
4001 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4004 delete_pf("msitest", FALSE
);
4005 DeleteFileA("msitest\\augustus");
4006 RemoveDirectoryA("msitest");
4007 DeleteFileA("maximus");
4008 DeleteFileA("tiberius");
4009 DeleteFileA("test1.cab");
4010 DeleteFileA("test4.cab");
4011 DeleteFileA(msifile
);
4014 static void test_sourcefolder(void)
4018 if (is_process_limited())
4020 skip("process is limited\n");
4024 CreateDirectoryA("msitest", NULL
);
4025 create_file("augustus", 500);
4027 create_database(msifile
, sf_tables
, sizeof(sf_tables
) / sizeof(msi_table
));
4029 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4031 r
= MsiInstallProductA(msifile
, NULL
);
4032 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4034 skip("Not enough rights to perform tests\n");
4037 ok(r
== ERROR_INSTALL_FAILURE
,
4038 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4039 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4042 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4044 RemoveDirectoryA("msitest");
4046 r
= MsiInstallProductA(msifile
, NULL
);
4047 ok(r
== ERROR_INSTALL_FAILURE
,
4048 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4049 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4052 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4056 DeleteFileA(msifile
);
4057 DeleteFileA("augustus");
4060 static void test_customaction51(void)
4064 if (is_process_limited())
4066 skip("process is limited\n");
4070 CreateDirectoryA("msitest", NULL
);
4071 create_file("msitest\\augustus", 500);
4073 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4075 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4077 r
= MsiInstallProductA(msifile
, NULL
);
4078 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4080 skip("Not enough rights to perform tests\n");
4083 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4084 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4085 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4088 DeleteFileA(msifile
);
4089 DeleteFileA("msitest\\augustus");
4090 RemoveDirectoryA("msitest");
4093 static void test_installstate(void)
4097 if (is_process_limited())
4099 skip("process is limited\n");
4103 CreateDirectoryA("msitest", NULL
);
4104 create_file("msitest\\alpha", 500);
4105 create_file("msitest\\beta", 500);
4106 create_file("msitest\\gamma", 500);
4107 create_file("msitest\\theta", 500);
4108 create_file("msitest\\delta", 500);
4109 create_file("msitest\\epsilon", 500);
4110 create_file("msitest\\zeta", 500);
4111 create_file("msitest\\iota", 500);
4112 create_file("msitest\\eta", 500);
4113 create_file("msitest\\kappa", 500);
4114 create_file("msitest\\lambda", 500);
4115 create_file("msitest\\mu", 500);
4117 create_database(msifile
, is_tables
, sizeof(is_tables
) / sizeof(msi_table
));
4119 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4121 r
= MsiInstallProductA(msifile
, NULL
);
4122 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4124 skip("Not enough rights to perform tests\n");
4127 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4128 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4129 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4130 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4131 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4132 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4133 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4134 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4135 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4136 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4137 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4138 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4139 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4140 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4142 r
= MsiInstallProductA(msifile
, "ADDLOCAL=\"one,two,three,four\"");
4143 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4144 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4145 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4146 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4147 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4148 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4149 ok(delete_pf("msitest\\epsilon", TRUE
), "File not installed\n");
4150 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4151 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4152 ok(delete_pf("msitest\\eta", TRUE
), "File not installed\n");
4153 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4154 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4155 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4156 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4158 r
= MsiInstallProductA(msifile
, "ADDSOURCE=\"one,two,three,four\"");
4159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4160 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4161 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4162 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4163 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4164 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4165 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4166 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4167 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4168 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4169 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4170 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4171 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4172 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4174 r
= MsiInstallProductA(msifile
, "REMOVE=\"one,two,three,four\"");
4175 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4176 ok(!delete_pf("msitest\\alpha", TRUE
), "File installed\n");
4177 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4178 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4179 ok(!delete_pf("msitest\\theta", TRUE
), "File installed\n");
4180 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4181 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4182 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4183 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4184 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4185 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4186 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4187 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4188 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4191 DeleteFileA(msifile
);
4192 DeleteFileA("msitest\\alpha");
4193 DeleteFileA("msitest\\beta");
4194 DeleteFileA("msitest\\gamma");
4195 DeleteFileA("msitest\\theta");
4196 DeleteFileA("msitest\\delta");
4197 DeleteFileA("msitest\\epsilon");
4198 DeleteFileA("msitest\\zeta");
4199 DeleteFileA("msitest\\iota");
4200 DeleteFileA("msitest\\eta");
4201 DeleteFileA("msitest\\kappa");
4202 DeleteFileA("msitest\\lambda");
4203 DeleteFileA("msitest\\mu");
4204 RemoveDirectoryA("msitest");
4207 static const struct sourcepathmap
4209 BOOL sost
; /* shortone\shorttwo */
4210 BOOL solt
; /* shortone\longtwo */
4211 BOOL lost
; /* longone\shorttwo */
4212 BOOL lolt
; /* longone\longtwo */
4213 BOOL soste
; /* shortone\shorttwo source exists */
4214 BOOL solte
; /* shortone\longtwo source exists */
4215 BOOL loste
; /* longone\shorttwo source exists */
4216 BOOL lolte
; /* longone\longtwo source exists */
4221 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4222 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4223 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4224 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4225 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4226 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4227 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4228 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4229 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4230 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4231 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4232 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4233 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4234 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4235 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4236 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4237 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4238 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4239 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4240 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4241 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4242 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4243 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4244 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4245 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4246 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4247 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4248 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4249 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4250 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4251 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4252 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4253 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4254 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4255 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4256 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4257 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4258 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4259 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4260 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4261 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4262 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4263 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4264 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4265 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4266 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4267 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4268 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4269 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4270 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4271 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4272 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4273 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4274 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4275 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4276 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4277 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4278 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4279 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4280 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4281 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4282 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4283 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4284 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4285 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4286 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4287 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4288 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4289 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4290 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4291 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4292 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4293 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4294 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4295 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4296 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4297 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4298 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4299 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4300 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4301 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4302 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4303 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4304 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4305 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4306 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4307 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4308 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4309 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4310 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4311 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4312 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4313 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4314 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4315 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4316 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4317 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4318 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4319 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4320 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4321 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4322 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4323 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4324 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4325 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4326 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4327 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4328 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4329 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4330 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4331 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4332 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4333 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4334 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4335 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4336 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4337 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4338 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4339 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4340 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4341 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4342 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4343 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4344 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4345 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4346 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4347 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4348 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4349 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4350 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4351 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4352 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4353 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4354 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4355 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4356 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4357 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4358 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4359 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4360 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4361 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4362 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4363 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4364 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4365 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4366 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4367 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4368 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4369 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4370 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4371 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4372 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4373 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4374 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4375 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4376 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4377 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4378 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4379 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4380 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4381 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4382 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4383 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4384 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4385 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4386 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4387 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4388 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4389 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4390 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4391 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4392 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4393 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4394 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4395 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4396 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4397 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4398 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4399 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4400 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4401 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4402 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4403 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4404 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4405 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4406 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4407 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4408 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4409 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4410 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4411 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4412 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4413 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4414 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4415 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4416 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4417 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4418 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4419 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4420 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4421 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4422 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4423 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4424 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4425 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4426 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4427 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4428 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4429 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4430 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4431 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4432 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4433 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4434 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4435 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4436 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4437 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4438 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4439 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4440 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4441 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4442 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4443 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4444 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4445 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4446 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4447 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4448 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4449 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4450 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4451 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4452 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4453 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4454 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4455 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4456 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4457 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4458 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4459 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4460 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4461 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4462 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4463 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4464 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4465 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4466 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4467 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4468 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4469 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4470 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4471 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4472 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4473 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4474 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4475 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4476 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4479 static DWORD
get_pf_file_size(LPCSTR file
)
4481 CHAR path
[MAX_PATH
];
4485 lstrcpyA(path
, PROG_FILES_DIR
);
4486 lstrcatA(path
, "\\");
4487 lstrcatA(path
, file
);
4489 hfile
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
4490 if (hfile
== INVALID_HANDLE_VALUE
)
4491 return INVALID_FILE_SIZE
;
4493 size
= GetFileSize(hfile
, NULL
);
4498 static void test_sourcepath(void)
4502 if (!winetest_interactive
)
4504 skip("Run in interactive mode to run source path tests.\n");
4508 create_database(msifile
, sp_tables
, sizeof(sp_tables
) / sizeof(msi_table
));
4510 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4512 for (i
= 0; i
< sizeof(spmap
) / sizeof(spmap
[0]); i
++)
4516 CreateDirectoryA("shortone", NULL
);
4517 CreateDirectoryA("shortone\\shorttwo", NULL
);
4522 CreateDirectoryA("shortone", NULL
);
4523 CreateDirectoryA("shortone\\longtwo", NULL
);
4528 CreateDirectoryA("longone", NULL
);
4529 CreateDirectoryA("longone\\shorttwo", NULL
);
4534 CreateDirectoryA("longone", NULL
);
4535 CreateDirectoryA("longone\\longtwo", NULL
);
4539 create_file("shortone\\shorttwo\\augustus", 50);
4541 create_file("shortone\\longtwo\\augustus", 100);
4543 create_file("longone\\shorttwo\\augustus", 150);
4545 create_file("longone\\longtwo\\augustus", 200);
4547 r
= MsiInstallProductA(msifile
, NULL
);
4548 ok(r
== spmap
[i
].err
, "%d: Expected %d, got %d\n", i
, spmap
[i
].err
, r
);
4549 ok(get_pf_file_size("msitest\\augustus") == spmap
[i
].size
,
4550 "%d: Expected %d, got %d\n", i
, spmap
[i
].size
,
4551 get_pf_file_size("msitest\\augustus"));
4553 if (r
== ERROR_SUCCESS
)
4555 ok(delete_pf("msitest\\augustus", TRUE
), "%d: File not installed\n", i
);
4556 ok(delete_pf("msitest", FALSE
), "%d: Directory not created\n", i
);
4560 ok(!delete_pf("msitest\\augustus", TRUE
), "%d: File installed\n", i
);
4561 todo_wine
ok(!delete_pf("msitest", FALSE
), "%d: Directory installed\n", i
);
4564 DeleteFileA("shortone\\shorttwo\\augustus");
4565 DeleteFileA("shortone\\longtwo\\augustus");
4566 DeleteFileA("longone\\shorttwo\\augustus");
4567 DeleteFileA("longone\\longtwo\\augustus");
4568 RemoveDirectoryA("shortone\\shorttwo");
4569 RemoveDirectoryA("shortone\\longtwo");
4570 RemoveDirectoryA("longone\\shorttwo");
4571 RemoveDirectoryA("longone\\longtwo");
4572 RemoveDirectoryA("shortone");
4573 RemoveDirectoryA("longone");
4576 DeleteFileA(msifile
);
4579 static void test_missingcomponent(void)
4583 if (is_process_limited())
4585 skip("process is limited\n");
4589 CreateDirectoryA("msitest", NULL
);
4590 create_file("msitest\\hydrogen", 500);
4591 create_file("msitest\\helium", 500);
4592 create_file("msitest\\lithium", 500);
4593 create_file("beryllium", 500);
4595 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
4597 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4599 r
= MsiInstallProductA(msifile
, "INSTALLLEVEL=10 PROPVAR=42");
4600 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4602 skip("Not enough rights to perform tests\n");
4605 else if (r
== ERROR_INSTALL_FAILURE
)
4607 win_skip("broken result\n");
4610 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4611 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4612 ok(pf_exists("msitest\\helium"), "File not installed\n");
4613 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4614 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4615 ok(pf_exists("msitest"), "File not installed\n");
4617 r
= MsiInstallProductA(msifile
, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
4618 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4619 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
4620 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
4621 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
4622 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4623 ok(!delete_pf("msitest", FALSE
), "Directory not removed\n");
4626 DeleteFileA(msifile
);
4627 DeleteFileA("msitest\\hydrogen");
4628 DeleteFileA("msitest\\helium");
4629 DeleteFileA("msitest\\lithium");
4630 DeleteFileA("beryllium");
4631 RemoveDirectoryA("msitest");
4634 static void test_sourcedirprop(void)
4637 CHAR props
[MAX_PATH
];
4639 if (is_process_limited())
4641 skip("process is limited\n");
4645 CreateDirectoryA("msitest", NULL
);
4646 create_file("msitest\\augustus", 500);
4648 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4650 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4652 r
= MsiInstallProductA(msifile
, NULL
);
4653 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4655 skip("Not enough rights to perform tests\n");
4658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4659 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4660 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4662 DeleteFileA("msitest\\augustus");
4663 RemoveDirectoryA("msitest");
4665 CreateDirectoryA("altsource", NULL
);
4666 CreateDirectoryA("altsource\\msitest", NULL
);
4667 create_file("altsource\\msitest\\augustus", 500);
4669 sprintf(props
, "SRCDIR=%s\\altsource\\", CURR_DIR
);
4671 r
= MsiInstallProductA(msifile
, props
);
4672 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4673 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4674 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4676 DeleteFileA("altsource\\msitest\\augustus");
4677 RemoveDirectoryA("altsource\\msitest");
4678 RemoveDirectoryA("altsource");
4681 DeleteFileA("msitest\\augustus");
4682 RemoveDirectoryA("msitest");
4683 DeleteFileA(msifile
);
4686 static void test_adminimage(void)
4690 if (is_process_limited())
4692 skip("process is limited\n");
4696 CreateDirectoryA("msitest", NULL
);
4697 CreateDirectoryA("msitest\\first", NULL
);
4698 CreateDirectoryA("msitest\\second", NULL
);
4699 CreateDirectoryA("msitest\\cabout", NULL
);
4700 CreateDirectoryA("msitest\\cabout\\new", NULL
);
4701 create_file("msitest\\one.txt", 100);
4702 create_file("msitest\\first\\two.txt", 100);
4703 create_file("msitest\\second\\three.txt", 100);
4704 create_file("msitest\\cabout\\four.txt", 100);
4705 create_file("msitest\\cabout\\new\\five.txt", 100);
4706 create_file("msitest\\filename", 100);
4707 create_file("msitest\\service.exe", 100);
4709 create_database_wordcount(msifile
, ai_tables
,
4710 sizeof(ai_tables
) / sizeof(msi_table
),
4711 100, msidbSumInfoSourceTypeAdminImage
, ";1033",
4712 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4714 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4716 r
= MsiInstallProductA(msifile
, NULL
);
4717 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4719 skip("Not enough rights to perform tests\n");
4722 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4724 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4725 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4726 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4727 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4728 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4729 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4730 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4731 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4732 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4733 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4734 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4735 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4738 DeleteFileA("msifile");
4739 DeleteFileA("msitest\\cabout\\new\\five.txt");
4740 DeleteFileA("msitest\\cabout\\four.txt");
4741 DeleteFileA("msitest\\second\\three.txt");
4742 DeleteFileA("msitest\\first\\two.txt");
4743 DeleteFileA("msitest\\one.txt");
4744 DeleteFileA("msitest\\service.exe");
4745 DeleteFileA("msitest\\filename");
4746 RemoveDirectoryA("msitest\\cabout\\new");
4747 RemoveDirectoryA("msitest\\cabout");
4748 RemoveDirectoryA("msitest\\second");
4749 RemoveDirectoryA("msitest\\first");
4750 RemoveDirectoryA("msitest");
4753 static void test_propcase(void)
4757 if (is_process_limited())
4759 skip("process is limited\n");
4763 CreateDirectoryA("msitest", NULL
);
4764 create_file("msitest\\augustus", 500);
4766 create_database(msifile
, pc_tables
, sizeof(pc_tables
) / sizeof(msi_table
));
4768 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4770 r
= MsiInstallProductA(msifile
, "MyProp=42");
4771 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4773 skip("Not enough rights to perform tests\n");
4776 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4777 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4778 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4780 r
= MsiInstallProductA(msifile
, "Prop1=\"Copyright \"\"My Company\"\" 2015\" MyProp=42");
4781 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4782 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4783 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4785 r
= MsiInstallProductA(msifile
, "Prop1=\"\"\"install.exe\"\" /Install\" MyProp=\"42\"");
4786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4787 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4788 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4791 DeleteFileA(msifile
);
4792 DeleteFileA("msitest\\augustus");
4793 RemoveDirectoryA("msitest");
4796 static void test_int_widths( void )
4798 static const WCHAR msitestW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
4799 static const WCHAR msitableW
[] = {'m','s','i','t','a','b','l','e','.','i','d','t',0};
4800 static const WCHAR slashW
[] = {'\\',0};
4801 static const char int0
[] = "int0\ni0\nint0\tint0\n1";
4802 static const char int1
[] = "int1\ni1\nint1\tint1\n1";
4803 static const char int2
[] = "int2\ni2\nint2\tint2\n1";
4804 static const char int3
[] = "int3\ni3\nint3\tint3\n1";
4805 static const char int4
[] = "int4\ni4\nint4\tint4\n1";
4806 static const char int5
[] = "int5\ni5\nint5\tint5\n1";
4807 static const char int8
[] = "int8\ni8\nint8\tint8\n1";
4816 { int0
, sizeof(int0
) - 1, ERROR_SUCCESS
},
4817 { int1
, sizeof(int1
) - 1, ERROR_SUCCESS
},
4818 { int2
, sizeof(int2
) - 1, ERROR_SUCCESS
},
4819 { int3
, sizeof(int3
) - 1, ERROR_FUNCTION_FAILED
},
4820 { int4
, sizeof(int4
) - 1, ERROR_SUCCESS
},
4821 { int5
, sizeof(int5
) - 1, ERROR_FUNCTION_FAILED
},
4822 { int8
, sizeof(int8
) - 1, ERROR_FUNCTION_FAILED
}
4824 WCHAR tmpdir
[MAX_PATH
], msitable
[MAX_PATH
], msidb
[MAX_PATH
];
4828 GetTempPathW(MAX_PATH
, tmpdir
);
4829 CreateDirectoryW(tmpdir
, NULL
);
4831 lstrcpyW(msitable
, tmpdir
);
4832 lstrcatW(msitable
, slashW
);
4833 lstrcatW(msitable
, msitableW
);
4835 lstrcpyW(msidb
, tmpdir
);
4836 lstrcatW(msidb
, slashW
);
4837 lstrcatW(msidb
, msitestW
);
4839 r
= MsiOpenDatabaseW(msidb
, MSIDBOPEN_CREATE
, &db
);
4840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4842 for (i
= 0; i
< sizeof(tests
)/sizeof(tests
[0]); i
++)
4845 HANDLE handle
= CreateFileW(msitable
, GENERIC_WRITE
, 0, NULL
,
4846 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
4847 WriteFile(handle
, tests
[i
].data
, tests
[i
].size
, &count
, NULL
);
4848 CloseHandle(handle
);
4850 r
= MsiDatabaseImportW(db
, tmpdir
, msitableW
);
4851 ok(r
== tests
[i
].ret
, " %u expected %u, got %u\n", i
, tests
[i
].ret
, r
);
4853 r
= MsiDatabaseCommit(db
);
4854 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4855 DeleteFileW(msitable
);
4860 RemoveDirectoryW(tmpdir
);
4863 static void test_shortcut(void)
4868 if (is_process_limited())
4870 skip("process is limited\n");
4874 create_test_files();
4875 create_database(msifile
, sc_tables
, sizeof(sc_tables
) / sizeof(msi_table
));
4877 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4879 r
= MsiInstallProductA(msifile
, NULL
);
4880 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4882 skip("Not enough rights to perform tests\n");
4885 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4887 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
4888 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4890 r
= MsiInstallProductA(msifile
, NULL
);
4891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4895 hr
= CoInitializeEx(NULL
, COINIT_APARTMENTTHREADED
);
4896 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4898 r
= MsiInstallProductA(msifile
, NULL
);
4899 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4903 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4904 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4905 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4906 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4907 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4908 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4909 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4910 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4911 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4912 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4913 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4914 while (!delete_pf("msitest\\Shortcut.lnk", TRUE
) && GetLastError() == ERROR_SHARING_VIOLATION
) Sleep(1000);
4915 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4918 delete_test_files();
4919 DeleteFileA(msifile
);
4922 static void test_preselected(void)
4926 if (is_process_limited())
4928 skip("process is limited\n");
4932 create_test_files();
4933 create_database(msifile
, ps_tables
, sizeof(ps_tables
) / sizeof(msi_table
));
4935 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4937 r
= MsiInstallProductA(msifile
, "ADDLOCAL=One");
4938 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4940 skip("Not enough rights to perform tests\n");
4943 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4945 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File installed\n");
4946 ok(!delete_pf("msitest\\cabout\\new", FALSE
), "Directory created\n");
4947 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE
), "File installed\n");
4948 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory created\n");
4949 ok(!delete_pf("msitest\\changed\\three.txt", TRUE
), "File installed\n");
4950 ok(!delete_pf("msitest\\changed", FALSE
), "Directory created\n");
4951 ok(!delete_pf("msitest\\first\\two.txt", TRUE
), "File installed\n");
4952 ok(!delete_pf("msitest\\first", FALSE
), "Directory created\n");
4953 ok(!delete_pf("msitest\\filename", TRUE
), "File installed\n");
4954 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4955 ok(!delete_pf("msitest\\service.exe", TRUE
), "File installed\n");
4956 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4958 r
= MsiInstallProductA(msifile
, NULL
);
4959 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4961 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4962 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4963 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4964 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4965 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4966 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4967 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4968 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4969 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4970 ok(!delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4971 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4972 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4975 delete_test_files();
4976 DeleteFileA(msifile
);
4979 static void test_installed_prop(void)
4981 static const char prodcode
[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
4984 if (is_process_limited())
4986 skip("process is limited\n");
4990 create_test_files();
4991 create_database(msifile
, ip_tables
, sizeof(ip_tables
) / sizeof(msi_table
));
4993 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4995 r
= MsiInstallProductA(msifile
, "FULL=1");
4996 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4998 skip("Not enough rights to perform tests\n");
5001 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5003 r
= MsiInstallProductA(msifile
, "FULL=1");
5004 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5006 r
= MsiConfigureProductExA(prodcode
, INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
, "FULL=1");
5007 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, 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\\filename", TRUE
), "File not installed\n");
5018 ok(delete_pf("msitest\\one.txt", TRUE
), "File 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 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5023 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5026 delete_test_files();
5027 DeleteFileA(msifile
);
5030 static void test_allusers_prop(void)
5034 if (is_process_limited())
5036 skip("process is limited\n");
5040 create_test_files();
5041 create_database(msifile
, aup_tables
, sizeof(aup_tables
) / sizeof(msi_table
));
5043 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5045 /* ALLUSERS property unset */
5046 r
= MsiInstallProductA(msifile
, "FULL=1");
5047 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5049 skip("Not enough rights to perform tests\n");
5052 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5054 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5055 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5056 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5057 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5058 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5059 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5060 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5061 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5062 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5063 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5064 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5065 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5067 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5068 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5070 delete_test_files();
5072 create_test_files();
5073 create_database(msifile
, aup2_tables
, sizeof(aup2_tables
) / sizeof(msi_table
));
5075 /* ALLUSERS property set to 1 */
5076 r
= MsiInstallProductA(msifile
, "FULL=1");
5077 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5079 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5080 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5081 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5082 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5083 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5084 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5085 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5086 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5087 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5088 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5089 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5090 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5092 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5093 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5095 delete_test_files();
5097 create_test_files();
5098 create_database(msifile
, aup3_tables
, sizeof(aup3_tables
) / sizeof(msi_table
));
5100 /* ALLUSERS property set to 2 */
5101 r
= MsiInstallProductA(msifile
, "FULL=1");
5102 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5104 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5105 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5106 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5107 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5108 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5109 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5110 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5111 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5112 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5113 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5114 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5115 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5117 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5120 delete_test_files();
5122 create_test_files();
5123 create_database(msifile
, aup4_tables
, sizeof(aup4_tables
) / sizeof(msi_table
));
5125 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
5126 r
= MsiInstallProductA(msifile
, "FULL=1");
5127 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5130 delete_test_files();
5131 DeleteFileA(msifile
);
5134 static const char session_manager
[] = "System\\CurrentControlSet\\Control\\Session Manager";
5135 static const char rename_ops
[] = "PendingFileRenameOperations";
5137 static void process_pending_renames(HKEY hkey
)
5139 char *buf
, *src
, *dst
, *buf2
, *buf2ptr
;
5144 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
);
5145 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5147 buf
= HeapAlloc(GetProcessHeap(), 0, size
+ 1);
5148 buf2ptr
= buf2
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, size
+ 1);
5150 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, (LPBYTE
)buf
, &size
);
5152 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5155 for (src
= buf
; *src
; src
= dst
+ strlen(dst
) + 1)
5157 DWORD flags
= MOVEFILE_COPY_ALLOWED
;
5160 dst
= src
+ strlen(src
) + 1;
5162 if (!strstr(src
, "msitest"))
5164 lstrcpyA(buf2ptr
, src
);
5165 buf2ptr
+= strlen(src
) + 1;
5166 lstrcpyA(buf2ptr
, dst
);
5167 buf2ptr
+= strlen(dst
) + 1;
5175 flags
|= MOVEFILE_REPLACE_EXISTING
;
5178 if (src
[0] == '\\' && src
[1] == '?' && src
[2] == '?' && src
[3] == '\\') src
+= 4;
5181 if (dst
[0] == '\\' && dst
[1] == '?' && dst
[2] == '?' && dst
[3] == '\\') dst
+= 4;
5182 fileret
= MoveFileExA(src
, dst
, flags
);
5183 ok(fileret
, "Failed to move file %s -> %s (%u)\n", src
, dst
, GetLastError());
5187 fileret
= DeleteFileA(src
);
5188 ok(fileret
|| broken(!fileret
) /* win2k3 */, "Failed to delete file %s (%u)\n", src
, GetLastError());
5192 ok(found
, "Expected a 'msitest' entry\n");
5195 RegSetValueExA(hkey
, rename_ops
, 0, REG_MULTI_SZ
, (LPBYTE
)buf2
, buf2ptr
+ 1 - buf2
);
5197 RegDeleteValueA(hkey
, rename_ops
);
5199 HeapFree(GetProcessHeap(), 0, buf
);
5200 HeapFree(GetProcessHeap(), 0, buf2
);
5203 static BOOL
file_matches_data(LPCSTR file
, LPCSTR data
)
5205 DWORD len
, data_len
= strlen(data
);
5209 handle
= CreateFileA(file
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
5210 ok(handle
!= INVALID_HANDLE_VALUE
, "failed to open %s (%u)\n", file
, GetLastError());
5212 if (ReadFile(handle
, buf
, sizeof(buf
), &len
, NULL
) && len
>= data_len
)
5214 CloseHandle(handle
);
5215 return !memcmp(buf
, data
, data_len
);
5217 CloseHandle(handle
);
5221 static void test_file_in_use(void)
5226 char path
[MAX_PATH
];
5228 if (is_process_limited())
5230 skip("process is limited\n");
5234 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5236 CreateDirectoryA("msitest", NULL
);
5237 create_file("msitest\\maximus", 500);
5238 create_database(msifile
, fiu_tables
, sizeof(fiu_tables
) / sizeof(msi_table
));
5240 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5242 lstrcpyA(path
, PROG_FILES_DIR
);
5243 lstrcatA(path
, "\\msitest");
5244 CreateDirectoryA(path
, NULL
);
5246 lstrcatA(path
, "\\maximus");
5247 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5249 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5250 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5252 skip("Not enough rights to perform tests\n");
5255 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5256 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5258 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5260 process_pending_renames(hkey
);
5263 ok(file_matches_data(path
, "msitest\\maximus"), "Expected file to match\n");
5264 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5265 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5267 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5268 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5273 delete_pf("msitest\\maximus", TRUE
);
5274 delete_pf("msitest", FALSE
);
5275 DeleteFileA("msitest\\maximus");
5276 delete_test_files();
5277 DeleteFileA(msifile
);
5280 static void test_file_in_use_cab(void)
5285 char path
[MAX_PATH
];
5287 if (is_process_limited())
5289 skip("process is limited\n");
5293 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5295 CreateDirectoryA("msitest", NULL
);
5296 create_file("maximus", 500);
5297 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
5298 DeleteFileA("maximus");
5300 create_database(msifile
, fiuc_tables
, sizeof(fiuc_tables
) / sizeof(msi_table
));
5302 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5304 lstrcpyA(path
, PROG_FILES_DIR
);
5305 lstrcatA(path
, "\\msitest");
5306 CreateDirectoryA(path
, NULL
);
5308 lstrcatA(path
, "\\maximus");
5309 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5311 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5312 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5314 skip("Not enough rights to perform tests\n");
5317 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5318 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5320 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5322 process_pending_renames(hkey
);
5325 ok(file_matches_data(path
, "maximus"), "Expected file to match\n");
5326 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5327 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5329 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5330 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5335 delete_pf("msitest\\maximus", TRUE
);
5336 delete_pf("msitest", FALSE
);
5337 DeleteFileA("msitest\\maximus");
5339 delete_test_files();
5340 DeleteFileA(msifile
);
5343 static void test_feature_override(void)
5346 REGSAM access
= KEY_ALL_ACCESS
;
5348 if (is_process_limited())
5350 skip("process is limited\n");
5354 create_test_files();
5355 create_file("msitest\\override.txt", 1000);
5356 create_file("msitest\\preselected.txt", 1000);
5357 create_file("msitest\\notpreselected.txt", 1000);
5358 create_database(msifile
, fo_tables
, sizeof(fo_tables
) / sizeof(msi_table
));
5361 access
|= KEY_WOW64_64KEY
;
5363 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5365 r
= MsiInstallProductA(msifile
, "ADDLOCAL=override");
5366 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5368 skip("Not enough rights to perform tests\n");
5371 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5373 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5374 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
5375 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5377 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5378 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5380 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5382 r
= MsiInstallProductA(msifile
, "preselect=1");
5383 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5385 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5386 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5387 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5389 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5390 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5392 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5394 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5395 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5398 r
= MsiInstallProductA(msifile
, NULL
);
5399 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5401 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5402 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5403 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5405 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5406 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5408 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5410 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5411 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5414 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", access
);
5417 DeleteFileA("msitest\\override.txt");
5418 DeleteFileA("msitest\\preselected.txt");
5419 DeleteFileA("msitest\\notpreselected.txt");
5420 delete_test_files();
5421 DeleteFileA(msifile
);
5424 static void test_icon_table(void)
5426 MSIHANDLE hdb
= 0, record
;
5429 CHAR path
[MAX_PATH
];
5430 static const char prodcode
[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
5432 if (is_process_limited())
5434 skip("process is limited\n");
5438 create_database(msifile
, icon_base_tables
, sizeof(icon_base_tables
) / sizeof(msi_table
));
5440 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5442 res
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_TRANSACT
, &hdb
);
5443 ok(res
== ERROR_SUCCESS
, "failed to open db: %d\n", res
);
5445 query
= "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
5446 res
= run_query( hdb
, 0, query
);
5447 ok(res
== ERROR_SUCCESS
, "Can't create Icon table: %d\n", res
);
5449 create_file("icon.ico", 100);
5450 record
= MsiCreateRecord(1);
5451 res
= MsiRecordSetStreamA(record
, 1, "icon.ico");
5452 ok(res
== ERROR_SUCCESS
, "Failed to add stream data to record: %d\n", res
);
5454 query
= "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
5455 res
= run_query(hdb
, record
, query
);
5456 ok(res
== ERROR_SUCCESS
, "Insert into Icon table failed: %d\n", res
);
5458 res
= MsiCloseHandle(record
);
5459 ok(res
== ERROR_SUCCESS
, "Failed to close record handle: %d\n", res
);
5460 DeleteFileA("icon.ico");
5461 res
= MsiDatabaseCommit(hdb
);
5462 ok(res
== ERROR_SUCCESS
, "Failed to commit database: %d\n", res
);
5463 res
= MsiCloseHandle(hdb
);
5464 ok(res
== ERROR_SUCCESS
, "Failed to close database: %d\n", res
);
5467 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
5468 if (res
== ERROR_INSTALL_PACKAGE_REJECTED
)
5470 skip("Not enough rights to perform tests\n");
5471 DeleteFileA(msifile
);
5474 ok(res
== ERROR_SUCCESS
, "Failed to do per-user install: %d\n", res
);
5476 lstrcpyA(path
, APP_DATA_DIR
);
5477 lstrcatA(path
, "\\");
5478 lstrcatA(path
, "Microsoft\\Installer\\");
5479 lstrcatA(path
, prodcode
);
5480 lstrcatA(path
, "\\testicon");
5481 ok(file_exists(path
), "Per-user icon file isn't where it's expected (%s)\n", path
);
5483 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5484 ok(res
== ERROR_SUCCESS
, "Failed to uninstall per-user\n");
5485 ok(!file_exists(path
), "Per-user icon file not removed (%s)\n", path
);
5488 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5489 ok(res
== ERROR_SUCCESS
, "Failed to system-wide install: %d\n", res
);
5491 lstrcpyA(path
, WINDOWS_DIR
);
5492 lstrcatA(path
, "\\");
5493 lstrcatA(path
, "Installer\\");
5494 lstrcatA(path
, prodcode
);
5495 lstrcatA(path
, "\\testicon");
5496 ok(file_exists(path
), "System-wide icon file isn't where it's expected (%s)\n", path
);
5498 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5499 ok(res
== ERROR_SUCCESS
, "Failed to uninstall system-wide\n");
5500 ok(!file_exists(path
), "System-wide icon file not removed (%s)\n", path
);
5502 delete_pfmsitest_files();
5503 DeleteFileA(msifile
);
5506 static void test_package_validation(void)
5510 if (is_process_limited())
5512 skip("process is limited\n");
5516 CreateDirectoryA("msitest", NULL
);
5517 create_file("msitest\\maximus", 500);
5518 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1033");
5520 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5522 r
= MsiInstallProductA(msifile
, NULL
);
5523 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5525 skip("Not enough rights to perform tests\n");
5528 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5529 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5530 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5532 DeleteFileA(msifile
);
5533 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;9999");
5535 r
= MsiInstallProductA(msifile
, NULL
);
5536 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5538 DeleteFileA(msifile
);
5539 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,1033;9999");
5541 r
= MsiInstallProductA(msifile
, NULL
);
5542 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5544 DeleteFileA(msifile
);
5545 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;1033");
5547 r
= MsiInstallProductA(msifile
, NULL
);
5548 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5549 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5550 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5552 DeleteFileA(msifile
);
5553 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel64,9999;1033");
5555 r
= MsiInstallProductA(msifile
, NULL
);
5556 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5558 DeleteFileA(msifile
);
5559 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,1033;1033");
5561 r
= MsiInstallProductA(msifile
, NULL
);
5562 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5564 DeleteFileA(msifile
);
5565 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,9999;1033");
5567 r
= MsiInstallProductA(msifile
, NULL
);
5568 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5570 DeleteFileA(msifile
);
5571 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9999");
5573 r
= MsiInstallProductA(msifile
, NULL
);
5574 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5575 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5576 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5578 if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH
, SUBLANG_ENGLISH_US
))
5580 DeleteFileA(msifile
);
5581 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9");
5582 r
= MsiInstallProductA(msifile
, NULL
);
5583 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5584 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5585 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5587 DeleteFileA(msifile
);
5588 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1024");
5589 r
= MsiInstallProductA(msifile
, NULL
);
5590 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5591 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5592 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5595 DeleteFileA(msifile
);
5596 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel32;0");
5598 r
= MsiInstallProductA(msifile
, NULL
);
5599 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5600 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5601 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5603 if (is_64bit
&& !is_wow64
)
5605 DeleteFileA(msifile
);
5606 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5608 r
= MsiInstallProductA(msifile
, NULL
);
5609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5610 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5611 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5613 DeleteFileA(msifile
);
5614 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5616 r
= MsiInstallProductA(msifile
, NULL
);
5617 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5618 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5619 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5621 DeleteFileA(msifile
);
5622 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5624 r
= MsiInstallProductA(msifile
, NULL
);
5625 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5626 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5627 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5631 DeleteFileA(msifile
);
5632 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5634 r
= MsiInstallProductA(msifile
, NULL
);
5635 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5636 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5637 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5639 DeleteFileA(msifile
);
5640 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5642 r
= MsiInstallProductA(msifile
, NULL
);
5643 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5644 ok(!delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5645 ok(!delete_pf_native("msitest", FALSE
), "directory exists\n");
5647 DeleteFileA(msifile
);
5648 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5650 r
= MsiInstallProductA(msifile
, NULL
);
5651 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5652 ok(delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5653 ok(delete_pf_native("msitest", FALSE
), "directory exists\n");
5657 DeleteFileA(msifile
);
5658 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5660 r
= MsiInstallProductA(msifile
, NULL
);
5661 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5662 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5663 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5665 DeleteFileA(msifile
);
5666 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Alpha,Beta,Intel;0");
5668 r
= MsiInstallProductA(msifile
, NULL
);
5669 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5670 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5671 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5673 DeleteFileA(msifile
);
5674 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5676 r
= MsiInstallProductA(msifile
, NULL
);
5677 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5678 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5679 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5681 DeleteFileA(msifile
);
5682 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5684 r
= MsiInstallProductA(msifile
, NULL
);
5685 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5686 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5687 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5691 /* Delete the files in the temp (current) folder */
5692 DeleteFileA(msifile
);
5693 DeleteFileA("msitest\\maximus");
5694 RemoveDirectoryA("msitest");
5697 static void test_upgrade_code(void)
5701 if (is_process_limited())
5703 skip("process is limited\n");
5707 CreateDirectoryA("msitest", NULL
);
5708 create_file("msitest\\upgradecode.txt", 1000);
5709 create_database(msifile
, uc_tables
, sizeof(uc_tables
) / sizeof(msi_table
));
5711 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5713 r
= MsiInstallProductA(msifile
, NULL
);
5714 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5716 ok(pf_exists("msitest\\upgradecode.txt"), "file not installed\n");
5718 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5719 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5721 ok(!delete_pf("msitest\\upgradecode.txt", TRUE
), "file not removed\n");
5722 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5724 DeleteFileA("msitest\\upgradecode.txt");
5725 RemoveDirectoryA("msitest");
5726 DeleteFileA(msifile
);
5729 static void test_mixed_package(void)
5734 char value
[MAX_PATH
];
5737 if (is_process_limited())
5739 skip("process is limited\n");
5742 if (!is_wow64
&& !is_64bit
)
5744 skip("this test must be run on 64-bit\n");
5747 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5748 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "x64;1033");
5750 r
= MsiInstallProductA(msifile
, NULL
);
5751 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5753 skip("Not enough rights to perform tests\n");
5756 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5758 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5759 ok(!res
, "can't open 32-bit component key, got %d\n", res
);
5760 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5761 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5762 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5763 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5766 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5767 ok(!res
, "can't open 64-bit component key, got %d\n", res
);
5768 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5769 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5770 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5771 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5774 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5775 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5776 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5777 ok(res
== ERROR_SUCCESS
, "can't open 32-bit CLSID key, got %d\n", res
);
5778 if (res
== ERROR_SUCCESS
) {
5779 size
= sizeof(value
);
5780 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5781 ok(!strcmp(value
, "winetest32.dll"), "got %s\n", value
);
5785 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5786 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5787 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5788 ok(res
== ERROR_SUCCESS
, "can't open 64-bit CLSID key, got %d\n", res
);
5789 if (res
== ERROR_SUCCESS
) {
5790 size
= sizeof(value
);
5791 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5792 ok(!strcmp(value
, "winetest64.dll"), "got %s\n", value
);
5796 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5799 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5800 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5802 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5803 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5805 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5806 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5807 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5808 ok(res
== ERROR_FILE_NOT_FOUND
, "32-bit CLSID key not removed\n");
5810 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5811 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5812 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5813 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit CLSID key not removed\n");
5815 DeleteFileA( msifile
);
5816 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "Intel;1033");
5818 r
= MsiInstallProductA(msifile
, NULL
);
5819 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5821 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5822 ok(!res
, "can't open 32-bit component key, got %d\n", res
);
5823 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5824 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5825 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5826 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5829 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5830 ok(!res
, "can't open 64-bit component key, got %d\n", res
);
5831 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5832 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5833 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5834 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5837 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5838 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5839 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5840 ok(res
== ERROR_SUCCESS
, "can't open 32-bit CLSID key, got %d\n", res
);
5841 if (res
== ERROR_SUCCESS
) {
5842 size
= sizeof(value
);
5843 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5844 ok(!strcmp(value
, "winetest32.dll"), "got %s\n", value
);
5848 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5849 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5850 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5851 ok(res
== ERROR_SUCCESS
, "can't open 64-bit CLSID key, got %d\n", res
);
5852 if (res
== ERROR_SUCCESS
) {
5853 size
= sizeof(value
);
5854 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5855 ok(!strcmp(value
, "winetest64.dll"), "got %s\n", value
);
5859 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5860 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5862 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5863 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5865 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5866 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5868 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5869 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5870 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5871 ok(res
== ERROR_FILE_NOT_FOUND
, "32-bit CLSID key not removed\n");
5873 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5874 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5875 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5876 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit CLSID key not removed\n");
5879 DeleteFileA( msifile
);
5882 static void test_volume_props(void)
5886 if (is_process_limited())
5888 skip("process is limited\n");
5891 CreateDirectoryA("msitest", NULL
);
5892 create_file("msitest\\volumeprop.txt", 1000);
5893 create_database(msifile
, vp_tables
, sizeof(vp_tables
)/sizeof(msi_table
));
5895 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5897 r
= MsiInstallProductA(msifile
, NULL
);
5898 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5900 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5901 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5903 DeleteFileA("msitest\\volumeprop.txt");
5904 RemoveDirectoryA("msitest");
5905 DeleteFileA(msifile
);
5908 static void test_shared_component(void)
5912 if (is_process_limited())
5914 skip("process is limited\n");
5917 CreateDirectoryA("msitest", NULL
);
5918 create_file("msitest\\sharedcomponent.txt", 1000);
5919 create_database_wordcount(msifile
, shc_tables
, sizeof(shc_tables
)/sizeof(shc_tables
[0]),
5920 100, 0, ";", "{A8826420-FD72-4E61-9E15-C1944CF4CBE1}");
5921 create_database_wordcount(msifile2
, shc2_tables
, sizeof(shc2_tables
)/sizeof(shc2_tables
[0]),
5922 100, 0, ";", "{A8B50B30-0E8A-4ACD-B3CF-1A5DC58B2739}");
5924 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5926 r
= MsiInstallProductA(msifile
, NULL
);
5927 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5929 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5931 r
= MsiInstallProductA(msifile2
, NULL
);
5932 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5934 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5936 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5937 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5939 ok(pf_exists("msitest\\sharedcomponent.txt"), "file removed\n");
5941 r
= MsiInstallProductA(msifile2
, "REMOVE=ALL");
5942 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5944 ok(!pf_exists("msitest\\sharedcomponent.txt"), "file not removed\n");
5946 DeleteFileA("msitest\\sharedcomponent.txt");
5947 RemoveDirectoryA("msitest");
5948 DeleteFileA(msifile
);
5949 DeleteFileA(msifile2
);
5952 static void test_remove_upgrade_code(void)
5957 REGSAM access
= KEY_ALL_ACCESS
;
5961 if (is_process_limited())
5963 skip( "process is limited\n" );
5966 if (is_wow64
) access
|= KEY_WOW64_64KEY
;
5968 create_test_files();
5969 create_database( msifile
, icon_base_tables
, sizeof(icon_base_tables
)/sizeof(icon_base_tables
[0]) );
5971 MsiSetInternalUI( INSTALLUILEVEL_NONE
, NULL
);
5973 r
= MsiInstallProductA( msifile
, "FULL=1" );
5974 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5976 res
= RegOpenKeyExA( HKEY_LOCAL_MACHINE
,
5977 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2",
5979 ok( res
== ERROR_SUCCESS
, "got %d\n", res
);
5984 res
= RegQueryValueExA( hkey
, "94A88FD7F6998CE40A22FB59F6B9C2BB", NULL
, &type
, (BYTE
*)buf
, &size
);
5985 ok( res
== ERROR_SUCCESS
, "got %d\n", res
);
5986 ok( type
== REG_SZ
, "got %u\n", type
);
5987 ok( size
== 1, "got %u\n", size
);
5988 ok( !buf
[0], "wrong data\n" );
5989 RegCloseKey( hkey
);
5991 r
= MsiInstallProductA( msifile
, "REMOVE=ALL" );
5992 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5994 res
= RegOpenKeyExA( HKEY_LOCAL_MACHINE
,
5995 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2",
5997 ok( res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
5999 RemoveDirectoryA( "msitest" );
6000 DeleteFileA( msifile
);
6003 static void test_feature_tree(void)
6007 if (is_process_limited())
6009 skip( "process is limited\n" );
6013 create_file( "msitest\\featuretree.txt", 1000 );
6014 create_database( msifile
, ft_tables
, sizeof(ft_tables
)/sizeof(ft_tables
[0]) );
6016 MsiSetInternalUI( INSTALLUILEVEL_NONE
, NULL
);
6018 r
= MsiInstallProductA( msifile
, "INSTALLTYPE=\"0\"" );
6019 ok( r
== ERROR_INSTALL_FAILURE
, "got %u\n", r
);
6021 r
= MsiInstallProductA( msifile
, "INSTALLTYPE=\"1\"" );
6022 ok( r
== ERROR_SUCCESS
, "got %u\n", r
);
6024 r
= MsiInstallProductA( msifile
, "REMOVE=ALL" );
6025 ok( r
== ERROR_SUCCESS
, "got %u\n", r
);
6027 DeleteFileA( "msitest\\featuretree.txt" );
6028 RemoveDirectoryA( "msitest" );
6029 DeleteFileA( msifile
);
6035 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6036 STATEMGRSTATUS status
;
6039 init_functionpointers();
6041 if (pIsWow64Process
)
6042 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
6044 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6045 GetTempPathA(MAX_PATH
, temp_path
);
6046 SetCurrentDirectoryA(temp_path
);
6048 lstrcpyA(CURR_DIR
, temp_path
);
6049 len
= lstrlenA(CURR_DIR
);
6051 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
6052 CURR_DIR
[len
- 1] = 0;
6054 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6055 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6057 /* Create a restore point ourselves so we circumvent the multitude of restore points
6058 * that would have been created by all the installation and removal tests.
6060 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6061 * creation of restore points.
6063 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
6065 memset(&status
, 0, sizeof(status
));
6066 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
6069 /* Create only one log file and don't append. We have to pass something
6070 * for the log mode for this to work. The logfile needs to have an absolute
6071 * path otherwise we still end up with some extra logfiles as some tests
6072 * change the current directory.
6074 lstrcpyA(log_file
, temp_path
);
6075 lstrcatA(log_file
, "\\msitest.log");
6076 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
6078 if (pSRSetRestorePointA
) /* test has side-effects on win2k3 that cause failures in following tests */
6079 test_MsiInstallProduct();
6080 test_MsiSetComponentState();
6081 test_packagecoltypes();
6082 test_continuouscabs();
6085 test_samesequence();
6086 test_uiLevelFlags();
6087 test_readonlyfile();
6088 test_readonlyfile_cab();
6089 test_setdirproperty();
6090 test_cabisextracted();
6091 test_transformprop();
6092 test_currentworkingdir();
6096 test_sourcefolder();
6097 test_customaction51();
6098 test_installstate();
6100 test_missingcomponent();
6101 test_sourcedirprop();
6107 test_installed_prop();
6109 test_file_in_use_cab();
6110 test_allusers_prop();
6111 test_feature_override();
6113 test_package_validation();
6114 test_upgrade_code();
6115 test_mixed_package();
6116 test_volume_props();
6117 test_shared_component();
6118 test_remove_upgrade_code();
6119 test_feature_tree();
6121 DeleteFileA(log_file
);
6123 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
6125 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
6127 remove_restore_point(status
.llSequenceNumber
);
6129 FreeLibrary(hsrclient
);
6131 SetCurrentDirectoryA(prev_path
);