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>
35 #include "wine/test.h"
37 static UINT (WINAPI
*pMsiQueryComponentStateA
)
38 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
39 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
40 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
41 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
42 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
44 static BOOL (WINAPI
*pCheckTokenMembership
)(HANDLE
,PSID
,PBOOL
);
45 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
46 static BOOL (WINAPI
*pOpenProcessToken
)( HANDLE
, DWORD
, PHANDLE
);
47 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
48 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
50 static HMODULE hsrclient
= 0;
51 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
52 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
55 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
57 static const char *msifile
= "msitest.msi";
58 static const char *msifile2
= "winetest2.msi";
59 static const char *mstfile
= "winetest.mst";
61 static const WCHAR msifileW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
62 static const WCHAR msifile2W
[] = {'w','i','n','e','t','e','s','t','2','.','m','s','i',0};
64 static CHAR CURR_DIR
[MAX_PATH
];
65 static CHAR PROG_FILES_DIR
[MAX_PATH
];
66 static CHAR PROG_FILES_DIR_NATIVE
[MAX_PATH
];
67 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
68 static CHAR APP_DATA_DIR
[MAX_PATH
];
69 static CHAR WINDOWS_DIR
[MAX_PATH
];
71 /* msi database data */
73 static const CHAR component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
74 "s72\tS38\ts72\ti2\tS255\tS72\n"
75 "Component\tComponent\n"
76 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
77 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
78 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
79 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
80 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
81 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
82 "component\t\tMSITESTDIR\t0\t1\tfile\n"
83 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
85 static const CHAR directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
87 "Directory\tDirectory\n"
88 "CABOUTDIR\tMSITESTDIR\tcabout\n"
89 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
90 "FIRSTDIR\tMSITESTDIR\tfirst\n"
91 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
92 "NEWDIR\tCABOUTDIR\tnew\n"
93 "ProgramFilesFolder\tTARGETDIR\t.\n"
94 "TARGETDIR\t\tSourceDir";
96 static const CHAR feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
97 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
99 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
100 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
101 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
102 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
103 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
104 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
105 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
107 static const CHAR feature_comp_dat
[] = "Feature_\tComponent_\n"
109 "FeatureComponents\tFeature_\tComponent_\n"
115 "feature\tcomponent\n"
116 "service_feature\tservice_comp\n";
118 static const CHAR file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
119 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
121 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
122 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
123 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
124 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
125 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
126 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
127 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
129 static const CHAR install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
131 "InstallExecuteSequence\tAction\n"
132 "AllocateRegistrySpace\tNOT Installed\t1550\n"
133 "CostFinalize\t\t1000\n"
134 "CostInitialize\t\t800\n"
136 "ResolveSource\t\t950\n"
137 "MoveFiles\t\t1700\n"
138 "InstallFiles\t\t4000\n"
139 "DuplicateFiles\t\t4500\n"
140 "WriteEnvironmentStrings\t\t4550\n"
141 "CreateShortcuts\t\t4600\n"
142 "InstallServices\t\t5000\n"
143 "InstallFinalize\t\t6600\n"
144 "InstallInitialize\t\t1500\n"
145 "InstallValidate\t\t1400\n"
146 "LaunchConditions\t\t100\n"
147 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
149 static const CHAR media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
150 "i2\ti4\tL64\tS255\tS32\tS72\n"
152 "1\t3\t\t\tDISK1\t\n"
153 "2\t5\t\tmsitest.cab\tDISK2\t\n";
155 static const CHAR property_dat
[] = "Property\tValue\n"
157 "Property\tProperty\n"
158 "DefaultUIFont\tDlgFont8\n"
161 "InstallMode\tTypical\n"
162 "Manufacturer\tWine\n"
163 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
164 "PRIMARYFOLDER\tTARGETDIR\n"
165 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
167 "ProductLanguage\t1033\n"
168 "ProductName\tMSITEST\n"
169 "ProductVersion\t1.1.1\n"
170 "PROMPTROLLBACKCOST\tP\n"
172 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
173 "AdminProperties\tPOSTADMIN\n"
175 "SERVNAME\tTestService\n"
176 "SERVDISP\tTestServiceDisp\n"
177 "MSIFASTINSTALL\t1\n";
179 static const CHAR aup_property_dat
[] = "Property\tValue\n"
181 "Property\tProperty\n"
182 "DefaultUIFont\tDlgFont8\n"
186 "InstallMode\tTypical\n"
187 "Manufacturer\tWine\n"
188 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
189 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
191 "ProductLanguage\t1033\n"
192 "ProductName\tMSITEST\n"
193 "ProductVersion\t1.1.1\n"
194 "PROMPTROLLBACKCOST\tP\n"
196 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
197 "AdminProperties\tPOSTADMIN\n"
199 "SERVNAME\tTestService\n"
200 "SERVDISP\tTestServiceDisp\n"
201 "MSIFASTINSTALL\t1\n";
203 static const CHAR aup2_property_dat
[] = "Property\tValue\n"
205 "Property\tProperty\n"
206 "DefaultUIFont\tDlgFont8\n"
210 "InstallMode\tTypical\n"
211 "Manufacturer\tWine\n"
212 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
213 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
215 "ProductLanguage\t1033\n"
216 "ProductName\tMSITEST\n"
217 "ProductVersion\t1.1.1\n"
218 "PROMPTROLLBACKCOST\tP\n"
220 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
221 "AdminProperties\tPOSTADMIN\n"
223 "SERVNAME\tTestService\n"
224 "SERVDISP\tTestServiceDisp\n"
225 "MSIFASTINSTALL\t1\n";
227 static const CHAR icon_property_dat
[] = "Property\tValue\n"
229 "Property\tProperty\n"
230 "DefaultUIFont\tDlgFont8\n"
233 "InstallMode\tTypical\n"
234 "Manufacturer\tWine\n"
235 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
236 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
238 "ProductLanguage\t1033\n"
239 "ProductName\tMSITEST\n"
240 "ProductVersion\t1.1.1\n"
241 "PROMPTROLLBACKCOST\tP\n"
243 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
244 "AdminProperties\tPOSTADMIN\n"
246 "SERVNAME\tTestService\n"
247 "SERVDISP\tTestServiceDisp\n"
248 "MSIFASTINSTALL\t1\n";
250 static const CHAR shortcut_dat
[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
251 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
252 "Shortcut\tShortcut\n"
253 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
255 static const CHAR condition_dat
[] = "Feature_\tLevel\tCondition\n"
257 "Condition\tFeature_\tLevel\n"
260 static const CHAR up_property_dat
[] = "Property\tValue\n"
262 "Property\tProperty\n"
263 "DefaultUIFont\tDlgFont8\n"
266 "InstallMode\tTypical\n"
267 "Manufacturer\tWine\n"
268 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
269 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
271 "ProductLanguage\t1033\n"
272 "ProductName\tMSITEST\n"
273 "ProductVersion\t1.1.1\n"
274 "PROMPTROLLBACKCOST\tP\n"
276 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
277 "AdminProperties\tPOSTADMIN\n"
279 "SERVNAME\tTestService\n"
280 "SERVDISP\tTestServiceDisp\n"
281 "RemovePreviousVersions\t1\n"
282 "MSIFASTINSTALL\t1\n";
284 static const CHAR up2_property_dat
[] = "Property\tValue\n"
286 "Property\tProperty\n"
287 "DefaultUIFont\tDlgFont8\n"
290 "InstallMode\tTypical\n"
291 "Manufacturer\tWine\n"
292 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
293 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
295 "ProductLanguage\t1033\n"
296 "ProductName\tMSITEST\n"
297 "ProductVersion\t1.1.2\n"
298 "PROMPTROLLBACKCOST\tP\n"
300 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
301 "AdminProperties\tPOSTADMIN\n"
303 "SERVNAME\tTestService\n"
304 "SERVDISP\tTestServiceDisp\n"
305 "MSIFASTINSTALL\t1\n";
307 static const CHAR up3_property_dat
[] = "Property\tValue\n"
309 "Property\tProperty\n"
310 "DefaultUIFont\tDlgFont8\n"
313 "InstallMode\tTypical\n"
314 "Manufacturer\tWine\n"
315 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
316 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
318 "ProductLanguage\t1033\n"
319 "ProductName\tMSITEST\n"
320 "ProductVersion\t1.1.2\n"
321 "PROMPTROLLBACKCOST\tP\n"
323 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
324 "AdminProperties\tPOSTADMIN\n"
326 "SERVNAME\tTestService\n"
327 "SERVDISP\tTestServiceDisp\n"
328 "RemovePreviousVersions\t1\n"
329 "MSIFASTINSTALL\t1\n";
331 static const CHAR registry_dat
[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
332 "s72\ti2\tl255\tL255\tL0\ts72\n"
333 "Registry\tRegistry\n"
334 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
335 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
336 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
337 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
339 static const CHAR service_install_dat
[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
340 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
341 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
342 "ServiceInstall\tServiceInstall\n"
343 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
345 static const CHAR service_control_dat
[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
346 "s72\tl255\ti2\tL255\tI2\ts72\n"
347 "ServiceControl\tServiceControl\n"
348 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
350 /* tables for test_continuouscabs */
351 static const CHAR cc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
352 "s72\tS38\ts72\ti2\tS255\tS72\n"
353 "Component\tComponent\n"
354 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
355 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
356 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
358 static const CHAR cc2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
359 "s72\tS38\ts72\ti2\tS255\tS72\n"
360 "Component\tComponent\n"
361 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
362 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
363 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
365 static const CHAR cc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
366 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
368 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
370 static const CHAR cc_feature_comp_dat
[] = "Feature_\tComponent_\n"
372 "FeatureComponents\tFeature_\tComponent_\n"
374 "feature\taugustus\n"
377 static const CHAR cc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
378 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
380 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
381 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
382 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
384 static const CHAR cc2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
385 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
387 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
388 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
389 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
390 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
392 static const CHAR cc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
393 "i2\ti4\tL64\tS255\tS32\tS72\n"
395 "1\t10\t\ttest1.cab\tDISK1\t\n"
396 "2\t2\t\ttest2.cab\tDISK2\t\n"
397 "3\t12\t\ttest3.cab\tDISK3\t\n";
399 static const CHAR cc3_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
400 "i2\ti4\tL64\tS255\tS32\tS72\n"
402 "1\t10\t\ttest1.cab\tDISK1\t\n"
403 "2\t2\t\ttest2_.cab\tDISK2\t\n"
404 "3\t12\t\ttest3.cab\tDISK3\t\n";
406 static const CHAR co_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
407 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
409 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
410 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
411 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
413 static const CHAR co_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
414 "i2\ti4\tL64\tS255\tS32\tS72\n"
416 "1\t10\t\ttest1.cab\tDISK1\t\n"
417 "2\t2\t\ttest2.cab\tDISK2\t\n"
418 "3\t3\t\ttest3.cab\tDISK3\t\n";
420 static const CHAR co2_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
421 "i2\ti4\tL64\tS255\tS32\tS72\n"
423 "1\t10\t\ttest1.cab\tDISK1\t\n"
424 "2\t12\t\ttest3.cab\tDISK3\t\n"
425 "3\t2\t\ttest2.cab\tDISK2\t\n";
427 static const CHAR mm_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
428 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
430 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
431 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
432 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
434 static const CHAR mm_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
435 "i2\ti4\tL64\tS255\tS32\tS72\n"
437 "1\t3\t\ttest1.cab\tDISK1\t\n";
439 static const CHAR ss_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
440 "i2\ti4\tL64\tS255\tS32\tS72\n"
442 "1\t2\t\ttest1.cab\tDISK1\t\n"
443 "2\t2\t\ttest2.cab\tDISK2\t\n"
444 "3\t12\t\ttest3.cab\tDISK3\t\n";
446 /* tables for test_uiLevelFlags */
447 static const CHAR ui_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
448 "s72\tS38\ts72\ti2\tS255\tS72\n"
449 "Component\tComponent\n"
450 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
451 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
452 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
454 static const CHAR ui_install_ui_seq_dat
[] = "Action\tCondition\tSequence\n"
456 "InstallUISequence\tAction\n"
457 "SetUIProperty\t\t5\n"
458 "ExecuteAction\t\t1100\n";
460 static const CHAR ui_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
461 "s72\ti2\tS64\tS0\tS255\n"
462 "CustomAction\tAction\n"
463 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
465 static const CHAR rof_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
466 "s72\tS38\ts72\ti2\tS255\tS72\n"
467 "Component\tComponent\n"
468 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
470 static const CHAR rof_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
471 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
473 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
474 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
476 static const CHAR rof_feature_comp_dat
[] = "Feature_\tComponent_\n"
478 "FeatureComponents\tFeature_\tComponent_\n"
480 "montecristo\tmaximus";
482 static const CHAR rof_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
483 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
485 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
487 static const CHAR rof_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
488 "i2\ti4\tL64\tS255\tS32\tS72\n"
490 "1\t1\t\t\tDISK1\t\n";
492 static const CHAR rofc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
493 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
495 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
497 static const CHAR rofc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
498 "i2\ti4\tL64\tS255\tS32\tS72\n"
500 "1\t1\t\ttest1.cab\tDISK1\t\n";
502 static const CHAR sdp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
504 "InstallExecuteSequence\tAction\n"
505 "AllocateRegistrySpace\tNOT Installed\t1550\n"
506 "CostFinalize\t\t1000\n"
507 "CostInitialize\t\t800\n"
509 "InstallFiles\t\t4000\n"
510 "InstallFinalize\t\t6600\n"
511 "InstallInitialize\t\t1500\n"
512 "InstallValidate\t\t1400\n"
513 "LaunchConditions\t\t100\n"
514 "SetDirProperty\t\t950";
516 static const CHAR sdp_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
517 "s72\ti2\tS64\tS0\tS255\n"
518 "CustomAction\tAction\n"
519 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
521 static const CHAR pv_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
523 "InstallExecuteSequence\tAction\n"
524 "LaunchConditions\t\t100\n"
525 "CostInitialize\t\t800\n"
527 "CostFinalize\t\t1000\n"
528 "InstallValidate\t\t1400\n"
529 "InstallInitialize\t\t1500\n"
530 "InstallFiles\t\t4000\n"
531 "InstallFinalize\t\t6600\n";
533 static const CHAR cie_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
534 "s72\tS38\ts72\ti2\tS255\tS72\n"
535 "Component\tComponent\n"
536 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
537 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
538 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
539 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
541 static const CHAR cie_feature_comp_dat
[] = "Feature_\tComponent_\n"
543 "FeatureComponents\tFeature_\tComponent_\n"
545 "feature\taugustus\n"
549 static const CHAR cie_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
550 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
552 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
553 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
554 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
555 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
557 static const CHAR cie_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
558 "i2\ti4\tL64\tS255\tS32\tS72\n"
560 "1\t1\t\ttest1.cab\tDISK1\t\n"
561 "2\t2\t\ttest2.cab\tDISK2\t\n"
562 "3\t12\t\ttest3.cab\tDISK3\t\n";
564 static const CHAR ci_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
566 "InstallExecuteSequence\tAction\n"
567 "CostFinalize\t\t1000\n"
568 "CostInitialize\t\t800\n"
570 "InstallFiles\t\t4000\n"
571 "InstallServices\t\t5000\n"
572 "InstallFinalize\t\t6600\n"
573 "InstallInitialize\t\t1500\n"
574 "RunInstall\t\t1600\n"
575 "InstallValidate\t\t1400\n"
576 "LaunchConditions\t\t100";
578 static const CHAR ci_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
579 "s72\ti2\tS64\tS0\tS255\n"
580 "CustomAction\tAction\n"
581 "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n";
583 static const CHAR ci_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
584 "s72\tS38\ts72\ti2\tS255\tS72\n"
585 "Component\tComponent\n"
586 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
588 static const CHAR ci2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
589 "s72\tS38\ts72\ti2\tS255\tS72\n"
590 "Component\tComponent\n"
591 "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n";
593 static const CHAR ci2_feature_comp_dat
[] = "Feature_\tComponent_\n"
595 "FeatureComponents\tFeature_\tComponent_\n"
598 static const CHAR ci2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
599 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
601 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
603 static const CHAR pp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
605 "InstallExecuteSequence\tAction\n"
606 "ValidateProductID\t\t700\n"
607 "CostInitialize\t\t800\n"
609 "CostFinalize\t\t1000\n"
610 "InstallValidate\t\t1400\n"
611 "InstallInitialize\t\t1500\n"
612 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
613 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
614 "RemoveFiles\t\t3500\n"
615 "InstallFiles\t\t4000\n"
616 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
617 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
618 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
619 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
620 "InstallFinalize\t\t6600";
622 static const CHAR tp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
623 "s72\tS38\ts72\ti2\tS255\tS72\n"
624 "Component\tComponent\n"
625 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
627 static const CHAR cwd_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
628 "s72\tS38\ts72\ti2\tS255\tS72\n"
629 "Component\tComponent\n"
630 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
632 static const CHAR adm_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
633 "s72\tS38\ts72\ti2\tS255\tS72\n"
634 "Component\tComponent\n"
635 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
637 static const CHAR adm_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
638 "s72\ti2\tS64\tS0\tS255\n"
639 "CustomAction\tAction\n"
640 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
642 static const CHAR adm_admin_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
644 "AdminExecuteSequence\tAction\n"
645 "CostFinalize\t\t1000\n"
646 "CostInitialize\t\t800\n"
648 "SetPOSTADMIN\t\t950\n"
649 "InstallFiles\t\t4000\n"
650 "InstallFinalize\t\t6600\n"
651 "InstallInitialize\t\t1500\n"
652 "InstallValidate\t\t1400\n"
653 "LaunchConditions\t\t100";
655 static const CHAR amp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
656 "s72\tS38\ts72\ti2\tS255\tS72\n"
657 "Component\tComponent\n"
658 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
660 static const CHAR rem_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
661 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
663 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
664 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
665 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
667 static const CHAR rem_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
669 "InstallExecuteSequence\tAction\n"
670 "ValidateProductID\t\t700\n"
671 "CostInitialize\t\t800\n"
673 "CostFinalize\t\t1000\n"
674 "InstallValidate\t\t1400\n"
675 "InstallInitialize\t\t1500\n"
676 "ProcessComponents\t\t1600\n"
677 "UnpublishFeatures\t\t1800\n"
678 "RemoveFiles\t\t3500\n"
679 "InstallFiles\t\t4000\n"
680 "RegisterProduct\t\t6100\n"
681 "PublishFeatures\t\t6300\n"
682 "PublishProduct\t\t6400\n"
683 "InstallFinalize\t\t6600";
685 static const CHAR mc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
686 "s72\tS38\ts72\ti2\tS255\tS72\n"
687 "Component\tComponent\n"
688 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
689 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
690 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
691 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
692 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
694 static const CHAR mc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
695 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
697 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
698 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
699 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
700 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
701 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
703 static const CHAR mc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
704 "i2\ti4\tL64\tS255\tS32\tS72\n"
706 "1\t1\t\ttest1.cab\tDISK1\t\n"
707 "2\t2\t\ttest2.cab\tDISK2\t\n"
708 "3\t3\t\ttest3.cab\tDISK3\t\n"
709 "4\t4\t\ttest3.cab\tDISK3\t\n"
710 "5\t5\t\ttest4.cab\tDISK4\t\n";
712 static const CHAR mc_file_hash_dat
[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
713 "s72\ti2\ti4\ti4\ti4\ti4\n"
714 "MsiFileHash\tFile_\n"
715 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
717 static const CHAR wrv_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
718 "s72\tS38\ts72\ti2\tS255\tS72\n"
719 "Component\tComponent\n"
720 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
722 static const CHAR ca51_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
723 "s72\tS38\ts72\ti2\tS255\tS72\n"
724 "Component\tComponent\n"
725 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
727 static const CHAR ca51_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
729 "InstallExecuteSequence\tAction\n"
730 "ValidateProductID\t\t700\n"
731 "GoodSetProperty\t\t725\n"
732 "BadSetProperty\t\t750\n"
733 "CostInitialize\t\t800\n"
734 "ResolveSource\t\t810\n"
736 "SetSourceDir\tSRCDIR\t910\n"
737 "CostFinalize\t\t1000\n"
738 "InstallValidate\t\t1400\n"
739 "InstallInitialize\t\t1500\n"
740 "InstallFiles\t\t4000\n"
741 "InstallFinalize\t\t6600";
743 static const CHAR ca51_custom_action_dat
[] = "Action\tType\tSource\tTarget\n"
745 "CustomAction\tAction\n"
746 "GoodSetProperty\t51\tMYPROP\t42\n"
747 "BadSetProperty\t51\t\tMYPROP\n"
748 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
750 static const CHAR is_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
751 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
753 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
754 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
755 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
756 "four\t\t\t\t2\t0\t\t0"; /* disabled */
758 static const CHAR is_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
759 "s72\tS38\ts72\ti2\tS255\tS72\n"
760 "Component\tComponent\n"
761 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
762 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
763 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
764 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
765 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
766 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
767 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
768 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
769 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
770 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
771 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
772 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
774 static const CHAR is_feature_comp_dat
[] = "Feature_\tComponent_\n"
776 "FeatureComponents\tFeature_\tComponent_\n"
790 static const CHAR is_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
791 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
793 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
794 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
795 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
796 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
797 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
798 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
799 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
800 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
801 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
802 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
803 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
804 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
806 static const CHAR is_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
807 "i2\ti4\tL64\tS255\tS32\tS72\n"
809 "1\t12\t\t\tDISK1\t\n";
811 static const CHAR sp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
812 "s72\tS38\ts72\ti2\tS255\tS72\n"
813 "Component\tComponent\n"
814 "augustus\t\tTWODIR\t0\t\taugustus\n";
816 static const CHAR sp_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
818 "Directory\tDirectory\n"
819 "TARGETDIR\t\tSourceDir\n"
820 "ProgramFilesFolder\tTARGETDIR\t.\n"
821 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
822 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
823 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
825 static const CHAR mcp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
826 "s72\tS38\ts72\ti2\tS255\tS72\n"
827 "Component\tComponent\n"
828 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
829 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
830 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
832 static const CHAR mcp_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
833 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
835 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
836 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
837 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
839 static const CHAR mcp_feature_comp_dat
[] = "Feature_\tComponent_\n"
841 "FeatureComponents\tFeature_\tComponent_\n"
842 "hydroxyl\thydrogen\n"
846 static const CHAR mcp_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
847 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
849 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
850 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
851 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
852 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
854 static const CHAR ai_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
855 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
857 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
858 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
859 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
860 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
861 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
862 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
863 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
865 static const CHAR ip_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
867 "InstallExecuteSequence\tAction\n"
868 "CostFinalize\t\t1000\n"
869 "ValidateProductID\t\t700\n"
870 "CostInitialize\t\t800\n"
872 "RemoveFiles\t\t3500\n"
873 "InstallFiles\t\t4000\n"
874 "RegisterUser\t\t6000\n"
875 "RegisterProduct\t\t6100\n"
876 "PublishFeatures\t\t6300\n"
877 "PublishProduct\t\t6400\n"
878 "InstallFinalize\t\t6600\n"
879 "InstallInitialize\t\t1500\n"
880 "ProcessComponents\t\t1600\n"
881 "UnpublishFeatures\t\t1800\n"
882 "InstallValidate\t\t1400\n"
883 "LaunchConditions\t\t100\n"
884 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
886 static const CHAR ip_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
887 "s72\ti2\tS64\tS0\tS255\n"
888 "CustomAction\tAction\n"
889 "TestInstalledProp\t19\t\tTest failed\t\n";
891 static const CHAR aup_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
893 "InstallExecuteSequence\tAction\n"
894 "CostFinalize\t\t1000\n"
895 "ValidateProductID\t\t700\n"
896 "CostInitialize\t\t800\n"
898 "RemoveFiles\t\t3500\n"
899 "InstallFiles\t\t4000\n"
900 "RegisterUser\t\t6000\n"
901 "RegisterProduct\t\t6100\n"
902 "PublishFeatures\t\t6300\n"
903 "PublishProduct\t\t6400\n"
904 "InstallFinalize\t\t6600\n"
905 "InstallInitialize\t\t1500\n"
906 "ProcessComponents\t\t1600\n"
907 "UnpublishFeatures\t\t1800\n"
908 "InstallValidate\t\t1400\n"
909 "LaunchConditions\t\t100\n"
910 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
912 static const CHAR aup2_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
914 "InstallExecuteSequence\tAction\n"
915 "CostFinalize\t\t1000\n"
916 "ValidateProductID\t\t700\n"
917 "CostInitialize\t\t800\n"
919 "RemoveFiles\t\t3500\n"
920 "InstallFiles\t\t4000\n"
921 "RegisterUser\t\t6000\n"
922 "RegisterProduct\t\t6100\n"
923 "PublishFeatures\t\t6300\n"
924 "PublishProduct\t\t6400\n"
925 "InstallFinalize\t\t6600\n"
926 "InstallInitialize\t\t1500\n"
927 "ProcessComponents\t\t1600\n"
928 "UnpublishFeatures\t\t1800\n"
929 "InstallValidate\t\t1400\n"
930 "LaunchConditions\t\t100\n"
931 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
933 static const CHAR aup3_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
935 "InstallExecuteSequence\tAction\n"
936 "CostFinalize\t\t1000\n"
937 "ValidateProductID\t\t700\n"
938 "CostInitialize\t\t800\n"
940 "RemoveFiles\t\t3500\n"
941 "InstallFiles\t\t4000\n"
942 "RegisterUser\t\t6000\n"
943 "RegisterProduct\t\t6100\n"
944 "PublishFeatures\t\t6300\n"
945 "PublishProduct\t\t6400\n"
946 "InstallFinalize\t\t6600\n"
947 "InstallInitialize\t\t1500\n"
948 "ProcessComponents\t\t1600\n"
949 "UnpublishFeatures\t\t1800\n"
950 "InstallValidate\t\t1400\n"
951 "LaunchConditions\t\t100\n"
952 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
954 static const CHAR aup_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
955 "s72\ti2\tS64\tS0\tS255\n"
956 "CustomAction\tAction\n"
957 "TestAllUsersProp\t19\t\tTest failed\t\n";
959 static const CHAR fo_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
960 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
962 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
963 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
964 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
966 static const CHAR fo_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
967 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
969 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
970 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
971 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
973 static const CHAR fo_condition_dat
[] = "Feature_\tLevel\tCondition\n"
975 "Condition\tFeature_\tLevel\n"
976 "preselected\t0\tPreselected\n"
977 "notpreselected\t0\tNOT Preselected\n";
979 static const CHAR fo_feature_comp_dat
[] = "Feature_\tComponent_\n"
981 "FeatureComponents\tFeature_\tComponent_\n"
982 "override\toverride\n"
983 "preselected\tpreselected\n"
984 "notpreselected\tnotpreselected\n";
986 static const CHAR fo_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
987 "s72\tS38\ts72\ti2\tS255\tS72\n"
988 "Component\tComponent\n"
989 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
990 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
991 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
993 static const CHAR fo_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
994 "s72\ti2\tS64\tS0\tS255\n"
995 "CustomAction\tAction\n"
996 "SetPreselected\t51\tPreselected\t1\t\n";
998 static const CHAR fo_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
1000 "InstallExecuteSequence\tAction\n"
1001 "LaunchConditions\t\t100\n"
1002 "SetPreselected\tpreselect=1\t200\n"
1003 "CostInitialize\t\t800\n"
1005 "CostFinalize\t\t1000\n"
1006 "InstallValidate\t\t1400\n"
1007 "InstallInitialize\t\t1500\n"
1008 "ProcessComponents\t\t1600\n"
1009 "RemoveFiles\t\t1700\n"
1010 "InstallFiles\t\t2000\n"
1011 "RegisterProduct\t\t5000\n"
1012 "PublishFeatures\t\t5100\n"
1013 "PublishProduct\t\t5200\n"
1014 "InstallFinalize\t\t6000\n";
1016 static const CHAR uc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1017 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1019 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
1021 static const CHAR uc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1022 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1023 "Feature\tFeature\n"
1024 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
1026 static const CHAR uc_feature_comp_dat
[] = "Feature_\tComponent_\n"
1028 "FeatureComponents\tFeature_\tComponent_\n"
1029 "upgradecode\tupgradecode\n";
1031 static const CHAR uc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1032 "s72\tS38\ts72\ti2\tS255\tS72\n"
1033 "Component\tComponent\n"
1034 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
1036 static const CHAR uc_property_dat
[] = "Property\tValue\n"
1038 "Property\tProperty\n"
1040 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
1041 "ProductName\tMSITEST\n"
1042 "ProductVersion\t1.1.1\n"
1043 "UpgradeCode\t#UPGEADECODE#\n"
1044 "MSIFASTINSTALL\t1\n";
1046 static const CHAR uc_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
1048 "InstallExecuteSequence\tAction\n"
1049 "LaunchConditions\t\t100\n"
1050 "CostInitialize\t\t200\n"
1052 "CostFinalize\t\t400\n"
1053 "InstallInitialize\t\t500\n"
1054 "ProcessComponents\t\t600\n"
1055 "InstallValidate\t\t700\n"
1056 "RemoveFiles\t\t800\n"
1057 "InstallFiles\t\t900\n"
1058 "RegisterProduct\t\t1000\n"
1059 "PublishFeatures\t\t1100\n"
1060 "PublishProduct\t\t1200\n"
1061 "InstallFinalize\t\t1300\n";
1063 static const char mixed_feature_dat
[] =
1064 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1065 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1066 "Feature\tFeature\n"
1067 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1068 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1070 static const char mixed_feature_comp_dat
[] =
1071 "Feature_\tComponent_\n"
1073 "FeatureComponents\tFeature_\tComponent_\n"
1075 "feature2\tcomp2\n";
1077 static const char mixed_component_dat
[] =
1078 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1079 "s72\tS38\ts72\ti2\tS255\tS72\n"
1080 "Component\tComponent\n"
1081 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1082 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1084 static const char mixed_registry_dat
[] =
1085 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1086 "s72\ti2\tl255\tL255\tL0\ts72\n"
1087 "Registry\tRegistry\n"
1088 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1089 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n";
1091 static const char mixed_install_exec_seq_dat
[] =
1092 "Action\tCondition\tSequence\n"
1094 "InstallExecuteSequence\tAction\n"
1095 "LaunchConditions\t\t100\n"
1096 "CostInitialize\t\t200\n"
1098 "CostFinalize\t\t400\n"
1099 "InstallValidate\t\t500\n"
1100 "InstallInitialize\t\t600\n"
1101 "ProcessComponents\t\t700\n"
1102 "UnpublishFeatures\t\t800\n"
1103 "RemoveRegistryValues\t\t900\n"
1104 "WriteRegistryValues\t\t1000\n"
1105 "RegisterProduct\t\t1100\n"
1106 "PublishFeatures\t\t1200\n"
1107 "PublishProduct\t\t1300\n"
1108 "InstallFinalize\t\t1400\n";
1110 static const char vp_file_dat
[] =
1111 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1112 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1114 "volumeprop\tcomp\tvolumeprop.txt\t1000\t\t\t8192\t1\n";
1116 static const char vp_feature_dat
[] =
1117 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1118 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1119 "Feature\tFeature\n"
1120 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1122 static const char vp_feature_comp_dat
[] =
1123 "Feature_\tComponent_\n"
1125 "FeatureComponents\tFeature_\tComponent_\n"
1128 static const char vp_component_dat
[] =
1129 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1130 "s72\tS38\ts72\ti2\tS255\tS72\n"
1131 "Component\tComponent\n"
1132 "comp\t{24364AE7-5B7F-496C-AF5A-54893639C567}\tMSITESTDIR\t0\t\tvolumeprop\n";
1134 static const char vp_custom_action_dat
[] =
1135 "Action\tType\tSource\tTarget\tISComments\n"
1136 "s72\ti2\tS64\tS0\tS255\n"
1137 "CustomAction\tAction\n"
1138 "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n"
1139 "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n"
1140 "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n"
1141 "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n"
1142 "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n"
1143 "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n";
1145 static const char vp_install_exec_seq_dat
[] =
1146 "Action\tCondition\tSequence\n"
1148 "InstallExecuteSequence\tAction\n"
1149 "LaunchConditions\t\t100\n"
1150 "CostInitialize\t\t200\n"
1152 "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n"
1153 "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n"
1154 "CostFinalize\t\t600\n"
1155 "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n"
1156 "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n"
1157 "InstallValidate\t\t900\n"
1158 "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n"
1159 "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n"
1160 "InstallInitialize\t\t1200\n"
1161 "ProcessComponents\t\t1300\n"
1162 "RemoveFiles\t\t1400\n"
1163 "InstallFiles\t\t1500\n"
1164 "RegisterProduct\t\t1600\n"
1165 "PublishFeatures\t\t1700\n"
1166 "PublishProduct\t\t1800\n"
1167 "InstallFinalize\t\t1900\n";
1169 static const char shc_property_dat
[] =
1172 "Property\tProperty\n"
1174 "ProductCode\t{5CD99CD0-69C7-409B-9905-82DD743CC840}\n"
1175 "ProductName\tMSITEST\n"
1176 "ProductVersion\t1.1.1\n"
1177 "MSIFASTINSTALL\t1\n";
1179 static const char shc2_property_dat
[] =
1182 "Property\tProperty\n"
1184 "ProductCode\t{4CEFADE5-DAFB-4C21-8EF2-4ED4F139F340}\n"
1185 "ProductName\tMSITEST2\n"
1186 "ProductVersion\t1.1.1\n"
1187 "MSIFASTINSTALL\t1\n";
1189 static const char shc_file_dat
[] =
1190 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1191 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1193 "sharedcomponent\tsharedcomponent\tsharedcomponent.txt\t1000\t\t\t8192\t1\n";
1195 static const char shc_feature_dat
[] =
1196 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1197 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1198 "Feature\tFeature\n"
1199 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1201 static const char shc_feature_comp_dat
[] =
1202 "Feature_\tComponent_\n"
1204 "FeatureComponents\tFeature_\tComponent_\n"
1205 "feature\tsharedcomponent\n";
1207 static const char shc_component_dat
[] =
1208 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1209 "s72\tS38\ts72\ti2\tS255\tS72\n"
1210 "Component\tComponent\n"
1211 "sharedcomponent\t{900A4ACB-DC6F-4795-A04B-81B530183D41}\tMSITESTDIR\t0\t\tsharedcomponent\n";
1213 static const char shc_custom_action_dat
[] =
1214 "Action\tType\tSource\tTarget\tISComments\n"
1215 "s72\ti2\tS64\tS0\tS255\n"
1216 "CustomAction\tAction\n"
1217 "TestComponentAction\t19\t\twrong component action on install\t\n";
1219 static const char shc_install_exec_seq_dat
[] =
1220 "Action\tCondition\tSequence\n"
1222 "InstallExecuteSequence\tAction\n"
1223 "LaunchConditions\t\t100\n"
1224 "CostInitialize\t\t200\n"
1226 "CostFinalize\t\t600\n"
1227 "InstallValidate\t\t900\n"
1228 "InstallInitialize\t\t1200\n"
1229 "ProcessComponents\t\t1300\n"
1230 "RemoveFiles\t\t1400\n"
1231 "InstallFiles\t\t1500\n"
1232 "TestComponentAction\tNOT REMOVE AND ($sharedcomponent <> 3)\t1600\n"
1233 "RegisterProduct\t\t1700\n"
1234 "PublishFeatures\t\t1800\n"
1235 "PublishProduct\t\t1900\n"
1236 "InstallFinalize\t\t2000\n";
1238 typedef struct _msi_table
1240 const CHAR
*filename
;
1245 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1247 static const msi_table tables
[] =
1249 ADD_TABLE(component
),
1250 ADD_TABLE(directory
),
1252 ADD_TABLE(feature_comp
),
1254 ADD_TABLE(install_exec_seq
),
1256 ADD_TABLE(property
),
1257 ADD_TABLE(registry
),
1258 ADD_TABLE(service_install
),
1259 ADD_TABLE(service_control
)
1262 static const msi_table sc_tables
[] =
1264 ADD_TABLE(component
),
1265 ADD_TABLE(directory
),
1267 ADD_TABLE(feature_comp
),
1269 ADD_TABLE(install_exec_seq
),
1271 ADD_TABLE(property
),
1275 static const msi_table ps_tables
[] =
1277 ADD_TABLE(component
),
1278 ADD_TABLE(directory
),
1280 ADD_TABLE(feature_comp
),
1282 ADD_TABLE(install_exec_seq
),
1284 ADD_TABLE(property
),
1285 ADD_TABLE(condition
)
1288 static const msi_table up_tables
[] =
1290 ADD_TABLE(component
),
1291 ADD_TABLE(directory
),
1293 ADD_TABLE(feature_comp
),
1295 ADD_TABLE(install_exec_seq
),
1297 ADD_TABLE(up_property
),
1298 ADD_TABLE(registry
),
1299 ADD_TABLE(service_install
),
1300 ADD_TABLE(service_control
)
1303 static const msi_table up2_tables
[] =
1305 ADD_TABLE(component
),
1306 ADD_TABLE(directory
),
1308 ADD_TABLE(feature_comp
),
1310 ADD_TABLE(install_exec_seq
),
1312 ADD_TABLE(up2_property
),
1313 ADD_TABLE(registry
),
1314 ADD_TABLE(service_install
),
1315 ADD_TABLE(service_control
)
1318 static const msi_table up3_tables
[] =
1320 ADD_TABLE(component
),
1321 ADD_TABLE(directory
),
1323 ADD_TABLE(feature_comp
),
1325 ADD_TABLE(install_exec_seq
),
1327 ADD_TABLE(up3_property
),
1328 ADD_TABLE(registry
),
1329 ADD_TABLE(service_install
),
1330 ADD_TABLE(service_control
)
1333 static const msi_table up4_tables
[] =
1335 ADD_TABLE(component
),
1336 ADD_TABLE(directory
),
1338 ADD_TABLE(feature_comp
),
1340 ADD_TABLE(pp_install_exec_seq
),
1342 ADD_TABLE(property
),
1343 ADD_TABLE(registry
),
1344 ADD_TABLE(service_install
),
1345 ADD_TABLE(service_control
)
1348 static const msi_table up5_tables
[] =
1350 ADD_TABLE(component
),
1351 ADD_TABLE(directory
),
1353 ADD_TABLE(feature_comp
),
1355 ADD_TABLE(pp_install_exec_seq
),
1357 ADD_TABLE(up_property
),
1358 ADD_TABLE(registry
),
1359 ADD_TABLE(service_install
),
1360 ADD_TABLE(service_control
)
1363 static const msi_table up6_tables
[] =
1365 ADD_TABLE(component
),
1366 ADD_TABLE(directory
),
1368 ADD_TABLE(feature_comp
),
1370 ADD_TABLE(pp_install_exec_seq
),
1372 ADD_TABLE(up2_property
),
1373 ADD_TABLE(registry
),
1374 ADD_TABLE(service_install
),
1375 ADD_TABLE(service_control
)
1378 static const msi_table up7_tables
[] =
1380 ADD_TABLE(component
),
1381 ADD_TABLE(directory
),
1383 ADD_TABLE(feature_comp
),
1385 ADD_TABLE(pp_install_exec_seq
),
1387 ADD_TABLE(up3_property
),
1388 ADD_TABLE(registry
),
1389 ADD_TABLE(service_install
),
1390 ADD_TABLE(service_control
)
1393 static const msi_table cc_tables
[] =
1395 ADD_TABLE(cc_component
),
1396 ADD_TABLE(directory
),
1397 ADD_TABLE(cc_feature
),
1398 ADD_TABLE(cc_feature_comp
),
1400 ADD_TABLE(install_exec_seq
),
1401 ADD_TABLE(cc_media
),
1402 ADD_TABLE(property
),
1405 static const msi_table cc2_tables
[] =
1407 ADD_TABLE(cc2_component
),
1408 ADD_TABLE(directory
),
1409 ADD_TABLE(cc_feature
),
1410 ADD_TABLE(cc_feature_comp
),
1411 ADD_TABLE(cc2_file
),
1412 ADD_TABLE(install_exec_seq
),
1413 ADD_TABLE(cc_media
),
1414 ADD_TABLE(property
),
1417 static const msi_table cc3_tables
[] =
1419 ADD_TABLE(cc_component
),
1420 ADD_TABLE(directory
),
1421 ADD_TABLE(cc_feature
),
1422 ADD_TABLE(cc_feature_comp
),
1424 ADD_TABLE(install_exec_seq
),
1425 ADD_TABLE(cc3_media
),
1426 ADD_TABLE(property
),
1429 static const msi_table co_tables
[] =
1431 ADD_TABLE(cc_component
),
1432 ADD_TABLE(directory
),
1433 ADD_TABLE(cc_feature
),
1434 ADD_TABLE(cc_feature_comp
),
1436 ADD_TABLE(install_exec_seq
),
1437 ADD_TABLE(co_media
),
1438 ADD_TABLE(property
),
1441 static const msi_table co2_tables
[] =
1443 ADD_TABLE(cc_component
),
1444 ADD_TABLE(directory
),
1445 ADD_TABLE(cc_feature
),
1446 ADD_TABLE(cc_feature_comp
),
1448 ADD_TABLE(install_exec_seq
),
1449 ADD_TABLE(co2_media
),
1450 ADD_TABLE(property
),
1453 static const msi_table mm_tables
[] =
1455 ADD_TABLE(cc_component
),
1456 ADD_TABLE(directory
),
1457 ADD_TABLE(cc_feature
),
1458 ADD_TABLE(cc_feature_comp
),
1460 ADD_TABLE(install_exec_seq
),
1461 ADD_TABLE(mm_media
),
1462 ADD_TABLE(property
),
1465 static const msi_table ss_tables
[] =
1467 ADD_TABLE(cc_component
),
1468 ADD_TABLE(directory
),
1469 ADD_TABLE(cc_feature
),
1470 ADD_TABLE(cc_feature_comp
),
1472 ADD_TABLE(install_exec_seq
),
1473 ADD_TABLE(ss_media
),
1474 ADD_TABLE(property
),
1477 static const msi_table ui_tables
[] =
1479 ADD_TABLE(ui_component
),
1480 ADD_TABLE(directory
),
1481 ADD_TABLE(cc_feature
),
1482 ADD_TABLE(cc_feature_comp
),
1484 ADD_TABLE(install_exec_seq
),
1485 ADD_TABLE(ui_install_ui_seq
),
1486 ADD_TABLE(ui_custom_action
),
1487 ADD_TABLE(cc_media
),
1488 ADD_TABLE(property
),
1491 static const msi_table rof_tables
[] =
1493 ADD_TABLE(rof_component
),
1494 ADD_TABLE(directory
),
1495 ADD_TABLE(rof_feature
),
1496 ADD_TABLE(rof_feature_comp
),
1497 ADD_TABLE(rof_file
),
1498 ADD_TABLE(install_exec_seq
),
1499 ADD_TABLE(rof_media
),
1500 ADD_TABLE(property
),
1503 static const msi_table rofc_tables
[] =
1505 ADD_TABLE(rof_component
),
1506 ADD_TABLE(directory
),
1507 ADD_TABLE(rof_feature
),
1508 ADD_TABLE(rof_feature_comp
),
1509 ADD_TABLE(rofc_file
),
1510 ADD_TABLE(install_exec_seq
),
1511 ADD_TABLE(rofc_media
),
1512 ADD_TABLE(property
),
1515 static const msi_table sdp_tables
[] =
1517 ADD_TABLE(rof_component
),
1518 ADD_TABLE(directory
),
1519 ADD_TABLE(rof_feature
),
1520 ADD_TABLE(rof_feature_comp
),
1521 ADD_TABLE(rof_file
),
1522 ADD_TABLE(sdp_install_exec_seq
),
1523 ADD_TABLE(sdp_custom_action
),
1524 ADD_TABLE(rof_media
),
1525 ADD_TABLE(property
),
1528 static const msi_table cie_tables
[] =
1530 ADD_TABLE(cie_component
),
1531 ADD_TABLE(directory
),
1532 ADD_TABLE(cc_feature
),
1533 ADD_TABLE(cie_feature_comp
),
1534 ADD_TABLE(cie_file
),
1535 ADD_TABLE(install_exec_seq
),
1536 ADD_TABLE(cie_media
),
1537 ADD_TABLE(property
),
1540 static const msi_table ci_tables
[] =
1542 ADD_TABLE(ci_component
),
1543 ADD_TABLE(directory
),
1544 ADD_TABLE(rof_feature
),
1545 ADD_TABLE(rof_feature_comp
),
1546 ADD_TABLE(rof_file
),
1547 ADD_TABLE(ci_install_exec_seq
),
1548 ADD_TABLE(rof_media
),
1549 ADD_TABLE(property
),
1550 ADD_TABLE(ci_custom_action
),
1553 static const msi_table ci2_tables
[] =
1555 ADD_TABLE(ci2_component
),
1556 ADD_TABLE(directory
),
1557 ADD_TABLE(rof_feature
),
1558 ADD_TABLE(ci2_feature_comp
),
1559 ADD_TABLE(ci2_file
),
1560 ADD_TABLE(install_exec_seq
),
1561 ADD_TABLE(rof_media
),
1562 ADD_TABLE(property
),
1565 static const msi_table tp_tables
[] =
1567 ADD_TABLE(tp_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 cwd_tables
[] =
1579 ADD_TABLE(cwd_component
),
1580 ADD_TABLE(directory
),
1581 ADD_TABLE(rof_feature
),
1582 ADD_TABLE(ci2_feature_comp
),
1583 ADD_TABLE(ci2_file
),
1584 ADD_TABLE(install_exec_seq
),
1585 ADD_TABLE(rof_media
),
1586 ADD_TABLE(property
),
1589 static const msi_table adm_tables
[] =
1591 ADD_TABLE(adm_component
),
1592 ADD_TABLE(directory
),
1593 ADD_TABLE(rof_feature
),
1594 ADD_TABLE(ci2_feature_comp
),
1595 ADD_TABLE(ci2_file
),
1596 ADD_TABLE(install_exec_seq
),
1597 ADD_TABLE(rof_media
),
1598 ADD_TABLE(property
),
1599 ADD_TABLE(adm_custom_action
),
1600 ADD_TABLE(adm_admin_exec_seq
),
1603 static const msi_table amp_tables
[] =
1605 ADD_TABLE(amp_component
),
1606 ADD_TABLE(directory
),
1607 ADD_TABLE(rof_feature
),
1608 ADD_TABLE(ci2_feature_comp
),
1609 ADD_TABLE(ci2_file
),
1610 ADD_TABLE(install_exec_seq
),
1611 ADD_TABLE(rof_media
),
1612 ADD_TABLE(property
),
1615 static const msi_table mc_tables
[] =
1617 ADD_TABLE(mc_component
),
1618 ADD_TABLE(directory
),
1619 ADD_TABLE(cc_feature
),
1620 ADD_TABLE(cie_feature_comp
),
1622 ADD_TABLE(install_exec_seq
),
1623 ADD_TABLE(mc_media
),
1624 ADD_TABLE(property
),
1625 ADD_TABLE(mc_file_hash
),
1628 static const msi_table sf_tables
[] =
1630 ADD_TABLE(wrv_component
),
1631 ADD_TABLE(directory
),
1632 ADD_TABLE(rof_feature
),
1633 ADD_TABLE(ci2_feature_comp
),
1634 ADD_TABLE(ci2_file
),
1635 ADD_TABLE(install_exec_seq
),
1636 ADD_TABLE(rof_media
),
1637 ADD_TABLE(property
),
1640 static const msi_table ca51_tables
[] =
1642 ADD_TABLE(ca51_component
),
1643 ADD_TABLE(directory
),
1644 ADD_TABLE(rof_feature
),
1645 ADD_TABLE(ci2_feature_comp
),
1646 ADD_TABLE(ci2_file
),
1647 ADD_TABLE(ca51_install_exec_seq
),
1648 ADD_TABLE(rof_media
),
1649 ADD_TABLE(property
),
1650 ADD_TABLE(ca51_custom_action
),
1653 static const msi_table is_tables
[] =
1655 ADD_TABLE(is_component
),
1656 ADD_TABLE(directory
),
1657 ADD_TABLE(is_feature
),
1658 ADD_TABLE(is_feature_comp
),
1660 ADD_TABLE(install_exec_seq
),
1661 ADD_TABLE(is_media
),
1662 ADD_TABLE(property
),
1665 static const msi_table sp_tables
[] =
1667 ADD_TABLE(sp_component
),
1668 ADD_TABLE(sp_directory
),
1669 ADD_TABLE(rof_feature
),
1670 ADD_TABLE(ci2_feature_comp
),
1671 ADD_TABLE(ci2_file
),
1672 ADD_TABLE(install_exec_seq
),
1673 ADD_TABLE(rof_media
),
1674 ADD_TABLE(property
),
1677 static const msi_table mcp_tables
[] =
1679 ADD_TABLE(mcp_component
),
1680 ADD_TABLE(directory
),
1681 ADD_TABLE(mcp_feature
),
1682 ADD_TABLE(mcp_feature_comp
),
1683 ADD_TABLE(mcp_file
),
1684 ADD_TABLE(rem_install_exec_seq
),
1685 ADD_TABLE(rof_media
),
1686 ADD_TABLE(property
),
1689 static const msi_table ai_tables
[] =
1691 ADD_TABLE(component
),
1692 ADD_TABLE(directory
),
1694 ADD_TABLE(feature_comp
),
1696 ADD_TABLE(install_exec_seq
),
1701 static const msi_table pc_tables
[] =
1703 ADD_TABLE(ca51_component
),
1704 ADD_TABLE(directory
),
1705 ADD_TABLE(rof_feature
),
1706 ADD_TABLE(ci2_feature_comp
),
1707 ADD_TABLE(ci2_file
),
1708 ADD_TABLE(install_exec_seq
),
1709 ADD_TABLE(rof_media
),
1713 static const msi_table ip_tables
[] =
1715 ADD_TABLE(component
),
1716 ADD_TABLE(directory
),
1718 ADD_TABLE(feature_comp
),
1720 ADD_TABLE(ip_install_exec_seq
),
1721 ADD_TABLE(ip_custom_action
),
1726 static const msi_table aup_tables
[] =
1728 ADD_TABLE(component
),
1729 ADD_TABLE(directory
),
1731 ADD_TABLE(feature_comp
),
1733 ADD_TABLE(aup_install_exec_seq
),
1734 ADD_TABLE(aup_custom_action
),
1739 static const msi_table aup2_tables
[] =
1741 ADD_TABLE(component
),
1742 ADD_TABLE(directory
),
1744 ADD_TABLE(feature_comp
),
1746 ADD_TABLE(aup2_install_exec_seq
),
1747 ADD_TABLE(aup_custom_action
),
1749 ADD_TABLE(aup_property
)
1752 static const msi_table aup3_tables
[] =
1754 ADD_TABLE(component
),
1755 ADD_TABLE(directory
),
1757 ADD_TABLE(feature_comp
),
1759 ADD_TABLE(aup2_install_exec_seq
),
1760 ADD_TABLE(aup_custom_action
),
1762 ADD_TABLE(aup2_property
)
1765 static const msi_table aup4_tables
[] =
1767 ADD_TABLE(component
),
1768 ADD_TABLE(directory
),
1770 ADD_TABLE(feature_comp
),
1772 ADD_TABLE(aup3_install_exec_seq
),
1773 ADD_TABLE(aup_custom_action
),
1775 ADD_TABLE(aup2_property
)
1778 static const msi_table fiu_tables
[] =
1780 ADD_TABLE(rof_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(property
),
1790 static const msi_table fiuc_tables
[] =
1792 ADD_TABLE(rof_component
),
1793 ADD_TABLE(directory
),
1794 ADD_TABLE(rof_feature
),
1795 ADD_TABLE(rof_feature_comp
),
1796 ADD_TABLE(rofc_file
),
1797 ADD_TABLE(pp_install_exec_seq
),
1798 ADD_TABLE(rofc_media
),
1799 ADD_TABLE(property
),
1802 static const msi_table fo_tables
[] =
1804 ADD_TABLE(directory
),
1806 ADD_TABLE(fo_component
),
1807 ADD_TABLE(fo_feature
),
1808 ADD_TABLE(fo_condition
),
1809 ADD_TABLE(fo_feature_comp
),
1810 ADD_TABLE(fo_custom_action
),
1811 ADD_TABLE(fo_install_exec_seq
),
1816 static const msi_table icon_base_tables
[] =
1818 ADD_TABLE(ci_component
),
1819 ADD_TABLE(directory
),
1820 ADD_TABLE(rof_feature
),
1821 ADD_TABLE(rof_feature_comp
),
1822 ADD_TABLE(rof_file
),
1823 ADD_TABLE(pp_install_exec_seq
),
1824 ADD_TABLE(rof_media
),
1825 ADD_TABLE(icon_property
),
1828 static const msi_table pv_tables
[] =
1830 ADD_TABLE(rof_component
),
1831 ADD_TABLE(directory
),
1832 ADD_TABLE(rof_feature
),
1833 ADD_TABLE(rof_feature_comp
),
1834 ADD_TABLE(rof_file
),
1835 ADD_TABLE(pv_install_exec_seq
),
1836 ADD_TABLE(rof_media
),
1840 static const msi_table uc_tables
[] =
1842 ADD_TABLE(directory
),
1843 ADD_TABLE(uc_component
),
1844 ADD_TABLE(uc_feature
),
1845 ADD_TABLE(uc_feature_comp
),
1847 ADD_TABLE(uc_install_exec_seq
),
1849 ADD_TABLE(uc_property
)
1852 static const msi_table mixed_tables
[] =
1854 ADD_TABLE(directory
),
1855 ADD_TABLE(mixed_component
),
1856 ADD_TABLE(mixed_feature
),
1857 ADD_TABLE(mixed_feature_comp
),
1858 ADD_TABLE(mixed_install_exec_seq
),
1859 ADD_TABLE(mixed_registry
),
1864 static const msi_table vp_tables
[] =
1866 ADD_TABLE(directory
),
1868 ADD_TABLE(vp_component
),
1869 ADD_TABLE(vp_feature
),
1870 ADD_TABLE(vp_feature_comp
),
1871 ADD_TABLE(vp_custom_action
),
1872 ADD_TABLE(vp_install_exec_seq
),
1877 static const msi_table shc_tables
[] =
1880 ADD_TABLE(directory
),
1881 ADD_TABLE(shc_file
),
1882 ADD_TABLE(shc_component
),
1883 ADD_TABLE(shc_feature
),
1884 ADD_TABLE(shc_feature_comp
),
1885 ADD_TABLE(shc_custom_action
),
1886 ADD_TABLE(shc_install_exec_seq
),
1887 ADD_TABLE(shc_property
)
1890 static const msi_table shc2_tables
[] =
1893 ADD_TABLE(directory
),
1894 ADD_TABLE(shc_file
),
1895 ADD_TABLE(shc_component
),
1896 ADD_TABLE(shc_feature
),
1897 ADD_TABLE(shc_feature_comp
),
1898 ADD_TABLE(shc_custom_action
),
1899 ADD_TABLE(shc_install_exec_seq
),
1900 ADD_TABLE(shc2_property
)
1903 /* cabinet definitions */
1905 /* make the max size large so there is only one cab file */
1906 #define MEDIA_SIZE 0x7FFFFFFF
1907 #define FOLDER_THRESHOLD 900000
1909 /* the FCI callbacks */
1911 static void * CDECL
mem_alloc(ULONG cb
)
1913 return HeapAlloc(GetProcessHeap(), 0, cb
);
1916 static void CDECL
mem_free(void *memory
)
1918 HeapFree(GetProcessHeap(), 0, memory
);
1921 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
1923 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
1927 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
1932 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
1933 BOOL fContinuation
, void *pv
)
1938 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
1942 DWORD dwShareMode
= 0;
1943 DWORD dwCreateDisposition
= OPEN_EXISTING
;
1945 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
1946 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1947 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
1949 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
1950 dwCreateDisposition
= OPEN_EXISTING
;
1952 dwCreateDisposition
= CREATE_NEW
;
1954 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
1955 dwCreateDisposition
, 0, NULL
);
1957 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
1959 return (INT_PTR
)handle
;
1962 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1964 HANDLE handle
= (HANDLE
)hf
;
1968 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
1969 ok(res
, "Failed to ReadFile\n");
1974 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1976 HANDLE handle
= (HANDLE
)hf
;
1980 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
1981 ok(res
, "Failed to WriteFile\n");
1986 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
1988 HANDLE handle
= (HANDLE
)hf
;
1989 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
1994 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
1996 HANDLE handle
= (HANDLE
)hf
;
1999 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
2000 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
2005 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
2007 BOOL ret
= DeleteFileA(pszFile
);
2008 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
2013 static void init_functionpointers(void)
2015 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2016 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2017 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2019 #define GET_PROC(mod, func) \
2020 p ## func = (void*)GetProcAddress(mod, #func); \
2022 trace("GetProcAddress(%s) failed\n", #func);
2024 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2025 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2026 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2028 GET_PROC(hadvapi32
, CheckTokenMembership
);
2029 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
2030 GET_PROC(hadvapi32
, OpenProcessToken
);
2031 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2032 GET_PROC(hkernel32
, IsWow64Process
)
2034 hsrclient
= LoadLibraryA("srclient.dll");
2035 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2036 GET_PROC(hsrclient
, SRSetRestorePointA
);
2041 static BOOL
is_process_limited(void)
2043 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2048 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2050 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2051 DOMAIN_ALIAS_RID_ADMINS
,
2052 0, 0, 0, 0, 0, 0, &Group
) ||
2053 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2055 trace("Could not check if the current user is an administrator\n");
2060 /* Only administrators have enough privileges for these tests */
2064 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2067 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2070 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2072 return (ret
&& type
== TokenElevationTypeLimited
);
2077 static BOOL
check_record(MSIHANDLE rec
, UINT field
, LPCSTR val
)
2084 r
= MsiRecordGetStringA(rec
, field
, buffer
, &sz
);
2085 return (r
== ERROR_SUCCESS
) && !strcmp(val
, buffer
);
2088 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2092 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2093 GetTempFileNameA(".", "xx", 0, tempname
);
2095 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2097 lstrcpyA(pszTempName
, tempname
);
2098 HeapFree(GetProcessHeap(), 0, tempname
);
2102 HeapFree(GetProcessHeap(), 0, tempname
);
2107 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2108 USHORT
*pattribs
, int *err
, void *pv
)
2110 BY_HANDLE_FILE_INFORMATION finfo
;
2116 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2117 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2119 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2121 res
= GetFileInformationByHandle(handle
, &finfo
);
2122 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2124 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2125 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2127 attrs
= GetFileAttributesA(pszName
);
2128 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2130 return (INT_PTR
)handle
;
2133 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2135 char path
[MAX_PATH
];
2136 char filename
[MAX_PATH
];
2138 lstrcpyA(path
, CURR_DIR
);
2139 lstrcatA(path
, "\\");
2140 lstrcatA(path
, file
);
2142 lstrcpyA(filename
, file
);
2144 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2145 progress
, get_open_info
, compress
);
2148 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2150 ZeroMemory(pCabParams
, sizeof(CCAB
));
2152 pCabParams
->cb
= max_size
;
2153 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2154 pCabParams
->setID
= 0xbeef;
2155 pCabParams
->iCab
= 1;
2156 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2157 lstrcatA(pCabParams
->szCabPath
, "\\");
2158 lstrcpyA(pCabParams
->szCab
, name
);
2161 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2169 set_cab_parameters(&cabParams
, name
, max_size
);
2171 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2172 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2173 get_temp_file
, &cabParams
, NULL
);
2175 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2180 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2181 ok(res
, "Failed to add file: %s\n", ptr
);
2182 ptr
+= lstrlenA(ptr
) + 1;
2185 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2186 ok(res
, "Failed to flush the cabinet\n");
2188 res
= FCIDestroy(hfci
);
2189 ok(res
, "Failed to destroy the cabinet\n");
2192 static BOOL
get_user_dirs(void)
2197 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2198 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2202 if(RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
)){
2211 static BOOL
get_system_dirs(void)
2216 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2220 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2221 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
)) {
2227 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2228 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
)) {
2234 if (RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR_NATIVE
, &size
)) {
2241 if(!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2247 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2252 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2253 if (file
== INVALID_HANDLE_VALUE
)
2256 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2260 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2267 #define create_file(name, size) create_file_data(name, name, size)
2269 static void create_test_files(void)
2271 CreateDirectoryA("msitest", NULL
);
2272 create_file("msitest\\one.txt", 100);
2273 CreateDirectoryA("msitest\\first", NULL
);
2274 create_file("msitest\\first\\two.txt", 100);
2275 CreateDirectoryA("msitest\\second", NULL
);
2276 create_file("msitest\\second\\three.txt", 100);
2278 create_file("four.txt", 100);
2279 create_file("five.txt", 100);
2280 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2282 create_file("msitest\\filename", 100);
2283 create_file("msitest\\service.exe", 100);
2285 DeleteFileA("four.txt");
2286 DeleteFileA("five.txt");
2289 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2291 CHAR path
[MAX_PATH
];
2293 lstrcpyA(path
, PROG_FILES_DIR
);
2294 lstrcatA(path
, "\\");
2295 lstrcatA(path
, rel_path
);
2298 return DeleteFileA(path
);
2300 return RemoveDirectoryA(path
);
2303 static BOOL
delete_pf_native(const CHAR
*rel_path
, BOOL is_file
)
2305 CHAR path
[MAX_PATH
];
2307 lstrcpyA(path
, PROG_FILES_DIR_NATIVE
);
2308 lstrcatA(path
, "\\");
2309 lstrcatA(path
, rel_path
);
2312 return DeleteFileA(path
);
2314 return RemoveDirectoryA(path
);
2317 static BOOL
delete_cf(const CHAR
*rel_path
, BOOL is_file
)
2319 CHAR path
[MAX_PATH
];
2321 lstrcpyA(path
, COMMON_FILES_DIR
);
2322 lstrcatA(path
, "\\");
2323 lstrcatA(path
, rel_path
);
2326 return DeleteFileA(path
);
2328 return RemoveDirectoryA(path
);
2331 static BOOL
compare_pf_data(const char *filename
, const char *data
, DWORD size
)
2336 char *buffer
, path
[MAX_PATH
];
2338 lstrcpyA(path
, PROG_FILES_DIR
);
2339 lstrcatA(path
, "\\");
2340 lstrcatA(path
, filename
);
2342 handle
= CreateFileA(path
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2343 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
2346 ReadFile(handle
, buffer
, size
, &read
, NULL
);
2347 if (read
== size
&& !memcmp(data
, buffer
, size
)) ret
= TRUE
;
2348 HeapFree(GetProcessHeap(), 0, buffer
);
2350 CloseHandle(handle
);
2354 static void delete_test_files(void)
2356 DeleteFileA("msitest.msi");
2357 DeleteFileA("msitest.cab");
2358 DeleteFileA("msitest\\second\\three.txt");
2359 DeleteFileA("msitest\\first\\two.txt");
2360 DeleteFileA("msitest\\one.txt");
2361 DeleteFileA("msitest\\service.exe");
2362 DeleteFileA("msitest\\filename");
2363 RemoveDirectoryA("msitest\\second");
2364 RemoveDirectoryA("msitest\\first");
2365 RemoveDirectoryA("msitest");
2368 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2372 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
,
2373 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2374 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2378 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
,
2379 const char *template, const char *packagecode
)
2384 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2385 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2387 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2388 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2390 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
, packagecode
);
2391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2393 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2394 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2396 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2399 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2400 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2402 /* write the summary changes back to the stream */
2403 r
= MsiSummaryInfoPersist(summary
);
2404 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2406 MsiCloseHandle(summary
);
2409 #define create_database(name, tables, num_tables) \
2410 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033", \
2411 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2413 #define create_database_template(name, tables, num_tables, version, template) \
2414 create_database_wordcount(name, tables, num_tables, version, 0, template, \
2415 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2417 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2418 int num_tables
, INT version
, INT wordcount
,
2419 const char *template, const char *packagecode
)
2426 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2427 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2428 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2430 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2431 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2433 /* import the tables into the database */
2434 for (j
= 0; j
< num_tables
; j
++)
2436 const msi_table
*table
= &tables
[j
];
2438 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2440 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2441 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2443 DeleteFileA(table
->filename
);
2446 write_msi_summary_info(db
, version
, wordcount
, template, packagecode
);
2448 r
= MsiDatabaseCommit(db
);
2449 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2452 HeapFree( GetProcessHeap(), 0, nameW
);
2455 static void check_service_is_installed(void)
2457 SC_HANDLE scm
, service
;
2460 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
2461 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
2463 service
= OpenServiceA(scm
, "TestService", SC_MANAGER_ALL_ACCESS
);
2464 ok(service
!= NULL
, "Failed to open TestService\n");
2466 res
= DeleteService(service
);
2467 ok(res
, "Failed to delete TestService\n");
2469 CloseServiceHandle(service
);
2470 CloseServiceHandle(scm
);
2473 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2475 RESTOREPOINTINFOA spec
;
2477 spec
.dwEventType
= event_type
;
2478 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2479 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2480 lstrcpyA(spec
.szDescription
, "msitest restore point");
2482 return pSRSetRestorePointA(&spec
, status
);
2485 static void remove_restore_point(DWORD seq_number
)
2489 res
= pSRRemoveRestorePoint(seq_number
);
2490 if (res
!= ERROR_SUCCESS
)
2491 trace("Failed to remove the restore point : %08x\n", res
);
2494 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2496 if (pRegDeleteKeyExA
)
2497 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2498 return RegDeleteKeyA( key
, subkey
);
2501 static void test_MsiInstallProduct(void)
2504 CHAR path
[MAX_PATH
];
2507 DWORD num
, size
, type
;
2508 REGSAM access
= KEY_ALL_ACCESS
;
2510 if (is_process_limited())
2512 skip("process is limited\n");
2517 access
|= KEY_WOW64_64KEY
;
2519 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2521 /* szPackagePath is NULL */
2522 r
= MsiInstallProductA(NULL
, "INSTALL=ALL");
2523 ok(r
== ERROR_INVALID_PARAMETER
,
2524 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2526 /* both szPackagePath and szCommandLine are NULL */
2527 r
= MsiInstallProductA(NULL
, NULL
);
2528 ok(r
== ERROR_INVALID_PARAMETER
,
2529 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2531 /* szPackagePath is empty */
2532 r
= MsiInstallProductA("", "INSTALL=ALL");
2533 ok(r
== ERROR_PATH_NOT_FOUND
,
2534 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r
);
2536 create_test_files();
2537 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2539 /* install, don't publish */
2540 r
= MsiInstallProductA(msifile
, NULL
);
2541 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2543 skip("Not enough rights to perform tests\n");
2546 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2548 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2549 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2550 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2551 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2552 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2553 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2554 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2555 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2556 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2557 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2558 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2559 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2561 res
= RegOpenKeyExA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", 0, access
, &hkey
);
2562 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2566 res
= RegQueryValueExA(hkey
, "Name", NULL
, &type
, (LPBYTE
)path
, &size
);
2567 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2568 ok(!lstrcmpA(path
, "imaname"), "Expected imaname, got %s\n", path
);
2572 res
= RegQueryValueExA(hkey
, "blah", NULL
, &type
, (LPBYTE
)path
, &size
);
2573 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2577 res
= RegQueryValueExA(hkey
, "number", NULL
, &type
, (LPBYTE
)&num
, &size
);
2578 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2579 ok(num
== 314, "Expected 314, got %d\n", num
);
2583 res
= RegQueryValueExA(hkey
, "OrderTestName", NULL
, &type
, (LPBYTE
)path
, &size
);
2584 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2585 ok(!lstrcmpA(path
, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path
);
2587 check_service_is_installed();
2589 delete_key(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", access
);
2591 /* not published, reinstall */
2592 r
= MsiInstallProductA(msifile
, NULL
);
2593 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2595 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2596 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2597 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2598 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2599 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2600 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2601 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2602 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2603 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2604 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2605 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2606 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2608 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2609 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2610 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2612 create_database(msifile
, up_tables
, sizeof(up_tables
) / sizeof(msi_table
));
2614 /* not published, RemovePreviousVersions set */
2615 r
= MsiInstallProductA(msifile
, NULL
);
2616 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2618 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2619 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2620 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2621 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2622 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2623 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2624 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2625 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2626 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2627 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2628 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2629 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2631 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2632 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2633 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2635 create_database(msifile
, up2_tables
, sizeof(up2_tables
) / sizeof(msi_table
));
2637 /* not published, version number bumped */
2638 r
= MsiInstallProductA(msifile
, NULL
);
2639 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2641 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2642 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2643 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2644 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2645 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2646 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2647 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2648 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2649 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2650 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2651 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2652 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2654 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2655 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2656 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2658 create_database(msifile
, up3_tables
, sizeof(up3_tables
) / sizeof(msi_table
));
2660 /* not published, RemovePreviousVersions set and version number bumped */
2661 r
= MsiInstallProductA(msifile
, NULL
);
2662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2664 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2665 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2666 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2667 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2668 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2669 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2670 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2671 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2672 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2673 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2674 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2675 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2677 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2678 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2679 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2681 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2683 /* install, publish product */
2684 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
2685 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2687 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2688 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2689 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2690 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2691 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2692 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2693 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2694 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2695 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2696 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2697 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2698 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2700 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2701 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2703 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2705 /* published, reinstall */
2706 r
= MsiInstallProductA(msifile
, NULL
);
2707 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2709 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2710 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2711 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2712 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2713 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2714 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2715 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2716 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2717 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2718 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2719 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2720 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2722 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2723 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2725 create_database(msifile
, up5_tables
, sizeof(up5_tables
) / sizeof(msi_table
));
2727 /* published product, RemovePreviousVersions set */
2728 r
= MsiInstallProductA(msifile
, NULL
);
2729 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2731 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2732 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2733 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2734 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2735 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2736 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2737 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2738 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2739 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2740 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2741 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2742 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2744 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2745 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2747 create_database(msifile
, up6_tables
, sizeof(up6_tables
) / sizeof(msi_table
));
2749 /* published product, version number bumped */
2750 r
= MsiInstallProductA(msifile
, NULL
);
2751 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2753 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2754 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2755 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2756 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2757 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2758 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2759 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2760 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2761 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2762 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2763 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2764 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2766 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2767 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2769 create_database(msifile
, up7_tables
, sizeof(up7_tables
) / sizeof(msi_table
));
2771 /* published product, RemovePreviousVersions set and version number bumped */
2772 r
= MsiInstallProductA(msifile
, NULL
);
2773 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2775 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2776 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2777 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2778 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2779 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2780 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2781 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2782 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2783 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2784 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2785 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2786 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2788 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2789 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2791 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
2792 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2795 delete_test_files();
2796 DeleteFileA(msifile
);
2799 static void test_MsiSetComponentState(void)
2801 INSTALLSTATE installed
, action
;
2803 char path
[MAX_PATH
];
2806 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2810 lstrcpyA(path
, CURR_DIR
);
2811 lstrcatA(path
, "\\");
2812 lstrcatA(path
, msifile
);
2814 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2816 r
= MsiOpenPackageA(path
, &package
);
2817 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2819 skip("Not enough rights to perform tests\n");
2822 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2824 r
= MsiDoActionA(package
, "CostInitialize");
2825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2827 r
= MsiDoActionA(package
, "FileCost");
2828 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2830 r
= MsiDoActionA(package
, "CostFinalize");
2831 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2833 r
= MsiGetComponentStateA(package
, "dangler", &installed
, &action
);
2834 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2835 ok(installed
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", installed
);
2836 ok(action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2838 r
= MsiSetComponentStateA(package
, "dangler", INSTALLSTATE_SOURCE
);
2839 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2841 MsiCloseHandle(package
);
2845 DeleteFileA(msifile
);
2848 static void test_packagecoltypes(void)
2850 MSIHANDLE hdb
, view
, rec
;
2851 char path
[MAX_PATH
];
2852 WCHAR pathW
[MAX_PATH
];
2856 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2860 lstrcpyA(path
, CURR_DIR
);
2861 lstrcatA(path
, "\\");
2862 lstrcatA(path
, msifile
);
2863 MultiByteToWideChar( CP_ACP
, 0, path
, -1, pathW
, MAX_PATH
);
2865 r
= MsiOpenDatabaseW(pathW
, MSIDBOPEN_READONLY
, &hdb
);
2866 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2868 query
= "SELECT * FROM `Media`";
2869 r
= MsiDatabaseOpenViewA( hdb
, query
, &view
);
2870 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2872 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_NAMES
, &rec
);
2873 count
= MsiRecordGetFieldCount( rec
);
2874 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2875 ok(count
== 6, "Expected 6, got %d\n", count
);
2876 ok(check_record(rec
, 1, "DiskId"), "wrong column label\n");
2877 ok(check_record(rec
, 2, "LastSequence"), "wrong column label\n");
2878 ok(check_record(rec
, 3, "DiskPrompt"), "wrong column label\n");
2879 ok(check_record(rec
, 4, "Cabinet"), "wrong column label\n");
2880 ok(check_record(rec
, 5, "VolumeLabel"), "wrong column label\n");
2881 ok(check_record(rec
, 6, "Source"), "wrong column label\n");
2882 MsiCloseHandle(rec
);
2884 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_TYPES
, &rec
);
2885 count
= MsiRecordGetFieldCount( rec
);
2886 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2887 ok(count
== 6, "Expected 6, got %d\n", count
);
2888 ok(check_record(rec
, 1, "i2"), "wrong column label\n");
2889 ok(check_record(rec
, 2, "i4"), "wrong column label\n");
2890 ok(check_record(rec
, 3, "L64"), "wrong column label\n");
2891 ok(check_record(rec
, 4, "S255"), "wrong column label\n");
2892 ok(check_record(rec
, 5, "S32"), "wrong column label\n");
2893 ok(check_record(rec
, 6, "S72"), "wrong column label\n");
2895 MsiCloseHandle(rec
);
2896 MsiCloseHandle(view
);
2897 MsiCloseHandle(hdb
);
2900 DeleteFileA(msifile
);
2903 static void create_cc_test_files(void)
2908 static CHAR cab_context
[] = "test%d.cab";
2911 create_file("maximus", 500);
2912 create_file("augustus", 50000);
2913 create_file("tiberius", 500);
2914 create_file("caesar", 500);
2916 set_cab_parameters(&cabParams
, "test1.cab", 40000);
2918 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2919 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2920 get_temp_file
, &cabParams
, cab_context
);
2921 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2923 res
= add_file(hfci
, "maximus", tcompTYPE_NONE
);
2924 ok(res
, "Failed to add file maximus\n");
2926 res
= add_file(hfci
, "augustus", tcompTYPE_NONE
);
2927 ok(res
, "Failed to add file augustus\n");
2929 res
= add_file(hfci
, "tiberius", tcompTYPE_NONE
);
2930 ok(res
, "Failed to add file tiberius\n");
2932 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2933 ok(res
, "Failed to flush the cabinet\n");
2935 res
= FCIDestroy(hfci
);
2936 ok(res
, "Failed to destroy the cabinet\n");
2938 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2940 DeleteFileA("maximus");
2941 DeleteFileA("augustus");
2942 DeleteFileA("tiberius");
2943 DeleteFileA("caesar");
2946 static void delete_cab_files(void)
2948 SHFILEOPSTRUCTA shfl
;
2949 CHAR path
[MAX_PATH
+10];
2951 lstrcpyA(path
, CURR_DIR
);
2952 lstrcatA(path
, "\\*.cab");
2953 path
[strlen(path
) + 1] = '\0';
2956 shfl
.wFunc
= FO_DELETE
;
2959 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
;
2961 SHFileOperationA(&shfl
);
2964 static void test_continuouscabs(void)
2968 if (is_process_limited())
2970 skip("process is limited\n");
2974 create_cc_test_files();
2975 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
2977 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2979 r
= MsiInstallProductA(msifile
, NULL
);
2980 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2982 skip("Not enough rights to perform tests\n");
2986 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2987 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2988 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2989 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2990 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2994 DeleteFileA(msifile
);
2996 create_cc_test_files();
2997 create_database(msifile
, cc2_tables
, sizeof(cc2_tables
) / sizeof(msi_table
));
2999 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3001 r
= MsiInstallProductA(msifile
, NULL
);
3002 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3004 skip("Not enough rights to perform tests\n");
3008 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3009 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3010 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3011 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3012 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3013 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3017 DeleteFileA(msifile
);
3019 /* Tests to show that only msi cab filename is taken in case of mismatch with the one given by previous cab */
3021 /* Filename from cab is right and the one from msi is wrong */
3022 create_cc_test_files();
3023 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
3025 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3027 r
= MsiInstallProductA(msifile
, NULL
);
3028 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3030 skip("Not enough rights to perform tests\n");
3034 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAIRE, got %u\n", r
);
3035 todo_wine
ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3036 ok(!delete_pf("msitest\\caesar", TRUE
), "File installed\n");
3037 todo_wine
ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3038 todo_wine
ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3042 DeleteFileA(msifile
);
3044 /* Filename from msi is right and the one from cab is wrong */
3045 create_cc_test_files();
3046 ok(MoveFileA("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
3047 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
3049 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3051 r
= MsiInstallProductA(msifile
, NULL
);
3052 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3054 skip("Not enough rights to perform tests\n");
3058 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3059 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3060 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3061 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3062 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3066 DeleteFileA(msifile
);
3069 static void test_caborder(void)
3073 create_file("imperator", 100);
3074 create_file("maximus", 500);
3075 create_file("augustus", 50000);
3076 create_file("caesar", 500);
3078 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
3080 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3082 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3083 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3084 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3086 r
= MsiInstallProductA(msifile
, NULL
);
3087 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3089 skip("Not enough rights to perform tests\n");
3092 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3093 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3094 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3097 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3098 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3103 create_cab_file("test1.cab", MEDIA_SIZE
, "imperator\0");
3104 create_cab_file("test2.cab", MEDIA_SIZE
, "maximus\0augustus\0");
3105 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3107 r
= MsiInstallProductA(msifile
, NULL
);
3108 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3109 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3110 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3111 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3112 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3115 DeleteFileA(msifile
);
3117 create_cc_test_files();
3118 create_database(msifile
, co_tables
, sizeof(co_tables
) / sizeof(msi_table
));
3120 r
= MsiInstallProductA(msifile
, NULL
);
3121 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3122 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3123 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3126 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3127 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3131 DeleteFileA(msifile
);
3133 create_cc_test_files();
3134 create_database(msifile
, co2_tables
, sizeof(co2_tables
) / sizeof(msi_table
));
3136 r
= MsiInstallProductA(msifile
, NULL
);
3137 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3138 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3141 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3142 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3143 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3148 DeleteFileA("imperator");
3149 DeleteFileA("maximus");
3150 DeleteFileA("augustus");
3151 DeleteFileA("caesar");
3152 DeleteFileA(msifile
);
3155 static void test_mixedmedia(void)
3159 if (is_process_limited())
3161 skip("process is limited\n");
3165 CreateDirectoryA("msitest", NULL
);
3166 create_file("msitest\\maximus", 500);
3167 create_file("msitest\\augustus", 500);
3168 create_file("caesar", 500);
3170 create_database(msifile
, mm_tables
, sizeof(mm_tables
) / sizeof(msi_table
));
3172 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3174 create_cab_file("test1.cab", MEDIA_SIZE
, "caesar\0");
3176 r
= MsiInstallProductA(msifile
, NULL
);
3177 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3179 skip("Not enough rights to perform tests\n");
3182 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3183 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3184 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3185 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3186 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3189 /* Delete the files in the temp (current) folder */
3190 DeleteFileA("msitest\\maximus");
3191 DeleteFileA("msitest\\augustus");
3192 RemoveDirectoryA("msitest");
3193 DeleteFileA("caesar");
3194 DeleteFileA("test1.cab");
3195 DeleteFileA(msifile
);
3198 static void test_samesequence(void)
3202 create_cc_test_files();
3203 create_database(msifile
, ss_tables
, sizeof(ss_tables
) / sizeof(msi_table
));
3205 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3207 r
= MsiInstallProductA(msifile
, NULL
);
3208 ok(r
== ERROR_SUCCESS
|| broken(r
== ERROR_INSTALL_FAILURE
), "Expected ERROR_SUCCESS, got %u\n", r
);
3209 if (r
== ERROR_SUCCESS
)
3211 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3212 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3213 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3214 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3217 DeleteFileA(msifile
);
3220 static void test_uiLevelFlags(void)
3224 create_cc_test_files();
3225 create_database(msifile
, ui_tables
, sizeof(ui_tables
) / sizeof(msi_table
));
3227 MsiSetInternalUI(INSTALLUILEVEL_NONE
| INSTALLUILEVEL_SOURCERESONLY
, NULL
);
3229 r
= MsiInstallProductA(msifile
, NULL
);
3230 ok(r
== ERROR_SUCCESS
|| broken(r
== ERROR_INSTALL_FAILURE
), "Expected ERROR_SUCCESS, got %u\n", r
);
3231 if (r
== ERROR_SUCCESS
)
3233 ok(!delete_pf("msitest\\maximus", TRUE
), "UI install occurred, but execute-only was requested.\n");
3234 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3235 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3236 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3239 DeleteFileA(msifile
);
3242 static BOOL
file_matches(LPSTR path
)
3248 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3249 NULL
, OPEN_EXISTING
, 0, NULL
);
3250 ZeroMemory(buf
, MAX_PATH
);
3251 ReadFile(file
, buf
, 15, &size
, NULL
);
3254 return !lstrcmpA(buf
, "msitest\\maximus");
3257 static void test_readonlyfile(void)
3262 CHAR path
[MAX_PATH
];
3264 if (is_process_limited())
3266 skip("process is limited\n");
3270 CreateDirectoryA("msitest", NULL
);
3271 create_file("msitest\\maximus", 500);
3272 create_database(msifile
, rof_tables
, sizeof(rof_tables
) / sizeof(msi_table
));
3274 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3276 lstrcpyA(path
, PROG_FILES_DIR
);
3277 lstrcatA(path
, "\\msitest");
3278 CreateDirectoryA(path
, NULL
);
3280 lstrcatA(path
, "\\maximus");
3281 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3282 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3284 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3287 r
= MsiInstallProductA(msifile
, NULL
);
3288 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3290 skip("Not enough rights to perform tests\n");
3293 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3294 ok(file_matches(path
), "Expected file to be overwritten\n");
3295 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3296 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3299 /* Delete the files in the temp (current) folder */
3300 DeleteFileA("msitest\\maximus");
3301 RemoveDirectoryA("msitest");
3302 DeleteFileA(msifile
);
3305 static void test_readonlyfile_cab(void)
3310 CHAR path
[MAX_PATH
];
3313 if (is_process_limited())
3315 skip("process is limited\n");
3319 CreateDirectoryA("msitest", NULL
);
3320 create_file("maximus", 500);
3321 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3322 DeleteFileA("maximus");
3324 create_database(msifile
, rofc_tables
, sizeof(rofc_tables
) / sizeof(msi_table
));
3326 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3328 lstrcpyA(path
, PROG_FILES_DIR
);
3329 lstrcatA(path
, "\\msitest");
3330 CreateDirectoryA(path
, NULL
);
3332 lstrcatA(path
, "\\maximus");
3333 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3334 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3336 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3339 r
= MsiInstallProductA(msifile
, NULL
);
3340 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3342 skip("Not enough rights to perform tests\n");
3345 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3347 memset( buf
, 0, sizeof(buf
) );
3348 if ((file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3349 NULL
, OPEN_EXISTING
, 0, NULL
)) != INVALID_HANDLE_VALUE
)
3351 ReadFile(file
, buf
, sizeof(buf
) - 1, &size
, NULL
);
3354 ok(!memcmp( buf
, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf
);
3355 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3356 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3359 /* Delete the files in the temp (current) folder */
3361 DeleteFileA("msitest\\maximus");
3362 RemoveDirectoryA("msitest");
3363 DeleteFileA(msifile
);
3366 static void test_setdirproperty(void)
3370 if (is_process_limited())
3372 skip("process is limited\n");
3376 CreateDirectoryA("msitest", NULL
);
3377 create_file("msitest\\maximus", 500);
3378 create_database(msifile
, sdp_tables
, sizeof(sdp_tables
) / sizeof(msi_table
));
3380 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3382 r
= MsiInstallProductA(msifile
, NULL
);
3383 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3385 skip("Not enough rights to perform tests\n");
3388 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3389 ok(delete_cf("msitest\\maximus", TRUE
), "File not installed\n");
3390 ok(delete_cf("msitest", FALSE
), "Directory not created\n");
3393 /* Delete the files in the temp (current) folder */
3394 DeleteFileA(msifile
);
3395 DeleteFileA("msitest\\maximus");
3396 RemoveDirectoryA("msitest");
3399 static void test_cabisextracted(void)
3403 if (is_process_limited())
3405 skip("process is limited\n");
3409 CreateDirectoryA("msitest", NULL
);
3410 create_file("msitest\\gaius", 500);
3411 create_file("maximus", 500);
3412 create_file("augustus", 500);
3413 create_file("caesar", 500);
3415 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3416 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3417 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3419 create_database(msifile
, cie_tables
, sizeof(cie_tables
) / sizeof(msi_table
));
3421 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3423 r
= MsiInstallProductA(msifile
, NULL
);
3424 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3426 skip("Not enough rights to perform tests\n");
3429 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3430 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3431 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3432 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3433 ok(delete_pf("msitest\\gaius", TRUE
), "File not installed\n");
3434 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3437 /* Delete the files in the temp (current) folder */
3439 DeleteFileA(msifile
);
3440 DeleteFileA("maximus");
3441 DeleteFileA("augustus");
3442 DeleteFileA("caesar");
3443 DeleteFileA("msitest\\gaius");
3444 RemoveDirectoryA("msitest");
3447 static BOOL
file_exists(LPCSTR file
)
3449 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
3452 static BOOL
pf_exists(LPCSTR file
)
3454 CHAR path
[MAX_PATH
];
3456 lstrcpyA(path
, PROG_FILES_DIR
);
3457 lstrcatA(path
, "\\");
3458 lstrcatA(path
, file
);
3460 return file_exists(path
);
3463 static void delete_pfmsitest_files(void)
3465 SHFILEOPSTRUCTA shfl
;
3466 CHAR path
[MAX_PATH
+11];
3468 lstrcpyA(path
, PROG_FILES_DIR
);
3469 lstrcatA(path
, "\\msitest\\*");
3470 path
[strlen(path
) + 1] = '\0';
3473 shfl
.wFunc
= FO_DELETE
;
3476 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
3478 SHFileOperationA(&shfl
);
3480 lstrcpyA(path
, PROG_FILES_DIR
);
3481 lstrcatA(path
, "\\msitest");
3482 RemoveDirectoryA(path
);
3485 static UINT
run_query(MSIHANDLE hdb
, MSIHANDLE hrec
, const char *query
)
3487 MSIHANDLE hview
= 0;
3490 r
= MsiDatabaseOpenViewA(hdb
, query
, &hview
);
3491 if(r
!= ERROR_SUCCESS
)
3494 r
= MsiViewExecute(hview
, hrec
);
3495 if(r
== ERROR_SUCCESS
)
3496 r
= MsiViewClose(hview
);
3497 MsiCloseHandle(hview
);
3501 static void set_transform_summary_info(void)
3504 MSIHANDLE suminfo
= 0;
3506 /* build summary info */
3507 r
= MsiGetSummaryInformationA(0, mstfile
, 3, &suminfo
);
3508 ok(r
== ERROR_SUCCESS
, "Failed to open summaryinfo\n");
3510 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
3511 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3513 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
3514 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3515 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3516 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3517 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3519 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_PAGECOUNT
, VT_I4
, 100, NULL
, NULL
);
3520 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3522 r
= MsiSummaryInfoPersist(suminfo
);
3523 ok(r
== ERROR_SUCCESS
, "Failed to make summary info persist\n");
3525 r
= MsiCloseHandle(suminfo
);
3526 ok(r
== ERROR_SUCCESS
, "Failed to close suminfo\n");
3529 static void generate_transform(void)
3531 MSIHANDLE hdb1
, hdb2
;
3535 /* start with two identical databases */
3536 CopyFileA(msifile
, msifile2
, FALSE
);
3538 r
= MsiOpenDatabaseW(msifile2W
, MSIDBOPEN_TRANSACT
, &hdb1
);
3539 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3541 r
= MsiDatabaseCommit(hdb1
);
3542 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
3544 r
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_READONLY
, &hdb2
);
3545 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3547 query
= "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3548 r
= run_query(hdb1
, 0, query
);
3549 ok(r
== ERROR_SUCCESS
, "failed to add property\n");
3551 /* database needs to be committed */
3552 MsiDatabaseCommit(hdb1
);
3554 r
= MsiDatabaseGenerateTransformA(hdb1
, hdb2
, mstfile
, 0, 0);
3555 ok(r
== ERROR_SUCCESS
, "return code %d, should be ERROR_SUCCESS\n", r
);
3557 r
= MsiCreateTransformSummaryInfoA(hdb2
, hdb2
, mstfile
, 0, 0);
3558 todo_wine
ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3560 MsiCloseHandle(hdb1
);
3561 MsiCloseHandle(hdb2
);
3564 /* data for generating a transform */
3566 /* tables transform names - encoded as they would be in an msi database file */
3567 static const WCHAR name1
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
3568 static const WCHAR name2
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
3569 static const WCHAR name3
[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
3571 /* data in each table */
3572 static const char data1
[] = /* _StringData */
3573 "propval"; /* all the strings squashed together */
3575 static const WCHAR data2
[] = { /* _StringPool */
3577 0, 0, /* string 0 '' */
3578 4, 1, /* string 1 'prop' */
3579 3, 1, /* string 2 'val' */
3582 static const WCHAR data3
[] = { /* Property */
3583 0x0201, 0x0001, 0x0002,
3586 static const struct {
3590 } table_transform_data
[] =
3592 { name1
, data1
, sizeof data1
- 1 },
3593 { name2
, data2
, sizeof data2
},
3594 { name3
, data3
, sizeof data3
},
3597 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3599 static void generate_transform_manual(void)
3601 IStorage
*stg
= NULL
;
3606 const DWORD mode
= STGM_CREATE
|STGM_READWRITE
|STGM_DIRECT
|STGM_SHARE_EXCLUSIVE
;
3608 const CLSID CLSID_MsiTransform
= { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3610 MultiByteToWideChar(CP_ACP
, 0, mstfile
, -1, name
, 0x20);
3612 r
= StgCreateDocfile(name
, mode
, 0, &stg
);
3613 ok(r
== S_OK
, "failed to create storage\n");
3617 r
= IStorage_SetClass(stg
, &CLSID_MsiTransform
);
3618 ok(r
== S_OK
, "failed to set storage type\n");
3620 for (i
=0; i
<NUM_TRANSFORM_TABLES
; i
++)
3622 r
= IStorage_CreateStream(stg
, table_transform_data
[i
].name
,
3623 STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3626 ok(0, "failed to create stream %08x\n", r
);
3630 r
= IStream_Write(stm
, table_transform_data
[i
].data
,
3631 table_transform_data
[i
].size
, &count
);
3632 if (FAILED(r
) || count
!= table_transform_data
[i
].size
)
3633 ok(0, "failed to write stream\n");
3634 IStream_Release(stm
);
3637 IStorage_Release(stg
);
3639 set_transform_summary_info();
3642 static void test_transformprop(void)
3646 if (is_process_limited())
3648 skip("process is limited\n");
3652 CreateDirectoryA("msitest", NULL
);
3653 create_file("msitest\\augustus", 500);
3655 create_database(msifile
, tp_tables
, sizeof(tp_tables
) / sizeof(msi_table
));
3657 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3659 r
= MsiInstallProductA(msifile
, NULL
);
3660 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3662 skip("Not enough rights to perform tests\n");
3665 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3666 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3667 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3670 generate_transform();
3672 generate_transform_manual();
3674 r
= MsiInstallProductA(msifile
, "TRANSFORMS=winetest.mst");
3675 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3676 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3677 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3680 /* Delete the files in the temp (current) folder */
3681 DeleteFileA(msifile
);
3682 DeleteFileA(msifile2
);
3683 DeleteFileA(mstfile
);
3684 DeleteFileA("msitest\\augustus");
3685 RemoveDirectoryA("msitest");
3688 static void test_currentworkingdir(void)
3691 CHAR drive
[MAX_PATH
], path
[MAX_PATH
];
3694 if (is_process_limited())
3696 skip("process is limited\n");
3700 CreateDirectoryA("msitest", NULL
);
3701 create_file("msitest\\augustus", 500);
3703 create_database(msifile
, cwd_tables
, sizeof(cwd_tables
) / sizeof(msi_table
));
3705 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3707 CreateDirectoryA("diffdir", NULL
);
3708 SetCurrentDirectoryA("diffdir");
3710 sprintf(path
, "..\\%s", msifile
);
3711 r
= MsiInstallProductA(path
, NULL
);
3714 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
3715 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3716 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3719 sprintf(path
, "%s\\%s", CURR_DIR
, msifile
);
3720 r
= MsiInstallProductA(path
, NULL
);
3721 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3723 skip("Not enough rights to perform tests\n");
3726 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3727 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3728 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3730 lstrcpyA(drive
, CURR_DIR
);
3733 SetCurrentDirectoryA(drive
);
3735 lstrcpyA(path
, CURR_DIR
);
3736 if (path
[lstrlenA(path
) - 1] != '\\') lstrcatA(path
, "\\");
3737 lstrcatA(path
, msifile
);
3738 ptr
= strchr(path
, ':');
3741 r
= MsiInstallProductA(ptr
, NULL
);
3742 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3743 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3744 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3747 SetCurrentDirectoryA(CURR_DIR
);
3748 DeleteFileA(msifile
);
3749 DeleteFileA("msitest\\augustus");
3750 RemoveDirectoryA("msitest");
3751 RemoveDirectoryA("diffdir");
3754 static void set_admin_summary_info(const WCHAR
*name
)
3756 MSIHANDLE db
, summary
;
3759 r
= MsiOpenDatabaseW(name
, MSIDBOPEN_DIRECT
, &db
);
3760 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3762 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
3763 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3765 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, 5, NULL
, NULL
);
3766 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3768 /* write the summary changes back to the stream */
3769 r
= MsiSummaryInfoPersist(summary
);
3770 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3772 MsiCloseHandle(summary
);
3774 r
= MsiDatabaseCommit(db
);
3775 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3780 static void test_admin(void)
3784 CreateDirectoryA("msitest", NULL
);
3785 create_file("msitest\\augustus", 500);
3787 create_database(msifile
, adm_tables
, sizeof(adm_tables
) / sizeof(msi_table
));
3788 set_admin_summary_info(msifileW
);
3790 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3792 r
= MsiInstallProductA(msifile
, NULL
);
3793 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3795 skip("Not enough rights to perform tests\n");
3798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3799 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3800 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3801 ok(!DeleteFileA("c:\\msitest\\augustus"), "File installed\n");
3802 ok(!RemoveDirectoryA("c:\\msitest"), "File installed\n");
3804 r
= MsiInstallProductA(msifile
, "ACTION=ADMIN");
3805 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3806 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3807 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3810 ok(DeleteFileA("c:\\msitest\\augustus"), "File not installed\n");
3811 ok(RemoveDirectoryA("c:\\msitest"), "File not installed\n");
3815 DeleteFileA(msifile
);
3816 DeleteFileA("msitest\\augustus");
3817 RemoveDirectoryA("msitest");
3820 static void set_admin_property_stream(LPCSTR file
)
3824 WCHAR fileW
[MAX_PATH
];
3827 const DWORD mode
= STGM_DIRECT
| STGM_READWRITE
| STGM_SHARE_EXCLUSIVE
;
3829 /* AdminProperties */
3830 static const WCHAR stmname
[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
3831 static const WCHAR data
[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
3832 'M','y','P','r','o','p','=','4','2',0};
3834 MultiByteToWideChar(CP_ACP
, 0, file
, -1, fileW
, MAX_PATH
);
3836 hr
= StgOpenStorage(fileW
, NULL
, mode
, NULL
, 0, &stg
);
3837 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3841 hr
= IStorage_CreateStream(stg
, stmname
, STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3842 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3844 hr
= IStream_Write(stm
, data
, sizeof(data
), &count
);
3845 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3847 IStream_Release(stm
);
3848 IStorage_Release(stg
);
3851 static void test_adminprops(void)
3855 if (is_process_limited())
3857 skip("process is limited\n");
3861 CreateDirectoryA("msitest", NULL
);
3862 create_file("msitest\\augustus", 500);
3864 create_database(msifile
, amp_tables
, sizeof(amp_tables
) / sizeof(msi_table
));
3865 set_admin_summary_info(msifileW
);
3866 set_admin_property_stream(msifile
);
3868 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3870 r
= MsiInstallProductA(msifile
, NULL
);
3871 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3873 skip("Not enough rights to perform tests\n");
3876 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3877 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3878 ok(delete_pf("msitest", FALSE
), "Directory created\n");
3881 DeleteFileA(msifile
);
3882 DeleteFileA("msitest\\augustus");
3883 RemoveDirectoryA("msitest");
3886 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
3888 CHAR path
[MAX_PATH
];
3890 lstrcpyA(path
, PROG_FILES_DIR
);
3891 lstrcatA(path
, "\\");
3892 lstrcatA(path
, file
);
3895 create_file_data(path
, data
, 500);
3897 CreateDirectoryA(path
, NULL
);
3900 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
3902 static void test_missingcab(void)
3906 if (is_process_limited())
3908 skip("process is limited\n");
3912 CreateDirectoryA("msitest", NULL
);
3913 create_file("msitest\\augustus", 500);
3914 create_file("maximus", 500);
3915 create_file("tiberius", 500);
3917 create_database(msifile
, mc_tables
, sizeof(mc_tables
) / sizeof(msi_table
));
3919 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3921 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3922 create_cab_file("test4.cab", MEDIA_SIZE
, "tiberius\0");
3924 create_pf("msitest", FALSE
);
3925 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3926 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3928 r
= MsiInstallProductA(msifile
, NULL
);
3929 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3931 skip("Not enough rights to perform tests\n");
3934 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3935 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3936 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3937 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3938 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3939 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3940 ok(!delete_pf("msitest\\gaius", TRUE
), "File installed\n");
3941 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3943 create_pf("msitest", FALSE
);
3944 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3945 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3946 create_pf("msitest\\gaius", TRUE
);
3948 r
= MsiInstallProductA(msifile
, "GAIUS=1");
3949 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3952 ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3953 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3955 ok(delete_pf("msitest\\caesar", TRUE
), "File removed\n");
3956 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3957 ok(delete_pf("msitest\\tiberius", TRUE
), "File removed\n");
3958 ok(delete_pf("msitest\\gaius", TRUE
), "File removed\n");
3959 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3962 delete_pf("msitest", FALSE
);
3963 DeleteFileA("msitest\\augustus");
3964 RemoveDirectoryA("msitest");
3965 DeleteFileA("maximus");
3966 DeleteFileA("tiberius");
3967 DeleteFileA("test1.cab");
3968 DeleteFileA("test4.cab");
3969 DeleteFileA(msifile
);
3972 static void test_sourcefolder(void)
3976 if (is_process_limited())
3978 skip("process is limited\n");
3982 CreateDirectoryA("msitest", NULL
);
3983 create_file("augustus", 500);
3985 create_database(msifile
, sf_tables
, sizeof(sf_tables
) / sizeof(msi_table
));
3987 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3989 r
= MsiInstallProductA(msifile
, NULL
);
3990 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3992 skip("Not enough rights to perform tests\n");
3995 ok(r
== ERROR_INSTALL_FAILURE
,
3996 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3997 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4000 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4002 RemoveDirectoryA("msitest");
4004 r
= MsiInstallProductA(msifile
, NULL
);
4005 ok(r
== ERROR_INSTALL_FAILURE
,
4006 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4007 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4010 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4014 DeleteFileA(msifile
);
4015 DeleteFileA("augustus");
4018 static void test_customaction51(void)
4022 if (is_process_limited())
4024 skip("process is limited\n");
4028 CreateDirectoryA("msitest", NULL
);
4029 create_file("msitest\\augustus", 500);
4031 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4033 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4035 r
= MsiInstallProductA(msifile
, NULL
);
4036 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4038 skip("Not enough rights to perform tests\n");
4041 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4042 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4043 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4046 DeleteFileA(msifile
);
4047 DeleteFileA("msitest\\augustus");
4048 RemoveDirectoryA("msitest");
4051 static void test_installstate(void)
4055 if (is_process_limited())
4057 skip("process is limited\n");
4061 CreateDirectoryA("msitest", NULL
);
4062 create_file("msitest\\alpha", 500);
4063 create_file("msitest\\beta", 500);
4064 create_file("msitest\\gamma", 500);
4065 create_file("msitest\\theta", 500);
4066 create_file("msitest\\delta", 500);
4067 create_file("msitest\\epsilon", 500);
4068 create_file("msitest\\zeta", 500);
4069 create_file("msitest\\iota", 500);
4070 create_file("msitest\\eta", 500);
4071 create_file("msitest\\kappa", 500);
4072 create_file("msitest\\lambda", 500);
4073 create_file("msitest\\mu", 500);
4075 create_database(msifile
, is_tables
, sizeof(is_tables
) / sizeof(msi_table
));
4077 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4079 r
= MsiInstallProductA(msifile
, NULL
);
4080 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4082 skip("Not enough rights to perform tests\n");
4085 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4086 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4087 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4088 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4089 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4090 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4091 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4092 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4093 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4094 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4095 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4096 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4097 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4098 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4100 r
= MsiInstallProductA(msifile
, "ADDLOCAL=\"one,two,three,four\"");
4101 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4102 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4103 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4104 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4105 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4106 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4107 ok(delete_pf("msitest\\epsilon", TRUE
), "File not installed\n");
4108 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4109 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4110 ok(delete_pf("msitest\\eta", TRUE
), "File not installed\n");
4111 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4112 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4113 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4114 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4116 r
= MsiInstallProductA(msifile
, "ADDSOURCE=\"one,two,three,four\"");
4117 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4118 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4119 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4120 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4121 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4122 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4123 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4124 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4125 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4126 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4127 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4128 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4129 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4130 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4132 r
= MsiInstallProductA(msifile
, "REMOVE=\"one,two,three,four\"");
4133 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4134 ok(!delete_pf("msitest\\alpha", TRUE
), "File installed\n");
4135 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4136 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4137 ok(!delete_pf("msitest\\theta", TRUE
), "File installed\n");
4138 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4139 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4140 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4141 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4142 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4143 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4144 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4145 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4146 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4149 DeleteFileA(msifile
);
4150 DeleteFileA("msitest\\alpha");
4151 DeleteFileA("msitest\\beta");
4152 DeleteFileA("msitest\\gamma");
4153 DeleteFileA("msitest\\theta");
4154 DeleteFileA("msitest\\delta");
4155 DeleteFileA("msitest\\epsilon");
4156 DeleteFileA("msitest\\zeta");
4157 DeleteFileA("msitest\\iota");
4158 DeleteFileA("msitest\\eta");
4159 DeleteFileA("msitest\\kappa");
4160 DeleteFileA("msitest\\lambda");
4161 DeleteFileA("msitest\\mu");
4162 RemoveDirectoryA("msitest");
4165 static const struct sourcepathmap
4167 BOOL sost
; /* shortone\shorttwo */
4168 BOOL solt
; /* shortone\longtwo */
4169 BOOL lost
; /* longone\shorttwo */
4170 BOOL lolt
; /* longone\longtwo */
4171 BOOL soste
; /* shortone\shorttwo source exists */
4172 BOOL solte
; /* shortone\longtwo source exists */
4173 BOOL loste
; /* longone\shorttwo source exists */
4174 BOOL lolte
; /* longone\longtwo source exists */
4179 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4180 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4181 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4182 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4183 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4184 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4185 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4186 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4187 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4188 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4189 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4190 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4191 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4192 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4193 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4194 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4195 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4196 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4197 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4198 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4199 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4200 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4201 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4202 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4203 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4204 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4205 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4206 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4207 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4208 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4209 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4210 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4211 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4212 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4213 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4214 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4215 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4216 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4217 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4218 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4219 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4220 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4221 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4222 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4223 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4224 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4225 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4226 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4227 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4228 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4229 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4230 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4231 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4232 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4233 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4234 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4235 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4236 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4237 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4238 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4239 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4240 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4241 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4242 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4243 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4244 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4245 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4246 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4247 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4248 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4249 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4250 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4251 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4252 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4253 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4254 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4255 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4256 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4257 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4258 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4259 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4260 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4261 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4262 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4263 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4264 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4265 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4266 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4267 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4268 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4269 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4270 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4271 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4272 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4273 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4274 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4275 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4276 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4277 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4278 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4279 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4280 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4281 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4282 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4283 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4284 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4285 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4286 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4287 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4288 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4289 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4290 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4291 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4292 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4293 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4294 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4295 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4296 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4297 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4298 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4299 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4300 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4301 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4302 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4303 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4304 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4305 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4306 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4307 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4308 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4309 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4310 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4311 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4312 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4313 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4314 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4315 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4316 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4317 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4318 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4319 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4320 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4321 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4322 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4323 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4324 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4325 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4326 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4327 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4328 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4329 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4330 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4331 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4332 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4333 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4334 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4335 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4336 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4337 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4338 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4339 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4340 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4341 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4342 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4343 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4344 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4345 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4346 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4347 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4348 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4349 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4350 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4351 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4352 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4353 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4354 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4355 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4356 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4357 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4358 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4359 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4360 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4361 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4362 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4363 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4364 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4365 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4366 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4367 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4368 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4369 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4370 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4371 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4372 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4373 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4374 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4375 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4376 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4377 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4378 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4379 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4380 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4381 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4382 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4383 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4384 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4385 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4386 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4387 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4388 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4389 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4390 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4391 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4392 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4393 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4394 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4395 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4396 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4397 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4398 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4399 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4400 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4401 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4402 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4403 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4404 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4405 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4406 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4407 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4408 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4409 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4410 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4411 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4412 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4413 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4414 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4415 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4416 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4417 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4418 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4419 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4420 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4421 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4422 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4423 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4424 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4425 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4426 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4427 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4428 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4429 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4430 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4431 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4432 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4433 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4434 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4437 static DWORD
get_pf_file_size(LPCSTR file
)
4439 CHAR path
[MAX_PATH
];
4443 lstrcpyA(path
, PROG_FILES_DIR
);
4444 lstrcatA(path
, "\\");
4445 lstrcatA(path
, file
);
4447 hfile
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
4448 if (hfile
== INVALID_HANDLE_VALUE
)
4449 return INVALID_FILE_SIZE
;
4451 size
= GetFileSize(hfile
, NULL
);
4456 static void test_sourcepath(void)
4460 if (!winetest_interactive
)
4462 skip("Run in interactive mode to run source path tests.\n");
4466 create_database(msifile
, sp_tables
, sizeof(sp_tables
) / sizeof(msi_table
));
4468 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4470 for (i
= 0; i
< sizeof(spmap
) / sizeof(spmap
[0]); i
++)
4474 CreateDirectoryA("shortone", NULL
);
4475 CreateDirectoryA("shortone\\shorttwo", NULL
);
4480 CreateDirectoryA("shortone", NULL
);
4481 CreateDirectoryA("shortone\\longtwo", NULL
);
4486 CreateDirectoryA("longone", NULL
);
4487 CreateDirectoryA("longone\\shorttwo", NULL
);
4492 CreateDirectoryA("longone", NULL
);
4493 CreateDirectoryA("longone\\longtwo", NULL
);
4497 create_file("shortone\\shorttwo\\augustus", 50);
4499 create_file("shortone\\longtwo\\augustus", 100);
4501 create_file("longone\\shorttwo\\augustus", 150);
4503 create_file("longone\\longtwo\\augustus", 200);
4505 r
= MsiInstallProductA(msifile
, NULL
);
4506 ok(r
== spmap
[i
].err
, "%d: Expected %d, got %d\n", i
, spmap
[i
].err
, r
);
4507 ok(get_pf_file_size("msitest\\augustus") == spmap
[i
].size
,
4508 "%d: Expected %d, got %d\n", i
, spmap
[i
].size
,
4509 get_pf_file_size("msitest\\augustus"));
4511 if (r
== ERROR_SUCCESS
)
4513 ok(delete_pf("msitest\\augustus", TRUE
), "%d: File not installed\n", i
);
4514 ok(delete_pf("msitest", FALSE
), "%d: Directory not created\n", i
);
4518 ok(!delete_pf("msitest\\augustus", TRUE
), "%d: File installed\n", i
);
4519 todo_wine
ok(!delete_pf("msitest", FALSE
), "%d: Directory installed\n", i
);
4522 DeleteFileA("shortone\\shorttwo\\augustus");
4523 DeleteFileA("shortone\\longtwo\\augustus");
4524 DeleteFileA("longone\\shorttwo\\augustus");
4525 DeleteFileA("longone\\longtwo\\augustus");
4526 RemoveDirectoryA("shortone\\shorttwo");
4527 RemoveDirectoryA("shortone\\longtwo");
4528 RemoveDirectoryA("longone\\shorttwo");
4529 RemoveDirectoryA("longone\\longtwo");
4530 RemoveDirectoryA("shortone");
4531 RemoveDirectoryA("longone");
4534 DeleteFileA(msifile
);
4537 static void test_missingcomponent(void)
4541 if (is_process_limited())
4543 skip("process is limited\n");
4547 CreateDirectoryA("msitest", NULL
);
4548 create_file("msitest\\hydrogen", 500);
4549 create_file("msitest\\helium", 500);
4550 create_file("msitest\\lithium", 500);
4551 create_file("beryllium", 500);
4553 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
4555 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4557 r
= MsiInstallProductA(msifile
, "INSTALLLEVEL=10 PROPVAR=42");
4558 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4560 skip("Not enough rights to perform tests\n");
4563 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4564 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4565 ok(pf_exists("msitest\\helium"), "File not installed\n");
4566 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4567 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4568 ok(pf_exists("msitest"), "File not installed\n");
4570 r
= MsiInstallProductA(msifile
, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
4571 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4572 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
4573 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
4574 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
4575 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4576 ok(!delete_pf("msitest", FALSE
), "Directory not removed\n");
4579 DeleteFileA(msifile
);
4580 DeleteFileA("msitest\\hydrogen");
4581 DeleteFileA("msitest\\helium");
4582 DeleteFileA("msitest\\lithium");
4583 DeleteFileA("beryllium");
4584 RemoveDirectoryA("msitest");
4587 static void test_sourcedirprop(void)
4590 CHAR props
[MAX_PATH
];
4592 if (is_process_limited())
4594 skip("process is limited\n");
4598 CreateDirectoryA("msitest", NULL
);
4599 create_file("msitest\\augustus", 500);
4601 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4603 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4605 r
= MsiInstallProductA(msifile
, NULL
);
4606 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4608 skip("Not enough rights to perform tests\n");
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("msitest\\augustus");
4616 RemoveDirectoryA("msitest");
4618 CreateDirectoryA("altsource", NULL
);
4619 CreateDirectoryA("altsource\\msitest", NULL
);
4620 create_file("altsource\\msitest\\augustus", 500);
4622 sprintf(props
, "SRCDIR=%s\\altsource\\", CURR_DIR
);
4624 r
= MsiInstallProductA(msifile
, props
);
4625 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4626 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4627 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4629 DeleteFileA("altsource\\msitest\\augustus");
4630 RemoveDirectoryA("altsource\\msitest");
4631 RemoveDirectoryA("altsource");
4634 DeleteFileA("msitest\\augustus");
4635 RemoveDirectoryA("msitest");
4636 DeleteFileA(msifile
);
4639 static void test_adminimage(void)
4643 if (is_process_limited())
4645 skip("process is limited\n");
4649 CreateDirectoryA("msitest", NULL
);
4650 CreateDirectoryA("msitest\\first", NULL
);
4651 CreateDirectoryA("msitest\\second", NULL
);
4652 CreateDirectoryA("msitest\\cabout", NULL
);
4653 CreateDirectoryA("msitest\\cabout\\new", NULL
);
4654 create_file("msitest\\one.txt", 100);
4655 create_file("msitest\\first\\two.txt", 100);
4656 create_file("msitest\\second\\three.txt", 100);
4657 create_file("msitest\\cabout\\four.txt", 100);
4658 create_file("msitest\\cabout\\new\\five.txt", 100);
4659 create_file("msitest\\filename", 100);
4660 create_file("msitest\\service.exe", 100);
4662 create_database_wordcount(msifile
, ai_tables
,
4663 sizeof(ai_tables
) / sizeof(msi_table
),
4664 100, msidbSumInfoSourceTypeAdminImage
, ";1033",
4665 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4667 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4669 r
= MsiInstallProductA(msifile
, NULL
);
4670 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4672 skip("Not enough rights to perform tests\n");
4675 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4677 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4678 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4679 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4680 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4681 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4682 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4683 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4684 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4685 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4686 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4687 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4688 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4691 DeleteFileA("msifile");
4692 DeleteFileA("msitest\\cabout\\new\\five.txt");
4693 DeleteFileA("msitest\\cabout\\four.txt");
4694 DeleteFileA("msitest\\second\\three.txt");
4695 DeleteFileA("msitest\\first\\two.txt");
4696 DeleteFileA("msitest\\one.txt");
4697 DeleteFileA("msitest\\service.exe");
4698 DeleteFileA("msitest\\filename");
4699 RemoveDirectoryA("msitest\\cabout\\new");
4700 RemoveDirectoryA("msitest\\cabout");
4701 RemoveDirectoryA("msitest\\second");
4702 RemoveDirectoryA("msitest\\first");
4703 RemoveDirectoryA("msitest");
4706 static void test_propcase(void)
4710 if (is_process_limited())
4712 skip("process is limited\n");
4716 CreateDirectoryA("msitest", NULL
);
4717 create_file("msitest\\augustus", 500);
4719 create_database(msifile
, pc_tables
, sizeof(pc_tables
) / sizeof(msi_table
));
4721 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4723 r
= MsiInstallProductA(msifile
, "MyProp=42");
4724 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4726 skip("Not enough rights to perform tests\n");
4729 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4730 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4731 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4734 DeleteFileA(msifile
);
4735 DeleteFileA("msitest\\augustus");
4736 RemoveDirectoryA("msitest");
4739 static void test_int_widths( void )
4741 static const WCHAR msitestW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
4742 static const WCHAR msitableW
[] = {'m','s','i','t','a','b','l','e','.','i','d','t',0};
4743 static const WCHAR slashW
[] = {'\\',0};
4744 static const char int0
[] = "int0\ni0\nint0\tint0\n1";
4745 static const char int1
[] = "int1\ni1\nint1\tint1\n1";
4746 static const char int2
[] = "int2\ni2\nint2\tint2\n1";
4747 static const char int3
[] = "int3\ni3\nint3\tint3\n1";
4748 static const char int4
[] = "int4\ni4\nint4\tint4\n1";
4749 static const char int5
[] = "int5\ni5\nint5\tint5\n1";
4750 static const char int8
[] = "int8\ni8\nint8\tint8\n1";
4759 { int0
, sizeof(int0
) - 1, ERROR_SUCCESS
},
4760 { int1
, sizeof(int1
) - 1, ERROR_SUCCESS
},
4761 { int2
, sizeof(int2
) - 1, ERROR_SUCCESS
},
4762 { int3
, sizeof(int3
) - 1, ERROR_FUNCTION_FAILED
},
4763 { int4
, sizeof(int4
) - 1, ERROR_SUCCESS
},
4764 { int5
, sizeof(int5
) - 1, ERROR_FUNCTION_FAILED
},
4765 { int8
, sizeof(int8
) - 1, ERROR_FUNCTION_FAILED
}
4767 WCHAR tmpdir
[MAX_PATH
], msitable
[MAX_PATH
], msidb
[MAX_PATH
];
4771 GetTempPathW(MAX_PATH
, tmpdir
);
4772 CreateDirectoryW(tmpdir
, NULL
);
4774 lstrcpyW(msitable
, tmpdir
);
4775 lstrcatW(msitable
, slashW
);
4776 lstrcatW(msitable
, msitableW
);
4778 lstrcpyW(msidb
, tmpdir
);
4779 lstrcatW(msidb
, slashW
);
4780 lstrcatW(msidb
, msitestW
);
4782 r
= MsiOpenDatabaseW(msidb
, MSIDBOPEN_CREATE
, &db
);
4783 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4785 for (i
= 0; i
< sizeof(tests
)/sizeof(tests
[0]); i
++)
4788 HANDLE handle
= CreateFileW(msitable
, GENERIC_WRITE
, 0, NULL
,
4789 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
4790 WriteFile(handle
, tests
[i
].data
, tests
[i
].size
, &count
, NULL
);
4791 CloseHandle(handle
);
4793 r
= MsiDatabaseImportW(db
, tmpdir
, msitableW
);
4794 ok(r
== tests
[i
].ret
, " %u expected %u, got %u\n", i
, tests
[i
].ret
, r
);
4796 r
= MsiDatabaseCommit(db
);
4797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4798 DeleteFileW(msitable
);
4803 RemoveDirectoryW(tmpdir
);
4806 static void test_shortcut(void)
4811 if (is_process_limited())
4813 skip("process is limited\n");
4817 create_test_files();
4818 create_database(msifile
, sc_tables
, sizeof(sc_tables
) / sizeof(msi_table
));
4820 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4822 r
= MsiInstallProductA(msifile
, NULL
);
4823 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4825 skip("Not enough rights to perform tests\n");
4828 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4830 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
4831 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4833 r
= MsiInstallProductA(msifile
, NULL
);
4834 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4838 hr
= CoInitializeEx(NULL
, COINIT_APARTMENTTHREADED
);
4839 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4841 r
= MsiInstallProductA(msifile
, NULL
);
4842 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4846 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4847 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4848 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4849 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4850 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4851 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4852 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4853 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4854 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4855 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4856 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4857 while (!delete_pf("msitest\\Shortcut.lnk", TRUE
) && GetLastError() == ERROR_SHARING_VIOLATION
) Sleep(1000);
4858 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4861 delete_test_files();
4862 DeleteFileA(msifile
);
4865 static void test_preselected(void)
4869 if (is_process_limited())
4871 skip("process is limited\n");
4875 create_test_files();
4876 create_database(msifile
, ps_tables
, sizeof(ps_tables
) / sizeof(msi_table
));
4878 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4880 r
= MsiInstallProductA(msifile
, "ADDLOCAL=One");
4881 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4883 skip("Not enough rights to perform tests\n");
4886 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4888 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File installed\n");
4889 ok(!delete_pf("msitest\\cabout\\new", FALSE
), "Directory created\n");
4890 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE
), "File installed\n");
4891 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory created\n");
4892 ok(!delete_pf("msitest\\changed\\three.txt", TRUE
), "File installed\n");
4893 ok(!delete_pf("msitest\\changed", FALSE
), "Directory created\n");
4894 ok(!delete_pf("msitest\\first\\two.txt", TRUE
), "File installed\n");
4895 ok(!delete_pf("msitest\\first", FALSE
), "Directory created\n");
4896 ok(!delete_pf("msitest\\filename", TRUE
), "File installed\n");
4897 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4898 ok(!delete_pf("msitest\\service.exe", TRUE
), "File installed\n");
4899 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4901 r
= MsiInstallProductA(msifile
, NULL
);
4902 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4904 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4905 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4906 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4907 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4908 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4909 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4910 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4911 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4912 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4913 ok(!delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4914 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4915 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4918 delete_test_files();
4919 DeleteFileA(msifile
);
4922 static void test_installed_prop(void)
4924 static const char prodcode
[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
4927 if (is_process_limited())
4929 skip("process is limited\n");
4933 create_test_files();
4934 create_database(msifile
, ip_tables
, sizeof(ip_tables
) / sizeof(msi_table
));
4936 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4938 r
= MsiInstallProductA(msifile
, "FULL=1");
4939 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4941 skip("Not enough rights to perform tests\n");
4944 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4946 r
= MsiInstallProductA(msifile
, "FULL=1");
4947 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4949 r
= MsiConfigureProductExA(prodcode
, INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
, "FULL=1");
4950 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4952 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4953 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4954 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4955 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4956 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4957 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4958 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4959 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4960 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4961 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4962 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4963 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4965 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4966 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4969 delete_test_files();
4970 DeleteFileA(msifile
);
4973 static void test_allusers_prop(void)
4977 if (is_process_limited())
4979 skip("process is limited\n");
4983 create_test_files();
4984 create_database(msifile
, aup_tables
, sizeof(aup_tables
) / sizeof(msi_table
));
4986 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4988 /* ALLUSERS property unset */
4989 r
= MsiInstallProductA(msifile
, "FULL=1");
4990 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4992 skip("Not enough rights to perform tests\n");
4995 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4997 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4998 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4999 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5000 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5001 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5002 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5003 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5004 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5005 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5006 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5007 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5008 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5010 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5011 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5013 delete_test_files();
5015 create_test_files();
5016 create_database(msifile
, aup2_tables
, sizeof(aup2_tables
) / sizeof(msi_table
));
5018 /* ALLUSERS property set to 1 */
5019 r
= MsiInstallProductA(msifile
, "FULL=1");
5020 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5022 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5023 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5024 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5025 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5026 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5027 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5028 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5029 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5030 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5031 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5032 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5033 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5035 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5036 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5038 delete_test_files();
5040 create_test_files();
5041 create_database(msifile
, aup3_tables
, sizeof(aup3_tables
) / sizeof(msi_table
));
5043 /* ALLUSERS property set to 2 */
5044 r
= MsiInstallProductA(msifile
, "FULL=1");
5045 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5047 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5048 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5049 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5050 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5051 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5052 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5053 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5054 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5055 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5056 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5057 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5058 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5060 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5061 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5063 delete_test_files();
5065 create_test_files();
5066 create_database(msifile
, aup4_tables
, sizeof(aup4_tables
) / sizeof(msi_table
));
5068 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
5069 r
= MsiInstallProductA(msifile
, "FULL=1");
5070 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5073 delete_test_files();
5074 DeleteFileA(msifile
);
5077 static const char session_manager
[] = "System\\CurrentControlSet\\Control\\Session Manager";
5078 static const char rename_ops
[] = "PendingFileRenameOperations";
5080 static void process_pending_renames(HKEY hkey
)
5082 char *buf
, *src
, *dst
, *buf2
, *buf2ptr
;
5087 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
);
5088 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5090 buf
= HeapAlloc(GetProcessHeap(), 0, size
+ 1);
5091 buf2ptr
= buf2
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, size
+ 1);
5093 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, (LPBYTE
)buf
, &size
);
5095 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5098 for (src
= buf
; *src
; src
= dst
+ strlen(dst
) + 1)
5100 DWORD flags
= MOVEFILE_COPY_ALLOWED
;
5103 dst
= src
+ strlen(src
) + 1;
5105 if (!strstr(src
, "msitest"))
5107 lstrcpyA(buf2ptr
, src
);
5108 buf2ptr
+= strlen(src
) + 1;
5109 lstrcpyA(buf2ptr
, dst
);
5110 buf2ptr
+= strlen(dst
) + 1;
5118 flags
|= MOVEFILE_REPLACE_EXISTING
;
5121 if (src
[0] == '\\' && src
[1] == '?' && src
[2] == '?' && src
[3] == '\\') src
+= 4;
5124 if (dst
[0] == '\\' && dst
[1] == '?' && dst
[2] == '?' && dst
[3] == '\\') dst
+= 4;
5125 fileret
= MoveFileExA(src
, dst
, flags
);
5126 ok(fileret
, "Failed to move file %s -> %s (%u)\n", src
, dst
, GetLastError());
5130 fileret
= DeleteFileA(src
);
5131 ok(fileret
, "Failed to delete file %s (%u)\n", src
, GetLastError());
5135 ok(found
, "Expected a 'msitest' entry\n");
5138 RegSetValueExA(hkey
, rename_ops
, 0, REG_MULTI_SZ
, (LPBYTE
)buf2
, buf2ptr
+ 1 - buf2
);
5140 RegDeleteValueA(hkey
, rename_ops
);
5142 HeapFree(GetProcessHeap(), 0, buf
);
5143 HeapFree(GetProcessHeap(), 0, buf2
);
5146 static BOOL
file_matches_data(LPCSTR file
, LPCSTR data
)
5148 DWORD len
, data_len
= strlen(data
);
5152 handle
= CreateFileA(file
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
5153 ok(handle
!= INVALID_HANDLE_VALUE
, "failed to open %s (%u)\n", file
, GetLastError());
5155 if (ReadFile(handle
, buf
, sizeof(buf
), &len
, NULL
) && len
>= data_len
)
5157 CloseHandle(handle
);
5158 return !memcmp(buf
, data
, data_len
);
5160 CloseHandle(handle
);
5164 static void test_file_in_use(void)
5169 char path
[MAX_PATH
];
5171 if (is_process_limited())
5173 skip("process is limited\n");
5177 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5179 CreateDirectoryA("msitest", NULL
);
5180 create_file("msitest\\maximus", 500);
5181 create_database(msifile
, fiu_tables
, sizeof(fiu_tables
) / sizeof(msi_table
));
5183 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5185 lstrcpyA(path
, PROG_FILES_DIR
);
5186 lstrcatA(path
, "\\msitest");
5187 CreateDirectoryA(path
, NULL
);
5189 lstrcatA(path
, "\\maximus");
5190 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5192 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5193 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5195 skip("Not enough rights to perform tests\n");
5198 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5199 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5201 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5203 process_pending_renames(hkey
);
5206 ok(file_matches_data(path
, "msitest\\maximus"), "Expected file to match\n");
5207 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5208 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5210 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5211 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5216 delete_pf("msitest\\maximus", TRUE
);
5217 delete_pf("msitest", FALSE
);
5218 DeleteFileA("msitest\\maximus");
5219 delete_test_files();
5220 DeleteFileA(msifile
);
5223 static void test_file_in_use_cab(void)
5228 char path
[MAX_PATH
];
5230 if (is_process_limited())
5232 skip("process is limited\n");
5236 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5238 CreateDirectoryA("msitest", NULL
);
5239 create_file("maximus", 500);
5240 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
5241 DeleteFileA("maximus");
5243 create_database(msifile
, fiuc_tables
, sizeof(fiuc_tables
) / sizeof(msi_table
));
5245 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5247 lstrcpyA(path
, PROG_FILES_DIR
);
5248 lstrcatA(path
, "\\msitest");
5249 CreateDirectoryA(path
, NULL
);
5251 lstrcatA(path
, "\\maximus");
5252 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5254 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5255 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5257 skip("Not enough rights to perform tests\n");
5260 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5261 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5263 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5265 process_pending_renames(hkey
);
5268 ok(file_matches_data(path
, "maximus"), "Expected file to match\n");
5269 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5270 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5272 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5273 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5278 delete_pf("msitest\\maximus", TRUE
);
5279 delete_pf("msitest", FALSE
);
5280 DeleteFileA("msitest\\maximus");
5282 delete_test_files();
5283 DeleteFileA(msifile
);
5286 static void test_feature_override(void)
5289 REGSAM access
= KEY_ALL_ACCESS
;
5291 if (is_process_limited())
5293 skip("process is limited\n");
5297 create_test_files();
5298 create_file("msitest\\override.txt", 1000);
5299 create_file("msitest\\preselected.txt", 1000);
5300 create_file("msitest\\notpreselected.txt", 1000);
5301 create_database(msifile
, fo_tables
, sizeof(fo_tables
) / sizeof(msi_table
));
5304 access
|= KEY_WOW64_64KEY
;
5306 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5308 r
= MsiInstallProductA(msifile
, "ADDLOCAL=override");
5309 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5311 skip("Not enough rights to perform tests\n");
5314 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5316 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5317 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
5318 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5320 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5321 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5323 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5325 r
= MsiInstallProductA(msifile
, "preselect=1");
5326 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5328 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5329 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5330 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5332 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5333 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5335 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5337 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5338 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5341 r
= MsiInstallProductA(msifile
, NULL
);
5342 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5344 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5345 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5346 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5348 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5349 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5351 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5353 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5354 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5357 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", access
);
5360 DeleteFileA("msitest\\override.txt");
5361 DeleteFileA("msitest\\preselected.txt");
5362 DeleteFileA("msitest\\notpreselected.txt");
5363 delete_test_files();
5364 DeleteFileA(msifile
);
5367 static void test_icon_table(void)
5369 MSIHANDLE hdb
= 0, record
;
5372 CHAR path
[MAX_PATH
];
5373 static const char prodcode
[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
5375 if (is_process_limited())
5377 skip("process is limited\n");
5381 create_database(msifile
, icon_base_tables
, sizeof(icon_base_tables
) / sizeof(msi_table
));
5383 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5385 res
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_TRANSACT
, &hdb
);
5386 ok(res
== ERROR_SUCCESS
, "failed to open db: %d\n", res
);
5388 query
= "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
5389 res
= run_query( hdb
, 0, query
);
5390 ok(res
== ERROR_SUCCESS
, "Can't create Icon table: %d\n", res
);
5392 create_file("icon.ico", 100);
5393 record
= MsiCreateRecord(1);
5394 res
= MsiRecordSetStreamA(record
, 1, "icon.ico");
5395 ok(res
== ERROR_SUCCESS
, "Failed to add stream data to record: %d\n", res
);
5397 query
= "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
5398 res
= run_query(hdb
, record
, query
);
5399 ok(res
== ERROR_SUCCESS
, "Insert into Icon table failed: %d\n", res
);
5401 res
= MsiCloseHandle(record
);
5402 ok(res
== ERROR_SUCCESS
, "Failed to close record handle: %d\n", res
);
5403 DeleteFileA("icon.ico");
5404 res
= MsiDatabaseCommit(hdb
);
5405 ok(res
== ERROR_SUCCESS
, "Failed to commit database: %d\n", res
);
5406 res
= MsiCloseHandle(hdb
);
5407 ok(res
== ERROR_SUCCESS
, "Failed to close database: %d\n", res
);
5410 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
5411 if (res
== ERROR_INSTALL_PACKAGE_REJECTED
)
5413 skip("Not enough rights to perform tests\n");
5414 DeleteFileA(msifile
);
5417 ok(res
== ERROR_SUCCESS
, "Failed to do per-user install: %d\n", res
);
5419 lstrcpyA(path
, APP_DATA_DIR
);
5420 lstrcatA(path
, "\\");
5421 lstrcatA(path
, "Microsoft\\Installer\\");
5422 lstrcatA(path
, prodcode
);
5423 lstrcatA(path
, "\\testicon");
5424 ok(file_exists(path
), "Per-user icon file isn't where it's expected (%s)\n", path
);
5426 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5427 ok(res
== ERROR_SUCCESS
, "Failed to uninstall per-user\n");
5428 ok(!file_exists(path
), "Per-user icon file not removed (%s)\n", path
);
5431 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5432 ok(res
== ERROR_SUCCESS
, "Failed to system-wide install: %d\n", res
);
5434 lstrcpyA(path
, WINDOWS_DIR
);
5435 lstrcatA(path
, "\\");
5436 lstrcatA(path
, "Installer\\");
5437 lstrcatA(path
, prodcode
);
5438 lstrcatA(path
, "\\testicon");
5439 ok(file_exists(path
), "System-wide icon file isn't where it's expected (%s)\n", path
);
5441 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5442 ok(res
== ERROR_SUCCESS
, "Failed to uninstall system-wide\n");
5443 ok(!file_exists(path
), "System-wide icon file not removed (%s)\n", path
);
5445 delete_pfmsitest_files();
5446 DeleteFileA(msifile
);
5449 static void test_package_validation(void)
5453 if (is_process_limited())
5455 skip("process is limited\n");
5459 CreateDirectoryA("msitest", NULL
);
5460 create_file("msitest\\maximus", 500);
5461 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1033");
5463 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5465 r
= MsiInstallProductA(msifile
, NULL
);
5466 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5468 skip("Not enough rights to perform tests\n");
5471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5472 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5473 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5475 DeleteFileA(msifile
);
5476 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;9999");
5478 r
= MsiInstallProductA(msifile
, NULL
);
5479 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5481 DeleteFileA(msifile
);
5482 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,1033;9999");
5484 r
= MsiInstallProductA(msifile
, NULL
);
5485 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5487 DeleteFileA(msifile
);
5488 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;1033");
5490 r
= MsiInstallProductA(msifile
, NULL
);
5491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5492 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5493 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5495 DeleteFileA(msifile
);
5496 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel64,9999;1033");
5498 r
= MsiInstallProductA(msifile
, NULL
);
5499 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5501 DeleteFileA(msifile
);
5502 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,1033;1033");
5504 r
= MsiInstallProductA(msifile
, NULL
);
5505 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5507 DeleteFileA(msifile
);
5508 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,9999;1033");
5510 r
= MsiInstallProductA(msifile
, NULL
);
5511 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5513 DeleteFileA(msifile
);
5514 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9999");
5516 r
= MsiInstallProductA(msifile
, NULL
);
5517 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5518 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5519 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5521 if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH
, SUBLANG_ENGLISH_US
))
5523 DeleteFileA(msifile
);
5524 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9");
5525 r
= MsiInstallProductA(msifile
, NULL
);
5526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5527 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5528 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5530 DeleteFileA(msifile
);
5531 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1024");
5532 r
= MsiInstallProductA(msifile
, NULL
);
5533 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5534 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5535 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5538 DeleteFileA(msifile
);
5539 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel32;0");
5541 r
= MsiInstallProductA(msifile
, NULL
);
5542 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5543 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5544 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5546 if (is_64bit
&& !is_wow64
)
5548 DeleteFileA(msifile
);
5549 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5551 r
= MsiInstallProductA(msifile
, NULL
);
5552 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5553 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5554 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5556 DeleteFileA(msifile
);
5557 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5559 r
= MsiInstallProductA(msifile
, NULL
);
5560 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5561 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5562 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5564 DeleteFileA(msifile
);
5565 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5567 r
= MsiInstallProductA(msifile
, NULL
);
5568 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5569 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5570 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5574 DeleteFileA(msifile
);
5575 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5577 r
= MsiInstallProductA(msifile
, NULL
);
5578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5579 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5580 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5582 DeleteFileA(msifile
);
5583 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5585 r
= MsiInstallProductA(msifile
, NULL
);
5586 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5587 ok(!delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5588 ok(!delete_pf_native("msitest", FALSE
), "directory exists\n");
5590 DeleteFileA(msifile
);
5591 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5593 r
= MsiInstallProductA(msifile
, NULL
);
5594 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5595 ok(delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5596 ok(delete_pf_native("msitest", FALSE
), "directory exists\n");
5600 DeleteFileA(msifile
);
5601 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5603 r
= MsiInstallProductA(msifile
, NULL
);
5604 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5605 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5606 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5608 DeleteFileA(msifile
);
5609 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Alpha,Beta,Intel;0");
5611 r
= MsiInstallProductA(msifile
, NULL
);
5612 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5613 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5614 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5616 DeleteFileA(msifile
);
5617 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5619 r
= MsiInstallProductA(msifile
, NULL
);
5620 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5621 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5622 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5624 DeleteFileA(msifile
);
5625 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5627 r
= MsiInstallProductA(msifile
, NULL
);
5628 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5629 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5630 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5634 /* Delete the files in the temp (current) folder */
5635 DeleteFileA(msifile
);
5636 DeleteFileA("msitest\\maximus");
5637 RemoveDirectoryA("msitest");
5640 static void test_upgrade_code(void)
5644 if (is_process_limited())
5646 skip("process is limited\n");
5650 CreateDirectoryA("msitest", NULL
);
5651 create_file("msitest\\upgradecode.txt", 1000);
5652 create_database(msifile
, uc_tables
, sizeof(uc_tables
) / sizeof(msi_table
));
5654 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5656 r
= MsiInstallProductA(msifile
, NULL
);
5657 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5659 ok(pf_exists("msitest\\upgradecode.txt"), "file not installed\n");
5661 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5664 ok(!delete_pf("msitest\\upgradecode.txt", TRUE
), "file not removed\n");
5665 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5667 DeleteFileA("msitest\\upgradecode.txt");
5668 RemoveDirectoryA("msitest");
5669 DeleteFileA(msifile
);
5672 static void test_mixed_package(void)
5678 if (is_process_limited())
5680 skip("process is limited\n");
5683 if (!is_wow64
&& !is_64bit
)
5685 skip("this test must be run on 64-bit\n");
5688 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5689 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "x64;1033");
5691 r
= MsiInstallProductA(msifile
, NULL
);
5692 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5694 skip("Not enough rights to perform tests\n");
5697 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5699 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5700 ok(!res
, "can't open 32-bit component key\n");
5701 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5702 ok(!res
, "value test1 not found\n");
5705 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5706 ok(!res
, "can't open 64-bit component key\n");
5707 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5708 ok(!res
, "value test2 not found\n");
5711 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5714 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5715 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5717 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5718 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5720 DeleteFileA( msifile
);
5721 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "Intel;1033");
5723 r
= MsiInstallProductA(msifile
, NULL
);
5724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5726 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5727 ok(!res
, "can't open 32-bit component key\n");
5728 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5729 ok(!res
, "value test1 not found\n");
5732 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5733 ok(!res
, "can't open 64-bit component key\n");
5734 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5735 ok(!res
, "value test2 not found\n");
5738 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5739 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5741 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5742 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5744 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5745 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5748 DeleteFileA( msifile
);
5751 static void test_volume_props(void)
5755 if (is_process_limited())
5757 skip("process is limited\n");
5760 CreateDirectoryA("msitest", NULL
);
5761 create_file("msitest\\volumeprop.txt", 1000);
5762 create_database(msifile
, vp_tables
, sizeof(vp_tables
)/sizeof(msi_table
));
5764 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5766 r
= MsiInstallProductA(msifile
, NULL
);
5767 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5769 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5770 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5772 DeleteFileA("msitest\\volumeprop.txt");
5773 RemoveDirectoryA("msitest");
5774 DeleteFileA(msifile
);
5777 static void test_shared_component(void)
5781 if (is_process_limited())
5783 skip("process is limited\n");
5786 CreateDirectoryA("msitest", NULL
);
5787 create_file("msitest\\sharedcomponent.txt", 1000);
5788 create_database_wordcount(msifile
, shc_tables
, sizeof(shc_tables
)/sizeof(shc_tables
[0]),
5789 100, 0, ";", "{A8826420-FD72-4E61-9E15-C1944CF4CBE1}");
5790 create_database_wordcount(msifile2
, shc2_tables
, sizeof(shc2_tables
)/sizeof(shc2_tables
[0]),
5791 100, 0, ";", "{A8B50B30-0E8A-4ACD-B3CF-1A5DC58B2739}");
5793 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5795 r
= MsiInstallProductA(msifile
, NULL
);
5796 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5798 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5800 r
= MsiInstallProductA(msifile2
, NULL
);
5801 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5803 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5805 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5806 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5808 ok(pf_exists("msitest\\sharedcomponent.txt"), "file removed\n");
5810 r
= MsiInstallProductA(msifile2
, "REMOVE=ALL");
5811 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5813 ok(!pf_exists("msitest\\sharedcomponent.txt"), "file not removed\n");
5815 DeleteFileA("msitest\\sharedcomponent.txt");
5816 RemoveDirectoryA("msitest");
5817 DeleteFileA(msifile
);
5818 DeleteFileA(msifile2
);
5824 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
5825 STATEMGRSTATUS status
;
5828 init_functionpointers();
5830 if (pIsWow64Process
)
5831 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
5833 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
5834 GetTempPathA(MAX_PATH
, temp_path
);
5835 SetCurrentDirectoryA(temp_path
);
5837 lstrcpyA(CURR_DIR
, temp_path
);
5838 len
= lstrlenA(CURR_DIR
);
5840 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
5841 CURR_DIR
[len
- 1] = 0;
5843 ok(get_system_dirs(), "failed to retrieve system dirs\n");
5844 ok(get_user_dirs(), "failed to retrieve user dirs\n");
5846 /* Create a restore point ourselves so we circumvent the multitude of restore points
5847 * that would have been created by all the installation and removal tests.
5849 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
5850 * creation of restore points.
5852 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
5854 memset(&status
, 0, sizeof(status
));
5855 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
5858 /* Create only one log file and don't append. We have to pass something
5859 * for the log mode for this to work. The logfile needs to have an absolute
5860 * path otherwise we still end up with some extra logfiles as some tests
5861 * change the current directory.
5863 lstrcpyA(log_file
, temp_path
);
5864 lstrcatA(log_file
, "\\msitest.log");
5865 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
5867 test_MsiInstallProduct();
5868 test_MsiSetComponentState();
5869 test_packagecoltypes();
5870 test_continuouscabs();
5873 test_samesequence();
5874 test_uiLevelFlags();
5875 test_readonlyfile();
5876 test_readonlyfile_cab();
5877 test_setdirproperty();
5878 test_cabisextracted();
5879 test_transformprop();
5880 test_currentworkingdir();
5884 test_sourcefolder();
5885 test_customaction51();
5886 test_installstate();
5888 test_missingcomponent();
5889 test_sourcedirprop();
5895 test_installed_prop();
5897 test_file_in_use_cab();
5898 test_allusers_prop();
5899 test_feature_override();
5901 test_package_validation();
5902 test_upgrade_code();
5903 test_mixed_package();
5904 test_volume_props();
5905 test_shared_component();
5907 DeleteFileA(log_file
);
5909 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
5911 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
5913 remove_restore_point(status
.llSequenceNumber
);
5915 FreeLibrary(hsrclient
);
5917 SetCurrentDirectoryA(prev_path
);