2 * Copyright (C) 2006 James Hawkins
4 * A test program for installing MSI products.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define _WIN32_MSI 300
32 #include <srrestoreptapi.h>
37 #include "wine/test.h"
39 static UINT (WINAPI
*pMsiQueryComponentStateA
)
40 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
41 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
42 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
43 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
44 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
46 static BOOL (WINAPI
*pCheckTokenMembership
)(HANDLE
,PSID
,PBOOL
);
47 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
48 static BOOL (WINAPI
*pOpenProcessToken
)( HANDLE
, DWORD
, PHANDLE
);
49 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
50 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
52 static HMODULE hsrclient
= 0;
53 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
54 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
57 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
59 static const char *msifile
= "msitest.msi";
60 static const char *msifile2
= "winetest2.msi";
61 static const char *mstfile
= "winetest.mst";
63 static const WCHAR msifileW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
64 static const WCHAR msifile2W
[] = {'w','i','n','e','t','e','s','t','2','.','m','s','i',0};
66 static CHAR CURR_DIR
[MAX_PATH
];
67 static CHAR PROG_FILES_DIR
[MAX_PATH
];
68 static CHAR PROG_FILES_DIR_NATIVE
[MAX_PATH
];
69 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
70 static CHAR APP_DATA_DIR
[MAX_PATH
];
71 static CHAR WINDOWS_DIR
[MAX_PATH
];
73 /* msi database data */
75 static const CHAR component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
76 "s72\tS38\ts72\ti2\tS255\tS72\n"
77 "Component\tComponent\n"
78 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
79 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
80 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
81 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
82 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
83 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
84 "component\t\tMSITESTDIR\t0\t1\tfile\n"
85 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
87 static const CHAR directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
89 "Directory\tDirectory\n"
90 "CABOUTDIR\tMSITESTDIR\tcabout\n"
91 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
92 "FIRSTDIR\tMSITESTDIR\tfirst\n"
93 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
94 "NEWDIR\tCABOUTDIR\tnew\n"
95 "ProgramFilesFolder\tTARGETDIR\t.\n"
96 "TARGETDIR\t\tSourceDir";
98 static const CHAR feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
99 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
101 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
102 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
103 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
104 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
105 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
106 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
107 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
109 static const CHAR feature_comp_dat
[] = "Feature_\tComponent_\n"
111 "FeatureComponents\tFeature_\tComponent_\n"
117 "feature\tcomponent\n"
118 "service_feature\tservice_comp\n";
120 static const CHAR file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
121 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
123 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
124 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
125 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
126 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
127 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
128 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
129 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
131 static const CHAR install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
133 "InstallExecuteSequence\tAction\n"
134 "AllocateRegistrySpace\tNOT Installed\t1550\n"
135 "CostFinalize\t\t1000\n"
136 "CostInitialize\t\t800\n"
138 "ResolveSource\t\t950\n"
139 "MoveFiles\t\t1700\n"
140 "InstallFiles\t\t4000\n"
141 "DuplicateFiles\t\t4500\n"
142 "WriteEnvironmentStrings\t\t4550\n"
143 "CreateShortcuts\t\t4600\n"
144 "InstallServices\t\t5000\n"
145 "InstallFinalize\t\t6600\n"
146 "InstallInitialize\t\t1500\n"
147 "InstallValidate\t\t1400\n"
148 "LaunchConditions\t\t100\n"
149 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
151 static const CHAR media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
152 "i2\ti4\tL64\tS255\tS32\tS72\n"
154 "1\t3\t\t\tDISK1\t\n"
155 "2\t5\t\tmsitest.cab\tDISK2\t\n";
157 static const CHAR property_dat
[] = "Property\tValue\n"
159 "Property\tProperty\n"
160 "DefaultUIFont\tDlgFont8\n"
163 "InstallMode\tTypical\n"
164 "Manufacturer\tWine\n"
165 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
166 "PRIMARYFOLDER\tTARGETDIR\n"
167 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
169 "ProductLanguage\t1033\n"
170 "ProductName\tMSITEST\n"
171 "ProductVersion\t1.1.1\n"
172 "PROMPTROLLBACKCOST\tP\n"
174 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
175 "AdminProperties\tPOSTADMIN\n"
177 "SERVNAME\tTestService\n"
178 "SERVDISP\tTestServiceDisp\n"
179 "MSIFASTINSTALL\t1\n";
181 static const CHAR aup_property_dat
[] = "Property\tValue\n"
183 "Property\tProperty\n"
184 "DefaultUIFont\tDlgFont8\n"
188 "InstallMode\tTypical\n"
189 "Manufacturer\tWine\n"
190 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
191 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
193 "ProductLanguage\t1033\n"
194 "ProductName\tMSITEST\n"
195 "ProductVersion\t1.1.1\n"
196 "PROMPTROLLBACKCOST\tP\n"
198 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
199 "AdminProperties\tPOSTADMIN\n"
201 "SERVNAME\tTestService\n"
202 "SERVDISP\tTestServiceDisp\n"
203 "MSIFASTINSTALL\t1\n";
205 static const CHAR aup2_property_dat
[] = "Property\tValue\n"
207 "Property\tProperty\n"
208 "DefaultUIFont\tDlgFont8\n"
212 "InstallMode\tTypical\n"
213 "Manufacturer\tWine\n"
214 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
215 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
217 "ProductLanguage\t1033\n"
218 "ProductName\tMSITEST\n"
219 "ProductVersion\t1.1.1\n"
220 "PROMPTROLLBACKCOST\tP\n"
222 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
223 "AdminProperties\tPOSTADMIN\n"
225 "SERVNAME\tTestService\n"
226 "SERVDISP\tTestServiceDisp\n"
227 "MSIFASTINSTALL\t1\n";
229 static const CHAR icon_property_dat
[] = "Property\tValue\n"
231 "Property\tProperty\n"
232 "DefaultUIFont\tDlgFont8\n"
235 "InstallMode\tTypical\n"
236 "Manufacturer\tWine\n"
237 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
238 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
240 "ProductLanguage\t1033\n"
241 "ProductName\tMSITEST\n"
242 "ProductVersion\t1.1.1\n"
243 "PROMPTROLLBACKCOST\tP\n"
245 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
246 "AdminProperties\tPOSTADMIN\n"
248 "SERVNAME\tTestService\n"
249 "SERVDISP\tTestServiceDisp\n"
250 "MSIFASTINSTALL\t1\n";
252 static const CHAR shortcut_dat
[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
253 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
254 "Shortcut\tShortcut\n"
255 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
257 static const CHAR condition_dat
[] = "Feature_\tLevel\tCondition\n"
259 "Condition\tFeature_\tLevel\n"
262 static const CHAR up_property_dat
[] = "Property\tValue\n"
264 "Property\tProperty\n"
265 "DefaultUIFont\tDlgFont8\n"
268 "InstallMode\tTypical\n"
269 "Manufacturer\tWine\n"
270 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
271 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
273 "ProductLanguage\t1033\n"
274 "ProductName\tMSITEST\n"
275 "ProductVersion\t1.1.1\n"
276 "PROMPTROLLBACKCOST\tP\n"
278 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
279 "AdminProperties\tPOSTADMIN\n"
281 "SERVNAME\tTestService\n"
282 "SERVDISP\tTestServiceDisp\n"
283 "RemovePreviousVersions\t1\n"
284 "MSIFASTINSTALL\t1\n";
286 static const CHAR up2_property_dat
[] = "Property\tValue\n"
288 "Property\tProperty\n"
289 "DefaultUIFont\tDlgFont8\n"
292 "InstallMode\tTypical\n"
293 "Manufacturer\tWine\n"
294 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
295 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
297 "ProductLanguage\t1033\n"
298 "ProductName\tMSITEST\n"
299 "ProductVersion\t1.1.2\n"
300 "PROMPTROLLBACKCOST\tP\n"
302 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
303 "AdminProperties\tPOSTADMIN\n"
305 "SERVNAME\tTestService\n"
306 "SERVDISP\tTestServiceDisp\n"
307 "MSIFASTINSTALL\t1\n";
309 static const CHAR up3_property_dat
[] = "Property\tValue\n"
311 "Property\tProperty\n"
312 "DefaultUIFont\tDlgFont8\n"
315 "InstallMode\tTypical\n"
316 "Manufacturer\tWine\n"
317 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
318 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
320 "ProductLanguage\t1033\n"
321 "ProductName\tMSITEST\n"
322 "ProductVersion\t1.1.2\n"
323 "PROMPTROLLBACKCOST\tP\n"
325 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
326 "AdminProperties\tPOSTADMIN\n"
328 "SERVNAME\tTestService\n"
329 "SERVDISP\tTestServiceDisp\n"
330 "RemovePreviousVersions\t1\n"
331 "MSIFASTINSTALL\t1\n";
333 static const CHAR registry_dat
[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
334 "s72\ti2\tl255\tL255\tL0\ts72\n"
335 "Registry\tRegistry\n"
336 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
337 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
338 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
339 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
341 static const CHAR service_install_dat
[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
342 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
343 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
344 "ServiceInstall\tServiceInstall\n"
345 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
347 static const CHAR service_control_dat
[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
348 "s72\tl255\ti2\tL255\tI2\ts72\n"
349 "ServiceControl\tServiceControl\n"
350 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
352 /* tables for test_continuouscabs */
353 static const CHAR cc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
354 "s72\tS38\ts72\ti2\tS255\tS72\n"
355 "Component\tComponent\n"
356 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
357 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
358 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
360 static const CHAR cc2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
361 "s72\tS38\ts72\ti2\tS255\tS72\n"
362 "Component\tComponent\n"
363 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
364 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
365 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
367 static const CHAR cc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
368 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
370 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
372 static const CHAR cc_feature_comp_dat
[] = "Feature_\tComponent_\n"
374 "FeatureComponents\tFeature_\tComponent_\n"
376 "feature\taugustus\n"
379 static const CHAR cc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
380 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
382 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
383 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
384 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
386 static const CHAR cc2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
387 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
389 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
390 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
391 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
392 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
394 static const CHAR cc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
395 "i2\ti4\tL64\tS255\tS32\tS72\n"
397 "1\t10\t\ttest1.cab\tDISK1\t\n"
398 "2\t2\t\ttest2.cab\tDISK2\t\n"
399 "3\t12\t\ttest3.cab\tDISK3\t\n";
401 static const CHAR cc3_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
402 "i2\ti4\tL64\tS255\tS32\tS72\n"
404 "1\t10\t\ttest1.cab\tDISK1\t\n"
405 "2\t2\t\ttest2_.cab\tDISK2\t\n"
406 "3\t12\t\ttest3.cab\tDISK3\t\n";
408 static const CHAR co_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
409 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
411 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
412 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
413 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
415 static const CHAR co_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
416 "i2\ti4\tL64\tS255\tS32\tS72\n"
418 "1\t10\t\ttest1.cab\tDISK1\t\n"
419 "2\t2\t\ttest2.cab\tDISK2\t\n"
420 "3\t3\t\ttest3.cab\tDISK3\t\n";
422 static const CHAR co2_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
423 "i2\ti4\tL64\tS255\tS32\tS72\n"
425 "1\t10\t\ttest1.cab\tDISK1\t\n"
426 "2\t12\t\ttest3.cab\tDISK3\t\n"
427 "3\t2\t\ttest2.cab\tDISK2\t\n";
429 static const CHAR mm_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
430 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
432 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
433 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
434 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
436 static const CHAR mm_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
437 "i2\ti4\tL64\tS255\tS32\tS72\n"
439 "1\t3\t\ttest1.cab\tDISK1\t\n";
441 static const CHAR ss_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
442 "i2\ti4\tL64\tS255\tS32\tS72\n"
444 "1\t2\t\ttest1.cab\tDISK1\t\n"
445 "2\t2\t\ttest2.cab\tDISK2\t\n"
446 "3\t12\t\ttest3.cab\tDISK3\t\n";
448 /* tables for test_uiLevelFlags */
449 static const CHAR ui_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
450 "s72\tS38\ts72\ti2\tS255\tS72\n"
451 "Component\tComponent\n"
452 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
453 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
454 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
456 static const CHAR ui_install_ui_seq_dat
[] = "Action\tCondition\tSequence\n"
458 "InstallUISequence\tAction\n"
459 "SetUIProperty\t\t5\n"
460 "ExecuteAction\t\t1100\n";
462 static const CHAR ui_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
463 "s72\ti2\tS64\tS0\tS255\n"
464 "CustomAction\tAction\n"
465 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
467 static const CHAR rof_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
468 "s72\tS38\ts72\ti2\tS255\tS72\n"
469 "Component\tComponent\n"
470 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
472 static const CHAR rof_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
473 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
475 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
476 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
478 static const CHAR rof_feature_comp_dat
[] = "Feature_\tComponent_\n"
480 "FeatureComponents\tFeature_\tComponent_\n"
482 "montecristo\tmaximus";
484 static const CHAR rof_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
485 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
487 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
489 static const CHAR rof_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
490 "i2\ti4\tL64\tS255\tS32\tS72\n"
492 "1\t1\t\t\tDISK1\t\n";
494 static const CHAR rofc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
495 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
497 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
499 static const CHAR rofc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
500 "i2\ti4\tL64\tS255\tS32\tS72\n"
502 "1\t1\t\ttest1.cab\tDISK1\t\n";
504 static const CHAR sdp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
506 "InstallExecuteSequence\tAction\n"
507 "AllocateRegistrySpace\tNOT Installed\t1550\n"
508 "CostFinalize\t\t1000\n"
509 "CostInitialize\t\t800\n"
511 "InstallFiles\t\t4000\n"
512 "InstallFinalize\t\t6600\n"
513 "InstallInitialize\t\t1500\n"
514 "InstallValidate\t\t1400\n"
515 "LaunchConditions\t\t100\n"
516 "SetDirProperty\t\t950";
518 static const CHAR sdp_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
519 "s72\ti2\tS64\tS0\tS255\n"
520 "CustomAction\tAction\n"
521 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
523 static const CHAR pv_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
525 "InstallExecuteSequence\tAction\n"
526 "LaunchConditions\t\t100\n"
527 "CostInitialize\t\t800\n"
529 "CostFinalize\t\t1000\n"
530 "InstallValidate\t\t1400\n"
531 "InstallInitialize\t\t1500\n"
532 "InstallFiles\t\t4000\n"
533 "InstallFinalize\t\t6600\n";
535 static const CHAR cie_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
536 "s72\tS38\ts72\ti2\tS255\tS72\n"
537 "Component\tComponent\n"
538 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
539 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
540 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
541 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
543 static const CHAR cie_feature_comp_dat
[] = "Feature_\tComponent_\n"
545 "FeatureComponents\tFeature_\tComponent_\n"
547 "feature\taugustus\n"
551 static const CHAR cie_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
552 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
554 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
555 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
556 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
557 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
559 static const CHAR cie_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
560 "i2\ti4\tL64\tS255\tS32\tS72\n"
562 "1\t1\t\ttest1.cab\tDISK1\t\n"
563 "2\t2\t\ttest2.cab\tDISK2\t\n"
564 "3\t12\t\ttest3.cab\tDISK3\t\n";
566 static const CHAR ci_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
567 "s72\tS38\ts72\ti2\tS255\tS72\n"
568 "Component\tComponent\n"
569 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
571 static const CHAR ci2_feature_comp_dat
[] = "Feature_\tComponent_\n"
573 "FeatureComponents\tFeature_\tComponent_\n"
576 static const CHAR ci2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
577 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
579 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
581 static const CHAR pp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
583 "InstallExecuteSequence\tAction\n"
584 "ValidateProductID\t\t700\n"
585 "CostInitialize\t\t800\n"
587 "CostFinalize\t\t1000\n"
588 "InstallValidate\t\t1400\n"
589 "InstallInitialize\t\t1500\n"
590 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
591 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
592 "RemoveFiles\t\t3500\n"
593 "InstallFiles\t\t4000\n"
594 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
595 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
596 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
597 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
598 "InstallFinalize\t\t6600";
600 static const CHAR tp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
601 "s72\tS38\ts72\ti2\tS255\tS72\n"
602 "Component\tComponent\n"
603 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
605 static const CHAR cwd_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
606 "s72\tS38\ts72\ti2\tS255\tS72\n"
607 "Component\tComponent\n"
608 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
610 static const CHAR adm_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
611 "s72\tS38\ts72\ti2\tS255\tS72\n"
612 "Component\tComponent\n"
613 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
615 static const CHAR adm_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
616 "s72\ti2\tS64\tS0\tS255\n"
617 "CustomAction\tAction\n"
618 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
620 static const CHAR adm_admin_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
622 "AdminExecuteSequence\tAction\n"
623 "CostFinalize\t\t1000\n"
624 "CostInitialize\t\t800\n"
626 "SetPOSTADMIN\t\t950\n"
627 "InstallFiles\t\t4000\n"
628 "InstallFinalize\t\t6600\n"
629 "InstallInitialize\t\t1500\n"
630 "InstallValidate\t\t1400\n"
631 "LaunchConditions\t\t100";
633 static const CHAR amp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
634 "s72\tS38\ts72\ti2\tS255\tS72\n"
635 "Component\tComponent\n"
636 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
638 static const CHAR rem_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
640 "InstallExecuteSequence\tAction\n"
641 "ValidateProductID\t\t700\n"
642 "CostInitialize\t\t800\n"
644 "CostFinalize\t\t1000\n"
645 "InstallValidate\t\t1400\n"
646 "InstallInitialize\t\t1500\n"
647 "ProcessComponents\t\t1600\n"
648 "UnpublishFeatures\t\t1800\n"
649 "RemoveFiles\t\t3500\n"
650 "InstallFiles\t\t4000\n"
651 "RegisterProduct\t\t6100\n"
652 "PublishFeatures\t\t6300\n"
653 "PublishProduct\t\t6400\n"
654 "InstallFinalize\t\t6600";
656 static const CHAR mc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
657 "s72\tS38\ts72\ti2\tS255\tS72\n"
658 "Component\tComponent\n"
659 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
660 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
661 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
662 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
663 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
665 static const CHAR mc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
666 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
668 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
669 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
670 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
671 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
672 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
674 static const CHAR mc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
675 "i2\ti4\tL64\tS255\tS32\tS72\n"
677 "1\t1\t\ttest1.cab\tDISK1\t\n"
678 "2\t2\t\ttest2.cab\tDISK2\t\n"
679 "3\t3\t\ttest3.cab\tDISK3\t\n"
680 "4\t4\t\ttest3.cab\tDISK3\t\n"
681 "5\t5\t\ttest4.cab\tDISK4\t\n";
683 static const CHAR mc_file_hash_dat
[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
684 "s72\ti2\ti4\ti4\ti4\ti4\n"
685 "MsiFileHash\tFile_\n"
686 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
688 static const CHAR wrv_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
689 "s72\tS38\ts72\ti2\tS255\tS72\n"
690 "Component\tComponent\n"
691 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
693 static const CHAR ca51_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
694 "s72\tS38\ts72\ti2\tS255\tS72\n"
695 "Component\tComponent\n"
696 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
698 static const CHAR ca51_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
700 "InstallExecuteSequence\tAction\n"
701 "ValidateProductID\t\t700\n"
702 "GoodSetProperty\t\t725\n"
703 "BadSetProperty\t\t750\n"
704 "CostInitialize\t\t800\n"
705 "ResolveSource\t\t810\n"
707 "SetSourceDir\tSRCDIR\t910\n"
708 "CostFinalize\t\t1000\n"
709 "InstallValidate\t\t1400\n"
710 "InstallInitialize\t\t1500\n"
711 "InstallFiles\t\t4000\n"
712 "InstallFinalize\t\t6600";
714 static const CHAR ca51_custom_action_dat
[] = "Action\tType\tSource\tTarget\n"
716 "CustomAction\tAction\n"
717 "GoodSetProperty\t51\tMYPROP\t42\n"
718 "BadSetProperty\t51\t\tMYPROP\n"
719 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
721 static const CHAR is_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
722 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
724 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
725 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
726 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
727 "four\t\t\t\t2\t0\t\t0"; /* disabled */
729 static const CHAR is_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
730 "s72\tS38\ts72\ti2\tS255\tS72\n"
731 "Component\tComponent\n"
732 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
733 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
734 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
735 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
736 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
737 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
738 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
739 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
740 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
741 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
742 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
743 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
745 static const CHAR is_feature_comp_dat
[] = "Feature_\tComponent_\n"
747 "FeatureComponents\tFeature_\tComponent_\n"
761 static const CHAR is_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
762 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
764 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
765 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
766 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
767 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
768 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
769 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
770 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
771 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
772 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
773 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
774 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
775 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
777 static const CHAR is_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
778 "i2\ti4\tL64\tS255\tS32\tS72\n"
780 "1\t12\t\t\tDISK1\t\n";
782 static const CHAR sp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
783 "s72\tS38\ts72\ti2\tS255\tS72\n"
784 "Component\tComponent\n"
785 "augustus\t\tTWODIR\t0\t\taugustus\n";
787 static const CHAR sp_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
789 "Directory\tDirectory\n"
790 "TARGETDIR\t\tSourceDir\n"
791 "ProgramFilesFolder\tTARGETDIR\t.\n"
792 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
793 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
794 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
796 static const CHAR mcp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
797 "s72\tS38\ts72\ti2\tS255\tS72\n"
798 "Component\tComponent\n"
799 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
800 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
801 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
803 static const CHAR mcp_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
804 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
806 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
807 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
808 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
810 static const CHAR mcp_feature_comp_dat
[] = "Feature_\tComponent_\n"
812 "FeatureComponents\tFeature_\tComponent_\n"
813 "hydroxyl\thydrogen\n"
817 static const CHAR mcp_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
818 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
820 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
821 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
822 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
823 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
825 static const CHAR ai_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
826 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
828 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
829 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
830 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
831 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
832 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
833 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
834 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
836 static const CHAR ip_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
838 "InstallExecuteSequence\tAction\n"
839 "CostFinalize\t\t1000\n"
840 "ValidateProductID\t\t700\n"
841 "CostInitialize\t\t800\n"
843 "RemoveFiles\t\t3500\n"
844 "InstallFiles\t\t4000\n"
845 "RegisterUser\t\t6000\n"
846 "RegisterProduct\t\t6100\n"
847 "PublishFeatures\t\t6300\n"
848 "PublishProduct\t\t6400\n"
849 "InstallFinalize\t\t6600\n"
850 "InstallInitialize\t\t1500\n"
851 "ProcessComponents\t\t1600\n"
852 "UnpublishFeatures\t\t1800\n"
853 "InstallValidate\t\t1400\n"
854 "LaunchConditions\t\t100\n"
855 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
857 static const CHAR ip_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
858 "s72\ti2\tS64\tS0\tS255\n"
859 "CustomAction\tAction\n"
860 "TestInstalledProp\t19\t\tTest failed\t\n";
862 static const CHAR aup_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
864 "InstallExecuteSequence\tAction\n"
865 "CostFinalize\t\t1000\n"
866 "ValidateProductID\t\t700\n"
867 "CostInitialize\t\t800\n"
869 "RemoveFiles\t\t3500\n"
870 "InstallFiles\t\t4000\n"
871 "RegisterUser\t\t6000\n"
872 "RegisterProduct\t\t6100\n"
873 "PublishFeatures\t\t6300\n"
874 "PublishProduct\t\t6400\n"
875 "InstallFinalize\t\t6600\n"
876 "InstallInitialize\t\t1500\n"
877 "ProcessComponents\t\t1600\n"
878 "UnpublishFeatures\t\t1800\n"
879 "InstallValidate\t\t1400\n"
880 "LaunchConditions\t\t100\n"
881 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
883 static const CHAR aup2_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
885 "InstallExecuteSequence\tAction\n"
886 "CostFinalize\t\t1000\n"
887 "ValidateProductID\t\t700\n"
888 "CostInitialize\t\t800\n"
890 "RemoveFiles\t\t3500\n"
891 "InstallFiles\t\t4000\n"
892 "RegisterUser\t\t6000\n"
893 "RegisterProduct\t\t6100\n"
894 "PublishFeatures\t\t6300\n"
895 "PublishProduct\t\t6400\n"
896 "InstallFinalize\t\t6600\n"
897 "InstallInitialize\t\t1500\n"
898 "ProcessComponents\t\t1600\n"
899 "UnpublishFeatures\t\t1800\n"
900 "InstallValidate\t\t1400\n"
901 "LaunchConditions\t\t100\n"
902 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
904 static const CHAR aup3_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
906 "InstallExecuteSequence\tAction\n"
907 "CostFinalize\t\t1000\n"
908 "ValidateProductID\t\t700\n"
909 "CostInitialize\t\t800\n"
911 "RemoveFiles\t\t3500\n"
912 "InstallFiles\t\t4000\n"
913 "RegisterUser\t\t6000\n"
914 "RegisterProduct\t\t6100\n"
915 "PublishFeatures\t\t6300\n"
916 "PublishProduct\t\t6400\n"
917 "InstallFinalize\t\t6600\n"
918 "InstallInitialize\t\t1500\n"
919 "ProcessComponents\t\t1600\n"
920 "UnpublishFeatures\t\t1800\n"
921 "InstallValidate\t\t1400\n"
922 "LaunchConditions\t\t100\n"
923 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
925 static const CHAR aup_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
926 "s72\ti2\tS64\tS0\tS255\n"
927 "CustomAction\tAction\n"
928 "TestAllUsersProp\t19\t\tTest failed\t\n";
930 static const CHAR fo_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
931 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
933 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
934 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
935 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
937 static const CHAR fo_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
938 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
940 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
941 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
942 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
944 static const CHAR fo_condition_dat
[] = "Feature_\tLevel\tCondition\n"
946 "Condition\tFeature_\tLevel\n"
947 "preselected\t0\tPreselected\n"
948 "notpreselected\t0\tNOT Preselected\n";
950 static const CHAR fo_feature_comp_dat
[] = "Feature_\tComponent_\n"
952 "FeatureComponents\tFeature_\tComponent_\n"
953 "override\toverride\n"
954 "preselected\tpreselected\n"
955 "notpreselected\tnotpreselected\n";
957 static const CHAR fo_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
958 "s72\tS38\ts72\ti2\tS255\tS72\n"
959 "Component\tComponent\n"
960 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
961 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
962 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
964 static const CHAR fo_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
965 "s72\ti2\tS64\tS0\tS255\n"
966 "CustomAction\tAction\n"
967 "SetPreselected\t51\tPreselected\t1\t\n";
969 static const CHAR fo_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
971 "InstallExecuteSequence\tAction\n"
972 "LaunchConditions\t\t100\n"
973 "SetPreselected\tpreselect=1\t200\n"
974 "CostInitialize\t\t800\n"
976 "CostFinalize\t\t1000\n"
977 "InstallValidate\t\t1400\n"
978 "InstallInitialize\t\t1500\n"
979 "ProcessComponents\t\t1600\n"
980 "RemoveFiles\t\t1700\n"
981 "InstallFiles\t\t2000\n"
982 "RegisterProduct\t\t5000\n"
983 "PublishFeatures\t\t5100\n"
984 "PublishProduct\t\t5200\n"
985 "InstallFinalize\t\t6000\n";
987 static const CHAR uc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
988 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
990 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
992 static const CHAR uc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
993 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
995 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
997 static const CHAR uc_feature_comp_dat
[] = "Feature_\tComponent_\n"
999 "FeatureComponents\tFeature_\tComponent_\n"
1000 "upgradecode\tupgradecode\n";
1002 static const CHAR uc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1003 "s72\tS38\ts72\ti2\tS255\tS72\n"
1004 "Component\tComponent\n"
1005 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
1007 static const CHAR uc_property_dat
[] = "Property\tValue\n"
1009 "Property\tProperty\n"
1011 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
1012 "ProductName\tMSITEST\n"
1013 "ProductVersion\t1.1.1\n"
1014 "UpgradeCode\t#UPGEADECODE#\n"
1015 "MSIFASTINSTALL\t1\n";
1017 static const CHAR uc_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
1019 "InstallExecuteSequence\tAction\n"
1020 "LaunchConditions\t\t100\n"
1021 "CostInitialize\t\t200\n"
1023 "CostFinalize\t\t400\n"
1024 "InstallInitialize\t\t500\n"
1025 "ProcessComponents\t\t600\n"
1026 "InstallValidate\t\t700\n"
1027 "RemoveFiles\t\t800\n"
1028 "InstallFiles\t\t900\n"
1029 "RegisterProduct\t\t1000\n"
1030 "PublishFeatures\t\t1100\n"
1031 "PublishProduct\t\t1200\n"
1032 "InstallFinalize\t\t1300\n";
1034 static const char mixed_feature_dat
[] =
1035 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1036 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1037 "Feature\tFeature\n"
1038 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1039 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1041 static const char mixed_feature_comp_dat
[] =
1042 "Feature_\tComponent_\n"
1044 "FeatureComponents\tFeature_\tComponent_\n"
1046 "feature2\tcomp2\n";
1048 static const char mixed_component_dat
[] =
1049 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1050 "s72\tS38\ts72\ti2\tS255\tS72\n"
1051 "Component\tComponent\n"
1052 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1053 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1055 static const char mixed_registry_dat
[] =
1056 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1057 "s72\ti2\tl255\tL255\tL0\ts72\n"
1058 "Registry\tRegistry\n"
1059 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1060 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n"
1061 "regdata3\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest32\tcomp1\n"
1062 "regdata4\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest32.dll\tcomp1\n"
1063 "regdata5\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest64\tcomp2\n"
1064 "regdata6\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest64.dll\tcomp2\n";
1066 static const char mixed_install_exec_seq_dat
[] =
1067 "Action\tCondition\tSequence\n"
1069 "InstallExecuteSequence\tAction\n"
1070 "LaunchConditions\t\t100\n"
1071 "CostInitialize\t\t200\n"
1073 "CostFinalize\t\t400\n"
1074 "InstallValidate\t\t500\n"
1075 "InstallInitialize\t\t600\n"
1076 "ProcessComponents\t\t700\n"
1077 "UnpublishFeatures\t\t800\n"
1078 "RemoveRegistryValues\t\t900\n"
1079 "WriteRegistryValues\t\t1000\n"
1080 "RegisterProduct\t\t1100\n"
1081 "PublishFeatures\t\t1200\n"
1082 "PublishProduct\t\t1300\n"
1083 "InstallFinalize\t\t1400\n";
1085 static const char vp_file_dat
[] =
1086 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1087 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1089 "volumeprop\tcomp\tvolumeprop.txt\t1000\t\t\t8192\t1\n";
1091 static const char vp_feature_dat
[] =
1092 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1093 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1094 "Feature\tFeature\n"
1095 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1097 static const char vp_feature_comp_dat
[] =
1098 "Feature_\tComponent_\n"
1100 "FeatureComponents\tFeature_\tComponent_\n"
1103 static const char vp_component_dat
[] =
1104 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1105 "s72\tS38\ts72\ti2\tS255\tS72\n"
1106 "Component\tComponent\n"
1107 "comp\t{24364AE7-5B7F-496C-AF5A-54893639C567}\tMSITESTDIR\t0\t\tvolumeprop\n";
1109 static const char vp_custom_action_dat
[] =
1110 "Action\tType\tSource\tTarget\tISComments\n"
1111 "s72\ti2\tS64\tS0\tS255\n"
1112 "CustomAction\tAction\n"
1113 "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n"
1114 "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n"
1115 "TestPrimaryVolumeSpaceRequired0\t19\t\tPrimaryVolumeSpaceRequired set before CostFinalize\t\n"
1116 "TestPrimaryVolumeSpaceRemaining0\t19\t\tPrimaryVolumeSpaceRemaining set before CostFinalize\t\n"
1117 "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n"
1118 "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n"
1119 "TestPrimaryVolumeSpaceRequired1\t19\t\tPrimaryVolumeSpaceRequired not set before InstallValidate\t\n"
1120 "TestPrimaryVolumeSpaceRemaining1\t19\t\tPrimaryVolumeSpaceRemaining not set before InstallValidate\t\n"
1121 "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n"
1122 "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n"
1123 "TestPrimaryVolumeSpaceRequired2\t19\t\tPrimaryVolumeSpaceRequired not set after InstallValidate\t\n"
1124 "TestPrimaryVolumeSpaceRemaining2\t19\t\tPrimaryVolumeSpaceRemaining not set after InstallValidate\t\n";
1126 static const char vp_install_exec_seq_dat
[] =
1127 "Action\tCondition\tSequence\n"
1129 "InstallExecuteSequence\tAction\n"
1130 "LaunchConditions\t\t100\n"
1131 "CostInitialize\t\t200\n"
1133 "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n"
1134 "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n"
1135 "TestPrimaryVolumeSpaceRequired0\tPrimaryVolumeSpaceRequired AND NOT REMOVE\t510\n"
1136 "TestPrimaryVolumeSpaceRemaining0\tPrimaryVolumeSpaceRemaining AND NOT REMOVE\t520\n"
1137 "CostFinalize\t\t600\n"
1138 "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n"
1139 "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n"
1140 "TestPrimaryVolumeSpaceRequired1\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t810\n"
1141 "TestPrimaryVolumeSpaceRemaining1\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t820\n"
1142 "InstallValidate\t\t900\n"
1143 "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n"
1144 "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n"
1145 "TestPrimaryVolumeSpaceRequired2\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t1110\n"
1146 "TestPrimaryVolumeSpaceRemaining2\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t1120\n"
1147 "InstallInitialize\t\t1200\n"
1148 "ProcessComponents\t\t1300\n"
1149 "RemoveFiles\t\t1400\n"
1150 "InstallFiles\t\t1500\n"
1151 "RegisterProduct\t\t1600\n"
1152 "PublishFeatures\t\t1700\n"
1153 "PublishProduct\t\t1800\n"
1154 "InstallFinalize\t\t1900\n";
1156 static const char shc_property_dat
[] =
1159 "Property\tProperty\n"
1161 "ProductCode\t{5CD99CD0-69C7-409B-9905-82DD743CC840}\n"
1162 "ProductName\tMSITEST\n"
1163 "ProductVersion\t1.1.1\n"
1164 "MSIFASTINSTALL\t1\n";
1166 static const char shc2_property_dat
[] =
1169 "Property\tProperty\n"
1171 "ProductCode\t{4CEFADE5-DAFB-4C21-8EF2-4ED4F139F340}\n"
1172 "ProductName\tMSITEST2\n"
1173 "ProductVersion\t1.1.1\n"
1174 "MSIFASTINSTALL\t1\n";
1176 static const char shc_file_dat
[] =
1177 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1178 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1180 "sharedcomponent\tsharedcomponent\tsharedcomponent.txt\t1000\t\t\t8192\t1\n";
1182 static const char shc_feature_dat
[] =
1183 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1184 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1185 "Feature\tFeature\n"
1186 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1188 static const char shc_feature_comp_dat
[] =
1189 "Feature_\tComponent_\n"
1191 "FeatureComponents\tFeature_\tComponent_\n"
1192 "feature\tsharedcomponent\n";
1194 static const char shc_component_dat
[] =
1195 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1196 "s72\tS38\ts72\ti2\tS255\tS72\n"
1197 "Component\tComponent\n"
1198 "sharedcomponent\t{900A4ACB-DC6F-4795-A04B-81B530183D41}\tMSITESTDIR\t0\t\tsharedcomponent\n";
1200 static const char shc_custom_action_dat
[] =
1201 "Action\tType\tSource\tTarget\tISComments\n"
1202 "s72\ti2\tS64\tS0\tS255\n"
1203 "CustomAction\tAction\n"
1204 "TestComponentAction\t19\t\twrong component action on install\t\n";
1206 static const char shc_install_exec_seq_dat
[] =
1207 "Action\tCondition\tSequence\n"
1209 "InstallExecuteSequence\tAction\n"
1210 "LaunchConditions\t\t100\n"
1211 "CostInitialize\t\t200\n"
1213 "CostFinalize\t\t600\n"
1214 "InstallValidate\t\t900\n"
1215 "InstallInitialize\t\t1200\n"
1216 "ProcessComponents\t\t1300\n"
1217 "RemoveFiles\t\t1400\n"
1218 "InstallFiles\t\t1500\n"
1219 "TestComponentAction\tNOT REMOVE AND ($sharedcomponent <> 3)\t1600\n"
1220 "RegisterProduct\t\t1700\n"
1221 "PublishFeatures\t\t1800\n"
1222 "PublishProduct\t\t1900\n"
1223 "InstallFinalize\t\t2000\n";
1225 typedef struct _msi_table
1227 const CHAR
*filename
;
1232 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1234 static const msi_table tables
[] =
1236 ADD_TABLE(component
),
1237 ADD_TABLE(directory
),
1239 ADD_TABLE(feature_comp
),
1241 ADD_TABLE(install_exec_seq
),
1243 ADD_TABLE(property
),
1244 ADD_TABLE(registry
),
1245 ADD_TABLE(service_install
),
1246 ADD_TABLE(service_control
)
1249 static const msi_table sc_tables
[] =
1251 ADD_TABLE(component
),
1252 ADD_TABLE(directory
),
1254 ADD_TABLE(feature_comp
),
1256 ADD_TABLE(install_exec_seq
),
1258 ADD_TABLE(property
),
1262 static const msi_table ps_tables
[] =
1264 ADD_TABLE(component
),
1265 ADD_TABLE(directory
),
1267 ADD_TABLE(feature_comp
),
1269 ADD_TABLE(install_exec_seq
),
1271 ADD_TABLE(property
),
1272 ADD_TABLE(condition
)
1275 static const msi_table up_tables
[] =
1277 ADD_TABLE(component
),
1278 ADD_TABLE(directory
),
1280 ADD_TABLE(feature_comp
),
1282 ADD_TABLE(install_exec_seq
),
1284 ADD_TABLE(up_property
),
1285 ADD_TABLE(registry
),
1286 ADD_TABLE(service_install
),
1287 ADD_TABLE(service_control
)
1290 static const msi_table up2_tables
[] =
1292 ADD_TABLE(component
),
1293 ADD_TABLE(directory
),
1295 ADD_TABLE(feature_comp
),
1297 ADD_TABLE(install_exec_seq
),
1299 ADD_TABLE(up2_property
),
1300 ADD_TABLE(registry
),
1301 ADD_TABLE(service_install
),
1302 ADD_TABLE(service_control
)
1305 static const msi_table up3_tables
[] =
1307 ADD_TABLE(component
),
1308 ADD_TABLE(directory
),
1310 ADD_TABLE(feature_comp
),
1312 ADD_TABLE(install_exec_seq
),
1314 ADD_TABLE(up3_property
),
1315 ADD_TABLE(registry
),
1316 ADD_TABLE(service_install
),
1317 ADD_TABLE(service_control
)
1320 static const msi_table up4_tables
[] =
1322 ADD_TABLE(component
),
1323 ADD_TABLE(directory
),
1325 ADD_TABLE(feature_comp
),
1327 ADD_TABLE(pp_install_exec_seq
),
1329 ADD_TABLE(property
),
1330 ADD_TABLE(registry
),
1331 ADD_TABLE(service_install
),
1332 ADD_TABLE(service_control
)
1335 static const msi_table up5_tables
[] =
1337 ADD_TABLE(component
),
1338 ADD_TABLE(directory
),
1340 ADD_TABLE(feature_comp
),
1342 ADD_TABLE(pp_install_exec_seq
),
1344 ADD_TABLE(up_property
),
1345 ADD_TABLE(registry
),
1346 ADD_TABLE(service_install
),
1347 ADD_TABLE(service_control
)
1350 static const msi_table up6_tables
[] =
1352 ADD_TABLE(component
),
1353 ADD_TABLE(directory
),
1355 ADD_TABLE(feature_comp
),
1357 ADD_TABLE(pp_install_exec_seq
),
1359 ADD_TABLE(up2_property
),
1360 ADD_TABLE(registry
),
1361 ADD_TABLE(service_install
),
1362 ADD_TABLE(service_control
)
1365 static const msi_table up7_tables
[] =
1367 ADD_TABLE(component
),
1368 ADD_TABLE(directory
),
1370 ADD_TABLE(feature_comp
),
1372 ADD_TABLE(pp_install_exec_seq
),
1374 ADD_TABLE(up3_property
),
1375 ADD_TABLE(registry
),
1376 ADD_TABLE(service_install
),
1377 ADD_TABLE(service_control
)
1380 static const msi_table cc_tables
[] =
1382 ADD_TABLE(cc_component
),
1383 ADD_TABLE(directory
),
1384 ADD_TABLE(cc_feature
),
1385 ADD_TABLE(cc_feature_comp
),
1387 ADD_TABLE(install_exec_seq
),
1388 ADD_TABLE(cc_media
),
1389 ADD_TABLE(property
),
1392 static const msi_table cc2_tables
[] =
1394 ADD_TABLE(cc2_component
),
1395 ADD_TABLE(directory
),
1396 ADD_TABLE(cc_feature
),
1397 ADD_TABLE(cc_feature_comp
),
1398 ADD_TABLE(cc2_file
),
1399 ADD_TABLE(install_exec_seq
),
1400 ADD_TABLE(cc_media
),
1401 ADD_TABLE(property
),
1404 static const msi_table cc3_tables
[] =
1406 ADD_TABLE(cc_component
),
1407 ADD_TABLE(directory
),
1408 ADD_TABLE(cc_feature
),
1409 ADD_TABLE(cc_feature_comp
),
1411 ADD_TABLE(install_exec_seq
),
1412 ADD_TABLE(cc3_media
),
1413 ADD_TABLE(property
),
1416 static const msi_table co_tables
[] =
1418 ADD_TABLE(cc_component
),
1419 ADD_TABLE(directory
),
1420 ADD_TABLE(cc_feature
),
1421 ADD_TABLE(cc_feature_comp
),
1423 ADD_TABLE(install_exec_seq
),
1424 ADD_TABLE(co_media
),
1425 ADD_TABLE(property
),
1428 static const msi_table co2_tables
[] =
1430 ADD_TABLE(cc_component
),
1431 ADD_TABLE(directory
),
1432 ADD_TABLE(cc_feature
),
1433 ADD_TABLE(cc_feature_comp
),
1435 ADD_TABLE(install_exec_seq
),
1436 ADD_TABLE(co2_media
),
1437 ADD_TABLE(property
),
1440 static const msi_table mm_tables
[] =
1442 ADD_TABLE(cc_component
),
1443 ADD_TABLE(directory
),
1444 ADD_TABLE(cc_feature
),
1445 ADD_TABLE(cc_feature_comp
),
1447 ADD_TABLE(install_exec_seq
),
1448 ADD_TABLE(mm_media
),
1449 ADD_TABLE(property
),
1452 static const msi_table ss_tables
[] =
1454 ADD_TABLE(cc_component
),
1455 ADD_TABLE(directory
),
1456 ADD_TABLE(cc_feature
),
1457 ADD_TABLE(cc_feature_comp
),
1459 ADD_TABLE(install_exec_seq
),
1460 ADD_TABLE(ss_media
),
1461 ADD_TABLE(property
),
1464 static const msi_table ui_tables
[] =
1466 ADD_TABLE(ui_component
),
1467 ADD_TABLE(directory
),
1468 ADD_TABLE(cc_feature
),
1469 ADD_TABLE(cc_feature_comp
),
1471 ADD_TABLE(install_exec_seq
),
1472 ADD_TABLE(ui_install_ui_seq
),
1473 ADD_TABLE(ui_custom_action
),
1474 ADD_TABLE(cc_media
),
1475 ADD_TABLE(property
),
1478 static const msi_table rof_tables
[] =
1480 ADD_TABLE(rof_component
),
1481 ADD_TABLE(directory
),
1482 ADD_TABLE(rof_feature
),
1483 ADD_TABLE(rof_feature_comp
),
1484 ADD_TABLE(rof_file
),
1485 ADD_TABLE(install_exec_seq
),
1486 ADD_TABLE(rof_media
),
1487 ADD_TABLE(property
),
1490 static const msi_table rofc_tables
[] =
1492 ADD_TABLE(rof_component
),
1493 ADD_TABLE(directory
),
1494 ADD_TABLE(rof_feature
),
1495 ADD_TABLE(rof_feature_comp
),
1496 ADD_TABLE(rofc_file
),
1497 ADD_TABLE(install_exec_seq
),
1498 ADD_TABLE(rofc_media
),
1499 ADD_TABLE(property
),
1502 static const msi_table sdp_tables
[] =
1504 ADD_TABLE(rof_component
),
1505 ADD_TABLE(directory
),
1506 ADD_TABLE(rof_feature
),
1507 ADD_TABLE(rof_feature_comp
),
1508 ADD_TABLE(rof_file
),
1509 ADD_TABLE(sdp_install_exec_seq
),
1510 ADD_TABLE(sdp_custom_action
),
1511 ADD_TABLE(rof_media
),
1512 ADD_TABLE(property
),
1515 static const msi_table cie_tables
[] =
1517 ADD_TABLE(cie_component
),
1518 ADD_TABLE(directory
),
1519 ADD_TABLE(cc_feature
),
1520 ADD_TABLE(cie_feature_comp
),
1521 ADD_TABLE(cie_file
),
1522 ADD_TABLE(install_exec_seq
),
1523 ADD_TABLE(cie_media
),
1524 ADD_TABLE(property
),
1527 static const msi_table tp_tables
[] =
1529 ADD_TABLE(tp_component
),
1530 ADD_TABLE(directory
),
1531 ADD_TABLE(rof_feature
),
1532 ADD_TABLE(ci2_feature_comp
),
1533 ADD_TABLE(ci2_file
),
1534 ADD_TABLE(install_exec_seq
),
1535 ADD_TABLE(rof_media
),
1536 ADD_TABLE(property
),
1539 static const msi_table cwd_tables
[] =
1541 ADD_TABLE(cwd_component
),
1542 ADD_TABLE(directory
),
1543 ADD_TABLE(rof_feature
),
1544 ADD_TABLE(ci2_feature_comp
),
1545 ADD_TABLE(ci2_file
),
1546 ADD_TABLE(install_exec_seq
),
1547 ADD_TABLE(rof_media
),
1548 ADD_TABLE(property
),
1551 static const msi_table adm_tables
[] =
1553 ADD_TABLE(adm_component
),
1554 ADD_TABLE(directory
),
1555 ADD_TABLE(rof_feature
),
1556 ADD_TABLE(ci2_feature_comp
),
1557 ADD_TABLE(ci2_file
),
1558 ADD_TABLE(install_exec_seq
),
1559 ADD_TABLE(rof_media
),
1560 ADD_TABLE(property
),
1561 ADD_TABLE(adm_custom_action
),
1562 ADD_TABLE(adm_admin_exec_seq
),
1565 static const msi_table amp_tables
[] =
1567 ADD_TABLE(amp_component
),
1568 ADD_TABLE(directory
),
1569 ADD_TABLE(rof_feature
),
1570 ADD_TABLE(ci2_feature_comp
),
1571 ADD_TABLE(ci2_file
),
1572 ADD_TABLE(install_exec_seq
),
1573 ADD_TABLE(rof_media
),
1574 ADD_TABLE(property
),
1577 static const msi_table mc_tables
[] =
1579 ADD_TABLE(mc_component
),
1580 ADD_TABLE(directory
),
1581 ADD_TABLE(cc_feature
),
1582 ADD_TABLE(cie_feature_comp
),
1584 ADD_TABLE(install_exec_seq
),
1585 ADD_TABLE(mc_media
),
1586 ADD_TABLE(property
),
1587 ADD_TABLE(mc_file_hash
),
1590 static const msi_table sf_tables
[] =
1592 ADD_TABLE(wrv_component
),
1593 ADD_TABLE(directory
),
1594 ADD_TABLE(rof_feature
),
1595 ADD_TABLE(ci2_feature_comp
),
1596 ADD_TABLE(ci2_file
),
1597 ADD_TABLE(install_exec_seq
),
1598 ADD_TABLE(rof_media
),
1599 ADD_TABLE(property
),
1602 static const msi_table ca51_tables
[] =
1604 ADD_TABLE(ca51_component
),
1605 ADD_TABLE(directory
),
1606 ADD_TABLE(rof_feature
),
1607 ADD_TABLE(ci2_feature_comp
),
1608 ADD_TABLE(ci2_file
),
1609 ADD_TABLE(ca51_install_exec_seq
),
1610 ADD_TABLE(rof_media
),
1611 ADD_TABLE(property
),
1612 ADD_TABLE(ca51_custom_action
),
1615 static const msi_table is_tables
[] =
1617 ADD_TABLE(is_component
),
1618 ADD_TABLE(directory
),
1619 ADD_TABLE(is_feature
),
1620 ADD_TABLE(is_feature_comp
),
1622 ADD_TABLE(install_exec_seq
),
1623 ADD_TABLE(is_media
),
1624 ADD_TABLE(property
),
1627 static const msi_table sp_tables
[] =
1629 ADD_TABLE(sp_component
),
1630 ADD_TABLE(sp_directory
),
1631 ADD_TABLE(rof_feature
),
1632 ADD_TABLE(ci2_feature_comp
),
1633 ADD_TABLE(ci2_file
),
1634 ADD_TABLE(install_exec_seq
),
1635 ADD_TABLE(rof_media
),
1636 ADD_TABLE(property
),
1639 static const msi_table mcp_tables
[] =
1641 ADD_TABLE(mcp_component
),
1642 ADD_TABLE(directory
),
1643 ADD_TABLE(mcp_feature
),
1644 ADD_TABLE(mcp_feature_comp
),
1645 ADD_TABLE(mcp_file
),
1646 ADD_TABLE(rem_install_exec_seq
),
1647 ADD_TABLE(rof_media
),
1648 ADD_TABLE(property
),
1651 static const msi_table ai_tables
[] =
1653 ADD_TABLE(component
),
1654 ADD_TABLE(directory
),
1656 ADD_TABLE(feature_comp
),
1658 ADD_TABLE(install_exec_seq
),
1663 static const msi_table pc_tables
[] =
1665 ADD_TABLE(ca51_component
),
1666 ADD_TABLE(directory
),
1667 ADD_TABLE(rof_feature
),
1668 ADD_TABLE(ci2_feature_comp
),
1669 ADD_TABLE(ci2_file
),
1670 ADD_TABLE(install_exec_seq
),
1671 ADD_TABLE(rof_media
),
1675 static const msi_table ip_tables
[] =
1677 ADD_TABLE(component
),
1678 ADD_TABLE(directory
),
1680 ADD_TABLE(feature_comp
),
1682 ADD_TABLE(ip_install_exec_seq
),
1683 ADD_TABLE(ip_custom_action
),
1688 static const msi_table aup_tables
[] =
1690 ADD_TABLE(component
),
1691 ADD_TABLE(directory
),
1693 ADD_TABLE(feature_comp
),
1695 ADD_TABLE(aup_install_exec_seq
),
1696 ADD_TABLE(aup_custom_action
),
1701 static const msi_table aup2_tables
[] =
1703 ADD_TABLE(component
),
1704 ADD_TABLE(directory
),
1706 ADD_TABLE(feature_comp
),
1708 ADD_TABLE(aup2_install_exec_seq
),
1709 ADD_TABLE(aup_custom_action
),
1711 ADD_TABLE(aup_property
)
1714 static const msi_table aup3_tables
[] =
1716 ADD_TABLE(component
),
1717 ADD_TABLE(directory
),
1719 ADD_TABLE(feature_comp
),
1721 ADD_TABLE(aup2_install_exec_seq
),
1722 ADD_TABLE(aup_custom_action
),
1724 ADD_TABLE(aup2_property
)
1727 static const msi_table aup4_tables
[] =
1729 ADD_TABLE(component
),
1730 ADD_TABLE(directory
),
1732 ADD_TABLE(feature_comp
),
1734 ADD_TABLE(aup3_install_exec_seq
),
1735 ADD_TABLE(aup_custom_action
),
1737 ADD_TABLE(aup2_property
)
1740 static const msi_table fiu_tables
[] =
1742 ADD_TABLE(rof_component
),
1743 ADD_TABLE(directory
),
1744 ADD_TABLE(rof_feature
),
1745 ADD_TABLE(rof_feature_comp
),
1746 ADD_TABLE(rof_file
),
1747 ADD_TABLE(pp_install_exec_seq
),
1748 ADD_TABLE(rof_media
),
1749 ADD_TABLE(property
),
1752 static const msi_table fiuc_tables
[] =
1754 ADD_TABLE(rof_component
),
1755 ADD_TABLE(directory
),
1756 ADD_TABLE(rof_feature
),
1757 ADD_TABLE(rof_feature_comp
),
1758 ADD_TABLE(rofc_file
),
1759 ADD_TABLE(pp_install_exec_seq
),
1760 ADD_TABLE(rofc_media
),
1761 ADD_TABLE(property
),
1764 static const msi_table fo_tables
[] =
1766 ADD_TABLE(directory
),
1768 ADD_TABLE(fo_component
),
1769 ADD_TABLE(fo_feature
),
1770 ADD_TABLE(fo_condition
),
1771 ADD_TABLE(fo_feature_comp
),
1772 ADD_TABLE(fo_custom_action
),
1773 ADD_TABLE(fo_install_exec_seq
),
1778 static const msi_table icon_base_tables
[] =
1780 ADD_TABLE(ci_component
),
1781 ADD_TABLE(directory
),
1782 ADD_TABLE(rof_feature
),
1783 ADD_TABLE(rof_feature_comp
),
1784 ADD_TABLE(rof_file
),
1785 ADD_TABLE(pp_install_exec_seq
),
1786 ADD_TABLE(rof_media
),
1787 ADD_TABLE(icon_property
),
1790 static const msi_table pv_tables
[] =
1792 ADD_TABLE(rof_component
),
1793 ADD_TABLE(directory
),
1794 ADD_TABLE(rof_feature
),
1795 ADD_TABLE(rof_feature_comp
),
1796 ADD_TABLE(rof_file
),
1797 ADD_TABLE(pv_install_exec_seq
),
1798 ADD_TABLE(rof_media
),
1802 static const msi_table uc_tables
[] =
1804 ADD_TABLE(directory
),
1805 ADD_TABLE(uc_component
),
1806 ADD_TABLE(uc_feature
),
1807 ADD_TABLE(uc_feature_comp
),
1809 ADD_TABLE(uc_install_exec_seq
),
1811 ADD_TABLE(uc_property
)
1814 static const msi_table mixed_tables
[] =
1816 ADD_TABLE(directory
),
1817 ADD_TABLE(mixed_component
),
1818 ADD_TABLE(mixed_feature
),
1819 ADD_TABLE(mixed_feature_comp
),
1820 ADD_TABLE(mixed_install_exec_seq
),
1821 ADD_TABLE(mixed_registry
),
1826 static const msi_table vp_tables
[] =
1828 ADD_TABLE(directory
),
1830 ADD_TABLE(vp_component
),
1831 ADD_TABLE(vp_feature
),
1832 ADD_TABLE(vp_feature_comp
),
1833 ADD_TABLE(vp_custom_action
),
1834 ADD_TABLE(vp_install_exec_seq
),
1839 static const msi_table shc_tables
[] =
1842 ADD_TABLE(directory
),
1843 ADD_TABLE(shc_file
),
1844 ADD_TABLE(shc_component
),
1845 ADD_TABLE(shc_feature
),
1846 ADD_TABLE(shc_feature_comp
),
1847 ADD_TABLE(shc_custom_action
),
1848 ADD_TABLE(shc_install_exec_seq
),
1849 ADD_TABLE(shc_property
)
1852 static const msi_table shc2_tables
[] =
1855 ADD_TABLE(directory
),
1856 ADD_TABLE(shc_file
),
1857 ADD_TABLE(shc_component
),
1858 ADD_TABLE(shc_feature
),
1859 ADD_TABLE(shc_feature_comp
),
1860 ADD_TABLE(shc_custom_action
),
1861 ADD_TABLE(shc_install_exec_seq
),
1862 ADD_TABLE(shc2_property
)
1865 /* cabinet definitions */
1867 /* make the max size large so there is only one cab file */
1868 #define MEDIA_SIZE 0x7FFFFFFF
1869 #define FOLDER_THRESHOLD 900000
1871 /* the FCI callbacks */
1873 static void * CDECL
mem_alloc(ULONG cb
)
1875 return HeapAlloc(GetProcessHeap(), 0, cb
);
1878 static void CDECL
mem_free(void *memory
)
1880 HeapFree(GetProcessHeap(), 0, memory
);
1883 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
1885 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
1889 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
1894 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
1895 BOOL fContinuation
, void *pv
)
1900 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
1904 DWORD dwShareMode
= 0;
1905 DWORD dwCreateDisposition
= OPEN_EXISTING
;
1907 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
1908 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1909 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
1911 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
1912 dwCreateDisposition
= OPEN_EXISTING
;
1914 dwCreateDisposition
= CREATE_NEW
;
1916 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
1917 dwCreateDisposition
, 0, NULL
);
1919 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
1921 return (INT_PTR
)handle
;
1924 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1926 HANDLE handle
= (HANDLE
)hf
;
1930 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
1931 ok(res
, "Failed to ReadFile\n");
1936 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1938 HANDLE handle
= (HANDLE
)hf
;
1942 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
1943 ok(res
, "Failed to WriteFile\n");
1948 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
1950 HANDLE handle
= (HANDLE
)hf
;
1951 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
1956 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
1958 HANDLE handle
= (HANDLE
)hf
;
1961 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
1962 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
1967 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
1969 BOOL ret
= DeleteFileA(pszFile
);
1970 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
1975 static void init_functionpointers(void)
1977 HMODULE hmsi
= GetModuleHandleA("msi.dll");
1978 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
1979 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
1981 #define GET_PROC(mod, func) \
1982 p ## func = (void*)GetProcAddress(mod, #func); \
1984 trace("GetProcAddress(%s) failed\n", #func);
1986 GET_PROC(hmsi
, MsiQueryComponentStateA
);
1987 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
1988 GET_PROC(hmsi
, MsiGetComponentPathExA
);
1990 GET_PROC(hadvapi32
, CheckTokenMembership
);
1991 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
1992 GET_PROC(hadvapi32
, OpenProcessToken
);
1993 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
1994 GET_PROC(hkernel32
, IsWow64Process
)
1996 hsrclient
= LoadLibraryA("srclient.dll");
1997 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
1998 GET_PROC(hsrclient
, SRSetRestorePointA
);
2003 static BOOL
is_process_limited(void)
2005 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2010 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2012 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2013 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0, &Group
) ||
2014 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2016 trace("Could not check if the current user is an administrator\n");
2024 /* Only administrators have enough privileges for these tests */
2028 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2031 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2034 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2036 return (ret
&& type
== TokenElevationTypeLimited
);
2041 static BOOL
check_record(MSIHANDLE rec
, UINT field
, LPCSTR val
)
2048 r
= MsiRecordGetStringA(rec
, field
, buffer
, &sz
);
2049 return (r
== ERROR_SUCCESS
) && !strcmp(val
, buffer
);
2052 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2056 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2057 GetTempFileNameA(".", "xx", 0, tempname
);
2059 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2061 lstrcpyA(pszTempName
, tempname
);
2062 HeapFree(GetProcessHeap(), 0, tempname
);
2066 HeapFree(GetProcessHeap(), 0, tempname
);
2071 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2072 USHORT
*pattribs
, int *err
, void *pv
)
2074 BY_HANDLE_FILE_INFORMATION finfo
;
2080 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2081 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2083 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2085 res
= GetFileInformationByHandle(handle
, &finfo
);
2086 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2088 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2089 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2091 attrs
= GetFileAttributesA(pszName
);
2092 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2094 return (INT_PTR
)handle
;
2097 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2099 char path
[MAX_PATH
];
2100 char filename
[MAX_PATH
];
2102 lstrcpyA(path
, CURR_DIR
);
2103 lstrcatA(path
, "\\");
2104 lstrcatA(path
, file
);
2106 lstrcpyA(filename
, file
);
2108 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2109 progress
, get_open_info
, compress
);
2112 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2114 ZeroMemory(pCabParams
, sizeof(CCAB
));
2116 pCabParams
->cb
= max_size
;
2117 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2118 pCabParams
->setID
= 0xbeef;
2119 pCabParams
->iCab
= 1;
2120 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2121 lstrcatA(pCabParams
->szCabPath
, "\\");
2122 lstrcpyA(pCabParams
->szCab
, name
);
2125 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2133 set_cab_parameters(&cabParams
, name
, max_size
);
2135 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2136 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2137 get_temp_file
, &cabParams
, NULL
);
2139 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2144 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2145 ok(res
, "Failed to add file: %s\n", ptr
);
2146 ptr
+= lstrlenA(ptr
) + 1;
2149 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2150 ok(res
, "Failed to flush the cabinet\n");
2152 res
= FCIDestroy(hfci
);
2153 ok(res
, "Failed to destroy the cabinet\n");
2156 static BOOL
get_user_dirs(void)
2161 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2162 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2166 if(RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
)){
2175 static BOOL
get_system_dirs(void)
2180 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2184 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2185 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
)) {
2191 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2192 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
)) {
2198 if (RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR_NATIVE
, &size
)) {
2205 if(!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2211 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2216 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2217 if (file
== INVALID_HANDLE_VALUE
)
2220 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2224 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2231 #define create_file(name, size) create_file_data(name, name, size)
2233 static void create_test_files(void)
2235 CreateDirectoryA("msitest", NULL
);
2236 create_file("msitest\\one.txt", 100);
2237 CreateDirectoryA("msitest\\first", NULL
);
2238 create_file("msitest\\first\\two.txt", 100);
2239 CreateDirectoryA("msitest\\second", NULL
);
2240 create_file("msitest\\second\\three.txt", 100);
2242 create_file("four.txt", 100);
2243 create_file("five.txt", 100);
2244 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2246 create_file("msitest\\filename", 100);
2247 create_file("msitest\\service.exe", 100);
2249 DeleteFileA("four.txt");
2250 DeleteFileA("five.txt");
2253 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2255 CHAR path
[MAX_PATH
];
2257 lstrcpyA(path
, PROG_FILES_DIR
);
2258 lstrcatA(path
, "\\");
2259 lstrcatA(path
, rel_path
);
2262 return DeleteFileA(path
);
2264 return RemoveDirectoryA(path
);
2267 static BOOL
delete_pf_native(const CHAR
*rel_path
, BOOL is_file
)
2269 CHAR path
[MAX_PATH
];
2271 lstrcpyA(path
, PROG_FILES_DIR_NATIVE
);
2272 lstrcatA(path
, "\\");
2273 lstrcatA(path
, rel_path
);
2276 return DeleteFileA(path
);
2278 return RemoveDirectoryA(path
);
2281 static BOOL
delete_cf(const CHAR
*rel_path
, BOOL is_file
)
2283 CHAR path
[MAX_PATH
];
2285 lstrcpyA(path
, COMMON_FILES_DIR
);
2286 lstrcatA(path
, "\\");
2287 lstrcatA(path
, rel_path
);
2290 return DeleteFileA(path
);
2292 return RemoveDirectoryA(path
);
2295 static BOOL
compare_pf_data(const char *filename
, const char *data
, DWORD size
)
2300 char *buffer
, path
[MAX_PATH
];
2302 lstrcpyA(path
, PROG_FILES_DIR
);
2303 lstrcatA(path
, "\\");
2304 lstrcatA(path
, filename
);
2306 handle
= CreateFileA(path
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2307 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
2310 ReadFile(handle
, buffer
, size
, &read
, NULL
);
2311 if (read
== size
&& !memcmp(data
, buffer
, size
)) ret
= TRUE
;
2312 HeapFree(GetProcessHeap(), 0, buffer
);
2314 CloseHandle(handle
);
2318 static void delete_test_files(void)
2320 DeleteFileA("msitest.msi");
2321 DeleteFileA("msitest.cab");
2322 DeleteFileA("msitest\\second\\three.txt");
2323 DeleteFileA("msitest\\first\\two.txt");
2324 DeleteFileA("msitest\\one.txt");
2325 DeleteFileA("msitest\\service.exe");
2326 DeleteFileA("msitest\\filename");
2327 RemoveDirectoryA("msitest\\second");
2328 RemoveDirectoryA("msitest\\first");
2329 RemoveDirectoryA("msitest");
2332 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2336 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
,
2337 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2338 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2342 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
,
2343 const char *template, const char *packagecode
)
2348 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2349 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2351 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2352 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2354 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
, packagecode
);
2355 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2357 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2358 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2360 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2361 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2363 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2364 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2366 /* write the summary changes back to the stream */
2367 r
= MsiSummaryInfoPersist(summary
);
2368 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2370 MsiCloseHandle(summary
);
2373 #define create_database(name, tables, num_tables) \
2374 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033", \
2375 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2377 #define create_database_template(name, tables, num_tables, version, template) \
2378 create_database_wordcount(name, tables, num_tables, version, 0, template, \
2379 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2381 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2382 int num_tables
, INT version
, INT wordcount
,
2383 const char *template, const char *packagecode
)
2390 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2391 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2392 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2394 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2395 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2397 /* import the tables into the database */
2398 for (j
= 0; j
< num_tables
; j
++)
2400 const msi_table
*table
= &tables
[j
];
2402 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2404 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2405 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2407 DeleteFileA(table
->filename
);
2410 write_msi_summary_info(db
, version
, wordcount
, template, packagecode
);
2412 r
= MsiDatabaseCommit(db
);
2413 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2416 HeapFree( GetProcessHeap(), 0, nameW
);
2419 static void check_service_is_installed(void)
2421 SC_HANDLE scm
, service
;
2424 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
2425 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
2427 service
= OpenServiceA(scm
, "TestService", SC_MANAGER_ALL_ACCESS
);
2428 ok(service
!= NULL
, "Failed to open TestService\n");
2430 res
= DeleteService(service
);
2431 ok(res
, "Failed to delete TestService\n");
2433 CloseServiceHandle(service
);
2434 CloseServiceHandle(scm
);
2437 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2439 RESTOREPOINTINFOA spec
;
2441 spec
.dwEventType
= event_type
;
2442 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2443 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2444 lstrcpyA(spec
.szDescription
, "msitest restore point");
2446 return pSRSetRestorePointA(&spec
, status
);
2449 static void remove_restore_point(DWORD seq_number
)
2453 res
= pSRRemoveRestorePoint(seq_number
);
2454 if (res
!= ERROR_SUCCESS
)
2455 trace("Failed to remove the restore point : %08x\n", res
);
2458 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2460 if (pRegDeleteKeyExA
)
2461 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2462 return RegDeleteKeyA( key
, subkey
);
2465 static void test_MsiInstallProduct(void)
2468 CHAR path
[MAX_PATH
];
2471 DWORD num
, size
, type
;
2472 REGSAM access
= KEY_ALL_ACCESS
;
2474 if (is_process_limited())
2476 skip("process is limited\n");
2481 access
|= KEY_WOW64_64KEY
;
2483 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2485 /* szPackagePath is NULL */
2486 r
= MsiInstallProductA(NULL
, "INSTALL=ALL");
2487 ok(r
== ERROR_INVALID_PARAMETER
,
2488 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2490 /* both szPackagePath and szCommandLine are NULL */
2491 r
= MsiInstallProductA(NULL
, NULL
);
2492 ok(r
== ERROR_INVALID_PARAMETER
,
2493 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2495 /* szPackagePath is empty */
2496 r
= MsiInstallProductA("", "INSTALL=ALL");
2497 ok(r
== ERROR_PATH_NOT_FOUND
,
2498 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r
);
2500 create_test_files();
2501 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2503 /* install, don't publish */
2504 r
= MsiInstallProductA(msifile
, NULL
);
2505 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2507 skip("Not enough rights to perform tests\n");
2510 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2512 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2513 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2514 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2515 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2516 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2517 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2518 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2519 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2520 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2521 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2522 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2523 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2525 res
= RegOpenKeyExA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", 0, access
, &hkey
);
2526 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2530 res
= RegQueryValueExA(hkey
, "Name", NULL
, &type
, (LPBYTE
)path
, &size
);
2531 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2532 ok(!lstrcmpA(path
, "imaname"), "Expected imaname, got %s\n", path
);
2536 res
= RegQueryValueExA(hkey
, "blah", NULL
, &type
, (LPBYTE
)path
, &size
);
2537 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2541 res
= RegQueryValueExA(hkey
, "number", NULL
, &type
, (LPBYTE
)&num
, &size
);
2542 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2543 ok(num
== 314, "Expected 314, got %d\n", num
);
2547 res
= RegQueryValueExA(hkey
, "OrderTestName", NULL
, &type
, (LPBYTE
)path
, &size
);
2548 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2549 ok(!lstrcmpA(path
, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path
);
2551 check_service_is_installed();
2553 delete_key(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", access
);
2555 /* not published, reinstall */
2556 r
= MsiInstallProductA(msifile
, NULL
);
2557 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2559 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2560 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2561 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2562 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2563 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2564 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2565 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2566 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2567 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2568 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2569 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2570 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2572 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2573 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2574 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2576 create_database(msifile
, up_tables
, sizeof(up_tables
) / sizeof(msi_table
));
2578 /* not published, RemovePreviousVersions set */
2579 r
= MsiInstallProductA(msifile
, NULL
);
2580 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2582 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2583 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2584 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2585 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2586 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2587 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2588 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2589 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2590 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2591 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2592 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2593 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2595 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2596 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2597 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2599 create_database(msifile
, up2_tables
, sizeof(up2_tables
) / sizeof(msi_table
));
2601 /* not published, version number bumped */
2602 r
= MsiInstallProductA(msifile
, NULL
);
2603 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2605 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2606 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2607 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2608 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2609 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2610 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2611 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2612 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2613 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2614 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2615 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2616 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2618 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2619 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2620 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2622 create_database(msifile
, up3_tables
, sizeof(up3_tables
) / sizeof(msi_table
));
2624 /* not published, RemovePreviousVersions set and version number bumped */
2625 r
= MsiInstallProductA(msifile
, NULL
);
2626 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2628 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2629 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2630 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2631 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2632 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2633 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2634 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2635 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2636 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2637 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2638 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2639 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2641 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2642 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2643 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2645 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2647 /* install, publish product */
2648 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
2649 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2651 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2652 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2653 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2654 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2655 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2656 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2657 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2658 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2659 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2660 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2661 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2662 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2664 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2665 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2667 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2669 /* published, reinstall */
2670 r
= MsiInstallProductA(msifile
, NULL
);
2671 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2673 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2674 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2675 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2676 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2677 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2678 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2679 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2680 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2681 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2682 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2683 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2684 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2686 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2687 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2689 create_database(msifile
, up5_tables
, sizeof(up5_tables
) / sizeof(msi_table
));
2691 /* published product, RemovePreviousVersions set */
2692 r
= MsiInstallProductA(msifile
, NULL
);
2693 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2695 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2696 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2697 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2698 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2699 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2700 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2701 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2702 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2703 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2704 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2705 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2706 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2708 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2709 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2711 create_database(msifile
, up6_tables
, sizeof(up6_tables
) / sizeof(msi_table
));
2713 /* published product, version number bumped */
2714 r
= MsiInstallProductA(msifile
, NULL
);
2715 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2717 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2718 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2719 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2720 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2721 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2722 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2723 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2724 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2725 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2726 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2727 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2728 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2730 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2731 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2733 create_database(msifile
, up7_tables
, sizeof(up7_tables
) / sizeof(msi_table
));
2735 /* published product, RemovePreviousVersions set and version number bumped */
2736 r
= MsiInstallProductA(msifile
, NULL
);
2737 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2739 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2740 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2741 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2742 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2743 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2744 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2745 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2746 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2747 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2748 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2749 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2750 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2752 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2753 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2755 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
2756 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2759 delete_test_files();
2760 DeleteFileA(msifile
);
2763 static void test_MsiSetComponentState(void)
2765 INSTALLSTATE installed
, action
;
2767 char path
[MAX_PATH
];
2770 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2774 lstrcpyA(path
, CURR_DIR
);
2775 lstrcatA(path
, "\\");
2776 lstrcatA(path
, msifile
);
2778 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2780 r
= MsiOpenPackageA(path
, &package
);
2781 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2783 skip("Not enough rights to perform tests\n");
2786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2788 r
= MsiDoActionA(package
, "CostInitialize");
2789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2791 r
= MsiDoActionA(package
, "FileCost");
2792 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2794 r
= MsiDoActionA(package
, "CostFinalize");
2795 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2797 r
= MsiGetComponentStateA(package
, "dangler", &installed
, &action
);
2798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2799 ok(installed
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", installed
);
2800 ok(action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2802 r
= MsiSetComponentStateA(package
, "dangler", INSTALLSTATE_SOURCE
);
2803 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2805 MsiCloseHandle(package
);
2809 DeleteFileA(msifile
);
2812 static void test_packagecoltypes(void)
2814 MSIHANDLE hdb
, view
, rec
;
2815 char path
[MAX_PATH
];
2816 WCHAR pathW
[MAX_PATH
];
2820 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2824 lstrcpyA(path
, CURR_DIR
);
2825 lstrcatA(path
, "\\");
2826 lstrcatA(path
, msifile
);
2827 MultiByteToWideChar( CP_ACP
, 0, path
, -1, pathW
, MAX_PATH
);
2829 r
= MsiOpenDatabaseW(pathW
, MSIDBOPEN_READONLY
, &hdb
);
2830 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2832 query
= "SELECT * FROM `Media`";
2833 r
= MsiDatabaseOpenViewA( hdb
, query
, &view
);
2834 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2836 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_NAMES
, &rec
);
2837 count
= MsiRecordGetFieldCount( rec
);
2838 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2839 ok(count
== 6, "Expected 6, got %d\n", count
);
2840 ok(check_record(rec
, 1, "DiskId"), "wrong column label\n");
2841 ok(check_record(rec
, 2, "LastSequence"), "wrong column label\n");
2842 ok(check_record(rec
, 3, "DiskPrompt"), "wrong column label\n");
2843 ok(check_record(rec
, 4, "Cabinet"), "wrong column label\n");
2844 ok(check_record(rec
, 5, "VolumeLabel"), "wrong column label\n");
2845 ok(check_record(rec
, 6, "Source"), "wrong column label\n");
2846 MsiCloseHandle(rec
);
2848 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_TYPES
, &rec
);
2849 count
= MsiRecordGetFieldCount( rec
);
2850 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2851 ok(count
== 6, "Expected 6, got %d\n", count
);
2852 ok(check_record(rec
, 1, "i2"), "wrong column label\n");
2853 ok(check_record(rec
, 2, "i4"), "wrong column label\n");
2854 ok(check_record(rec
, 3, "L64"), "wrong column label\n");
2855 ok(check_record(rec
, 4, "S255"), "wrong column label\n");
2856 ok(check_record(rec
, 5, "S32"), "wrong column label\n");
2857 ok(check_record(rec
, 6, "S72"), "wrong column label\n");
2859 MsiCloseHandle(rec
);
2860 MsiCloseHandle(view
);
2861 MsiCloseHandle(hdb
);
2864 DeleteFileA(msifile
);
2867 static void create_cc_test_files(void)
2872 static CHAR cab_context
[] = "test%d.cab";
2875 create_file("maximus", 500);
2876 create_file("augustus", 50000);
2877 create_file("tiberius", 500);
2878 create_file("caesar", 500);
2880 set_cab_parameters(&cabParams
, "test1.cab", 40000);
2882 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2883 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2884 get_temp_file
, &cabParams
, cab_context
);
2885 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2887 res
= add_file(hfci
, "maximus", tcompTYPE_NONE
);
2888 ok(res
, "Failed to add file maximus\n");
2890 res
= add_file(hfci
, "augustus", tcompTYPE_NONE
);
2891 ok(res
, "Failed to add file augustus\n");
2893 res
= add_file(hfci
, "tiberius", tcompTYPE_NONE
);
2894 ok(res
, "Failed to add file tiberius\n");
2896 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2897 ok(res
, "Failed to flush the cabinet\n");
2899 res
= FCIDestroy(hfci
);
2900 ok(res
, "Failed to destroy the cabinet\n");
2902 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2904 DeleteFileA("maximus");
2905 DeleteFileA("augustus");
2906 DeleteFileA("tiberius");
2907 DeleteFileA("caesar");
2910 static void delete_cab_files(void)
2912 SHFILEOPSTRUCTA shfl
;
2913 CHAR path
[MAX_PATH
+10];
2915 lstrcpyA(path
, CURR_DIR
);
2916 lstrcatA(path
, "\\*.cab");
2917 path
[strlen(path
) + 1] = '\0';
2920 shfl
.wFunc
= FO_DELETE
;
2923 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
;
2925 SHFileOperationA(&shfl
);
2928 static void test_continuouscabs(void)
2932 if (is_process_limited())
2934 skip("process is limited\n");
2938 create_cc_test_files();
2939 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
2941 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2943 r
= MsiInstallProductA(msifile
, NULL
);
2944 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2946 skip("Not enough rights to perform tests\n");
2951 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2952 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2953 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2954 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2955 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2959 DeleteFileA(msifile
);
2961 create_cc_test_files();
2962 create_database(msifile
, cc2_tables
, sizeof(cc2_tables
) / sizeof(msi_table
));
2964 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2966 r
= MsiInstallProductA(msifile
, NULL
);
2967 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2969 skip("Not enough rights to perform tests\n");
2973 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2974 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2975 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
2976 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
2977 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2978 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2982 DeleteFileA(msifile
);
2984 /* Tests to show that only msi cab filename is taken in case of mismatch with the one given by previous cab */
2986 /* Filename from cab is right and the one from msi is wrong */
2987 create_cc_test_files();
2988 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
2990 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2992 r
= MsiInstallProductA(msifile
, NULL
);
2993 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2995 skip("Not enough rights to perform tests\n");
2999 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAIRE, got %u\n", r
);
3000 todo_wine
ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3001 ok(!delete_pf("msitest\\caesar", TRUE
), "File installed\n");
3002 todo_wine
ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3003 todo_wine
ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3007 DeleteFileA(msifile
);
3009 /* Filename from msi is right and the one from cab is wrong */
3010 create_cc_test_files();
3011 ok(MoveFileA("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
3012 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
3014 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3016 r
= MsiInstallProductA(msifile
, NULL
);
3017 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3019 skip("Not enough rights to perform tests\n");
3023 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3024 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3025 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3026 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3027 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3032 DeleteFileA(msifile
);
3035 static void test_caborder(void)
3039 create_file("imperator", 100);
3040 create_file("maximus", 500);
3041 create_file("augustus", 50000);
3042 create_file("caesar", 500);
3044 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
3046 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3048 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3049 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3050 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3052 r
= MsiInstallProductA(msifile
, NULL
);
3053 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3055 skip("Not enough rights to perform tests\n");
3058 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3059 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3060 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3063 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3064 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3069 create_cab_file("test1.cab", MEDIA_SIZE
, "imperator\0");
3070 create_cab_file("test2.cab", MEDIA_SIZE
, "maximus\0augustus\0");
3071 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3073 r
= MsiInstallProductA(msifile
, NULL
);
3074 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3075 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3076 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3077 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3078 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3081 DeleteFileA(msifile
);
3083 create_cc_test_files();
3084 create_database(msifile
, co_tables
, sizeof(co_tables
) / sizeof(msi_table
));
3086 r
= MsiInstallProductA(msifile
, NULL
);
3087 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3088 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3089 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3092 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3093 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3097 DeleteFileA(msifile
);
3099 create_cc_test_files();
3100 create_database(msifile
, co2_tables
, sizeof(co2_tables
) / sizeof(msi_table
));
3102 r
= MsiInstallProductA(msifile
, NULL
);
3103 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3104 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3107 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3108 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3109 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3114 DeleteFileA("imperator");
3115 DeleteFileA("maximus");
3116 DeleteFileA("augustus");
3117 DeleteFileA("caesar");
3118 DeleteFileA(msifile
);
3121 static void test_mixedmedia(void)
3125 if (is_process_limited())
3127 skip("process is limited\n");
3131 CreateDirectoryA("msitest", NULL
);
3132 create_file("msitest\\maximus", 500);
3133 create_file("msitest\\augustus", 500);
3134 create_file("caesar", 500);
3136 create_database(msifile
, mm_tables
, sizeof(mm_tables
) / sizeof(msi_table
));
3138 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3140 create_cab_file("test1.cab", MEDIA_SIZE
, "caesar\0");
3142 r
= MsiInstallProductA(msifile
, NULL
);
3143 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3145 skip("Not enough rights to perform tests\n");
3148 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3149 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3150 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3151 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3152 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3155 /* Delete the files in the temp (current) folder */
3156 DeleteFileA("msitest\\maximus");
3157 DeleteFileA("msitest\\augustus");
3158 RemoveDirectoryA("msitest");
3159 DeleteFileA("caesar");
3160 DeleteFileA("test1.cab");
3161 DeleteFileA(msifile
);
3164 static void test_samesequence(void)
3168 create_cc_test_files();
3169 create_database(msifile
, ss_tables
, sizeof(ss_tables
) / sizeof(msi_table
));
3171 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3173 r
= MsiInstallProductA(msifile
, NULL
);
3174 if (r
== ERROR_INSTALL_FAILURE
)
3176 win_skip("unprivileged user?\n");
3179 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3180 if (r
== ERROR_SUCCESS
)
3182 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3183 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3184 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3185 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3190 DeleteFileA(msifile
);
3193 static void test_uiLevelFlags(void)
3197 create_cc_test_files();
3198 create_database(msifile
, ui_tables
, sizeof(ui_tables
) / sizeof(msi_table
));
3200 MsiSetInternalUI(INSTALLUILEVEL_NONE
| INSTALLUILEVEL_SOURCERESONLY
, NULL
);
3202 r
= MsiInstallProductA(msifile
, NULL
);
3203 if (r
== ERROR_INSTALL_FAILURE
)
3205 win_skip("unprivileged user?\n");
3209 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3210 if (r
== ERROR_SUCCESS
)
3212 ok(!delete_pf("msitest\\maximus", TRUE
), "UI install occurred, but execute-only was requested.\n");
3213 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3214 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3215 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3220 DeleteFileA(msifile
);
3223 static BOOL
file_matches(LPSTR path
)
3229 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3230 NULL
, OPEN_EXISTING
, 0, NULL
);
3231 ZeroMemory(buf
, MAX_PATH
);
3232 ReadFile(file
, buf
, 15, &size
, NULL
);
3235 return !lstrcmpA(buf
, "msitest\\maximus");
3238 static void test_readonlyfile(void)
3243 CHAR path
[MAX_PATH
];
3245 if (is_process_limited())
3247 skip("process is limited\n");
3251 CreateDirectoryA("msitest", NULL
);
3252 create_file("msitest\\maximus", 500);
3253 create_database(msifile
, rof_tables
, sizeof(rof_tables
) / sizeof(msi_table
));
3255 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3257 lstrcpyA(path
, PROG_FILES_DIR
);
3258 lstrcatA(path
, "\\msitest");
3259 CreateDirectoryA(path
, NULL
);
3261 lstrcatA(path
, "\\maximus");
3262 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3263 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3265 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3268 r
= MsiInstallProductA(msifile
, NULL
);
3269 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3271 skip("Not enough rights to perform tests\n");
3274 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3275 ok(file_matches(path
), "Expected file to be overwritten\n");
3276 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3277 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3280 /* Delete the files in the temp (current) folder */
3281 DeleteFileA("msitest\\maximus");
3282 RemoveDirectoryA("msitest");
3283 DeleteFileA(msifile
);
3286 static void test_readonlyfile_cab(void)
3291 CHAR path
[MAX_PATH
];
3294 if (is_process_limited())
3296 skip("process is limited\n");
3300 CreateDirectoryA("msitest", NULL
);
3301 create_file("maximus", 500);
3302 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3303 DeleteFileA("maximus");
3305 create_database(msifile
, rofc_tables
, sizeof(rofc_tables
) / sizeof(msi_table
));
3307 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3309 lstrcpyA(path
, PROG_FILES_DIR
);
3310 lstrcatA(path
, "\\msitest");
3311 CreateDirectoryA(path
, NULL
);
3313 lstrcatA(path
, "\\maximus");
3314 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3315 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3317 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3320 r
= MsiInstallProductA(msifile
, NULL
);
3321 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3323 skip("Not enough rights to perform tests\n");
3326 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3328 memset( buf
, 0, sizeof(buf
) );
3329 if ((file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3330 NULL
, OPEN_EXISTING
, 0, NULL
)) != INVALID_HANDLE_VALUE
)
3332 ReadFile(file
, buf
, sizeof(buf
) - 1, &size
, NULL
);
3335 ok(!memcmp( buf
, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf
);
3336 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3337 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3340 /* Delete the files in the temp (current) folder */
3342 DeleteFileA("msitest\\maximus");
3343 RemoveDirectoryA("msitest");
3344 DeleteFileA(msifile
);
3347 static void test_setdirproperty(void)
3351 if (is_process_limited())
3353 skip("process is limited\n");
3357 CreateDirectoryA("msitest", NULL
);
3358 create_file("msitest\\maximus", 500);
3359 create_database(msifile
, sdp_tables
, sizeof(sdp_tables
) / sizeof(msi_table
));
3361 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3363 r
= MsiInstallProductA(msifile
, NULL
);
3364 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3366 skip("Not enough rights to perform tests\n");
3369 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3370 ok(delete_cf("msitest\\maximus", TRUE
), "File not installed\n");
3371 ok(delete_cf("msitest", FALSE
), "Directory not created\n");
3374 /* Delete the files in the temp (current) folder */
3375 DeleteFileA(msifile
);
3376 DeleteFileA("msitest\\maximus");
3377 RemoveDirectoryA("msitest");
3380 static void test_cabisextracted(void)
3384 if (is_process_limited())
3386 skip("process is limited\n");
3390 CreateDirectoryA("msitest", NULL
);
3391 create_file("msitest\\gaius", 500);
3392 create_file("maximus", 500);
3393 create_file("augustus", 500);
3394 create_file("caesar", 500);
3396 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3397 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3398 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3400 create_database(msifile
, cie_tables
, sizeof(cie_tables
) / sizeof(msi_table
));
3402 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3404 r
= MsiInstallProductA(msifile
, NULL
);
3405 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3407 skip("Not enough rights to perform tests\n");
3410 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3411 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3412 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3413 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3414 ok(delete_pf("msitest\\gaius", TRUE
), "File not installed\n");
3415 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3418 /* Delete the files in the temp (current) folder */
3420 DeleteFileA(msifile
);
3421 DeleteFileA("maximus");
3422 DeleteFileA("augustus");
3423 DeleteFileA("caesar");
3424 DeleteFileA("msitest\\gaius");
3425 RemoveDirectoryA("msitest");
3428 static BOOL
file_exists(LPCSTR file
)
3430 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
3433 static BOOL
pf_exists(LPCSTR file
)
3435 CHAR path
[MAX_PATH
];
3437 lstrcpyA(path
, PROG_FILES_DIR
);
3438 lstrcatA(path
, "\\");
3439 lstrcatA(path
, file
);
3441 return file_exists(path
);
3444 static void delete_pfmsitest_files(void)
3446 SHFILEOPSTRUCTA shfl
;
3447 CHAR path
[MAX_PATH
+11];
3449 lstrcpyA(path
, PROG_FILES_DIR
);
3450 lstrcatA(path
, "\\msitest\\*");
3451 path
[strlen(path
) + 1] = '\0';
3454 shfl
.wFunc
= FO_DELETE
;
3457 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
3459 SHFileOperationA(&shfl
);
3461 lstrcpyA(path
, PROG_FILES_DIR
);
3462 lstrcatA(path
, "\\msitest");
3463 RemoveDirectoryA(path
);
3466 static UINT
run_query(MSIHANDLE hdb
, MSIHANDLE hrec
, const char *query
)
3468 MSIHANDLE hview
= 0;
3471 r
= MsiDatabaseOpenViewA(hdb
, query
, &hview
);
3472 if(r
!= ERROR_SUCCESS
)
3475 r
= MsiViewExecute(hview
, hrec
);
3476 if(r
== ERROR_SUCCESS
)
3477 r
= MsiViewClose(hview
);
3478 MsiCloseHandle(hview
);
3482 static void set_transform_summary_info(void)
3485 MSIHANDLE suminfo
= 0;
3487 /* build summary info */
3488 r
= MsiGetSummaryInformationA(0, mstfile
, 3, &suminfo
);
3489 ok(r
== ERROR_SUCCESS
, "Failed to open summaryinfo\n");
3491 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
3492 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3494 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
3495 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3496 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3497 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3498 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3500 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_PAGECOUNT
, VT_I4
, 100, NULL
, NULL
);
3501 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3503 r
= MsiSummaryInfoPersist(suminfo
);
3504 ok(r
== ERROR_SUCCESS
, "Failed to make summary info persist\n");
3506 r
= MsiCloseHandle(suminfo
);
3507 ok(r
== ERROR_SUCCESS
, "Failed to close suminfo\n");
3510 static void generate_transform(void)
3512 MSIHANDLE hdb1
, hdb2
;
3516 /* start with two identical databases */
3517 CopyFileA(msifile
, msifile2
, FALSE
);
3519 r
= MsiOpenDatabaseW(msifile2W
, MSIDBOPEN_TRANSACT
, &hdb1
);
3520 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3522 r
= MsiDatabaseCommit(hdb1
);
3523 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
3525 r
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_READONLY
, &hdb2
);
3526 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3528 query
= "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3529 r
= run_query(hdb1
, 0, query
);
3530 ok(r
== ERROR_SUCCESS
, "failed to add property\n");
3532 /* database needs to be committed */
3533 MsiDatabaseCommit(hdb1
);
3535 r
= MsiDatabaseGenerateTransformA(hdb1
, hdb2
, mstfile
, 0, 0);
3536 ok(r
== ERROR_SUCCESS
, "return code %d, should be ERROR_SUCCESS\n", r
);
3538 r
= MsiCreateTransformSummaryInfoA(hdb2
, hdb2
, mstfile
, 0, 0);
3539 todo_wine
ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3541 MsiCloseHandle(hdb1
);
3542 MsiCloseHandle(hdb2
);
3545 /* data for generating a transform */
3547 /* tables transform names - encoded as they would be in an msi database file */
3548 static const WCHAR name1
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
3549 static const WCHAR name2
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
3550 static const WCHAR name3
[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
3552 /* data in each table */
3553 static const char data1
[] = /* _StringData */
3554 "propval"; /* all the strings squashed together */
3556 static const WCHAR data2
[] = { /* _StringPool */
3558 0, 0, /* string 0 '' */
3559 4, 1, /* string 1 'prop' */
3560 3, 1, /* string 2 'val' */
3563 static const WCHAR data3
[] = { /* Property */
3564 0x0201, 0x0001, 0x0002,
3567 static const struct {
3571 } table_transform_data
[] =
3573 { name1
, data1
, sizeof data1
- 1 },
3574 { name2
, data2
, sizeof data2
},
3575 { name3
, data3
, sizeof data3
},
3578 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3580 static void generate_transform_manual(void)
3582 IStorage
*stg
= NULL
;
3587 const DWORD mode
= STGM_CREATE
|STGM_READWRITE
|STGM_DIRECT
|STGM_SHARE_EXCLUSIVE
;
3589 const CLSID CLSID_MsiTransform
= { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3591 MultiByteToWideChar(CP_ACP
, 0, mstfile
, -1, name
, 0x20);
3593 r
= StgCreateDocfile(name
, mode
, 0, &stg
);
3594 ok(r
== S_OK
, "failed to create storage\n");
3598 r
= IStorage_SetClass(stg
, &CLSID_MsiTransform
);
3599 ok(r
== S_OK
, "failed to set storage type\n");
3601 for (i
=0; i
<NUM_TRANSFORM_TABLES
; i
++)
3603 r
= IStorage_CreateStream(stg
, table_transform_data
[i
].name
,
3604 STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3607 ok(0, "failed to create stream %08x\n", r
);
3611 r
= IStream_Write(stm
, table_transform_data
[i
].data
,
3612 table_transform_data
[i
].size
, &count
);
3613 if (FAILED(r
) || count
!= table_transform_data
[i
].size
)
3614 ok(0, "failed to write stream\n");
3615 IStream_Release(stm
);
3618 IStorage_Release(stg
);
3620 set_transform_summary_info();
3623 static void test_transformprop(void)
3627 if (is_process_limited())
3629 skip("process is limited\n");
3633 CreateDirectoryA("msitest", NULL
);
3634 create_file("msitest\\augustus", 500);
3636 create_database(msifile
, tp_tables
, sizeof(tp_tables
) / sizeof(msi_table
));
3638 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3640 r
= MsiInstallProductA(msifile
, NULL
);
3641 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3643 skip("Not enough rights to perform tests\n");
3646 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3647 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3648 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3651 generate_transform();
3653 generate_transform_manual();
3655 r
= MsiInstallProductA(msifile
, "TRANSFORMS=winetest.mst");
3656 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3657 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3658 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3661 /* Delete the files in the temp (current) folder */
3662 DeleteFileA(msifile
);
3663 DeleteFileA(msifile2
);
3664 DeleteFileA(mstfile
);
3665 DeleteFileA("msitest\\augustus");
3666 RemoveDirectoryA("msitest");
3669 static void test_currentworkingdir(void)
3672 CHAR drive
[MAX_PATH
], path
[MAX_PATH
];
3675 if (is_process_limited())
3677 skip("process is limited\n");
3681 CreateDirectoryA("msitest", NULL
);
3682 create_file("msitest\\augustus", 500);
3684 create_database(msifile
, cwd_tables
, sizeof(cwd_tables
) / sizeof(msi_table
));
3686 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3688 CreateDirectoryA("diffdir", NULL
);
3689 SetCurrentDirectoryA("diffdir");
3691 sprintf(path
, "..\\%s", msifile
);
3692 r
= MsiInstallProductA(path
, NULL
);
3695 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
3696 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3697 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3700 sprintf(path
, "%s\\%s", CURR_DIR
, msifile
);
3701 r
= MsiInstallProductA(path
, 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 not installed\n");
3709 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3711 lstrcpyA(drive
, CURR_DIR
);
3714 SetCurrentDirectoryA(drive
);
3716 lstrcpyA(path
, CURR_DIR
);
3717 if (path
[lstrlenA(path
) - 1] != '\\') lstrcatA(path
, "\\");
3718 lstrcatA(path
, msifile
);
3719 ptr
= strchr(path
, ':');
3722 r
= MsiInstallProductA(ptr
, NULL
);
3723 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3724 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3725 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3728 SetCurrentDirectoryA(CURR_DIR
);
3729 DeleteFileA(msifile
);
3730 DeleteFileA("msitest\\augustus");
3731 RemoveDirectoryA("msitest");
3732 RemoveDirectoryA("diffdir");
3735 static void set_admin_summary_info(const WCHAR
*name
)
3737 MSIHANDLE db
, summary
;
3740 r
= MsiOpenDatabaseW(name
, MSIDBOPEN_DIRECT
, &db
);
3741 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3743 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
3744 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3746 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, 5, NULL
, NULL
);
3747 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3749 /* write the summary changes back to the stream */
3750 r
= MsiSummaryInfoPersist(summary
);
3751 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3753 MsiCloseHandle(summary
);
3755 r
= MsiDatabaseCommit(db
);
3756 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3761 static void test_admin(void)
3765 CreateDirectoryA("msitest", NULL
);
3766 create_file("msitest\\augustus", 500);
3768 create_database(msifile
, adm_tables
, sizeof(adm_tables
) / sizeof(msi_table
));
3769 set_admin_summary_info(msifileW
);
3771 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3773 r
= MsiInstallProductA(msifile
, NULL
);
3774 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3776 skip("Not enough rights to perform tests\n");
3779 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3780 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3781 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3782 ok(!DeleteFileA("c:\\msitest\\augustus"), "File installed\n");
3783 ok(!RemoveDirectoryA("c:\\msitest"), "File installed\n");
3785 r
= MsiInstallProductA(msifile
, "ACTION=ADMIN");
3786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3787 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3788 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3791 ok(DeleteFileA("c:\\msitest\\augustus"), "File not installed\n");
3792 ok(RemoveDirectoryA("c:\\msitest"), "File not installed\n");
3796 DeleteFileA(msifile
);
3797 DeleteFileA("msitest\\augustus");
3798 RemoveDirectoryA("msitest");
3801 static void set_admin_property_stream(LPCSTR file
)
3805 WCHAR fileW
[MAX_PATH
];
3808 const DWORD mode
= STGM_DIRECT
| STGM_READWRITE
| STGM_SHARE_EXCLUSIVE
;
3810 /* AdminProperties */
3811 static const WCHAR stmname
[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
3812 static const WCHAR data
[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
3813 'M','y','P','r','o','p','=','4','2',0};
3815 MultiByteToWideChar(CP_ACP
, 0, file
, -1, fileW
, MAX_PATH
);
3817 hr
= StgOpenStorage(fileW
, NULL
, mode
, NULL
, 0, &stg
);
3818 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3822 hr
= IStorage_CreateStream(stg
, stmname
, STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3823 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3825 hr
= IStream_Write(stm
, data
, sizeof(data
), &count
);
3826 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3828 IStream_Release(stm
);
3829 IStorage_Release(stg
);
3832 static void test_adminprops(void)
3836 if (is_process_limited())
3838 skip("process is limited\n");
3842 CreateDirectoryA("msitest", NULL
);
3843 create_file("msitest\\augustus", 500);
3845 create_database(msifile
, amp_tables
, sizeof(amp_tables
) / sizeof(msi_table
));
3846 set_admin_summary_info(msifileW
);
3847 set_admin_property_stream(msifile
);
3849 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3851 r
= MsiInstallProductA(msifile
, NULL
);
3852 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3854 skip("Not enough rights to perform tests\n");
3857 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3858 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3859 ok(delete_pf("msitest", FALSE
), "Directory created\n");
3862 DeleteFileA(msifile
);
3863 DeleteFileA("msitest\\augustus");
3864 RemoveDirectoryA("msitest");
3867 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
3869 CHAR path
[MAX_PATH
];
3871 lstrcpyA(path
, PROG_FILES_DIR
);
3872 lstrcatA(path
, "\\");
3873 lstrcatA(path
, file
);
3876 create_file_data(path
, data
, 500);
3878 CreateDirectoryA(path
, NULL
);
3881 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
3883 static void test_missingcab(void)
3887 if (is_process_limited())
3889 skip("process is limited\n");
3893 CreateDirectoryA("msitest", NULL
);
3894 create_file("msitest\\augustus", 500);
3895 create_file("maximus", 500);
3896 create_file("tiberius", 500);
3898 create_database(msifile
, mc_tables
, sizeof(mc_tables
) / sizeof(msi_table
));
3900 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3902 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3903 create_cab_file("test4.cab", MEDIA_SIZE
, "tiberius\0");
3905 create_pf("msitest", FALSE
);
3906 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3907 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3909 r
= MsiInstallProductA(msifile
, NULL
);
3910 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3912 skip("Not enough rights to perform tests\n");
3915 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3916 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3917 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3918 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3919 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3920 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3921 ok(!delete_pf("msitest\\gaius", TRUE
), "File installed\n");
3922 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3924 create_pf("msitest", FALSE
);
3925 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3926 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3927 create_pf("msitest\\gaius", TRUE
);
3929 r
= MsiInstallProductA(msifile
, "GAIUS=1");
3930 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3933 ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3934 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3936 ok(delete_pf("msitest\\caesar", TRUE
), "File removed\n");
3937 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3938 ok(delete_pf("msitest\\tiberius", TRUE
), "File removed\n");
3939 ok(delete_pf("msitest\\gaius", TRUE
), "File removed\n");
3940 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3943 delete_pf("msitest", FALSE
);
3944 DeleteFileA("msitest\\augustus");
3945 RemoveDirectoryA("msitest");
3946 DeleteFileA("maximus");
3947 DeleteFileA("tiberius");
3948 DeleteFileA("test1.cab");
3949 DeleteFileA("test4.cab");
3950 DeleteFileA(msifile
);
3953 static void test_sourcefolder(void)
3957 if (is_process_limited())
3959 skip("process is limited\n");
3963 CreateDirectoryA("msitest", NULL
);
3964 create_file("augustus", 500);
3966 create_database(msifile
, sf_tables
, sizeof(sf_tables
) / sizeof(msi_table
));
3968 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
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_INSTALL_FAILURE
,
3977 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3978 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3981 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3983 RemoveDirectoryA("msitest");
3985 r
= MsiInstallProductA(msifile
, NULL
);
3986 ok(r
== ERROR_INSTALL_FAILURE
,
3987 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3988 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3991 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3995 DeleteFileA(msifile
);
3996 DeleteFileA("augustus");
3999 static void test_customaction51(void)
4003 if (is_process_limited())
4005 skip("process is limited\n");
4009 CreateDirectoryA("msitest", NULL
);
4010 create_file("msitest\\augustus", 500);
4012 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4014 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4016 r
= MsiInstallProductA(msifile
, NULL
);
4017 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4019 skip("Not enough rights to perform tests\n");
4022 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4023 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4024 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4027 DeleteFileA(msifile
);
4028 DeleteFileA("msitest\\augustus");
4029 RemoveDirectoryA("msitest");
4032 static void test_installstate(void)
4036 if (is_process_limited())
4038 skip("process is limited\n");
4042 CreateDirectoryA("msitest", NULL
);
4043 create_file("msitest\\alpha", 500);
4044 create_file("msitest\\beta", 500);
4045 create_file("msitest\\gamma", 500);
4046 create_file("msitest\\theta", 500);
4047 create_file("msitest\\delta", 500);
4048 create_file("msitest\\epsilon", 500);
4049 create_file("msitest\\zeta", 500);
4050 create_file("msitest\\iota", 500);
4051 create_file("msitest\\eta", 500);
4052 create_file("msitest\\kappa", 500);
4053 create_file("msitest\\lambda", 500);
4054 create_file("msitest\\mu", 500);
4056 create_database(msifile
, is_tables
, sizeof(is_tables
) / sizeof(msi_table
));
4058 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4060 r
= MsiInstallProductA(msifile
, NULL
);
4061 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4063 skip("Not enough rights to perform tests\n");
4066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4067 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4068 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4069 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4070 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4071 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4072 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4073 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4074 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4075 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4076 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4077 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4078 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4079 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4081 r
= MsiInstallProductA(msifile
, "ADDLOCAL=\"one,two,three,four\"");
4082 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4083 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4084 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4085 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4086 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4087 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4088 ok(delete_pf("msitest\\epsilon", TRUE
), "File not installed\n");
4089 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4090 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4091 ok(delete_pf("msitest\\eta", TRUE
), "File not installed\n");
4092 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4093 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4094 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4095 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4097 r
= MsiInstallProductA(msifile
, "ADDSOURCE=\"one,two,three,four\"");
4098 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4099 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4100 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4101 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4102 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4103 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4104 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4105 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4106 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4107 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4108 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4109 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4110 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4111 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4113 r
= MsiInstallProductA(msifile
, "REMOVE=\"one,two,three,four\"");
4114 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4115 ok(!delete_pf("msitest\\alpha", TRUE
), "File installed\n");
4116 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4117 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4118 ok(!delete_pf("msitest\\theta", TRUE
), "File installed\n");
4119 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4120 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4121 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4122 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4123 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4124 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4125 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4126 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4127 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4130 DeleteFileA(msifile
);
4131 DeleteFileA("msitest\\alpha");
4132 DeleteFileA("msitest\\beta");
4133 DeleteFileA("msitest\\gamma");
4134 DeleteFileA("msitest\\theta");
4135 DeleteFileA("msitest\\delta");
4136 DeleteFileA("msitest\\epsilon");
4137 DeleteFileA("msitest\\zeta");
4138 DeleteFileA("msitest\\iota");
4139 DeleteFileA("msitest\\eta");
4140 DeleteFileA("msitest\\kappa");
4141 DeleteFileA("msitest\\lambda");
4142 DeleteFileA("msitest\\mu");
4143 RemoveDirectoryA("msitest");
4146 static const struct sourcepathmap
4148 BOOL sost
; /* shortone\shorttwo */
4149 BOOL solt
; /* shortone\longtwo */
4150 BOOL lost
; /* longone\shorttwo */
4151 BOOL lolt
; /* longone\longtwo */
4152 BOOL soste
; /* shortone\shorttwo source exists */
4153 BOOL solte
; /* shortone\longtwo source exists */
4154 BOOL loste
; /* longone\shorttwo source exists */
4155 BOOL lolte
; /* longone\longtwo source exists */
4160 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4161 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4162 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4163 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4164 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4165 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4166 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4167 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4168 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4169 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4170 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4171 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4172 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4173 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4174 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4175 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4176 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4177 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4178 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4179 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4180 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4181 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4182 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4183 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4184 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4185 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4186 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4187 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4188 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4189 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4190 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4191 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4192 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4193 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4194 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4195 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4196 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4197 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4198 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4199 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4200 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4201 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4202 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4203 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4204 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4205 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4206 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4207 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4208 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4209 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4210 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4211 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4212 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4213 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4214 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4215 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4216 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4217 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4218 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4219 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4220 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4221 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4222 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4223 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4224 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4225 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4226 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4227 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4228 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4229 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4230 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4231 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4232 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4233 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4234 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4235 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4236 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4237 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4238 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4239 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4240 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4241 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4242 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4243 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4244 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4245 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4246 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4247 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4248 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4249 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4250 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4251 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4252 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4253 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4254 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4255 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4256 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4257 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4258 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4259 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4260 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4261 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4262 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4263 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4264 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4265 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4266 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4267 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4268 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4269 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4270 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4271 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4272 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4273 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4274 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4275 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4276 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4277 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4278 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4279 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4280 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4281 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4282 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4283 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4284 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4285 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4286 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4287 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4288 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4289 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4290 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4291 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4292 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4293 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4294 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4295 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4296 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4297 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4298 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4299 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4300 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4301 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4302 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4303 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4304 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4305 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4306 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4307 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4308 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4309 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4310 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4311 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4312 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4313 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4314 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4315 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4316 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4317 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4318 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4319 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4320 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4321 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4322 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4323 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4324 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4325 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4326 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4327 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4328 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4329 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4330 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4331 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4332 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4333 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4334 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4335 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4336 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4337 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4338 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4339 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4340 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4341 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4342 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4343 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4344 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4345 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4346 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4347 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4348 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4349 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4350 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4351 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4352 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4353 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4354 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4355 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4356 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4357 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4358 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4359 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4360 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4361 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4362 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4363 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4364 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4365 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4366 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4367 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4368 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4369 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4370 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4371 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4372 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4373 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4374 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4375 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4376 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4377 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4378 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4379 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4380 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4381 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4382 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4383 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4384 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4385 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4386 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4387 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4388 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4389 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4390 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4391 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4392 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4393 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4394 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4395 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4396 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4397 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4398 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4399 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4400 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4401 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4402 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4403 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4404 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4405 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4406 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4407 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4408 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4409 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4410 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4411 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4412 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4413 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4414 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4415 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4418 static DWORD
get_pf_file_size(LPCSTR file
)
4420 CHAR path
[MAX_PATH
];
4424 lstrcpyA(path
, PROG_FILES_DIR
);
4425 lstrcatA(path
, "\\");
4426 lstrcatA(path
, file
);
4428 hfile
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
4429 if (hfile
== INVALID_HANDLE_VALUE
)
4430 return INVALID_FILE_SIZE
;
4432 size
= GetFileSize(hfile
, NULL
);
4437 static void test_sourcepath(void)
4441 if (!winetest_interactive
)
4443 skip("Run in interactive mode to run source path tests.\n");
4447 create_database(msifile
, sp_tables
, sizeof(sp_tables
) / sizeof(msi_table
));
4449 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4451 for (i
= 0; i
< sizeof(spmap
) / sizeof(spmap
[0]); i
++)
4455 CreateDirectoryA("shortone", NULL
);
4456 CreateDirectoryA("shortone\\shorttwo", NULL
);
4461 CreateDirectoryA("shortone", NULL
);
4462 CreateDirectoryA("shortone\\longtwo", NULL
);
4467 CreateDirectoryA("longone", NULL
);
4468 CreateDirectoryA("longone\\shorttwo", NULL
);
4473 CreateDirectoryA("longone", NULL
);
4474 CreateDirectoryA("longone\\longtwo", NULL
);
4478 create_file("shortone\\shorttwo\\augustus", 50);
4480 create_file("shortone\\longtwo\\augustus", 100);
4482 create_file("longone\\shorttwo\\augustus", 150);
4484 create_file("longone\\longtwo\\augustus", 200);
4486 r
= MsiInstallProductA(msifile
, NULL
);
4487 ok(r
== spmap
[i
].err
, "%d: Expected %d, got %d\n", i
, spmap
[i
].err
, r
);
4488 ok(get_pf_file_size("msitest\\augustus") == spmap
[i
].size
,
4489 "%d: Expected %d, got %d\n", i
, spmap
[i
].size
,
4490 get_pf_file_size("msitest\\augustus"));
4492 if (r
== ERROR_SUCCESS
)
4494 ok(delete_pf("msitest\\augustus", TRUE
), "%d: File not installed\n", i
);
4495 ok(delete_pf("msitest", FALSE
), "%d: Directory not created\n", i
);
4499 ok(!delete_pf("msitest\\augustus", TRUE
), "%d: File installed\n", i
);
4500 todo_wine
ok(!delete_pf("msitest", FALSE
), "%d: Directory installed\n", i
);
4503 DeleteFileA("shortone\\shorttwo\\augustus");
4504 DeleteFileA("shortone\\longtwo\\augustus");
4505 DeleteFileA("longone\\shorttwo\\augustus");
4506 DeleteFileA("longone\\longtwo\\augustus");
4507 RemoveDirectoryA("shortone\\shorttwo");
4508 RemoveDirectoryA("shortone\\longtwo");
4509 RemoveDirectoryA("longone\\shorttwo");
4510 RemoveDirectoryA("longone\\longtwo");
4511 RemoveDirectoryA("shortone");
4512 RemoveDirectoryA("longone");
4515 DeleteFileA(msifile
);
4518 static void test_missingcomponent(void)
4522 if (is_process_limited())
4524 skip("process is limited\n");
4528 CreateDirectoryA("msitest", NULL
);
4529 create_file("msitest\\hydrogen", 500);
4530 create_file("msitest\\helium", 500);
4531 create_file("msitest\\lithium", 500);
4532 create_file("beryllium", 500);
4534 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
4536 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4538 r
= MsiInstallProductA(msifile
, "INSTALLLEVEL=10 PROPVAR=42");
4539 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4541 skip("Not enough rights to perform tests\n");
4544 else if (r
== ERROR_INSTALL_FAILURE
)
4546 win_skip("broken result\n");
4549 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4550 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4551 ok(pf_exists("msitest\\helium"), "File not installed\n");
4552 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4553 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4554 ok(pf_exists("msitest"), "File not installed\n");
4556 r
= MsiInstallProductA(msifile
, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
4557 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4558 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
4559 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
4560 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
4561 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4562 ok(!delete_pf("msitest", FALSE
), "Directory not removed\n");
4565 DeleteFileA(msifile
);
4566 DeleteFileA("msitest\\hydrogen");
4567 DeleteFileA("msitest\\helium");
4568 DeleteFileA("msitest\\lithium");
4569 DeleteFileA("beryllium");
4570 RemoveDirectoryA("msitest");
4573 static void test_sourcedirprop(void)
4576 CHAR props
[MAX_PATH
];
4578 if (is_process_limited())
4580 skip("process is limited\n");
4584 CreateDirectoryA("msitest", NULL
);
4585 create_file("msitest\\augustus", 500);
4587 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4589 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4591 r
= MsiInstallProductA(msifile
, NULL
);
4592 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4594 skip("Not enough rights to perform tests\n");
4597 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4598 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4599 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4601 DeleteFileA("msitest\\augustus");
4602 RemoveDirectoryA("msitest");
4604 CreateDirectoryA("altsource", NULL
);
4605 CreateDirectoryA("altsource\\msitest", NULL
);
4606 create_file("altsource\\msitest\\augustus", 500);
4608 sprintf(props
, "SRCDIR=%s\\altsource\\", CURR_DIR
);
4610 r
= MsiInstallProductA(msifile
, props
);
4611 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4612 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4613 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4615 DeleteFileA("altsource\\msitest\\augustus");
4616 RemoveDirectoryA("altsource\\msitest");
4617 RemoveDirectoryA("altsource");
4620 DeleteFileA("msitest\\augustus");
4621 RemoveDirectoryA("msitest");
4622 DeleteFileA(msifile
);
4625 static void test_adminimage(void)
4629 if (is_process_limited())
4631 skip("process is limited\n");
4635 CreateDirectoryA("msitest", NULL
);
4636 CreateDirectoryA("msitest\\first", NULL
);
4637 CreateDirectoryA("msitest\\second", NULL
);
4638 CreateDirectoryA("msitest\\cabout", NULL
);
4639 CreateDirectoryA("msitest\\cabout\\new", NULL
);
4640 create_file("msitest\\one.txt", 100);
4641 create_file("msitest\\first\\two.txt", 100);
4642 create_file("msitest\\second\\three.txt", 100);
4643 create_file("msitest\\cabout\\four.txt", 100);
4644 create_file("msitest\\cabout\\new\\five.txt", 100);
4645 create_file("msitest\\filename", 100);
4646 create_file("msitest\\service.exe", 100);
4648 create_database_wordcount(msifile
, ai_tables
,
4649 sizeof(ai_tables
) / sizeof(msi_table
),
4650 100, msidbSumInfoSourceTypeAdminImage
, ";1033",
4651 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4653 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4655 r
= MsiInstallProductA(msifile
, NULL
);
4656 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4658 skip("Not enough rights to perform tests\n");
4661 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4663 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4664 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4665 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4666 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4667 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4668 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4669 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4670 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4671 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4672 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4673 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4674 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4677 DeleteFileA("msifile");
4678 DeleteFileA("msitest\\cabout\\new\\five.txt");
4679 DeleteFileA("msitest\\cabout\\four.txt");
4680 DeleteFileA("msitest\\second\\three.txt");
4681 DeleteFileA("msitest\\first\\two.txt");
4682 DeleteFileA("msitest\\one.txt");
4683 DeleteFileA("msitest\\service.exe");
4684 DeleteFileA("msitest\\filename");
4685 RemoveDirectoryA("msitest\\cabout\\new");
4686 RemoveDirectoryA("msitest\\cabout");
4687 RemoveDirectoryA("msitest\\second");
4688 RemoveDirectoryA("msitest\\first");
4689 RemoveDirectoryA("msitest");
4692 static void test_propcase(void)
4696 if (is_process_limited())
4698 skip("process is limited\n");
4702 CreateDirectoryA("msitest", NULL
);
4703 create_file("msitest\\augustus", 500);
4705 create_database(msifile
, pc_tables
, sizeof(pc_tables
) / sizeof(msi_table
));
4707 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4709 r
= MsiInstallProductA(msifile
, "MyProp=42");
4710 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4712 skip("Not enough rights to perform tests\n");
4715 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4716 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4717 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4720 DeleteFileA(msifile
);
4721 DeleteFileA("msitest\\augustus");
4722 RemoveDirectoryA("msitest");
4725 static void test_int_widths( void )
4727 static const WCHAR msitestW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
4728 static const WCHAR msitableW
[] = {'m','s','i','t','a','b','l','e','.','i','d','t',0};
4729 static const WCHAR slashW
[] = {'\\',0};
4730 static const char int0
[] = "int0\ni0\nint0\tint0\n1";
4731 static const char int1
[] = "int1\ni1\nint1\tint1\n1";
4732 static const char int2
[] = "int2\ni2\nint2\tint2\n1";
4733 static const char int3
[] = "int3\ni3\nint3\tint3\n1";
4734 static const char int4
[] = "int4\ni4\nint4\tint4\n1";
4735 static const char int5
[] = "int5\ni5\nint5\tint5\n1";
4736 static const char int8
[] = "int8\ni8\nint8\tint8\n1";
4745 { int0
, sizeof(int0
) - 1, ERROR_SUCCESS
},
4746 { int1
, sizeof(int1
) - 1, ERROR_SUCCESS
},
4747 { int2
, sizeof(int2
) - 1, ERROR_SUCCESS
},
4748 { int3
, sizeof(int3
) - 1, ERROR_FUNCTION_FAILED
},
4749 { int4
, sizeof(int4
) - 1, ERROR_SUCCESS
},
4750 { int5
, sizeof(int5
) - 1, ERROR_FUNCTION_FAILED
},
4751 { int8
, sizeof(int8
) - 1, ERROR_FUNCTION_FAILED
}
4753 WCHAR tmpdir
[MAX_PATH
], msitable
[MAX_PATH
], msidb
[MAX_PATH
];
4757 GetTempPathW(MAX_PATH
, tmpdir
);
4758 CreateDirectoryW(tmpdir
, NULL
);
4760 lstrcpyW(msitable
, tmpdir
);
4761 lstrcatW(msitable
, slashW
);
4762 lstrcatW(msitable
, msitableW
);
4764 lstrcpyW(msidb
, tmpdir
);
4765 lstrcatW(msidb
, slashW
);
4766 lstrcatW(msidb
, msitestW
);
4768 r
= MsiOpenDatabaseW(msidb
, MSIDBOPEN_CREATE
, &db
);
4769 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4771 for (i
= 0; i
< sizeof(tests
)/sizeof(tests
[0]); i
++)
4774 HANDLE handle
= CreateFileW(msitable
, GENERIC_WRITE
, 0, NULL
,
4775 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
4776 WriteFile(handle
, tests
[i
].data
, tests
[i
].size
, &count
, NULL
);
4777 CloseHandle(handle
);
4779 r
= MsiDatabaseImportW(db
, tmpdir
, msitableW
);
4780 ok(r
== tests
[i
].ret
, " %u expected %u, got %u\n", i
, tests
[i
].ret
, r
);
4782 r
= MsiDatabaseCommit(db
);
4783 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4784 DeleteFileW(msitable
);
4789 RemoveDirectoryW(tmpdir
);
4792 static void test_shortcut(void)
4797 if (is_process_limited())
4799 skip("process is limited\n");
4803 create_test_files();
4804 create_database(msifile
, sc_tables
, sizeof(sc_tables
) / sizeof(msi_table
));
4806 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4808 r
= MsiInstallProductA(msifile
, NULL
);
4809 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4811 skip("Not enough rights to perform tests\n");
4814 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4816 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
4817 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4819 r
= MsiInstallProductA(msifile
, NULL
);
4820 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4824 hr
= CoInitializeEx(NULL
, COINIT_APARTMENTTHREADED
);
4825 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4827 r
= MsiInstallProductA(msifile
, NULL
);
4828 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4832 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4833 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4834 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4835 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4836 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4837 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4838 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4839 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4840 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4841 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4842 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4843 while (!delete_pf("msitest\\Shortcut.lnk", TRUE
) && GetLastError() == ERROR_SHARING_VIOLATION
) Sleep(1000);
4844 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4847 delete_test_files();
4848 DeleteFileA(msifile
);
4851 static void test_preselected(void)
4855 if (is_process_limited())
4857 skip("process is limited\n");
4861 create_test_files();
4862 create_database(msifile
, ps_tables
, sizeof(ps_tables
) / sizeof(msi_table
));
4864 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4866 r
= MsiInstallProductA(msifile
, "ADDLOCAL=One");
4867 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4869 skip("Not enough rights to perform tests\n");
4872 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4874 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File installed\n");
4875 ok(!delete_pf("msitest\\cabout\\new", FALSE
), "Directory created\n");
4876 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE
), "File installed\n");
4877 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory created\n");
4878 ok(!delete_pf("msitest\\changed\\three.txt", TRUE
), "File installed\n");
4879 ok(!delete_pf("msitest\\changed", FALSE
), "Directory created\n");
4880 ok(!delete_pf("msitest\\first\\two.txt", TRUE
), "File installed\n");
4881 ok(!delete_pf("msitest\\first", FALSE
), "Directory created\n");
4882 ok(!delete_pf("msitest\\filename", TRUE
), "File installed\n");
4883 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4884 ok(!delete_pf("msitest\\service.exe", TRUE
), "File installed\n");
4885 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4887 r
= MsiInstallProductA(msifile
, NULL
);
4888 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4890 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4891 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4892 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4893 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4894 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4895 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4896 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4897 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4898 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4899 ok(!delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4900 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4901 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4904 delete_test_files();
4905 DeleteFileA(msifile
);
4908 static void test_installed_prop(void)
4910 static const char prodcode
[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
4913 if (is_process_limited())
4915 skip("process is limited\n");
4919 create_test_files();
4920 create_database(msifile
, ip_tables
, sizeof(ip_tables
) / sizeof(msi_table
));
4922 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4924 r
= MsiInstallProductA(msifile
, "FULL=1");
4925 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4927 skip("Not enough rights to perform tests\n");
4930 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4932 r
= MsiInstallProductA(msifile
, "FULL=1");
4933 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4935 r
= MsiConfigureProductExA(prodcode
, INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
, "FULL=1");
4936 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4938 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4939 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4940 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4941 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4942 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4943 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4944 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4945 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4946 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4947 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4948 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4949 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4951 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4952 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4955 delete_test_files();
4956 DeleteFileA(msifile
);
4959 static void test_allusers_prop(void)
4963 if (is_process_limited())
4965 skip("process is limited\n");
4969 create_test_files();
4970 create_database(msifile
, aup_tables
, sizeof(aup_tables
) / sizeof(msi_table
));
4972 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4974 /* ALLUSERS property unset */
4975 r
= MsiInstallProductA(msifile
, "FULL=1");
4976 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4978 skip("Not enough rights to perform tests\n");
4981 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4983 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4984 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4985 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4986 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4987 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4988 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4989 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4990 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4991 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4992 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4993 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4994 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4996 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4997 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4999 delete_test_files();
5001 create_test_files();
5002 create_database(msifile
, aup2_tables
, sizeof(aup2_tables
) / sizeof(msi_table
));
5004 /* ALLUSERS property set to 1 */
5005 r
= MsiInstallProductA(msifile
, "FULL=1");
5006 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5008 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5009 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5010 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5011 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5012 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5013 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5014 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5015 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5016 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5017 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5018 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5019 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5021 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5022 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5024 delete_test_files();
5026 create_test_files();
5027 create_database(msifile
, aup3_tables
, sizeof(aup3_tables
) / sizeof(msi_table
));
5029 /* ALLUSERS property set to 2 */
5030 r
= MsiInstallProductA(msifile
, "FULL=1");
5031 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5033 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5034 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5035 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5036 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5037 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5038 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5039 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5040 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5041 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5042 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5043 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5044 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5046 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5047 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5049 delete_test_files();
5051 create_test_files();
5052 create_database(msifile
, aup4_tables
, sizeof(aup4_tables
) / sizeof(msi_table
));
5054 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
5055 r
= MsiInstallProductA(msifile
, "FULL=1");
5056 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5059 delete_test_files();
5060 DeleteFileA(msifile
);
5063 static const char session_manager
[] = "System\\CurrentControlSet\\Control\\Session Manager";
5064 static const char rename_ops
[] = "PendingFileRenameOperations";
5066 static void process_pending_renames(HKEY hkey
)
5068 char *buf
, *src
, *dst
, *buf2
, *buf2ptr
;
5073 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
);
5074 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5076 buf
= HeapAlloc(GetProcessHeap(), 0, size
+ 1);
5077 buf2ptr
= buf2
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, size
+ 1);
5079 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, (LPBYTE
)buf
, &size
);
5081 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5084 for (src
= buf
; *src
; src
= dst
+ strlen(dst
) + 1)
5086 DWORD flags
= MOVEFILE_COPY_ALLOWED
;
5089 dst
= src
+ strlen(src
) + 1;
5091 if (!strstr(src
, "msitest"))
5093 lstrcpyA(buf2ptr
, src
);
5094 buf2ptr
+= strlen(src
) + 1;
5095 lstrcpyA(buf2ptr
, dst
);
5096 buf2ptr
+= strlen(dst
) + 1;
5104 flags
|= MOVEFILE_REPLACE_EXISTING
;
5107 if (src
[0] == '\\' && src
[1] == '?' && src
[2] == '?' && src
[3] == '\\') src
+= 4;
5110 if (dst
[0] == '\\' && dst
[1] == '?' && dst
[2] == '?' && dst
[3] == '\\') dst
+= 4;
5111 fileret
= MoveFileExA(src
, dst
, flags
);
5112 ok(fileret
, "Failed to move file %s -> %s (%u)\n", src
, dst
, GetLastError());
5116 fileret
= DeleteFileA(src
);
5117 ok(fileret
|| broken(!fileret
) /* win2k3 */, "Failed to delete file %s (%u)\n", src
, GetLastError());
5121 ok(found
, "Expected a 'msitest' entry\n");
5124 RegSetValueExA(hkey
, rename_ops
, 0, REG_MULTI_SZ
, (LPBYTE
)buf2
, buf2ptr
+ 1 - buf2
);
5126 RegDeleteValueA(hkey
, rename_ops
);
5128 HeapFree(GetProcessHeap(), 0, buf
);
5129 HeapFree(GetProcessHeap(), 0, buf2
);
5132 static BOOL
file_matches_data(LPCSTR file
, LPCSTR data
)
5134 DWORD len
, data_len
= strlen(data
);
5138 handle
= CreateFileA(file
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
5139 ok(handle
!= INVALID_HANDLE_VALUE
, "failed to open %s (%u)\n", file
, GetLastError());
5141 if (ReadFile(handle
, buf
, sizeof(buf
), &len
, NULL
) && len
>= data_len
)
5143 CloseHandle(handle
);
5144 return !memcmp(buf
, data
, data_len
);
5146 CloseHandle(handle
);
5150 static void test_file_in_use(void)
5155 char path
[MAX_PATH
];
5157 if (is_process_limited())
5159 skip("process is limited\n");
5163 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5165 CreateDirectoryA("msitest", NULL
);
5166 create_file("msitest\\maximus", 500);
5167 create_database(msifile
, fiu_tables
, sizeof(fiu_tables
) / sizeof(msi_table
));
5169 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5171 lstrcpyA(path
, PROG_FILES_DIR
);
5172 lstrcatA(path
, "\\msitest");
5173 CreateDirectoryA(path
, NULL
);
5175 lstrcatA(path
, "\\maximus");
5176 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5178 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5179 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5181 skip("Not enough rights to perform tests\n");
5184 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5185 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5187 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5189 process_pending_renames(hkey
);
5192 ok(file_matches_data(path
, "msitest\\maximus"), "Expected file to match\n");
5193 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5194 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5196 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5197 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5202 delete_pf("msitest\\maximus", TRUE
);
5203 delete_pf("msitest", FALSE
);
5204 DeleteFileA("msitest\\maximus");
5205 delete_test_files();
5206 DeleteFileA(msifile
);
5209 static void test_file_in_use_cab(void)
5214 char path
[MAX_PATH
];
5216 if (is_process_limited())
5218 skip("process is limited\n");
5222 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5224 CreateDirectoryA("msitest", NULL
);
5225 create_file("maximus", 500);
5226 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
5227 DeleteFileA("maximus");
5229 create_database(msifile
, fiuc_tables
, sizeof(fiuc_tables
) / sizeof(msi_table
));
5231 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5233 lstrcpyA(path
, PROG_FILES_DIR
);
5234 lstrcatA(path
, "\\msitest");
5235 CreateDirectoryA(path
, NULL
);
5237 lstrcatA(path
, "\\maximus");
5238 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5240 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5241 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5243 skip("Not enough rights to perform tests\n");
5246 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5247 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5249 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5251 process_pending_renames(hkey
);
5254 ok(file_matches_data(path
, "maximus"), "Expected file to match\n");
5255 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5256 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5258 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5259 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5264 delete_pf("msitest\\maximus", TRUE
);
5265 delete_pf("msitest", FALSE
);
5266 DeleteFileA("msitest\\maximus");
5268 delete_test_files();
5269 DeleteFileA(msifile
);
5272 static void test_feature_override(void)
5275 REGSAM access
= KEY_ALL_ACCESS
;
5277 if (is_process_limited())
5279 skip("process is limited\n");
5283 create_test_files();
5284 create_file("msitest\\override.txt", 1000);
5285 create_file("msitest\\preselected.txt", 1000);
5286 create_file("msitest\\notpreselected.txt", 1000);
5287 create_database(msifile
, fo_tables
, sizeof(fo_tables
) / sizeof(msi_table
));
5290 access
|= KEY_WOW64_64KEY
;
5292 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5294 r
= MsiInstallProductA(msifile
, "ADDLOCAL=override");
5295 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5297 skip("Not enough rights to perform tests\n");
5300 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5302 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5303 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
5304 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5306 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5307 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5309 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5311 r
= MsiInstallProductA(msifile
, "preselect=1");
5312 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5314 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5315 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5316 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5318 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5319 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5321 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5323 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5324 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5327 r
= MsiInstallProductA(msifile
, NULL
);
5328 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5330 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5331 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5332 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5334 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5335 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5337 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5339 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5340 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5343 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", access
);
5346 DeleteFileA("msitest\\override.txt");
5347 DeleteFileA("msitest\\preselected.txt");
5348 DeleteFileA("msitest\\notpreselected.txt");
5349 delete_test_files();
5350 DeleteFileA(msifile
);
5353 static void test_icon_table(void)
5355 MSIHANDLE hdb
= 0, record
;
5358 CHAR path
[MAX_PATH
];
5359 static const char prodcode
[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
5361 if (is_process_limited())
5363 skip("process is limited\n");
5367 create_database(msifile
, icon_base_tables
, sizeof(icon_base_tables
) / sizeof(msi_table
));
5369 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5371 res
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_TRANSACT
, &hdb
);
5372 ok(res
== ERROR_SUCCESS
, "failed to open db: %d\n", res
);
5374 query
= "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
5375 res
= run_query( hdb
, 0, query
);
5376 ok(res
== ERROR_SUCCESS
, "Can't create Icon table: %d\n", res
);
5378 create_file("icon.ico", 100);
5379 record
= MsiCreateRecord(1);
5380 res
= MsiRecordSetStreamA(record
, 1, "icon.ico");
5381 ok(res
== ERROR_SUCCESS
, "Failed to add stream data to record: %d\n", res
);
5383 query
= "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
5384 res
= run_query(hdb
, record
, query
);
5385 ok(res
== ERROR_SUCCESS
, "Insert into Icon table failed: %d\n", res
);
5387 res
= MsiCloseHandle(record
);
5388 ok(res
== ERROR_SUCCESS
, "Failed to close record handle: %d\n", res
);
5389 DeleteFileA("icon.ico");
5390 res
= MsiDatabaseCommit(hdb
);
5391 ok(res
== ERROR_SUCCESS
, "Failed to commit database: %d\n", res
);
5392 res
= MsiCloseHandle(hdb
);
5393 ok(res
== ERROR_SUCCESS
, "Failed to close database: %d\n", res
);
5396 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
5397 if (res
== ERROR_INSTALL_PACKAGE_REJECTED
)
5399 skip("Not enough rights to perform tests\n");
5400 DeleteFileA(msifile
);
5403 ok(res
== ERROR_SUCCESS
, "Failed to do per-user install: %d\n", res
);
5405 lstrcpyA(path
, APP_DATA_DIR
);
5406 lstrcatA(path
, "\\");
5407 lstrcatA(path
, "Microsoft\\Installer\\");
5408 lstrcatA(path
, prodcode
);
5409 lstrcatA(path
, "\\testicon");
5410 ok(file_exists(path
), "Per-user icon file isn't where it's expected (%s)\n", path
);
5412 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5413 ok(res
== ERROR_SUCCESS
, "Failed to uninstall per-user\n");
5414 ok(!file_exists(path
), "Per-user icon file not removed (%s)\n", path
);
5417 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5418 ok(res
== ERROR_SUCCESS
, "Failed to system-wide install: %d\n", res
);
5420 lstrcpyA(path
, WINDOWS_DIR
);
5421 lstrcatA(path
, "\\");
5422 lstrcatA(path
, "Installer\\");
5423 lstrcatA(path
, prodcode
);
5424 lstrcatA(path
, "\\testicon");
5425 ok(file_exists(path
), "System-wide icon file isn't where it's expected (%s)\n", path
);
5427 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5428 ok(res
== ERROR_SUCCESS
, "Failed to uninstall system-wide\n");
5429 ok(!file_exists(path
), "System-wide icon file not removed (%s)\n", path
);
5431 delete_pfmsitest_files();
5432 DeleteFileA(msifile
);
5435 static void test_package_validation(void)
5439 if (is_process_limited())
5441 skip("process is limited\n");
5445 CreateDirectoryA("msitest", NULL
);
5446 create_file("msitest\\maximus", 500);
5447 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1033");
5449 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5451 r
= MsiInstallProductA(msifile
, NULL
);
5452 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5454 skip("Not enough rights to perform tests\n");
5457 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5458 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5459 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5461 DeleteFileA(msifile
);
5462 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;9999");
5464 r
= MsiInstallProductA(msifile
, NULL
);
5465 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5467 DeleteFileA(msifile
);
5468 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,1033;9999");
5470 r
= MsiInstallProductA(msifile
, NULL
);
5471 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5473 DeleteFileA(msifile
);
5474 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;1033");
5476 r
= MsiInstallProductA(msifile
, NULL
);
5477 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5478 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5479 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5481 DeleteFileA(msifile
);
5482 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel64,9999;1033");
5484 r
= MsiInstallProductA(msifile
, NULL
);
5485 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5487 DeleteFileA(msifile
);
5488 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,1033;1033");
5490 r
= MsiInstallProductA(msifile
, NULL
);
5491 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5493 DeleteFileA(msifile
);
5494 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,9999;1033");
5496 r
= MsiInstallProductA(msifile
, NULL
);
5497 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5499 DeleteFileA(msifile
);
5500 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9999");
5502 r
= MsiInstallProductA(msifile
, NULL
);
5503 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5504 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5505 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5507 if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH
, SUBLANG_ENGLISH_US
))
5509 DeleteFileA(msifile
);
5510 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9");
5511 r
= MsiInstallProductA(msifile
, NULL
);
5512 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5513 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5514 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5516 DeleteFileA(msifile
);
5517 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1024");
5518 r
= MsiInstallProductA(msifile
, NULL
);
5519 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5520 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5521 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5524 DeleteFileA(msifile
);
5525 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel32;0");
5527 r
= MsiInstallProductA(msifile
, NULL
);
5528 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5529 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5530 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5532 if (is_64bit
&& !is_wow64
)
5534 DeleteFileA(msifile
);
5535 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5537 r
= MsiInstallProductA(msifile
, NULL
);
5538 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5539 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5540 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5542 DeleteFileA(msifile
);
5543 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5545 r
= MsiInstallProductA(msifile
, NULL
);
5546 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5547 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5548 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5550 DeleteFileA(msifile
);
5551 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5553 r
= MsiInstallProductA(msifile
, NULL
);
5554 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5555 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5556 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5560 DeleteFileA(msifile
);
5561 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5563 r
= MsiInstallProductA(msifile
, NULL
);
5564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5565 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5566 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5568 DeleteFileA(msifile
);
5569 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5571 r
= MsiInstallProductA(msifile
, NULL
);
5572 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5573 ok(!delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5574 ok(!delete_pf_native("msitest", FALSE
), "directory exists\n");
5576 DeleteFileA(msifile
);
5577 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5579 r
= MsiInstallProductA(msifile
, NULL
);
5580 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5581 ok(delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5582 ok(delete_pf_native("msitest", FALSE
), "directory exists\n");
5586 DeleteFileA(msifile
);
5587 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
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");
5594 DeleteFileA(msifile
);
5595 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Alpha,Beta,Intel;0");
5597 r
= MsiInstallProductA(msifile
, NULL
);
5598 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5599 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5600 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5602 DeleteFileA(msifile
);
5603 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5605 r
= MsiInstallProductA(msifile
, NULL
);
5606 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5607 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5608 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5610 DeleteFileA(msifile
);
5611 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5613 r
= MsiInstallProductA(msifile
, NULL
);
5614 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5615 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5616 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5620 /* Delete the files in the temp (current) folder */
5621 DeleteFileA(msifile
);
5622 DeleteFileA("msitest\\maximus");
5623 RemoveDirectoryA("msitest");
5626 static void test_upgrade_code(void)
5630 if (is_process_limited())
5632 skip("process is limited\n");
5636 CreateDirectoryA("msitest", NULL
);
5637 create_file("msitest\\upgradecode.txt", 1000);
5638 create_database(msifile
, uc_tables
, sizeof(uc_tables
) / sizeof(msi_table
));
5640 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5642 r
= MsiInstallProductA(msifile
, NULL
);
5643 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5645 ok(pf_exists("msitest\\upgradecode.txt"), "file not installed\n");
5647 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5648 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5650 ok(!delete_pf("msitest\\upgradecode.txt", TRUE
), "file not removed\n");
5651 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5653 DeleteFileA("msitest\\upgradecode.txt");
5654 RemoveDirectoryA("msitest");
5655 DeleteFileA(msifile
);
5658 static void test_mixed_package(void)
5663 char value
[MAX_PATH
];
5666 if (is_process_limited())
5668 skip("process is limited\n");
5671 if (!is_wow64
&& !is_64bit
)
5673 skip("this test must be run on 64-bit\n");
5676 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5677 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "x64;1033");
5679 r
= MsiInstallProductA(msifile
, NULL
);
5680 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5682 skip("Not enough rights to perform tests\n");
5685 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5687 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5688 ok(!res
, "can't open 32-bit component key, got %d\n", res
);
5689 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5690 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5691 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5692 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5695 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5696 ok(!res
, "can't open 64-bit component key, got %d\n", res
);
5697 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5698 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5699 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5700 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5703 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5704 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5705 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5706 ok(res
== ERROR_SUCCESS
, "can't open 32-bit CLSID key, got %d\n", res
);
5707 if (res
== ERROR_SUCCESS
) {
5708 size
= sizeof(value
);
5709 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5710 ok(!strcmp(value
, "winetest32.dll"), "got %s\n", value
);
5714 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5715 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5716 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5717 ok(res
== ERROR_SUCCESS
, "can't open 64-bit CLSID key, got %d\n", res
);
5718 if (res
== ERROR_SUCCESS
) {
5719 size
= sizeof(value
);
5720 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5721 ok(!strcmp(value
, "winetest64.dll"), "got %s\n", value
);
5725 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5726 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5728 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5729 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5731 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5732 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5734 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5735 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5736 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5737 ok(res
== ERROR_FILE_NOT_FOUND
, "32-bit CLSID key not removed\n");
5739 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5740 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5741 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5742 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit CLSID key not removed\n");
5744 DeleteFileA( msifile
);
5745 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "Intel;1033");
5747 r
= MsiInstallProductA(msifile
, NULL
);
5748 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5750 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5751 ok(!res
, "can't open 32-bit component key, got %d\n", res
);
5752 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5753 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5754 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5755 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5758 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5759 ok(!res
, "can't open 64-bit component key, got %d\n", res
);
5760 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5761 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5762 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5763 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5766 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5767 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5768 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5769 ok(res
== ERROR_SUCCESS
, "can't open 32-bit CLSID key, got %d\n", res
);
5770 if (res
== ERROR_SUCCESS
) {
5771 size
= sizeof(value
);
5772 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5773 ok(!strcmp(value
, "winetest32.dll"), "got %s\n", value
);
5777 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5778 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5779 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5780 ok(res
== ERROR_SUCCESS
, "can't open 64-bit CLSID key, got %d\n", res
);
5781 if (res
== ERROR_SUCCESS
) {
5782 size
= sizeof(value
);
5783 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5784 ok(!strcmp(value
, "winetest64.dll"), "got %s\n", value
);
5788 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5791 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5792 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5794 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5795 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5797 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5798 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5799 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5800 ok(res
== ERROR_FILE_NOT_FOUND
, "32-bit CLSID key not removed\n");
5802 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5803 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5804 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5805 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit CLSID key not removed\n");
5808 DeleteFileA( msifile
);
5811 static void test_volume_props(void)
5815 if (is_process_limited())
5817 skip("process is limited\n");
5820 CreateDirectoryA("msitest", NULL
);
5821 create_file("msitest\\volumeprop.txt", 1000);
5822 create_database(msifile
, vp_tables
, sizeof(vp_tables
)/sizeof(msi_table
));
5824 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5826 r
= MsiInstallProductA(msifile
, NULL
);
5827 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5829 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5830 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5832 DeleteFileA("msitest\\volumeprop.txt");
5833 RemoveDirectoryA("msitest");
5834 DeleteFileA(msifile
);
5837 static void test_shared_component(void)
5841 if (is_process_limited())
5843 skip("process is limited\n");
5846 CreateDirectoryA("msitest", NULL
);
5847 create_file("msitest\\sharedcomponent.txt", 1000);
5848 create_database_wordcount(msifile
, shc_tables
, sizeof(shc_tables
)/sizeof(shc_tables
[0]),
5849 100, 0, ";", "{A8826420-FD72-4E61-9E15-C1944CF4CBE1}");
5850 create_database_wordcount(msifile2
, shc2_tables
, sizeof(shc2_tables
)/sizeof(shc2_tables
[0]),
5851 100, 0, ";", "{A8B50B30-0E8A-4ACD-B3CF-1A5DC58B2739}");
5853 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5855 r
= MsiInstallProductA(msifile
, NULL
);
5856 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5858 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5860 r
= MsiInstallProductA(msifile2
, NULL
);
5861 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5863 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5865 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5866 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5868 ok(pf_exists("msitest\\sharedcomponent.txt"), "file removed\n");
5870 r
= MsiInstallProductA(msifile2
, "REMOVE=ALL");
5871 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5873 ok(!pf_exists("msitest\\sharedcomponent.txt"), "file not removed\n");
5875 DeleteFileA("msitest\\sharedcomponent.txt");
5876 RemoveDirectoryA("msitest");
5877 DeleteFileA(msifile
);
5878 DeleteFileA(msifile2
);
5884 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
5885 STATEMGRSTATUS status
;
5888 init_functionpointers();
5890 if (pIsWow64Process
)
5891 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
5893 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
5894 GetTempPathA(MAX_PATH
, temp_path
);
5895 SetCurrentDirectoryA(temp_path
);
5897 lstrcpyA(CURR_DIR
, temp_path
);
5898 len
= lstrlenA(CURR_DIR
);
5900 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
5901 CURR_DIR
[len
- 1] = 0;
5903 ok(get_system_dirs(), "failed to retrieve system dirs\n");
5904 ok(get_user_dirs(), "failed to retrieve user dirs\n");
5906 /* Create a restore point ourselves so we circumvent the multitude of restore points
5907 * that would have been created by all the installation and removal tests.
5909 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
5910 * creation of restore points.
5912 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
5914 memset(&status
, 0, sizeof(status
));
5915 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
5918 /* Create only one log file and don't append. We have to pass something
5919 * for the log mode for this to work. The logfile needs to have an absolute
5920 * path otherwise we still end up with some extra logfiles as some tests
5921 * change the current directory.
5923 lstrcpyA(log_file
, temp_path
);
5924 lstrcatA(log_file
, "\\msitest.log");
5925 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
5927 if (pSRSetRestorePointA
) /* test has side-effects on win2k3 that cause failures in following tests */
5928 test_MsiInstallProduct();
5929 test_MsiSetComponentState();
5930 test_packagecoltypes();
5931 test_continuouscabs();
5934 test_samesequence();
5935 test_uiLevelFlags();
5936 test_readonlyfile();
5937 test_readonlyfile_cab();
5938 test_setdirproperty();
5939 test_cabisextracted();
5940 test_transformprop();
5941 test_currentworkingdir();
5945 test_sourcefolder();
5946 test_customaction51();
5947 test_installstate();
5949 test_missingcomponent();
5950 test_sourcedirprop();
5956 test_installed_prop();
5958 test_file_in_use_cab();
5959 test_allusers_prop();
5960 test_feature_override();
5962 test_package_validation();
5963 test_upgrade_code();
5964 test_mixed_package();
5965 test_volume_props();
5966 test_shared_component();
5968 DeleteFileA(log_file
);
5970 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
5972 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
5974 remove_restore_point(status
.llSequenceNumber
);
5976 FreeLibrary(hsrclient
);
5978 SetCurrentDirectoryA(prev_path
);