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_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
565 "s72\tS38\ts72\ti2\tS255\tS72\n"
566 "Component\tComponent\n"
567 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
569 static const CHAR ci2_feature_comp_dat
[] = "Feature_\tComponent_\n"
571 "FeatureComponents\tFeature_\tComponent_\n"
574 static const CHAR ci2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
575 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
577 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
579 static const CHAR pp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
581 "InstallExecuteSequence\tAction\n"
582 "ValidateProductID\t\t700\n"
583 "CostInitialize\t\t800\n"
585 "CostFinalize\t\t1000\n"
586 "InstallValidate\t\t1400\n"
587 "InstallInitialize\t\t1500\n"
588 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
589 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
590 "RemoveFiles\t\t3500\n"
591 "InstallFiles\t\t4000\n"
592 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
593 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
594 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
595 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
596 "InstallFinalize\t\t6600";
598 static const CHAR tp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
599 "s72\tS38\ts72\ti2\tS255\tS72\n"
600 "Component\tComponent\n"
601 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
603 static const CHAR cwd_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
604 "s72\tS38\ts72\ti2\tS255\tS72\n"
605 "Component\tComponent\n"
606 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
608 static const CHAR adm_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
609 "s72\tS38\ts72\ti2\tS255\tS72\n"
610 "Component\tComponent\n"
611 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
613 static const CHAR adm_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
614 "s72\ti2\tS64\tS0\tS255\n"
615 "CustomAction\tAction\n"
616 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
618 static const CHAR adm_admin_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
620 "AdminExecuteSequence\tAction\n"
621 "CostFinalize\t\t1000\n"
622 "CostInitialize\t\t800\n"
624 "SetPOSTADMIN\t\t950\n"
625 "InstallFiles\t\t4000\n"
626 "InstallFinalize\t\t6600\n"
627 "InstallInitialize\t\t1500\n"
628 "InstallValidate\t\t1400\n"
629 "LaunchConditions\t\t100";
631 static const CHAR amp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
632 "s72\tS38\ts72\ti2\tS255\tS72\n"
633 "Component\tComponent\n"
634 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
636 static const CHAR rem_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
638 "InstallExecuteSequence\tAction\n"
639 "ValidateProductID\t\t700\n"
640 "CostInitialize\t\t800\n"
642 "CostFinalize\t\t1000\n"
643 "InstallValidate\t\t1400\n"
644 "InstallInitialize\t\t1500\n"
645 "ProcessComponents\t\t1600\n"
646 "UnpublishFeatures\t\t1800\n"
647 "RemoveFiles\t\t3500\n"
648 "InstallFiles\t\t4000\n"
649 "RegisterProduct\t\t6100\n"
650 "PublishFeatures\t\t6300\n"
651 "PublishProduct\t\t6400\n"
652 "InstallFinalize\t\t6600";
654 static const CHAR mc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
655 "s72\tS38\ts72\ti2\tS255\tS72\n"
656 "Component\tComponent\n"
657 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
658 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
659 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
660 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
661 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
663 static const CHAR mc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
664 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
666 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
667 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
668 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
669 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
670 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
672 static const CHAR mc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
673 "i2\ti4\tL64\tS255\tS32\tS72\n"
675 "1\t1\t\ttest1.cab\tDISK1\t\n"
676 "2\t2\t\ttest2.cab\tDISK2\t\n"
677 "3\t3\t\ttest3.cab\tDISK3\t\n"
678 "4\t4\t\ttest3.cab\tDISK3\t\n"
679 "5\t5\t\ttest4.cab\tDISK4\t\n";
681 static const CHAR mc_file_hash_dat
[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
682 "s72\ti2\ti4\ti4\ti4\ti4\n"
683 "MsiFileHash\tFile_\n"
684 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
686 static const CHAR wrv_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
687 "s72\tS38\ts72\ti2\tS255\tS72\n"
688 "Component\tComponent\n"
689 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
691 static const CHAR ca51_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
692 "s72\tS38\ts72\ti2\tS255\tS72\n"
693 "Component\tComponent\n"
694 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
696 static const CHAR ca51_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
698 "InstallExecuteSequence\tAction\n"
699 "ValidateProductID\t\t700\n"
700 "GoodSetProperty\t\t725\n"
701 "BadSetProperty\t\t750\n"
702 "CostInitialize\t\t800\n"
703 "ResolveSource\t\t810\n"
705 "SetSourceDir\tSRCDIR\t910\n"
706 "CostFinalize\t\t1000\n"
707 "InstallValidate\t\t1400\n"
708 "InstallInitialize\t\t1500\n"
709 "InstallFiles\t\t4000\n"
710 "InstallFinalize\t\t6600";
712 static const CHAR ca51_custom_action_dat
[] = "Action\tType\tSource\tTarget\n"
714 "CustomAction\tAction\n"
715 "GoodSetProperty\t51\tMYPROP\t42\n"
716 "BadSetProperty\t51\t\tMYPROP\n"
717 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
719 static const CHAR is_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
720 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
722 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
723 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
724 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
725 "four\t\t\t\t2\t0\t\t0"; /* disabled */
727 static const CHAR is_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
728 "s72\tS38\ts72\ti2\tS255\tS72\n"
729 "Component\tComponent\n"
730 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
731 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
732 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
733 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
734 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
735 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
736 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
737 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
738 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
739 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
740 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
741 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
743 static const CHAR is_feature_comp_dat
[] = "Feature_\tComponent_\n"
745 "FeatureComponents\tFeature_\tComponent_\n"
759 static const CHAR is_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
760 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
762 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
763 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
764 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
765 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
766 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
767 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
768 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
769 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
770 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
771 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
772 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
773 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
775 static const CHAR is_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
776 "i2\ti4\tL64\tS255\tS32\tS72\n"
778 "1\t12\t\t\tDISK1\t\n";
780 static const CHAR sp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
781 "s72\tS38\ts72\ti2\tS255\tS72\n"
782 "Component\tComponent\n"
783 "augustus\t\tTWODIR\t0\t\taugustus\n";
785 static const CHAR sp_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
787 "Directory\tDirectory\n"
788 "TARGETDIR\t\tSourceDir\n"
789 "ProgramFilesFolder\tTARGETDIR\t.\n"
790 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
791 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
792 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
794 static const CHAR mcp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
795 "s72\tS38\ts72\ti2\tS255\tS72\n"
796 "Component\tComponent\n"
797 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
798 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
799 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
801 static const CHAR mcp_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
802 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
804 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
805 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
806 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
808 static const CHAR mcp_feature_comp_dat
[] = "Feature_\tComponent_\n"
810 "FeatureComponents\tFeature_\tComponent_\n"
811 "hydroxyl\thydrogen\n"
815 static const CHAR mcp_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
816 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
818 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
819 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
820 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
821 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
823 static const CHAR ai_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
824 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
826 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
827 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
828 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
829 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
830 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
831 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
832 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
834 static const CHAR ip_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
836 "InstallExecuteSequence\tAction\n"
837 "CostFinalize\t\t1000\n"
838 "ValidateProductID\t\t700\n"
839 "CostInitialize\t\t800\n"
841 "RemoveFiles\t\t3500\n"
842 "InstallFiles\t\t4000\n"
843 "RegisterUser\t\t6000\n"
844 "RegisterProduct\t\t6100\n"
845 "PublishFeatures\t\t6300\n"
846 "PublishProduct\t\t6400\n"
847 "InstallFinalize\t\t6600\n"
848 "InstallInitialize\t\t1500\n"
849 "ProcessComponents\t\t1600\n"
850 "UnpublishFeatures\t\t1800\n"
851 "InstallValidate\t\t1400\n"
852 "LaunchConditions\t\t100\n"
853 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
855 static const CHAR ip_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
856 "s72\ti2\tS64\tS0\tS255\n"
857 "CustomAction\tAction\n"
858 "TestInstalledProp\t19\t\tTest failed\t\n";
860 static const CHAR aup_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
862 "InstallExecuteSequence\tAction\n"
863 "CostFinalize\t\t1000\n"
864 "ValidateProductID\t\t700\n"
865 "CostInitialize\t\t800\n"
867 "RemoveFiles\t\t3500\n"
868 "InstallFiles\t\t4000\n"
869 "RegisterUser\t\t6000\n"
870 "RegisterProduct\t\t6100\n"
871 "PublishFeatures\t\t6300\n"
872 "PublishProduct\t\t6400\n"
873 "InstallFinalize\t\t6600\n"
874 "InstallInitialize\t\t1500\n"
875 "ProcessComponents\t\t1600\n"
876 "UnpublishFeatures\t\t1800\n"
877 "InstallValidate\t\t1400\n"
878 "LaunchConditions\t\t100\n"
879 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
881 static const CHAR aup2_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
883 "InstallExecuteSequence\tAction\n"
884 "CostFinalize\t\t1000\n"
885 "ValidateProductID\t\t700\n"
886 "CostInitialize\t\t800\n"
888 "RemoveFiles\t\t3500\n"
889 "InstallFiles\t\t4000\n"
890 "RegisterUser\t\t6000\n"
891 "RegisterProduct\t\t6100\n"
892 "PublishFeatures\t\t6300\n"
893 "PublishProduct\t\t6400\n"
894 "InstallFinalize\t\t6600\n"
895 "InstallInitialize\t\t1500\n"
896 "ProcessComponents\t\t1600\n"
897 "UnpublishFeatures\t\t1800\n"
898 "InstallValidate\t\t1400\n"
899 "LaunchConditions\t\t100\n"
900 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
902 static const CHAR aup3_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
904 "InstallExecuteSequence\tAction\n"
905 "CostFinalize\t\t1000\n"
906 "ValidateProductID\t\t700\n"
907 "CostInitialize\t\t800\n"
909 "RemoveFiles\t\t3500\n"
910 "InstallFiles\t\t4000\n"
911 "RegisterUser\t\t6000\n"
912 "RegisterProduct\t\t6100\n"
913 "PublishFeatures\t\t6300\n"
914 "PublishProduct\t\t6400\n"
915 "InstallFinalize\t\t6600\n"
916 "InstallInitialize\t\t1500\n"
917 "ProcessComponents\t\t1600\n"
918 "UnpublishFeatures\t\t1800\n"
919 "InstallValidate\t\t1400\n"
920 "LaunchConditions\t\t100\n"
921 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
923 static const CHAR aup_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
924 "s72\ti2\tS64\tS0\tS255\n"
925 "CustomAction\tAction\n"
926 "TestAllUsersProp\t19\t\tTest failed\t\n";
928 static const CHAR fo_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
929 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
931 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
932 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
933 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
935 static const CHAR fo_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
936 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
938 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
939 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
940 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
942 static const CHAR fo_condition_dat
[] = "Feature_\tLevel\tCondition\n"
944 "Condition\tFeature_\tLevel\n"
945 "preselected\t0\tPreselected\n"
946 "notpreselected\t0\tNOT Preselected\n";
948 static const CHAR fo_feature_comp_dat
[] = "Feature_\tComponent_\n"
950 "FeatureComponents\tFeature_\tComponent_\n"
951 "override\toverride\n"
952 "preselected\tpreselected\n"
953 "notpreselected\tnotpreselected\n";
955 static const CHAR fo_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
956 "s72\tS38\ts72\ti2\tS255\tS72\n"
957 "Component\tComponent\n"
958 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
959 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
960 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
962 static const CHAR fo_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
963 "s72\ti2\tS64\tS0\tS255\n"
964 "CustomAction\tAction\n"
965 "SetPreselected\t51\tPreselected\t1\t\n";
967 static const CHAR fo_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
969 "InstallExecuteSequence\tAction\n"
970 "LaunchConditions\t\t100\n"
971 "SetPreselected\tpreselect=1\t200\n"
972 "CostInitialize\t\t800\n"
974 "CostFinalize\t\t1000\n"
975 "InstallValidate\t\t1400\n"
976 "InstallInitialize\t\t1500\n"
977 "ProcessComponents\t\t1600\n"
978 "RemoveFiles\t\t1700\n"
979 "InstallFiles\t\t2000\n"
980 "RegisterProduct\t\t5000\n"
981 "PublishFeatures\t\t5100\n"
982 "PublishProduct\t\t5200\n"
983 "InstallFinalize\t\t6000\n";
985 static const CHAR uc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
986 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
988 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
990 static const CHAR uc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
991 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
993 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
995 static const CHAR uc_feature_comp_dat
[] = "Feature_\tComponent_\n"
997 "FeatureComponents\tFeature_\tComponent_\n"
998 "upgradecode\tupgradecode\n";
1000 static const CHAR uc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1001 "s72\tS38\ts72\ti2\tS255\tS72\n"
1002 "Component\tComponent\n"
1003 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
1005 static const CHAR uc_property_dat
[] = "Property\tValue\n"
1007 "Property\tProperty\n"
1009 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
1010 "ProductName\tMSITEST\n"
1011 "ProductVersion\t1.1.1\n"
1012 "UpgradeCode\t#UPGEADECODE#\n"
1013 "MSIFASTINSTALL\t1\n";
1015 static const CHAR uc_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
1017 "InstallExecuteSequence\tAction\n"
1018 "LaunchConditions\t\t100\n"
1019 "CostInitialize\t\t200\n"
1021 "CostFinalize\t\t400\n"
1022 "InstallInitialize\t\t500\n"
1023 "ProcessComponents\t\t600\n"
1024 "InstallValidate\t\t700\n"
1025 "RemoveFiles\t\t800\n"
1026 "InstallFiles\t\t900\n"
1027 "RegisterProduct\t\t1000\n"
1028 "PublishFeatures\t\t1100\n"
1029 "PublishProduct\t\t1200\n"
1030 "InstallFinalize\t\t1300\n";
1032 static const char mixed_feature_dat
[] =
1033 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1034 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1035 "Feature\tFeature\n"
1036 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1037 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1039 static const char mixed_feature_comp_dat
[] =
1040 "Feature_\tComponent_\n"
1042 "FeatureComponents\tFeature_\tComponent_\n"
1044 "feature2\tcomp2\n";
1046 static const char mixed_component_dat
[] =
1047 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1048 "s72\tS38\ts72\ti2\tS255\tS72\n"
1049 "Component\tComponent\n"
1050 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1051 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1053 static const char mixed_registry_dat
[] =
1054 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1055 "s72\ti2\tl255\tL255\tL0\ts72\n"
1056 "Registry\tRegistry\n"
1057 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1058 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n"
1059 "regdata3\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest32\tcomp1\n"
1060 "regdata4\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest32.dll\tcomp1\n"
1061 "regdata5\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest64\tcomp2\n"
1062 "regdata6\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest64.dll\tcomp2\n";
1064 static const char mixed_install_exec_seq_dat
[] =
1065 "Action\tCondition\tSequence\n"
1067 "InstallExecuteSequence\tAction\n"
1068 "LaunchConditions\t\t100\n"
1069 "CostInitialize\t\t200\n"
1071 "CostFinalize\t\t400\n"
1072 "InstallValidate\t\t500\n"
1073 "InstallInitialize\t\t600\n"
1074 "ProcessComponents\t\t700\n"
1075 "UnpublishFeatures\t\t800\n"
1076 "RemoveRegistryValues\t\t900\n"
1077 "WriteRegistryValues\t\t1000\n"
1078 "RegisterProduct\t\t1100\n"
1079 "PublishFeatures\t\t1200\n"
1080 "PublishProduct\t\t1300\n"
1081 "InstallFinalize\t\t1400\n";
1083 static const char vp_file_dat
[] =
1084 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1085 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1087 "volumeprop\tcomp\tvolumeprop.txt\t1000\t\t\t8192\t1\n";
1089 static const char vp_feature_dat
[] =
1090 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1091 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1092 "Feature\tFeature\n"
1093 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1095 static const char vp_feature_comp_dat
[] =
1096 "Feature_\tComponent_\n"
1098 "FeatureComponents\tFeature_\tComponent_\n"
1101 static const char vp_component_dat
[] =
1102 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1103 "s72\tS38\ts72\ti2\tS255\tS72\n"
1104 "Component\tComponent\n"
1105 "comp\t{24364AE7-5B7F-496C-AF5A-54893639C567}\tMSITESTDIR\t0\t\tvolumeprop\n";
1107 static const char vp_custom_action_dat
[] =
1108 "Action\tType\tSource\tTarget\tISComments\n"
1109 "s72\ti2\tS64\tS0\tS255\n"
1110 "CustomAction\tAction\n"
1111 "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n"
1112 "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n"
1113 "TestPrimaryVolumeSpaceRequired0\t19\t\tPrimaryVolumeSpaceRequired set before CostFinalize\t\n"
1114 "TestPrimaryVolumeSpaceRemaining0\t19\t\tPrimaryVolumeSpaceRemaining set before CostFinalize\t\n"
1115 "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n"
1116 "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n"
1117 "TestPrimaryVolumeSpaceRequired1\t19\t\tPrimaryVolumeSpaceRequired not set before InstallValidate\t\n"
1118 "TestPrimaryVolumeSpaceRemaining1\t19\t\tPrimaryVolumeSpaceRemaining not set before InstallValidate\t\n"
1119 "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n"
1120 "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n"
1121 "TestPrimaryVolumeSpaceRequired2\t19\t\tPrimaryVolumeSpaceRequired not set after InstallValidate\t\n"
1122 "TestPrimaryVolumeSpaceRemaining2\t19\t\tPrimaryVolumeSpaceRemaining not set after InstallValidate\t\n";
1124 static const char vp_install_exec_seq_dat
[] =
1125 "Action\tCondition\tSequence\n"
1127 "InstallExecuteSequence\tAction\n"
1128 "LaunchConditions\t\t100\n"
1129 "CostInitialize\t\t200\n"
1131 "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n"
1132 "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n"
1133 "TestPrimaryVolumeSpaceRequired0\tPrimaryVolumeSpaceRequired AND NOT REMOVE\t510\n"
1134 "TestPrimaryVolumeSpaceRemaining0\tPrimaryVolumeSpaceRemaining AND NOT REMOVE\t520\n"
1135 "CostFinalize\t\t600\n"
1136 "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n"
1137 "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n"
1138 "TestPrimaryVolumeSpaceRequired1\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t810\n"
1139 "TestPrimaryVolumeSpaceRemaining1\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t820\n"
1140 "InstallValidate\t\t900\n"
1141 "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n"
1142 "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n"
1143 "TestPrimaryVolumeSpaceRequired2\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t1110\n"
1144 "TestPrimaryVolumeSpaceRemaining2\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t1120\n"
1145 "InstallInitialize\t\t1200\n"
1146 "ProcessComponents\t\t1300\n"
1147 "RemoveFiles\t\t1400\n"
1148 "InstallFiles\t\t1500\n"
1149 "RegisterProduct\t\t1600\n"
1150 "PublishFeatures\t\t1700\n"
1151 "PublishProduct\t\t1800\n"
1152 "InstallFinalize\t\t1900\n";
1154 static const char shc_property_dat
[] =
1157 "Property\tProperty\n"
1159 "ProductCode\t{5CD99CD0-69C7-409B-9905-82DD743CC840}\n"
1160 "ProductName\tMSITEST\n"
1161 "ProductVersion\t1.1.1\n"
1162 "MSIFASTINSTALL\t1\n";
1164 static const char shc2_property_dat
[] =
1167 "Property\tProperty\n"
1169 "ProductCode\t{4CEFADE5-DAFB-4C21-8EF2-4ED4F139F340}\n"
1170 "ProductName\tMSITEST2\n"
1171 "ProductVersion\t1.1.1\n"
1172 "MSIFASTINSTALL\t1\n";
1174 static const char shc_file_dat
[] =
1175 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1176 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1178 "sharedcomponent\tsharedcomponent\tsharedcomponent.txt\t1000\t\t\t8192\t1\n";
1180 static const char shc_feature_dat
[] =
1181 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1182 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1183 "Feature\tFeature\n"
1184 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1186 static const char shc_feature_comp_dat
[] =
1187 "Feature_\tComponent_\n"
1189 "FeatureComponents\tFeature_\tComponent_\n"
1190 "feature\tsharedcomponent\n";
1192 static const char shc_component_dat
[] =
1193 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1194 "s72\tS38\ts72\ti2\tS255\tS72\n"
1195 "Component\tComponent\n"
1196 "sharedcomponent\t{900A4ACB-DC6F-4795-A04B-81B530183D41}\tMSITESTDIR\t0\t\tsharedcomponent\n";
1198 static const char shc_custom_action_dat
[] =
1199 "Action\tType\tSource\tTarget\tISComments\n"
1200 "s72\ti2\tS64\tS0\tS255\n"
1201 "CustomAction\tAction\n"
1202 "TestComponentAction\t19\t\twrong component action on install\t\n";
1204 static const char shc_install_exec_seq_dat
[] =
1205 "Action\tCondition\tSequence\n"
1207 "InstallExecuteSequence\tAction\n"
1208 "LaunchConditions\t\t100\n"
1209 "CostInitialize\t\t200\n"
1211 "CostFinalize\t\t600\n"
1212 "InstallValidate\t\t900\n"
1213 "InstallInitialize\t\t1200\n"
1214 "ProcessComponents\t\t1300\n"
1215 "RemoveFiles\t\t1400\n"
1216 "InstallFiles\t\t1500\n"
1217 "TestComponentAction\tNOT REMOVE AND ($sharedcomponent <> 3)\t1600\n"
1218 "RegisterProduct\t\t1700\n"
1219 "PublishFeatures\t\t1800\n"
1220 "PublishProduct\t\t1900\n"
1221 "InstallFinalize\t\t2000\n";
1223 static const char ft_file_dat
[] =
1224 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1225 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1227 "featuretree\tcomp\tfeaturetree.txt\t1000\t\t\t8192\t1\n";
1229 static const char ft_comp_dat
[] =
1230 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1231 "s72\tS38\ts72\ti2\tS255\tS72\n"
1232 "Component\tComponent\n"
1233 "comp\t{12345678-1234-1234-1234-222222222222}\tTARGETDIR\t0\t\t\n"
1234 "comp2\t{12345678-1234-1234-1234-333333333333}\tTARGETDIR\t0\t\tfeaturetree\n";
1236 static const char ft_feature_dat
[] =
1237 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1238 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1239 "Feature\tFeature\n"
1240 "A\t\t\t\t2\t1\t\t0\n"
1241 "C\tB\t\t\t2\t1\t\t0\n"
1242 "B\tA\t\t\t4\t1\t\t0\n"
1243 "D\t\t\t\t2\t1\t\t0\n";
1245 static const char ft_feature_comp_dat
[] =
1246 "Feature_\tComponent_\n"
1248 "FeatureComponents\tFeature_\tComponent_\n"
1252 static const char ft_condition_dat
[] =
1253 "Feature_\tLevel\tCondition\n"
1255 "Condition\tFeature_\tLevel\n"
1256 "A\t0\t\"0\"<>INSTALLTYPE\n";
1258 static const char ft_custom_action_dat
[] =
1259 "Action\tType\tSource\tTarget\tISComments\n"
1260 "s72\ti2\tS64\tS0\tS255\n"
1261 "CustomAction\tAction\n"
1262 "Run A\t19\t\tA\t\n"
1263 "Run B\t19\t\tB\t\n"
1264 "Run C\t19\t\tC\t\n";
1266 static const char ft_install_exec_seq_dat
[] =
1267 "Action\tCondition\tSequence\n"
1269 "InstallExecuteSequence\tAction\n"
1270 "CostInitialize\t\t100\n"
1272 "CostFinalize\t\t300\n"
1273 "InstallValidate\t\t400\n"
1274 "InstallInitialize\t\t500\n"
1275 "Run C\t3 = &C AND NOT Installed\t600\n"
1276 "Run B\t3 = &B AND NOT Installed\t700\n"
1277 "Run A\t3 = &A AND NOT Installed\t800\n"
1278 "ProcessComponents\t\t900\n"
1279 "RemoveFiles\t\t1000\n"
1280 "InstallFiles\t\t1100\n"
1281 "RegisterProduct\t\t1200\n"
1282 "PublishFeatures\t\t1300\n"
1283 "PublishProduct\t\t1400\n"
1284 "InstallFinalize\t\t1500\n";
1286 typedef struct _msi_table
1288 const CHAR
*filename
;
1293 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1295 static const msi_table tables
[] =
1297 ADD_TABLE(component
),
1298 ADD_TABLE(directory
),
1300 ADD_TABLE(feature_comp
),
1302 ADD_TABLE(install_exec_seq
),
1304 ADD_TABLE(property
),
1305 ADD_TABLE(registry
),
1306 ADD_TABLE(service_install
),
1307 ADD_TABLE(service_control
)
1310 static const msi_table sc_tables
[] =
1312 ADD_TABLE(component
),
1313 ADD_TABLE(directory
),
1315 ADD_TABLE(feature_comp
),
1317 ADD_TABLE(install_exec_seq
),
1319 ADD_TABLE(property
),
1323 static const msi_table ps_tables
[] =
1325 ADD_TABLE(component
),
1326 ADD_TABLE(directory
),
1328 ADD_TABLE(feature_comp
),
1330 ADD_TABLE(install_exec_seq
),
1332 ADD_TABLE(property
),
1333 ADD_TABLE(condition
)
1336 static const msi_table up_tables
[] =
1338 ADD_TABLE(component
),
1339 ADD_TABLE(directory
),
1341 ADD_TABLE(feature_comp
),
1343 ADD_TABLE(install_exec_seq
),
1345 ADD_TABLE(up_property
),
1346 ADD_TABLE(registry
),
1347 ADD_TABLE(service_install
),
1348 ADD_TABLE(service_control
)
1351 static const msi_table up2_tables
[] =
1353 ADD_TABLE(component
),
1354 ADD_TABLE(directory
),
1356 ADD_TABLE(feature_comp
),
1358 ADD_TABLE(install_exec_seq
),
1360 ADD_TABLE(up2_property
),
1361 ADD_TABLE(registry
),
1362 ADD_TABLE(service_install
),
1363 ADD_TABLE(service_control
)
1366 static const msi_table up3_tables
[] =
1368 ADD_TABLE(component
),
1369 ADD_TABLE(directory
),
1371 ADD_TABLE(feature_comp
),
1373 ADD_TABLE(install_exec_seq
),
1375 ADD_TABLE(up3_property
),
1376 ADD_TABLE(registry
),
1377 ADD_TABLE(service_install
),
1378 ADD_TABLE(service_control
)
1381 static const msi_table up4_tables
[] =
1383 ADD_TABLE(component
),
1384 ADD_TABLE(directory
),
1386 ADD_TABLE(feature_comp
),
1388 ADD_TABLE(pp_install_exec_seq
),
1390 ADD_TABLE(property
),
1391 ADD_TABLE(registry
),
1392 ADD_TABLE(service_install
),
1393 ADD_TABLE(service_control
)
1396 static const msi_table up5_tables
[] =
1398 ADD_TABLE(component
),
1399 ADD_TABLE(directory
),
1401 ADD_TABLE(feature_comp
),
1403 ADD_TABLE(pp_install_exec_seq
),
1405 ADD_TABLE(up_property
),
1406 ADD_TABLE(registry
),
1407 ADD_TABLE(service_install
),
1408 ADD_TABLE(service_control
)
1411 static const msi_table up6_tables
[] =
1413 ADD_TABLE(component
),
1414 ADD_TABLE(directory
),
1416 ADD_TABLE(feature_comp
),
1418 ADD_TABLE(pp_install_exec_seq
),
1420 ADD_TABLE(up2_property
),
1421 ADD_TABLE(registry
),
1422 ADD_TABLE(service_install
),
1423 ADD_TABLE(service_control
)
1426 static const msi_table up7_tables
[] =
1428 ADD_TABLE(component
),
1429 ADD_TABLE(directory
),
1431 ADD_TABLE(feature_comp
),
1433 ADD_TABLE(pp_install_exec_seq
),
1435 ADD_TABLE(up3_property
),
1436 ADD_TABLE(registry
),
1437 ADD_TABLE(service_install
),
1438 ADD_TABLE(service_control
)
1441 static const msi_table cc_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(cc_media
),
1450 ADD_TABLE(property
),
1453 static const msi_table cc2_tables
[] =
1455 ADD_TABLE(cc2_component
),
1456 ADD_TABLE(directory
),
1457 ADD_TABLE(cc_feature
),
1458 ADD_TABLE(cc_feature_comp
),
1459 ADD_TABLE(cc2_file
),
1460 ADD_TABLE(install_exec_seq
),
1461 ADD_TABLE(cc_media
),
1462 ADD_TABLE(property
),
1465 static const msi_table cc3_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(cc3_media
),
1474 ADD_TABLE(property
),
1477 static const msi_table co_tables
[] =
1479 ADD_TABLE(cc_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(co_media
),
1486 ADD_TABLE(property
),
1489 static const msi_table co2_tables
[] =
1491 ADD_TABLE(cc_component
),
1492 ADD_TABLE(directory
),
1493 ADD_TABLE(cc_feature
),
1494 ADD_TABLE(cc_feature_comp
),
1496 ADD_TABLE(install_exec_seq
),
1497 ADD_TABLE(co2_media
),
1498 ADD_TABLE(property
),
1501 static const msi_table mm_tables
[] =
1503 ADD_TABLE(cc_component
),
1504 ADD_TABLE(directory
),
1505 ADD_TABLE(cc_feature
),
1506 ADD_TABLE(cc_feature_comp
),
1508 ADD_TABLE(install_exec_seq
),
1509 ADD_TABLE(mm_media
),
1510 ADD_TABLE(property
),
1513 static const msi_table ss_tables
[] =
1515 ADD_TABLE(cc_component
),
1516 ADD_TABLE(directory
),
1517 ADD_TABLE(cc_feature
),
1518 ADD_TABLE(cc_feature_comp
),
1520 ADD_TABLE(install_exec_seq
),
1521 ADD_TABLE(ss_media
),
1522 ADD_TABLE(property
),
1525 static const msi_table ui_tables
[] =
1527 ADD_TABLE(ui_component
),
1528 ADD_TABLE(directory
),
1529 ADD_TABLE(cc_feature
),
1530 ADD_TABLE(cc_feature_comp
),
1532 ADD_TABLE(install_exec_seq
),
1533 ADD_TABLE(ui_install_ui_seq
),
1534 ADD_TABLE(ui_custom_action
),
1535 ADD_TABLE(cc_media
),
1536 ADD_TABLE(property
),
1539 static const msi_table rof_tables
[] =
1541 ADD_TABLE(rof_component
),
1542 ADD_TABLE(directory
),
1543 ADD_TABLE(rof_feature
),
1544 ADD_TABLE(rof_feature_comp
),
1545 ADD_TABLE(rof_file
),
1546 ADD_TABLE(install_exec_seq
),
1547 ADD_TABLE(rof_media
),
1548 ADD_TABLE(property
),
1551 static const msi_table rofc_tables
[] =
1553 ADD_TABLE(rof_component
),
1554 ADD_TABLE(directory
),
1555 ADD_TABLE(rof_feature
),
1556 ADD_TABLE(rof_feature_comp
),
1557 ADD_TABLE(rofc_file
),
1558 ADD_TABLE(install_exec_seq
),
1559 ADD_TABLE(rofc_media
),
1560 ADD_TABLE(property
),
1563 static const msi_table sdp_tables
[] =
1565 ADD_TABLE(rof_component
),
1566 ADD_TABLE(directory
),
1567 ADD_TABLE(rof_feature
),
1568 ADD_TABLE(rof_feature_comp
),
1569 ADD_TABLE(rof_file
),
1570 ADD_TABLE(sdp_install_exec_seq
),
1571 ADD_TABLE(sdp_custom_action
),
1572 ADD_TABLE(rof_media
),
1573 ADD_TABLE(property
),
1576 static const msi_table cie_tables
[] =
1578 ADD_TABLE(cie_component
),
1579 ADD_TABLE(directory
),
1580 ADD_TABLE(cc_feature
),
1581 ADD_TABLE(cie_feature_comp
),
1582 ADD_TABLE(cie_file
),
1583 ADD_TABLE(install_exec_seq
),
1584 ADD_TABLE(cie_media
),
1585 ADD_TABLE(property
),
1588 static const msi_table tp_tables
[] =
1590 ADD_TABLE(tp_component
),
1591 ADD_TABLE(directory
),
1592 ADD_TABLE(rof_feature
),
1593 ADD_TABLE(ci2_feature_comp
),
1594 ADD_TABLE(ci2_file
),
1595 ADD_TABLE(install_exec_seq
),
1596 ADD_TABLE(rof_media
),
1597 ADD_TABLE(property
),
1600 static const msi_table cwd_tables
[] =
1602 ADD_TABLE(cwd_component
),
1603 ADD_TABLE(directory
),
1604 ADD_TABLE(rof_feature
),
1605 ADD_TABLE(ci2_feature_comp
),
1606 ADD_TABLE(ci2_file
),
1607 ADD_TABLE(install_exec_seq
),
1608 ADD_TABLE(rof_media
),
1609 ADD_TABLE(property
),
1612 static const msi_table adm_tables
[] =
1614 ADD_TABLE(adm_component
),
1615 ADD_TABLE(directory
),
1616 ADD_TABLE(rof_feature
),
1617 ADD_TABLE(ci2_feature_comp
),
1618 ADD_TABLE(ci2_file
),
1619 ADD_TABLE(install_exec_seq
),
1620 ADD_TABLE(rof_media
),
1621 ADD_TABLE(property
),
1622 ADD_TABLE(adm_custom_action
),
1623 ADD_TABLE(adm_admin_exec_seq
),
1626 static const msi_table amp_tables
[] =
1628 ADD_TABLE(amp_component
),
1629 ADD_TABLE(directory
),
1630 ADD_TABLE(rof_feature
),
1631 ADD_TABLE(ci2_feature_comp
),
1632 ADD_TABLE(ci2_file
),
1633 ADD_TABLE(install_exec_seq
),
1634 ADD_TABLE(rof_media
),
1635 ADD_TABLE(property
),
1638 static const msi_table mc_tables
[] =
1640 ADD_TABLE(mc_component
),
1641 ADD_TABLE(directory
),
1642 ADD_TABLE(cc_feature
),
1643 ADD_TABLE(cie_feature_comp
),
1645 ADD_TABLE(install_exec_seq
),
1646 ADD_TABLE(mc_media
),
1647 ADD_TABLE(property
),
1648 ADD_TABLE(mc_file_hash
),
1651 static const msi_table sf_tables
[] =
1653 ADD_TABLE(wrv_component
),
1654 ADD_TABLE(directory
),
1655 ADD_TABLE(rof_feature
),
1656 ADD_TABLE(ci2_feature_comp
),
1657 ADD_TABLE(ci2_file
),
1658 ADD_TABLE(install_exec_seq
),
1659 ADD_TABLE(rof_media
),
1660 ADD_TABLE(property
),
1663 static const msi_table ca51_tables
[] =
1665 ADD_TABLE(ca51_component
),
1666 ADD_TABLE(directory
),
1667 ADD_TABLE(rof_feature
),
1668 ADD_TABLE(ci2_feature_comp
),
1669 ADD_TABLE(ci2_file
),
1670 ADD_TABLE(ca51_install_exec_seq
),
1671 ADD_TABLE(rof_media
),
1672 ADD_TABLE(property
),
1673 ADD_TABLE(ca51_custom_action
),
1676 static const msi_table is_tables
[] =
1678 ADD_TABLE(is_component
),
1679 ADD_TABLE(directory
),
1680 ADD_TABLE(is_feature
),
1681 ADD_TABLE(is_feature_comp
),
1683 ADD_TABLE(install_exec_seq
),
1684 ADD_TABLE(is_media
),
1685 ADD_TABLE(property
),
1688 static const msi_table sp_tables
[] =
1690 ADD_TABLE(sp_component
),
1691 ADD_TABLE(sp_directory
),
1692 ADD_TABLE(rof_feature
),
1693 ADD_TABLE(ci2_feature_comp
),
1694 ADD_TABLE(ci2_file
),
1695 ADD_TABLE(install_exec_seq
),
1696 ADD_TABLE(rof_media
),
1697 ADD_TABLE(property
),
1700 static const msi_table mcp_tables
[] =
1702 ADD_TABLE(mcp_component
),
1703 ADD_TABLE(directory
),
1704 ADD_TABLE(mcp_feature
),
1705 ADD_TABLE(mcp_feature_comp
),
1706 ADD_TABLE(mcp_file
),
1707 ADD_TABLE(rem_install_exec_seq
),
1708 ADD_TABLE(rof_media
),
1709 ADD_TABLE(property
),
1712 static const msi_table ai_tables
[] =
1714 ADD_TABLE(component
),
1715 ADD_TABLE(directory
),
1717 ADD_TABLE(feature_comp
),
1719 ADD_TABLE(install_exec_seq
),
1724 static const msi_table pc_tables
[] =
1726 ADD_TABLE(ca51_component
),
1727 ADD_TABLE(directory
),
1728 ADD_TABLE(rof_feature
),
1729 ADD_TABLE(ci2_feature_comp
),
1730 ADD_TABLE(ci2_file
),
1731 ADD_TABLE(install_exec_seq
),
1732 ADD_TABLE(rof_media
),
1736 static const msi_table ip_tables
[] =
1738 ADD_TABLE(component
),
1739 ADD_TABLE(directory
),
1741 ADD_TABLE(feature_comp
),
1743 ADD_TABLE(ip_install_exec_seq
),
1744 ADD_TABLE(ip_custom_action
),
1749 static const msi_table aup_tables
[] =
1751 ADD_TABLE(component
),
1752 ADD_TABLE(directory
),
1754 ADD_TABLE(feature_comp
),
1756 ADD_TABLE(aup_install_exec_seq
),
1757 ADD_TABLE(aup_custom_action
),
1762 static const msi_table aup2_tables
[] =
1764 ADD_TABLE(component
),
1765 ADD_TABLE(directory
),
1767 ADD_TABLE(feature_comp
),
1769 ADD_TABLE(aup2_install_exec_seq
),
1770 ADD_TABLE(aup_custom_action
),
1772 ADD_TABLE(aup_property
)
1775 static const msi_table aup3_tables
[] =
1777 ADD_TABLE(component
),
1778 ADD_TABLE(directory
),
1780 ADD_TABLE(feature_comp
),
1782 ADD_TABLE(aup2_install_exec_seq
),
1783 ADD_TABLE(aup_custom_action
),
1785 ADD_TABLE(aup2_property
)
1788 static const msi_table aup4_tables
[] =
1790 ADD_TABLE(component
),
1791 ADD_TABLE(directory
),
1793 ADD_TABLE(feature_comp
),
1795 ADD_TABLE(aup3_install_exec_seq
),
1796 ADD_TABLE(aup_custom_action
),
1798 ADD_TABLE(aup2_property
)
1801 static const msi_table fiu_tables
[] =
1803 ADD_TABLE(rof_component
),
1804 ADD_TABLE(directory
),
1805 ADD_TABLE(rof_feature
),
1806 ADD_TABLE(rof_feature_comp
),
1807 ADD_TABLE(rof_file
),
1808 ADD_TABLE(pp_install_exec_seq
),
1809 ADD_TABLE(rof_media
),
1810 ADD_TABLE(property
),
1813 static const msi_table fiuc_tables
[] =
1815 ADD_TABLE(rof_component
),
1816 ADD_TABLE(directory
),
1817 ADD_TABLE(rof_feature
),
1818 ADD_TABLE(rof_feature_comp
),
1819 ADD_TABLE(rofc_file
),
1820 ADD_TABLE(pp_install_exec_seq
),
1821 ADD_TABLE(rofc_media
),
1822 ADD_TABLE(property
),
1825 static const msi_table fo_tables
[] =
1827 ADD_TABLE(directory
),
1829 ADD_TABLE(fo_component
),
1830 ADD_TABLE(fo_feature
),
1831 ADD_TABLE(fo_condition
),
1832 ADD_TABLE(fo_feature_comp
),
1833 ADD_TABLE(fo_custom_action
),
1834 ADD_TABLE(fo_install_exec_seq
),
1839 static const msi_table icon_base_tables
[] =
1841 ADD_TABLE(ci_component
),
1842 ADD_TABLE(directory
),
1843 ADD_TABLE(rof_feature
),
1844 ADD_TABLE(rof_feature_comp
),
1845 ADD_TABLE(rof_file
),
1846 ADD_TABLE(pp_install_exec_seq
),
1847 ADD_TABLE(rof_media
),
1848 ADD_TABLE(icon_property
),
1851 static const msi_table pv_tables
[] =
1853 ADD_TABLE(rof_component
),
1854 ADD_TABLE(directory
),
1855 ADD_TABLE(rof_feature
),
1856 ADD_TABLE(rof_feature_comp
),
1857 ADD_TABLE(rof_file
),
1858 ADD_TABLE(pv_install_exec_seq
),
1859 ADD_TABLE(rof_media
),
1863 static const msi_table uc_tables
[] =
1865 ADD_TABLE(directory
),
1866 ADD_TABLE(uc_component
),
1867 ADD_TABLE(uc_feature
),
1868 ADD_TABLE(uc_feature_comp
),
1870 ADD_TABLE(uc_install_exec_seq
),
1872 ADD_TABLE(uc_property
)
1875 static const msi_table mixed_tables
[] =
1877 ADD_TABLE(directory
),
1878 ADD_TABLE(mixed_component
),
1879 ADD_TABLE(mixed_feature
),
1880 ADD_TABLE(mixed_feature_comp
),
1881 ADD_TABLE(mixed_install_exec_seq
),
1882 ADD_TABLE(mixed_registry
),
1887 static const msi_table vp_tables
[] =
1889 ADD_TABLE(directory
),
1891 ADD_TABLE(vp_component
),
1892 ADD_TABLE(vp_feature
),
1893 ADD_TABLE(vp_feature_comp
),
1894 ADD_TABLE(vp_custom_action
),
1895 ADD_TABLE(vp_install_exec_seq
),
1900 static const msi_table shc_tables
[] =
1903 ADD_TABLE(directory
),
1904 ADD_TABLE(shc_file
),
1905 ADD_TABLE(shc_component
),
1906 ADD_TABLE(shc_feature
),
1907 ADD_TABLE(shc_feature_comp
),
1908 ADD_TABLE(shc_custom_action
),
1909 ADD_TABLE(shc_install_exec_seq
),
1910 ADD_TABLE(shc_property
)
1913 static const msi_table shc2_tables
[] =
1916 ADD_TABLE(directory
),
1917 ADD_TABLE(shc_file
),
1918 ADD_TABLE(shc_component
),
1919 ADD_TABLE(shc_feature
),
1920 ADD_TABLE(shc_feature_comp
),
1921 ADD_TABLE(shc_custom_action
),
1922 ADD_TABLE(shc_install_exec_seq
),
1923 ADD_TABLE(shc2_property
)
1926 static const msi_table ft_tables
[] =
1929 ADD_TABLE(directory
),
1932 ADD_TABLE(ft_feature
),
1933 ADD_TABLE(ft_feature_comp
),
1934 ADD_TABLE(ft_condition
),
1935 ADD_TABLE(ft_custom_action
),
1936 ADD_TABLE(ft_install_exec_seq
),
1940 /* cabinet definitions */
1942 /* make the max size large so there is only one cab file */
1943 #define MEDIA_SIZE 0x7FFFFFFF
1944 #define FOLDER_THRESHOLD 900000
1946 /* the FCI callbacks */
1948 static void * CDECL
mem_alloc(ULONG cb
)
1950 return HeapAlloc(GetProcessHeap(), 0, cb
);
1953 static void CDECL
mem_free(void *memory
)
1955 HeapFree(GetProcessHeap(), 0, memory
);
1958 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
1960 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
1964 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
1969 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
1970 BOOL fContinuation
, void *pv
)
1975 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
1979 DWORD dwShareMode
= 0;
1980 DWORD dwCreateDisposition
= OPEN_EXISTING
;
1982 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
1983 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1984 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
1986 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
1987 dwCreateDisposition
= OPEN_EXISTING
;
1989 dwCreateDisposition
= CREATE_NEW
;
1991 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
1992 dwCreateDisposition
, 0, NULL
);
1994 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
1996 return (INT_PTR
)handle
;
1999 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2001 HANDLE handle
= (HANDLE
)hf
;
2005 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
2006 ok(res
, "Failed to ReadFile\n");
2011 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2013 HANDLE handle
= (HANDLE
)hf
;
2017 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
2018 ok(res
, "Failed to WriteFile\n");
2023 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
2025 HANDLE handle
= (HANDLE
)hf
;
2026 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
2031 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
2033 HANDLE handle
= (HANDLE
)hf
;
2036 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
2037 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
2042 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
2044 BOOL ret
= DeleteFileA(pszFile
);
2045 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
2050 static void init_functionpointers(void)
2052 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2053 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2054 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2056 #define GET_PROC(mod, func) \
2057 p ## func = (void*)GetProcAddress(mod, #func); \
2059 trace("GetProcAddress(%s) failed\n", #func);
2061 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2062 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2063 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2065 GET_PROC(hadvapi32
, CheckTokenMembership
);
2066 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
2067 GET_PROC(hadvapi32
, OpenProcessToken
);
2068 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2069 GET_PROC(hkernel32
, IsWow64Process
)
2071 hsrclient
= LoadLibraryA("srclient.dll");
2072 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2073 GET_PROC(hsrclient
, SRSetRestorePointA
);
2078 static BOOL
is_process_limited(void)
2080 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2085 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2087 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2088 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0, &Group
) ||
2089 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2091 trace("Could not check if the current user is an administrator\n");
2099 /* Only administrators have enough privileges for these tests */
2103 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2106 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2109 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2111 return (ret
&& type
== TokenElevationTypeLimited
);
2116 static BOOL
check_record(MSIHANDLE rec
, UINT field
, LPCSTR val
)
2123 r
= MsiRecordGetStringA(rec
, field
, buffer
, &sz
);
2124 return (r
== ERROR_SUCCESS
) && !strcmp(val
, buffer
);
2127 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2131 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2132 GetTempFileNameA(".", "xx", 0, tempname
);
2134 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2136 lstrcpyA(pszTempName
, tempname
);
2137 HeapFree(GetProcessHeap(), 0, tempname
);
2141 HeapFree(GetProcessHeap(), 0, tempname
);
2146 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2147 USHORT
*pattribs
, int *err
, void *pv
)
2149 BY_HANDLE_FILE_INFORMATION finfo
;
2155 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2156 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2158 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2160 res
= GetFileInformationByHandle(handle
, &finfo
);
2161 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2163 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2164 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2166 attrs
= GetFileAttributesA(pszName
);
2167 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2169 return (INT_PTR
)handle
;
2172 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2174 char path
[MAX_PATH
];
2175 char filename
[MAX_PATH
];
2177 lstrcpyA(path
, CURR_DIR
);
2178 lstrcatA(path
, "\\");
2179 lstrcatA(path
, file
);
2181 lstrcpyA(filename
, file
);
2183 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2184 progress
, get_open_info
, compress
);
2187 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2189 ZeroMemory(pCabParams
, sizeof(CCAB
));
2191 pCabParams
->cb
= max_size
;
2192 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2193 pCabParams
->setID
= 0xbeef;
2194 pCabParams
->iCab
= 1;
2195 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2196 lstrcatA(pCabParams
->szCabPath
, "\\");
2197 lstrcpyA(pCabParams
->szCab
, name
);
2200 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2208 set_cab_parameters(&cabParams
, name
, max_size
);
2210 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2211 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2212 get_temp_file
, &cabParams
, NULL
);
2214 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2219 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2220 ok(res
, "Failed to add file: %s\n", ptr
);
2221 ptr
+= lstrlenA(ptr
) + 1;
2224 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2225 ok(res
, "Failed to flush the cabinet\n");
2227 res
= FCIDestroy(hfci
);
2228 ok(res
, "Failed to destroy the cabinet\n");
2231 static BOOL
get_user_dirs(void)
2236 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2237 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2241 if(RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
)){
2250 static BOOL
get_system_dirs(void)
2255 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2259 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2260 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
)) {
2266 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2267 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
)) {
2273 if (RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR_NATIVE
, &size
)) {
2280 if(!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2286 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2291 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2292 if (file
== INVALID_HANDLE_VALUE
)
2295 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2299 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2306 #define create_file(name, size) create_file_data(name, name, size)
2308 static void create_test_files(void)
2310 CreateDirectoryA("msitest", NULL
);
2311 create_file("msitest\\one.txt", 100);
2312 CreateDirectoryA("msitest\\first", NULL
);
2313 create_file("msitest\\first\\two.txt", 100);
2314 CreateDirectoryA("msitest\\second", NULL
);
2315 create_file("msitest\\second\\three.txt", 100);
2317 create_file("four.txt", 100);
2318 create_file("five.txt", 100);
2319 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2321 create_file("msitest\\filename", 100);
2322 create_file("msitest\\service.exe", 100);
2324 DeleteFileA("four.txt");
2325 DeleteFileA("five.txt");
2328 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2330 CHAR path
[MAX_PATH
];
2332 lstrcpyA(path
, PROG_FILES_DIR
);
2333 lstrcatA(path
, "\\");
2334 lstrcatA(path
, rel_path
);
2337 return DeleteFileA(path
);
2339 return RemoveDirectoryA(path
);
2342 static BOOL
delete_pf_native(const CHAR
*rel_path
, BOOL is_file
)
2344 CHAR path
[MAX_PATH
];
2346 lstrcpyA(path
, PROG_FILES_DIR_NATIVE
);
2347 lstrcatA(path
, "\\");
2348 lstrcatA(path
, rel_path
);
2351 return DeleteFileA(path
);
2353 return RemoveDirectoryA(path
);
2356 static BOOL
delete_cf(const CHAR
*rel_path
, BOOL is_file
)
2358 CHAR path
[MAX_PATH
];
2360 lstrcpyA(path
, COMMON_FILES_DIR
);
2361 lstrcatA(path
, "\\");
2362 lstrcatA(path
, rel_path
);
2365 return DeleteFileA(path
);
2367 return RemoveDirectoryA(path
);
2370 static BOOL
compare_pf_data(const char *filename
, const char *data
, DWORD size
)
2375 char *buffer
, path
[MAX_PATH
];
2377 lstrcpyA(path
, PROG_FILES_DIR
);
2378 lstrcatA(path
, "\\");
2379 lstrcatA(path
, filename
);
2381 handle
= CreateFileA(path
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2382 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
2385 ReadFile(handle
, buffer
, size
, &read
, NULL
);
2386 if (read
== size
&& !memcmp(data
, buffer
, size
)) ret
= TRUE
;
2387 HeapFree(GetProcessHeap(), 0, buffer
);
2389 CloseHandle(handle
);
2393 static void delete_test_files(void)
2395 DeleteFileA("msitest.msi");
2396 DeleteFileA("msitest.cab");
2397 DeleteFileA("msitest\\second\\three.txt");
2398 DeleteFileA("msitest\\first\\two.txt");
2399 DeleteFileA("msitest\\one.txt");
2400 DeleteFileA("msitest\\service.exe");
2401 DeleteFileA("msitest\\filename");
2402 RemoveDirectoryA("msitest\\second");
2403 RemoveDirectoryA("msitest\\first");
2404 RemoveDirectoryA("msitest");
2407 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2411 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
,
2412 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2413 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2417 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
,
2418 const char *template, const char *packagecode
)
2423 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2424 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2426 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2427 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2429 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
, packagecode
);
2430 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2432 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2433 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2435 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2436 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2438 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2439 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2441 /* write the summary changes back to the stream */
2442 r
= MsiSummaryInfoPersist(summary
);
2443 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2445 MsiCloseHandle(summary
);
2448 #define create_database(name, tables, num_tables) \
2449 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033", \
2450 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2452 #define create_database_template(name, tables, num_tables, version, template) \
2453 create_database_wordcount(name, tables, num_tables, version, 0, template, \
2454 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2456 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2457 int num_tables
, INT version
, INT wordcount
,
2458 const char *template, const char *packagecode
)
2465 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2466 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2467 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2469 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2472 /* import the tables into the database */
2473 for (j
= 0; j
< num_tables
; j
++)
2475 const msi_table
*table
= &tables
[j
];
2477 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2479 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2480 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2482 DeleteFileA(table
->filename
);
2485 write_msi_summary_info(db
, version
, wordcount
, template, packagecode
);
2487 r
= MsiDatabaseCommit(db
);
2488 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2491 HeapFree( GetProcessHeap(), 0, nameW
);
2494 static void check_service_is_installed(void)
2496 SC_HANDLE scm
, service
;
2499 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
2500 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
2502 service
= OpenServiceA(scm
, "TestService", SC_MANAGER_ALL_ACCESS
);
2503 ok(service
!= NULL
, "Failed to open TestService\n");
2505 res
= DeleteService(service
);
2506 ok(res
, "Failed to delete TestService\n");
2508 CloseServiceHandle(service
);
2509 CloseServiceHandle(scm
);
2512 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2514 RESTOREPOINTINFOA spec
;
2516 spec
.dwEventType
= event_type
;
2517 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2518 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2519 lstrcpyA(spec
.szDescription
, "msitest restore point");
2521 return pSRSetRestorePointA(&spec
, status
);
2524 static void remove_restore_point(DWORD seq_number
)
2528 res
= pSRRemoveRestorePoint(seq_number
);
2529 if (res
!= ERROR_SUCCESS
)
2530 trace("Failed to remove the restore point : %08x\n", res
);
2533 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2535 if (pRegDeleteKeyExA
)
2536 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2537 return RegDeleteKeyA( key
, subkey
);
2540 static void test_MsiInstallProduct(void)
2543 CHAR path
[MAX_PATH
];
2546 DWORD num
, size
, type
;
2547 REGSAM access
= KEY_ALL_ACCESS
;
2549 if (is_process_limited())
2551 skip("process is limited\n");
2556 access
|= KEY_WOW64_64KEY
;
2558 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2560 /* szPackagePath is NULL */
2561 r
= MsiInstallProductA(NULL
, "INSTALL=ALL");
2562 ok(r
== ERROR_INVALID_PARAMETER
,
2563 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2565 /* both szPackagePath and szCommandLine are NULL */
2566 r
= MsiInstallProductA(NULL
, NULL
);
2567 ok(r
== ERROR_INVALID_PARAMETER
,
2568 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2570 /* szPackagePath is empty */
2571 r
= MsiInstallProductA("", "INSTALL=ALL");
2572 ok(r
== ERROR_PATH_NOT_FOUND
,
2573 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r
);
2575 create_test_files();
2576 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2578 /* install, don't publish */
2579 r
= MsiInstallProductA(msifile
, NULL
);
2580 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2582 skip("Not enough rights to perform tests\n");
2585 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2587 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2588 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2589 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2590 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2591 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2592 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2593 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2594 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2595 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2596 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2597 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2598 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2600 res
= RegOpenKeyExA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", 0, access
, &hkey
);
2601 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2605 res
= RegQueryValueExA(hkey
, "Name", NULL
, &type
, (LPBYTE
)path
, &size
);
2606 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2607 ok(!lstrcmpA(path
, "imaname"), "Expected imaname, got %s\n", path
);
2611 res
= RegQueryValueExA(hkey
, "blah", NULL
, &type
, (LPBYTE
)path
, &size
);
2612 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2616 res
= RegQueryValueExA(hkey
, "number", NULL
, &type
, (LPBYTE
)&num
, &size
);
2617 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2618 ok(num
== 314, "Expected 314, got %d\n", num
);
2622 res
= RegQueryValueExA(hkey
, "OrderTestName", NULL
, &type
, (LPBYTE
)path
, &size
);
2623 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2624 ok(!lstrcmpA(path
, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path
);
2626 check_service_is_installed();
2628 delete_key(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", access
);
2630 /* not published, reinstall */
2631 r
= MsiInstallProductA(msifile
, NULL
);
2632 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2634 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2635 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2636 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2637 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2638 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2639 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2640 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2641 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2642 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2643 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2644 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2645 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2647 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2648 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2649 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2651 create_database(msifile
, up_tables
, sizeof(up_tables
) / sizeof(msi_table
));
2653 /* not published, RemovePreviousVersions set */
2654 r
= MsiInstallProductA(msifile
, NULL
);
2655 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2657 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2658 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2659 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2660 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2661 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2662 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2663 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2664 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2665 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2666 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2667 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2668 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2670 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2671 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2672 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2674 create_database(msifile
, up2_tables
, sizeof(up2_tables
) / sizeof(msi_table
));
2676 /* not published, version number bumped */
2677 r
= MsiInstallProductA(msifile
, NULL
);
2678 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2680 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2681 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2682 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2683 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2684 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2685 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2686 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2687 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2688 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2689 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2690 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2691 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2693 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2694 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2695 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2697 create_database(msifile
, up3_tables
, sizeof(up3_tables
) / sizeof(msi_table
));
2699 /* not published, RemovePreviousVersions set and version number bumped */
2700 r
= MsiInstallProductA(msifile
, NULL
);
2701 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2703 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2704 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2705 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2706 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2707 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2708 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2709 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2710 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2711 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2712 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2713 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2714 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2716 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2717 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2718 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2720 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2722 /* install, publish product */
2723 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
2724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2726 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2727 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2728 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2729 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2730 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2731 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2732 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2733 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2734 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2735 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2736 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2737 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2739 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2740 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2742 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2744 /* published, reinstall */
2745 r
= MsiInstallProductA(msifile
, NULL
);
2746 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2748 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2749 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2750 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2751 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2752 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2753 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2754 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2755 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2756 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2757 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2758 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2759 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2761 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2762 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2764 create_database(msifile
, up5_tables
, sizeof(up5_tables
) / sizeof(msi_table
));
2766 /* published product, RemovePreviousVersions set */
2767 r
= MsiInstallProductA(msifile
, NULL
);
2768 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2770 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2771 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2772 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2773 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2774 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2775 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2776 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2777 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2778 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2779 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2780 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2781 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2783 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2784 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2786 create_database(msifile
, up6_tables
, sizeof(up6_tables
) / sizeof(msi_table
));
2788 /* published product, version number bumped */
2789 r
= MsiInstallProductA(msifile
, NULL
);
2790 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2792 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2793 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2794 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2795 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2796 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2797 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2798 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2799 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2800 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2801 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2802 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2803 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2805 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2806 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2808 create_database(msifile
, up7_tables
, sizeof(up7_tables
) / sizeof(msi_table
));
2810 /* published product, RemovePreviousVersions set and version number bumped */
2811 r
= MsiInstallProductA(msifile
, NULL
);
2812 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2814 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2815 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2816 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2817 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2818 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2819 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2820 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2821 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2822 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2823 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2824 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2825 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2827 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2828 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2830 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
2831 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2834 delete_test_files();
2835 DeleteFileA(msifile
);
2838 static void test_MsiSetComponentState(void)
2840 INSTALLSTATE installed
, action
;
2842 char path
[MAX_PATH
];
2845 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2849 lstrcpyA(path
, CURR_DIR
);
2850 lstrcatA(path
, "\\");
2851 lstrcatA(path
, msifile
);
2853 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2855 r
= MsiOpenPackageA(path
, &package
);
2856 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2858 skip("Not enough rights to perform tests\n");
2861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2863 r
= MsiDoActionA(package
, "CostInitialize");
2864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2866 r
= MsiDoActionA(package
, "FileCost");
2867 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2869 r
= MsiDoActionA(package
, "CostFinalize");
2870 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2872 r
= MsiGetComponentStateA(package
, "dangler", &installed
, &action
);
2873 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2874 ok(installed
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", installed
);
2875 ok(action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2877 r
= MsiSetComponentStateA(package
, "dangler", INSTALLSTATE_SOURCE
);
2878 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2880 MsiCloseHandle(package
);
2884 DeleteFileA(msifile
);
2887 static void test_packagecoltypes(void)
2889 MSIHANDLE hdb
, view
, rec
;
2890 char path
[MAX_PATH
];
2891 WCHAR pathW
[MAX_PATH
];
2895 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2899 lstrcpyA(path
, CURR_DIR
);
2900 lstrcatA(path
, "\\");
2901 lstrcatA(path
, msifile
);
2902 MultiByteToWideChar( CP_ACP
, 0, path
, -1, pathW
, MAX_PATH
);
2904 r
= MsiOpenDatabaseW(pathW
, MSIDBOPEN_READONLY
, &hdb
);
2905 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2907 query
= "SELECT * FROM `Media`";
2908 r
= MsiDatabaseOpenViewA( hdb
, query
, &view
);
2909 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2911 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_NAMES
, &rec
);
2912 count
= MsiRecordGetFieldCount( rec
);
2913 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2914 ok(count
== 6, "Expected 6, got %d\n", count
);
2915 ok(check_record(rec
, 1, "DiskId"), "wrong column label\n");
2916 ok(check_record(rec
, 2, "LastSequence"), "wrong column label\n");
2917 ok(check_record(rec
, 3, "DiskPrompt"), "wrong column label\n");
2918 ok(check_record(rec
, 4, "Cabinet"), "wrong column label\n");
2919 ok(check_record(rec
, 5, "VolumeLabel"), "wrong column label\n");
2920 ok(check_record(rec
, 6, "Source"), "wrong column label\n");
2921 MsiCloseHandle(rec
);
2923 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_TYPES
, &rec
);
2924 count
= MsiRecordGetFieldCount( rec
);
2925 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2926 ok(count
== 6, "Expected 6, got %d\n", count
);
2927 ok(check_record(rec
, 1, "i2"), "wrong column label\n");
2928 ok(check_record(rec
, 2, "i4"), "wrong column label\n");
2929 ok(check_record(rec
, 3, "L64"), "wrong column label\n");
2930 ok(check_record(rec
, 4, "S255"), "wrong column label\n");
2931 ok(check_record(rec
, 5, "S32"), "wrong column label\n");
2932 ok(check_record(rec
, 6, "S72"), "wrong column label\n");
2934 MsiCloseHandle(rec
);
2935 MsiCloseHandle(view
);
2936 MsiCloseHandle(hdb
);
2939 DeleteFileA(msifile
);
2942 static void create_cc_test_files(void)
2947 static CHAR cab_context
[] = "test%d.cab";
2950 create_file("maximus", 500);
2951 create_file("augustus", 50000);
2952 create_file("tiberius", 500);
2953 create_file("caesar", 500);
2955 set_cab_parameters(&cabParams
, "test1.cab", 40000);
2957 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2958 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2959 get_temp_file
, &cabParams
, cab_context
);
2960 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2962 res
= add_file(hfci
, "maximus", tcompTYPE_NONE
);
2963 ok(res
, "Failed to add file maximus\n");
2965 res
= add_file(hfci
, "augustus", tcompTYPE_NONE
);
2966 ok(res
, "Failed to add file augustus\n");
2968 res
= add_file(hfci
, "tiberius", tcompTYPE_NONE
);
2969 ok(res
, "Failed to add file tiberius\n");
2971 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2972 ok(res
, "Failed to flush the cabinet\n");
2974 res
= FCIDestroy(hfci
);
2975 ok(res
, "Failed to destroy the cabinet\n");
2977 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2979 DeleteFileA("maximus");
2980 DeleteFileA("augustus");
2981 DeleteFileA("tiberius");
2982 DeleteFileA("caesar");
2985 static void delete_cab_files(void)
2987 SHFILEOPSTRUCTA shfl
;
2988 CHAR path
[MAX_PATH
+10];
2990 lstrcpyA(path
, CURR_DIR
);
2991 lstrcatA(path
, "\\*.cab");
2992 path
[strlen(path
) + 1] = '\0';
2995 shfl
.wFunc
= FO_DELETE
;
2998 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
;
3000 SHFileOperationA(&shfl
);
3003 static void test_continuouscabs(void)
3007 if (is_process_limited())
3009 skip("process is limited\n");
3013 create_cc_test_files();
3014 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
3016 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3018 r
= MsiInstallProductA(msifile
, NULL
);
3019 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3021 skip("Not enough rights to perform tests\n");
3026 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3027 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3028 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3029 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3030 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3034 DeleteFileA(msifile
);
3036 create_cc_test_files();
3037 create_database(msifile
, cc2_tables
, sizeof(cc2_tables
) / sizeof(msi_table
));
3039 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3041 r
= MsiInstallProductA(msifile
, NULL
);
3042 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3044 skip("Not enough rights to perform tests\n");
3048 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3049 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3050 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3051 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3052 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3053 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3057 DeleteFileA(msifile
);
3059 /* Tests to show that only msi cab filename is taken in case of mismatch with the one given by previous cab */
3061 /* Filename from cab is right and the one from msi is wrong */
3062 create_cc_test_files();
3063 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
3065 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3067 r
= MsiInstallProductA(msifile
, NULL
);
3068 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3070 skip("Not enough rights to perform tests\n");
3074 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3075 todo_wine
ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3076 ok(!delete_pf("msitest\\caesar", TRUE
), "File installed\n");
3077 todo_wine
ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3078 todo_wine
ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3082 DeleteFileA(msifile
);
3084 /* Filename from msi is right and the one from cab is wrong */
3085 create_cc_test_files();
3086 ok(MoveFileA("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
3087 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
3089 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3091 r
= MsiInstallProductA(msifile
, NULL
);
3092 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3094 skip("Not enough rights to perform tests\n");
3098 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3099 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3100 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3101 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3102 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3107 DeleteFileA(msifile
);
3110 static void test_caborder(void)
3114 create_file("imperator", 100);
3115 create_file("maximus", 500);
3116 create_file("augustus", 50000);
3117 create_file("caesar", 500);
3119 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
3121 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3123 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3124 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3125 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3127 r
= MsiInstallProductA(msifile
, NULL
);
3128 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3130 skip("Not enough rights to perform tests\n");
3133 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3134 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3135 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3138 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3139 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3144 create_cab_file("test1.cab", MEDIA_SIZE
, "imperator\0");
3145 create_cab_file("test2.cab", MEDIA_SIZE
, "maximus\0augustus\0");
3146 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3148 r
= MsiInstallProductA(msifile
, NULL
);
3149 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3150 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3151 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3152 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3153 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3156 DeleteFileA(msifile
);
3158 create_cc_test_files();
3159 create_database(msifile
, co_tables
, sizeof(co_tables
) / sizeof(msi_table
));
3161 r
= MsiInstallProductA(msifile
, NULL
);
3162 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3163 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3164 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3167 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3168 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3172 DeleteFileA(msifile
);
3174 create_cc_test_files();
3175 create_database(msifile
, co2_tables
, sizeof(co2_tables
) / sizeof(msi_table
));
3177 r
= MsiInstallProductA(msifile
, NULL
);
3178 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3179 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3182 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3183 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3184 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3189 DeleteFileA("imperator");
3190 DeleteFileA("maximus");
3191 DeleteFileA("augustus");
3192 DeleteFileA("caesar");
3193 DeleteFileA(msifile
);
3196 static void test_mixedmedia(void)
3200 if (is_process_limited())
3202 skip("process is limited\n");
3206 CreateDirectoryA("msitest", NULL
);
3207 create_file("msitest\\maximus", 500);
3208 create_file("msitest\\augustus", 500);
3209 create_file("caesar", 500);
3211 create_database(msifile
, mm_tables
, sizeof(mm_tables
) / sizeof(msi_table
));
3213 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3215 create_cab_file("test1.cab", MEDIA_SIZE
, "caesar\0");
3217 r
= MsiInstallProductA(msifile
, NULL
);
3218 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3220 skip("Not enough rights to perform tests\n");
3223 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3224 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3225 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3226 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3227 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3230 /* Delete the files in the temp (current) folder */
3231 DeleteFileA("msitest\\maximus");
3232 DeleteFileA("msitest\\augustus");
3233 RemoveDirectoryA("msitest");
3234 DeleteFileA("caesar");
3235 DeleteFileA("test1.cab");
3236 DeleteFileA(msifile
);
3239 static void test_samesequence(void)
3243 create_cc_test_files();
3244 create_database(msifile
, ss_tables
, sizeof(ss_tables
) / sizeof(msi_table
));
3246 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3248 r
= MsiInstallProductA(msifile
, NULL
);
3249 if (r
== ERROR_INSTALL_FAILURE
)
3251 win_skip("unprivileged user?\n");
3254 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3255 if (r
== ERROR_SUCCESS
)
3257 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3258 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3259 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3260 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3265 DeleteFileA(msifile
);
3268 static void test_uiLevelFlags(void)
3272 create_cc_test_files();
3273 create_database(msifile
, ui_tables
, sizeof(ui_tables
) / sizeof(msi_table
));
3275 MsiSetInternalUI(INSTALLUILEVEL_NONE
| INSTALLUILEVEL_SOURCERESONLY
, NULL
);
3277 r
= MsiInstallProductA(msifile
, NULL
);
3278 if (r
== ERROR_INSTALL_FAILURE
)
3280 win_skip("unprivileged user?\n");
3284 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3285 if (r
== ERROR_SUCCESS
)
3287 ok(!delete_pf("msitest\\maximus", TRUE
), "UI install occurred, but execute-only was requested.\n");
3288 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3289 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3290 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3295 DeleteFileA(msifile
);
3298 static BOOL
file_matches(LPSTR path
)
3304 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3305 NULL
, OPEN_EXISTING
, 0, NULL
);
3306 ZeroMemory(buf
, MAX_PATH
);
3307 ReadFile(file
, buf
, 15, &size
, NULL
);
3310 return !lstrcmpA(buf
, "msitest\\maximus");
3313 static void test_readonlyfile(void)
3318 CHAR path
[MAX_PATH
];
3320 if (is_process_limited())
3322 skip("process is limited\n");
3326 CreateDirectoryA("msitest", NULL
);
3327 create_file("msitest\\maximus", 500);
3328 create_database(msifile
, rof_tables
, sizeof(rof_tables
) / sizeof(msi_table
));
3330 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3332 lstrcpyA(path
, PROG_FILES_DIR
);
3333 lstrcatA(path
, "\\msitest");
3334 CreateDirectoryA(path
, NULL
);
3336 lstrcatA(path
, "\\maximus");
3337 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3338 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3340 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3343 r
= MsiInstallProductA(msifile
, NULL
);
3344 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3346 skip("Not enough rights to perform tests\n");
3349 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3350 ok(file_matches(path
), "Expected file to be overwritten\n");
3351 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3352 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3355 /* Delete the files in the temp (current) folder */
3356 DeleteFileA("msitest\\maximus");
3357 RemoveDirectoryA("msitest");
3358 DeleteFileA(msifile
);
3361 static void test_readonlyfile_cab(void)
3366 CHAR path
[MAX_PATH
];
3369 if (is_process_limited())
3371 skip("process is limited\n");
3375 CreateDirectoryA("msitest", NULL
);
3376 create_file("maximus", 500);
3377 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3378 DeleteFileA("maximus");
3380 create_database(msifile
, rofc_tables
, sizeof(rofc_tables
) / sizeof(msi_table
));
3382 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3384 lstrcpyA(path
, PROG_FILES_DIR
);
3385 lstrcatA(path
, "\\msitest");
3386 CreateDirectoryA(path
, NULL
);
3388 lstrcatA(path
, "\\maximus");
3389 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3390 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3392 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3395 r
= MsiInstallProductA(msifile
, NULL
);
3396 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3398 skip("Not enough rights to perform tests\n");
3401 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3403 memset( buf
, 0, sizeof(buf
) );
3404 if ((file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3405 NULL
, OPEN_EXISTING
, 0, NULL
)) != INVALID_HANDLE_VALUE
)
3407 ReadFile(file
, buf
, sizeof(buf
) - 1, &size
, NULL
);
3410 ok(!memcmp( buf
, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf
);
3411 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3412 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3415 /* Delete the files in the temp (current) folder */
3417 DeleteFileA("msitest\\maximus");
3418 RemoveDirectoryA("msitest");
3419 DeleteFileA(msifile
);
3422 static void test_setdirproperty(void)
3426 if (is_process_limited())
3428 skip("process is limited\n");
3432 CreateDirectoryA("msitest", NULL
);
3433 create_file("msitest\\maximus", 500);
3434 create_database(msifile
, sdp_tables
, sizeof(sdp_tables
) / sizeof(msi_table
));
3436 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3438 r
= MsiInstallProductA(msifile
, NULL
);
3439 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3441 skip("Not enough rights to perform tests\n");
3444 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3445 ok(delete_cf("msitest\\maximus", TRUE
), "File not installed\n");
3446 ok(delete_cf("msitest", FALSE
), "Directory not created\n");
3449 /* Delete the files in the temp (current) folder */
3450 DeleteFileA(msifile
);
3451 DeleteFileA("msitest\\maximus");
3452 RemoveDirectoryA("msitest");
3455 static void test_cabisextracted(void)
3459 if (is_process_limited())
3461 skip("process is limited\n");
3465 CreateDirectoryA("msitest", NULL
);
3466 create_file("msitest\\gaius", 500);
3467 create_file("maximus", 500);
3468 create_file("augustus", 500);
3469 create_file("caesar", 500);
3471 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3472 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3473 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3475 create_database(msifile
, cie_tables
, sizeof(cie_tables
) / sizeof(msi_table
));
3477 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3479 r
= MsiInstallProductA(msifile
, NULL
);
3480 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3482 skip("Not enough rights to perform tests\n");
3485 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3486 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3487 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3488 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3489 ok(delete_pf("msitest\\gaius", TRUE
), "File not installed\n");
3490 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3493 /* Delete the files in the temp (current) folder */
3495 DeleteFileA(msifile
);
3496 DeleteFileA("maximus");
3497 DeleteFileA("augustus");
3498 DeleteFileA("caesar");
3499 DeleteFileA("msitest\\gaius");
3500 RemoveDirectoryA("msitest");
3503 static BOOL
file_exists(LPCSTR file
)
3505 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
3508 static BOOL
pf_exists(LPCSTR file
)
3510 CHAR path
[MAX_PATH
];
3512 lstrcpyA(path
, PROG_FILES_DIR
);
3513 lstrcatA(path
, "\\");
3514 lstrcatA(path
, file
);
3516 return file_exists(path
);
3519 static void delete_pfmsitest_files(void)
3521 SHFILEOPSTRUCTA shfl
;
3522 CHAR path
[MAX_PATH
+11];
3524 lstrcpyA(path
, PROG_FILES_DIR
);
3525 lstrcatA(path
, "\\msitest\\*");
3526 path
[strlen(path
) + 1] = '\0';
3529 shfl
.wFunc
= FO_DELETE
;
3532 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
3534 SHFileOperationA(&shfl
);
3536 lstrcpyA(path
, PROG_FILES_DIR
);
3537 lstrcatA(path
, "\\msitest");
3538 RemoveDirectoryA(path
);
3541 static UINT
run_query(MSIHANDLE hdb
, MSIHANDLE hrec
, const char *query
)
3543 MSIHANDLE hview
= 0;
3546 r
= MsiDatabaseOpenViewA(hdb
, query
, &hview
);
3547 if(r
!= ERROR_SUCCESS
)
3550 r
= MsiViewExecute(hview
, hrec
);
3551 if(r
== ERROR_SUCCESS
)
3552 r
= MsiViewClose(hview
);
3553 MsiCloseHandle(hview
);
3557 static void set_transform_summary_info(void)
3560 MSIHANDLE suminfo
= 0;
3562 /* build summary info */
3563 r
= MsiGetSummaryInformationA(0, mstfile
, 3, &suminfo
);
3564 ok(r
== ERROR_SUCCESS
, "Failed to open summaryinfo\n");
3566 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
3567 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3569 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
3570 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3571 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3572 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3573 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3575 r
= MsiSummaryInfoSetPropertyA(suminfo
, PID_PAGECOUNT
, VT_I4
, 100, NULL
, NULL
);
3576 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3578 r
= MsiSummaryInfoPersist(suminfo
);
3579 ok(r
== ERROR_SUCCESS
, "Failed to make summary info persist\n");
3581 r
= MsiCloseHandle(suminfo
);
3582 ok(r
== ERROR_SUCCESS
, "Failed to close suminfo\n");
3585 static void generate_transform(void)
3587 MSIHANDLE hdb1
, hdb2
;
3591 /* start with two identical databases */
3592 CopyFileA(msifile
, msifile2
, FALSE
);
3594 r
= MsiOpenDatabaseW(msifile2W
, MSIDBOPEN_TRANSACT
, &hdb1
);
3595 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3597 r
= MsiDatabaseCommit(hdb1
);
3598 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
3600 r
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_READONLY
, &hdb2
);
3601 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3603 query
= "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3604 r
= run_query(hdb1
, 0, query
);
3605 ok(r
== ERROR_SUCCESS
, "failed to add property\n");
3607 /* database needs to be committed */
3608 MsiDatabaseCommit(hdb1
);
3610 r
= MsiDatabaseGenerateTransformA(hdb1
, hdb2
, mstfile
, 0, 0);
3611 ok(r
== ERROR_SUCCESS
, "return code %d, should be ERROR_SUCCESS\n", r
);
3613 r
= MsiCreateTransformSummaryInfoA(hdb2
, hdb2
, mstfile
, 0, 0);
3614 todo_wine
ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3616 MsiCloseHandle(hdb1
);
3617 MsiCloseHandle(hdb2
);
3620 /* data for generating a transform */
3622 /* tables transform names - encoded as they would be in an msi database file */
3623 static const WCHAR name1
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
3624 static const WCHAR name2
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
3625 static const WCHAR name3
[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
3627 /* data in each table */
3628 static const char data1
[] = /* _StringData */
3629 "propval"; /* all the strings squashed together */
3631 static const WCHAR data2
[] = { /* _StringPool */
3633 0, 0, /* string 0 '' */
3634 4, 1, /* string 1 'prop' */
3635 3, 1, /* string 2 'val' */
3638 static const WCHAR data3
[] = { /* Property */
3639 0x0201, 0x0001, 0x0002,
3642 static const struct {
3646 } table_transform_data
[] =
3648 { name1
, data1
, sizeof data1
- 1 },
3649 { name2
, data2
, sizeof data2
},
3650 { name3
, data3
, sizeof data3
},
3653 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3655 static void generate_transform_manual(void)
3657 IStorage
*stg
= NULL
;
3662 const DWORD mode
= STGM_CREATE
|STGM_READWRITE
|STGM_DIRECT
|STGM_SHARE_EXCLUSIVE
;
3664 const CLSID CLSID_MsiTransform
= { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3666 MultiByteToWideChar(CP_ACP
, 0, mstfile
, -1, name
, 0x20);
3668 r
= StgCreateDocfile(name
, mode
, 0, &stg
);
3669 ok(r
== S_OK
, "failed to create storage\n");
3673 r
= IStorage_SetClass(stg
, &CLSID_MsiTransform
);
3674 ok(r
== S_OK
, "failed to set storage type\n");
3676 for (i
=0; i
<NUM_TRANSFORM_TABLES
; i
++)
3678 r
= IStorage_CreateStream(stg
, table_transform_data
[i
].name
,
3679 STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3682 ok(0, "failed to create stream %08x\n", r
);
3686 r
= IStream_Write(stm
, table_transform_data
[i
].data
,
3687 table_transform_data
[i
].size
, &count
);
3688 if (FAILED(r
) || count
!= table_transform_data
[i
].size
)
3689 ok(0, "failed to write stream\n");
3690 IStream_Release(stm
);
3693 IStorage_Release(stg
);
3695 set_transform_summary_info();
3698 static void test_transformprop(void)
3702 if (is_process_limited())
3704 skip("process is limited\n");
3708 CreateDirectoryA("msitest", NULL
);
3709 create_file("msitest\\augustus", 500);
3711 create_database(msifile
, tp_tables
, sizeof(tp_tables
) / sizeof(msi_table
));
3713 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3715 r
= MsiInstallProductA(msifile
, NULL
);
3716 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3718 skip("Not enough rights to perform tests\n");
3721 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3722 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3723 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3726 generate_transform();
3728 generate_transform_manual();
3730 r
= MsiInstallProductA(msifile
, "TRANSFORMS=winetest.mst");
3731 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3732 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3733 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3736 /* Delete the files in the temp (current) folder */
3737 DeleteFileA(msifile
);
3738 DeleteFileA(msifile2
);
3739 DeleteFileA(mstfile
);
3740 DeleteFileA("msitest\\augustus");
3741 RemoveDirectoryA("msitest");
3744 static void test_currentworkingdir(void)
3747 CHAR drive
[MAX_PATH
], path
[MAX_PATH
];
3750 if (is_process_limited())
3752 skip("process is limited\n");
3756 CreateDirectoryA("msitest", NULL
);
3757 create_file("msitest\\augustus", 500);
3759 create_database(msifile
, cwd_tables
, sizeof(cwd_tables
) / sizeof(msi_table
));
3761 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3763 CreateDirectoryA("diffdir", NULL
);
3764 SetCurrentDirectoryA("diffdir");
3766 sprintf(path
, "..\\%s", msifile
);
3767 r
= MsiInstallProductA(path
, NULL
);
3770 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
3771 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3772 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3775 sprintf(path
, "%s\\%s", CURR_DIR
, msifile
);
3776 r
= MsiInstallProductA(path
, NULL
);
3777 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3779 skip("Not enough rights to perform tests\n");
3782 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3783 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3784 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3786 lstrcpyA(drive
, CURR_DIR
);
3789 SetCurrentDirectoryA(drive
);
3791 lstrcpyA(path
, CURR_DIR
);
3792 if (path
[lstrlenA(path
) - 1] != '\\') lstrcatA(path
, "\\");
3793 lstrcatA(path
, msifile
);
3794 ptr
= strchr(path
, ':');
3797 r
= MsiInstallProductA(ptr
, NULL
);
3798 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3799 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3800 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3803 SetCurrentDirectoryA(CURR_DIR
);
3804 DeleteFileA(msifile
);
3805 DeleteFileA("msitest\\augustus");
3806 RemoveDirectoryA("msitest");
3807 RemoveDirectoryA("diffdir");
3810 static void set_admin_summary_info(const WCHAR
*name
)
3812 MSIHANDLE db
, summary
;
3815 r
= MsiOpenDatabaseW(name
, MSIDBOPEN_DIRECT
, &db
);
3816 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3818 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
3819 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3821 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, 5, NULL
, NULL
);
3822 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3824 /* write the summary changes back to the stream */
3825 r
= MsiSummaryInfoPersist(summary
);
3826 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3828 MsiCloseHandle(summary
);
3830 r
= MsiDatabaseCommit(db
);
3831 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3836 static void test_admin(void)
3840 CreateDirectoryA("msitest", NULL
);
3841 create_file("msitest\\augustus", 500);
3843 create_database(msifile
, adm_tables
, sizeof(adm_tables
) / sizeof(msi_table
));
3844 set_admin_summary_info(msifileW
);
3846 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3848 r
= MsiInstallProductA(msifile
, NULL
);
3849 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3851 skip("Not enough rights to perform tests\n");
3854 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3855 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3856 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3857 ok(!DeleteFileA("c:\\msitest\\augustus"), "File installed\n");
3858 ok(!RemoveDirectoryA("c:\\msitest"), "File installed\n");
3860 r
= MsiInstallProductA(msifile
, "ACTION=ADMIN");
3861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3862 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3863 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3866 ok(DeleteFileA("c:\\msitest\\augustus"), "File not installed\n");
3867 ok(RemoveDirectoryA("c:\\msitest"), "File not installed\n");
3871 DeleteFileA(msifile
);
3872 DeleteFileA("msitest\\augustus");
3873 RemoveDirectoryA("msitest");
3876 static void set_admin_property_stream(LPCSTR file
)
3880 WCHAR fileW
[MAX_PATH
];
3883 const DWORD mode
= STGM_DIRECT
| STGM_READWRITE
| STGM_SHARE_EXCLUSIVE
;
3885 /* AdminProperties */
3886 static const WCHAR stmname
[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
3887 static const WCHAR data
[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
3888 'M','y','P','r','o','p','=','4','2',0};
3890 MultiByteToWideChar(CP_ACP
, 0, file
, -1, fileW
, MAX_PATH
);
3892 hr
= StgOpenStorage(fileW
, NULL
, mode
, NULL
, 0, &stg
);
3893 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3897 hr
= IStorage_CreateStream(stg
, stmname
, STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3898 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3900 hr
= IStream_Write(stm
, data
, sizeof(data
), &count
);
3901 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3903 IStream_Release(stm
);
3904 IStorage_Release(stg
);
3907 static void test_adminprops(void)
3911 if (is_process_limited())
3913 skip("process is limited\n");
3917 CreateDirectoryA("msitest", NULL
);
3918 create_file("msitest\\augustus", 500);
3920 create_database(msifile
, amp_tables
, sizeof(amp_tables
) / sizeof(msi_table
));
3921 set_admin_summary_info(msifileW
);
3922 set_admin_property_stream(msifile
);
3924 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3926 r
= MsiInstallProductA(msifile
, NULL
);
3927 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3929 skip("Not enough rights to perform tests\n");
3932 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3933 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3934 ok(delete_pf("msitest", FALSE
), "Directory created\n");
3937 DeleteFileA(msifile
);
3938 DeleteFileA("msitest\\augustus");
3939 RemoveDirectoryA("msitest");
3942 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
3944 CHAR path
[MAX_PATH
];
3946 lstrcpyA(path
, PROG_FILES_DIR
);
3947 lstrcatA(path
, "\\");
3948 lstrcatA(path
, file
);
3951 create_file_data(path
, data
, 500);
3953 CreateDirectoryA(path
, NULL
);
3956 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
3958 static void test_missingcab(void)
3962 if (is_process_limited())
3964 skip("process is limited\n");
3968 CreateDirectoryA("msitest", NULL
);
3969 create_file("msitest\\augustus", 500);
3970 create_file("maximus", 500);
3971 create_file("tiberius", 500);
3973 create_database(msifile
, mc_tables
, sizeof(mc_tables
) / sizeof(msi_table
));
3975 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3977 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3978 create_cab_file("test4.cab", MEDIA_SIZE
, "tiberius\0");
3980 create_pf("msitest", FALSE
);
3981 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3982 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3984 r
= MsiInstallProductA(msifile
, NULL
);
3985 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3987 skip("Not enough rights to perform tests\n");
3990 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3991 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3992 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3993 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3994 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3995 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3996 ok(!delete_pf("msitest\\gaius", TRUE
), "File installed\n");
3997 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3999 create_pf("msitest", FALSE
);
4000 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
4001 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
4002 create_pf("msitest\\gaius", TRUE
);
4004 r
= MsiInstallProductA(msifile
, "GAIUS=1");
4005 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4008 ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
4009 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4011 ok(delete_pf("msitest\\caesar", TRUE
), "File removed\n");
4012 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
4013 ok(delete_pf("msitest\\tiberius", TRUE
), "File removed\n");
4014 ok(delete_pf("msitest\\gaius", TRUE
), "File removed\n");
4015 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4018 delete_pf("msitest", FALSE
);
4019 DeleteFileA("msitest\\augustus");
4020 RemoveDirectoryA("msitest");
4021 DeleteFileA("maximus");
4022 DeleteFileA("tiberius");
4023 DeleteFileA("test1.cab");
4024 DeleteFileA("test4.cab");
4025 DeleteFileA(msifile
);
4028 static void test_sourcefolder(void)
4032 if (is_process_limited())
4034 skip("process is limited\n");
4038 CreateDirectoryA("msitest", NULL
);
4039 create_file("augustus", 500);
4041 create_database(msifile
, sf_tables
, sizeof(sf_tables
) / sizeof(msi_table
));
4043 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4045 r
= MsiInstallProductA(msifile
, NULL
);
4046 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4048 skip("Not enough rights to perform tests\n");
4051 ok(r
== ERROR_INSTALL_FAILURE
,
4052 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4053 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4056 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4058 RemoveDirectoryA("msitest");
4060 r
= MsiInstallProductA(msifile
, NULL
);
4061 ok(r
== ERROR_INSTALL_FAILURE
,
4062 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4063 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4066 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4070 DeleteFileA(msifile
);
4071 DeleteFileA("augustus");
4074 static void test_customaction51(void)
4078 if (is_process_limited())
4080 skip("process is limited\n");
4084 CreateDirectoryA("msitest", NULL
);
4085 create_file("msitest\\augustus", 500);
4087 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4089 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4091 r
= MsiInstallProductA(msifile
, NULL
);
4092 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4094 skip("Not enough rights to perform tests\n");
4097 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4098 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4099 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4102 DeleteFileA(msifile
);
4103 DeleteFileA("msitest\\augustus");
4104 RemoveDirectoryA("msitest");
4107 static void test_installstate(void)
4111 if (is_process_limited())
4113 skip("process is limited\n");
4117 CreateDirectoryA("msitest", NULL
);
4118 create_file("msitest\\alpha", 500);
4119 create_file("msitest\\beta", 500);
4120 create_file("msitest\\gamma", 500);
4121 create_file("msitest\\theta", 500);
4122 create_file("msitest\\delta", 500);
4123 create_file("msitest\\epsilon", 500);
4124 create_file("msitest\\zeta", 500);
4125 create_file("msitest\\iota", 500);
4126 create_file("msitest\\eta", 500);
4127 create_file("msitest\\kappa", 500);
4128 create_file("msitest\\lambda", 500);
4129 create_file("msitest\\mu", 500);
4131 create_database(msifile
, is_tables
, sizeof(is_tables
) / sizeof(msi_table
));
4133 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4135 r
= MsiInstallProductA(msifile
, NULL
);
4136 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4138 skip("Not enough rights to perform tests\n");
4141 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4142 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4143 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4144 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4145 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4146 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4147 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4148 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4149 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4150 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4151 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4152 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4153 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4154 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4156 r
= MsiInstallProductA(msifile
, "ADDLOCAL=\"one,two,three,four\"");
4157 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4158 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4159 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4160 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
4161 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4162 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4163 ok(delete_pf("msitest\\epsilon", TRUE
), "File not installed\n");
4164 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4165 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4166 ok(delete_pf("msitest\\eta", TRUE
), "File not installed\n");
4167 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4168 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4169 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4170 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4172 r
= MsiInstallProductA(msifile
, "ADDSOURCE=\"one,two,three,four\"");
4173 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4174 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
4175 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4176 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4177 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
4178 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4179 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4180 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4181 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4182 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4183 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4184 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4185 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4186 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4188 r
= MsiInstallProductA(msifile
, "REMOVE=\"one,two,three,four\"");
4189 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4190 ok(!delete_pf("msitest\\alpha", TRUE
), "File installed\n");
4191 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4192 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4193 ok(!delete_pf("msitest\\theta", TRUE
), "File installed\n");
4194 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4195 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4196 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4197 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4198 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4199 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4200 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4201 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4202 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4205 DeleteFileA(msifile
);
4206 DeleteFileA("msitest\\alpha");
4207 DeleteFileA("msitest\\beta");
4208 DeleteFileA("msitest\\gamma");
4209 DeleteFileA("msitest\\theta");
4210 DeleteFileA("msitest\\delta");
4211 DeleteFileA("msitest\\epsilon");
4212 DeleteFileA("msitest\\zeta");
4213 DeleteFileA("msitest\\iota");
4214 DeleteFileA("msitest\\eta");
4215 DeleteFileA("msitest\\kappa");
4216 DeleteFileA("msitest\\lambda");
4217 DeleteFileA("msitest\\mu");
4218 RemoveDirectoryA("msitest");
4221 static const struct sourcepathmap
4223 BOOL sost
; /* shortone\shorttwo */
4224 BOOL solt
; /* shortone\longtwo */
4225 BOOL lost
; /* longone\shorttwo */
4226 BOOL lolt
; /* longone\longtwo */
4227 BOOL soste
; /* shortone\shorttwo source exists */
4228 BOOL solte
; /* shortone\longtwo source exists */
4229 BOOL loste
; /* longone\shorttwo source exists */
4230 BOOL lolte
; /* longone\longtwo source exists */
4235 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4236 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4237 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4238 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4239 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4240 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4241 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4242 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4243 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4244 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4245 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4246 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4247 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4248 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4249 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4250 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4251 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4252 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4253 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4254 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4255 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4256 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4257 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4258 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4259 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4260 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4261 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4262 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4263 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4264 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4265 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4266 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4267 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4268 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4269 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4270 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4271 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4272 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4273 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4274 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4275 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4276 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4277 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4278 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4279 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4280 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4281 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4282 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4283 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4284 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4285 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4286 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4287 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4288 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4289 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4290 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4291 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4292 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4293 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4294 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4295 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4296 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4297 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4298 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4299 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4300 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4301 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4302 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4303 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4304 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4305 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4306 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4307 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4308 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4309 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4310 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4311 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4312 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4313 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4314 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4315 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4316 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4317 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4318 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4319 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4320 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4321 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4322 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4323 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4324 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4325 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4326 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4327 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4328 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4329 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4330 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4331 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4332 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4333 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4334 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4335 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4336 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4337 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4338 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4339 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4340 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4341 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4342 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4343 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4344 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4345 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4346 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4347 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4348 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4349 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4350 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4351 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4352 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4353 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4354 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4355 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4356 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4357 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4358 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4359 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4360 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4361 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4362 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4363 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4364 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4365 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4366 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4367 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4368 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4369 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4370 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4371 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4372 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4373 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4374 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4375 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4376 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4377 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4378 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4379 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4380 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4381 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4382 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4383 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4384 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4385 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4386 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4387 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4388 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4389 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4390 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4391 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4392 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4393 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4394 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4395 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4396 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4397 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4398 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4399 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4400 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4401 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4402 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4403 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4404 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4405 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4406 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4407 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4408 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4409 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4410 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4411 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4412 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4413 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4414 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4415 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4416 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4417 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4418 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4419 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4420 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4421 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4422 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4423 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4424 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4425 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4426 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4427 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4428 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4429 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4430 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4431 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4432 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4433 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4434 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4435 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4436 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4437 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4438 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4439 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4440 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4441 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4442 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4443 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4444 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4445 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4446 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4447 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4448 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4449 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4450 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4451 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4452 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4453 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4454 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4455 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4456 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4457 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4458 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4459 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4460 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4461 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4462 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4463 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4464 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4465 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4466 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4467 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4468 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4469 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4470 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4471 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4472 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4473 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4474 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4475 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4476 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4477 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4478 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4479 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4480 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4481 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4482 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4483 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4484 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4485 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4486 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4487 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4488 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4489 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4490 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4493 static DWORD
get_pf_file_size(LPCSTR file
)
4495 CHAR path
[MAX_PATH
];
4499 lstrcpyA(path
, PROG_FILES_DIR
);
4500 lstrcatA(path
, "\\");
4501 lstrcatA(path
, file
);
4503 hfile
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
4504 if (hfile
== INVALID_HANDLE_VALUE
)
4505 return INVALID_FILE_SIZE
;
4507 size
= GetFileSize(hfile
, NULL
);
4512 static void test_sourcepath(void)
4516 if (!winetest_interactive
)
4518 skip("Run in interactive mode to run source path tests.\n");
4522 create_database(msifile
, sp_tables
, sizeof(sp_tables
) / sizeof(msi_table
));
4524 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4526 for (i
= 0; i
< sizeof(spmap
) / sizeof(spmap
[0]); i
++)
4530 CreateDirectoryA("shortone", NULL
);
4531 CreateDirectoryA("shortone\\shorttwo", NULL
);
4536 CreateDirectoryA("shortone", NULL
);
4537 CreateDirectoryA("shortone\\longtwo", NULL
);
4542 CreateDirectoryA("longone", NULL
);
4543 CreateDirectoryA("longone\\shorttwo", NULL
);
4548 CreateDirectoryA("longone", NULL
);
4549 CreateDirectoryA("longone\\longtwo", NULL
);
4553 create_file("shortone\\shorttwo\\augustus", 50);
4555 create_file("shortone\\longtwo\\augustus", 100);
4557 create_file("longone\\shorttwo\\augustus", 150);
4559 create_file("longone\\longtwo\\augustus", 200);
4561 r
= MsiInstallProductA(msifile
, NULL
);
4562 ok(r
== spmap
[i
].err
, "%d: Expected %d, got %d\n", i
, spmap
[i
].err
, r
);
4563 ok(get_pf_file_size("msitest\\augustus") == spmap
[i
].size
,
4564 "%d: Expected %d, got %d\n", i
, spmap
[i
].size
,
4565 get_pf_file_size("msitest\\augustus"));
4567 if (r
== ERROR_SUCCESS
)
4569 ok(delete_pf("msitest\\augustus", TRUE
), "%d: File not installed\n", i
);
4570 ok(delete_pf("msitest", FALSE
), "%d: Directory not created\n", i
);
4574 ok(!delete_pf("msitest\\augustus", TRUE
), "%d: File installed\n", i
);
4575 todo_wine
ok(!delete_pf("msitest", FALSE
), "%d: Directory installed\n", i
);
4578 DeleteFileA("shortone\\shorttwo\\augustus");
4579 DeleteFileA("shortone\\longtwo\\augustus");
4580 DeleteFileA("longone\\shorttwo\\augustus");
4581 DeleteFileA("longone\\longtwo\\augustus");
4582 RemoveDirectoryA("shortone\\shorttwo");
4583 RemoveDirectoryA("shortone\\longtwo");
4584 RemoveDirectoryA("longone\\shorttwo");
4585 RemoveDirectoryA("longone\\longtwo");
4586 RemoveDirectoryA("shortone");
4587 RemoveDirectoryA("longone");
4590 DeleteFileA(msifile
);
4593 static void test_missingcomponent(void)
4597 if (is_process_limited())
4599 skip("process is limited\n");
4603 CreateDirectoryA("msitest", NULL
);
4604 create_file("msitest\\hydrogen", 500);
4605 create_file("msitest\\helium", 500);
4606 create_file("msitest\\lithium", 500);
4607 create_file("beryllium", 500);
4609 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
4611 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4613 r
= MsiInstallProductA(msifile
, "INSTALLLEVEL=10 PROPVAR=42");
4614 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4616 skip("Not enough rights to perform tests\n");
4619 else if (r
== ERROR_INSTALL_FAILURE
)
4621 win_skip("broken result\n");
4624 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4625 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4626 ok(pf_exists("msitest\\helium"), "File not installed\n");
4627 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4628 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4629 ok(pf_exists("msitest"), "File not installed\n");
4631 r
= MsiInstallProductA(msifile
, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
4632 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4633 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
4634 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
4635 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
4636 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4637 ok(!delete_pf("msitest", FALSE
), "Directory not removed\n");
4640 DeleteFileA(msifile
);
4641 DeleteFileA("msitest\\hydrogen");
4642 DeleteFileA("msitest\\helium");
4643 DeleteFileA("msitest\\lithium");
4644 DeleteFileA("beryllium");
4645 RemoveDirectoryA("msitest");
4648 static void test_sourcedirprop(void)
4651 CHAR props
[MAX_PATH
];
4653 if (is_process_limited())
4655 skip("process is limited\n");
4659 CreateDirectoryA("msitest", NULL
);
4660 create_file("msitest\\augustus", 500);
4662 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4664 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4666 r
= MsiInstallProductA(msifile
, NULL
);
4667 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4669 skip("Not enough rights to perform tests\n");
4672 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4673 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4674 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4676 DeleteFileA("msitest\\augustus");
4677 RemoveDirectoryA("msitest");
4679 CreateDirectoryA("altsource", NULL
);
4680 CreateDirectoryA("altsource\\msitest", NULL
);
4681 create_file("altsource\\msitest\\augustus", 500);
4683 sprintf(props
, "SRCDIR=%s\\altsource\\", CURR_DIR
);
4685 r
= MsiInstallProductA(msifile
, props
);
4686 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4687 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4688 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4690 DeleteFileA("altsource\\msitest\\augustus");
4691 RemoveDirectoryA("altsource\\msitest");
4692 RemoveDirectoryA("altsource");
4695 DeleteFileA("msitest\\augustus");
4696 RemoveDirectoryA("msitest");
4697 DeleteFileA(msifile
);
4700 static void test_adminimage(void)
4704 if (is_process_limited())
4706 skip("process is limited\n");
4710 CreateDirectoryA("msitest", NULL
);
4711 CreateDirectoryA("msitest\\first", NULL
);
4712 CreateDirectoryA("msitest\\second", NULL
);
4713 CreateDirectoryA("msitest\\cabout", NULL
);
4714 CreateDirectoryA("msitest\\cabout\\new", NULL
);
4715 create_file("msitest\\one.txt", 100);
4716 create_file("msitest\\first\\two.txt", 100);
4717 create_file("msitest\\second\\three.txt", 100);
4718 create_file("msitest\\cabout\\four.txt", 100);
4719 create_file("msitest\\cabout\\new\\five.txt", 100);
4720 create_file("msitest\\filename", 100);
4721 create_file("msitest\\service.exe", 100);
4723 create_database_wordcount(msifile
, ai_tables
,
4724 sizeof(ai_tables
) / sizeof(msi_table
),
4725 100, msidbSumInfoSourceTypeAdminImage
, ";1033",
4726 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4728 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4730 r
= MsiInstallProductA(msifile
, NULL
);
4731 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4733 skip("Not enough rights to perform tests\n");
4736 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4738 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4739 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4740 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4741 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4742 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4743 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4744 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4745 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4746 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4747 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4748 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4749 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4752 DeleteFileA("msifile");
4753 DeleteFileA("msitest\\cabout\\new\\five.txt");
4754 DeleteFileA("msitest\\cabout\\four.txt");
4755 DeleteFileA("msitest\\second\\three.txt");
4756 DeleteFileA("msitest\\first\\two.txt");
4757 DeleteFileA("msitest\\one.txt");
4758 DeleteFileA("msitest\\service.exe");
4759 DeleteFileA("msitest\\filename");
4760 RemoveDirectoryA("msitest\\cabout\\new");
4761 RemoveDirectoryA("msitest\\cabout");
4762 RemoveDirectoryA("msitest\\second");
4763 RemoveDirectoryA("msitest\\first");
4764 RemoveDirectoryA("msitest");
4767 static void test_propcase(void)
4771 if (is_process_limited())
4773 skip("process is limited\n");
4777 CreateDirectoryA("msitest", NULL
);
4778 create_file("msitest\\augustus", 500);
4780 create_database(msifile
, pc_tables
, sizeof(pc_tables
) / sizeof(msi_table
));
4782 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4784 r
= MsiInstallProductA(msifile
, "MyProp=42");
4785 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4787 skip("Not enough rights to perform tests\n");
4790 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4791 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4792 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4794 r
= MsiInstallProductA(msifile
, "Prop1=\"Copyright \"\"My Company\"\" 2015\" MyProp=42");
4795 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4796 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4797 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4799 r
= MsiInstallProductA(msifile
, "Prop1=\"\"\"install.exe\"\" /Install\" MyProp=\"42\"");
4800 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4801 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4802 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4805 DeleteFileA(msifile
);
4806 DeleteFileA("msitest\\augustus");
4807 RemoveDirectoryA("msitest");
4810 static void test_int_widths( void )
4812 static const WCHAR msitestW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
4813 static const WCHAR msitableW
[] = {'m','s','i','t','a','b','l','e','.','i','d','t',0};
4814 static const WCHAR slashW
[] = {'\\',0};
4815 static const char int0
[] = "int0\ni0\nint0\tint0\n1";
4816 static const char int1
[] = "int1\ni1\nint1\tint1\n1";
4817 static const char int2
[] = "int2\ni2\nint2\tint2\n1";
4818 static const char int3
[] = "int3\ni3\nint3\tint3\n1";
4819 static const char int4
[] = "int4\ni4\nint4\tint4\n1";
4820 static const char int5
[] = "int5\ni5\nint5\tint5\n1";
4821 static const char int8
[] = "int8\ni8\nint8\tint8\n1";
4830 { int0
, sizeof(int0
) - 1, ERROR_SUCCESS
},
4831 { int1
, sizeof(int1
) - 1, ERROR_SUCCESS
},
4832 { int2
, sizeof(int2
) - 1, ERROR_SUCCESS
},
4833 { int3
, sizeof(int3
) - 1, ERROR_FUNCTION_FAILED
},
4834 { int4
, sizeof(int4
) - 1, ERROR_SUCCESS
},
4835 { int5
, sizeof(int5
) - 1, ERROR_FUNCTION_FAILED
},
4836 { int8
, sizeof(int8
) - 1, ERROR_FUNCTION_FAILED
}
4838 WCHAR tmpdir
[MAX_PATH
], msitable
[MAX_PATH
], msidb
[MAX_PATH
];
4842 GetTempPathW(MAX_PATH
, tmpdir
);
4843 CreateDirectoryW(tmpdir
, NULL
);
4845 lstrcpyW(msitable
, tmpdir
);
4846 lstrcatW(msitable
, slashW
);
4847 lstrcatW(msitable
, msitableW
);
4849 lstrcpyW(msidb
, tmpdir
);
4850 lstrcatW(msidb
, slashW
);
4851 lstrcatW(msidb
, msitestW
);
4853 r
= MsiOpenDatabaseW(msidb
, MSIDBOPEN_CREATE
, &db
);
4854 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4856 for (i
= 0; i
< sizeof(tests
)/sizeof(tests
[0]); i
++)
4859 HANDLE handle
= CreateFileW(msitable
, GENERIC_WRITE
, 0, NULL
,
4860 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
4861 WriteFile(handle
, tests
[i
].data
, tests
[i
].size
, &count
, NULL
);
4862 CloseHandle(handle
);
4864 r
= MsiDatabaseImportW(db
, tmpdir
, msitableW
);
4865 ok(r
== tests
[i
].ret
, " %u expected %u, got %u\n", i
, tests
[i
].ret
, r
);
4867 r
= MsiDatabaseCommit(db
);
4868 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4869 DeleteFileW(msitable
);
4874 RemoveDirectoryW(tmpdir
);
4877 static void test_shortcut(void)
4882 if (is_process_limited())
4884 skip("process is limited\n");
4888 create_test_files();
4889 create_database(msifile
, sc_tables
, sizeof(sc_tables
) / sizeof(msi_table
));
4891 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4893 r
= MsiInstallProductA(msifile
, NULL
);
4894 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4896 skip("Not enough rights to perform tests\n");
4899 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4901 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
4902 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4904 r
= MsiInstallProductA(msifile
, NULL
);
4905 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4909 hr
= CoInitializeEx(NULL
, COINIT_APARTMENTTHREADED
);
4910 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4912 r
= MsiInstallProductA(msifile
, NULL
);
4913 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4917 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4918 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4919 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4920 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4921 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4922 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4923 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4924 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4925 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4926 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4927 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4928 while (!delete_pf("msitest\\Shortcut.lnk", TRUE
) && GetLastError() == ERROR_SHARING_VIOLATION
) Sleep(1000);
4929 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4932 delete_test_files();
4933 DeleteFileA(msifile
);
4936 static void test_preselected(void)
4940 if (is_process_limited())
4942 skip("process is limited\n");
4946 create_test_files();
4947 create_database(msifile
, ps_tables
, sizeof(ps_tables
) / sizeof(msi_table
));
4949 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4951 r
= MsiInstallProductA(msifile
, "ADDLOCAL=One");
4952 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4954 skip("Not enough rights to perform tests\n");
4957 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4959 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File installed\n");
4960 ok(!delete_pf("msitest\\cabout\\new", FALSE
), "Directory created\n");
4961 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE
), "File installed\n");
4962 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory created\n");
4963 ok(!delete_pf("msitest\\changed\\three.txt", TRUE
), "File installed\n");
4964 ok(!delete_pf("msitest\\changed", FALSE
), "Directory created\n");
4965 ok(!delete_pf("msitest\\first\\two.txt", TRUE
), "File installed\n");
4966 ok(!delete_pf("msitest\\first", FALSE
), "Directory created\n");
4967 ok(!delete_pf("msitest\\filename", TRUE
), "File installed\n");
4968 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4969 ok(!delete_pf("msitest\\service.exe", TRUE
), "File installed\n");
4970 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4972 r
= MsiInstallProductA(msifile
, NULL
);
4973 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4975 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4976 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4977 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4978 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4979 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4980 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4981 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4982 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4983 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4984 ok(!delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4985 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4986 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4989 delete_test_files();
4990 DeleteFileA(msifile
);
4993 static void test_installed_prop(void)
4995 static const char prodcode
[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
4998 if (is_process_limited())
5000 skip("process is limited\n");
5004 create_test_files();
5005 create_database(msifile
, ip_tables
, sizeof(ip_tables
) / sizeof(msi_table
));
5007 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5009 r
= MsiInstallProductA(msifile
, "FULL=1");
5010 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5012 skip("Not enough rights to perform tests\n");
5015 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5017 r
= MsiInstallProductA(msifile
, "FULL=1");
5018 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5020 r
= MsiConfigureProductExA(prodcode
, INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
, "FULL=1");
5021 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5023 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5024 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5025 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5026 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5027 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5028 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5029 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5030 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5031 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5032 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5033 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5034 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5036 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5037 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5040 delete_test_files();
5041 DeleteFileA(msifile
);
5044 static void test_allusers_prop(void)
5048 if (is_process_limited())
5050 skip("process is limited\n");
5054 create_test_files();
5055 create_database(msifile
, aup_tables
, sizeof(aup_tables
) / sizeof(msi_table
));
5057 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5059 /* ALLUSERS property unset */
5060 r
= MsiInstallProductA(msifile
, "FULL=1");
5061 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5063 skip("Not enough rights to perform tests\n");
5066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5068 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5069 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5070 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5071 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5072 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5073 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5074 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5075 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5076 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5077 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5078 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5079 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5081 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5082 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5084 delete_test_files();
5086 create_test_files();
5087 create_database(msifile
, aup2_tables
, sizeof(aup2_tables
) / sizeof(msi_table
));
5089 /* ALLUSERS property set to 1 */
5090 r
= MsiInstallProductA(msifile
, "FULL=1");
5091 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5093 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5094 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5095 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5096 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5097 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5098 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5099 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5100 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5101 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5102 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5103 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5104 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5106 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5107 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5109 delete_test_files();
5111 create_test_files();
5112 create_database(msifile
, aup3_tables
, sizeof(aup3_tables
) / sizeof(msi_table
));
5114 /* ALLUSERS property set to 2 */
5115 r
= MsiInstallProductA(msifile
, "FULL=1");
5116 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5118 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5119 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5120 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5121 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5122 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5123 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5124 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5125 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5126 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5127 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
5128 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5129 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5131 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5132 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5134 delete_test_files();
5136 create_test_files();
5137 create_database(msifile
, aup4_tables
, sizeof(aup4_tables
) / sizeof(msi_table
));
5139 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
5140 r
= MsiInstallProductA(msifile
, "FULL=1");
5141 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5144 delete_test_files();
5145 DeleteFileA(msifile
);
5148 static const char session_manager
[] = "System\\CurrentControlSet\\Control\\Session Manager";
5149 static const char rename_ops
[] = "PendingFileRenameOperations";
5151 static void process_pending_renames(HKEY hkey
)
5153 char *buf
, *src
, *dst
, *buf2
, *buf2ptr
;
5158 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
);
5159 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5161 buf
= HeapAlloc(GetProcessHeap(), 0, size
+ 1);
5162 buf2ptr
= buf2
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, size
+ 1);
5164 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, (LPBYTE
)buf
, &size
);
5166 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
5169 for (src
= buf
; *src
; src
= dst
+ strlen(dst
) + 1)
5171 DWORD flags
= MOVEFILE_COPY_ALLOWED
;
5174 dst
= src
+ strlen(src
) + 1;
5176 if (!strstr(src
, "msitest"))
5178 lstrcpyA(buf2ptr
, src
);
5179 buf2ptr
+= strlen(src
) + 1;
5180 lstrcpyA(buf2ptr
, dst
);
5181 buf2ptr
+= strlen(dst
) + 1;
5189 flags
|= MOVEFILE_REPLACE_EXISTING
;
5192 if (src
[0] == '\\' && src
[1] == '?' && src
[2] == '?' && src
[3] == '\\') src
+= 4;
5195 if (dst
[0] == '\\' && dst
[1] == '?' && dst
[2] == '?' && dst
[3] == '\\') dst
+= 4;
5196 fileret
= MoveFileExA(src
, dst
, flags
);
5197 ok(fileret
, "Failed to move file %s -> %s (%u)\n", src
, dst
, GetLastError());
5201 fileret
= DeleteFileA(src
);
5202 ok(fileret
|| broken(!fileret
) /* win2k3 */, "Failed to delete file %s (%u)\n", src
, GetLastError());
5206 ok(found
, "Expected a 'msitest' entry\n");
5209 RegSetValueExA(hkey
, rename_ops
, 0, REG_MULTI_SZ
, (LPBYTE
)buf2
, buf2ptr
+ 1 - buf2
);
5211 RegDeleteValueA(hkey
, rename_ops
);
5213 HeapFree(GetProcessHeap(), 0, buf
);
5214 HeapFree(GetProcessHeap(), 0, buf2
);
5217 static BOOL
file_matches_data(LPCSTR file
, LPCSTR data
)
5219 DWORD len
, data_len
= strlen(data
);
5223 handle
= CreateFileA(file
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
5224 ok(handle
!= INVALID_HANDLE_VALUE
, "failed to open %s (%u)\n", file
, GetLastError());
5226 if (ReadFile(handle
, buf
, sizeof(buf
), &len
, NULL
) && len
>= data_len
)
5228 CloseHandle(handle
);
5229 return !memcmp(buf
, data
, data_len
);
5231 CloseHandle(handle
);
5235 static void test_file_in_use(void)
5240 char path
[MAX_PATH
];
5242 if (is_process_limited())
5244 skip("process is limited\n");
5248 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5250 CreateDirectoryA("msitest", NULL
);
5251 create_file("msitest\\maximus", 500);
5252 create_database(msifile
, fiu_tables
, sizeof(fiu_tables
) / sizeof(msi_table
));
5254 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5256 lstrcpyA(path
, PROG_FILES_DIR
);
5257 lstrcatA(path
, "\\msitest");
5258 CreateDirectoryA(path
, NULL
);
5260 lstrcatA(path
, "\\maximus");
5261 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5263 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5264 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5266 skip("Not enough rights to perform tests\n");
5269 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5270 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5272 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5274 process_pending_renames(hkey
);
5277 ok(file_matches_data(path
, "msitest\\maximus"), "Expected file to match\n");
5278 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5279 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5281 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5282 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5287 delete_pf("msitest\\maximus", TRUE
);
5288 delete_pf("msitest", FALSE
);
5289 DeleteFileA("msitest\\maximus");
5290 delete_test_files();
5291 DeleteFileA(msifile
);
5294 static void test_file_in_use_cab(void)
5299 char path
[MAX_PATH
];
5301 if (is_process_limited())
5303 skip("process is limited\n");
5307 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5309 CreateDirectoryA("msitest", NULL
);
5310 create_file("maximus", 500);
5311 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
5312 DeleteFileA("maximus");
5314 create_database(msifile
, fiuc_tables
, sizeof(fiuc_tables
) / sizeof(msi_table
));
5316 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5318 lstrcpyA(path
, PROG_FILES_DIR
);
5319 lstrcatA(path
, "\\msitest");
5320 CreateDirectoryA(path
, NULL
);
5322 lstrcatA(path
, "\\maximus");
5323 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5325 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5326 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5328 skip("Not enough rights to perform tests\n");
5331 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5332 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5334 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5336 process_pending_renames(hkey
);
5339 ok(file_matches_data(path
, "maximus"), "Expected file to match\n");
5340 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5341 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5343 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5344 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5349 delete_pf("msitest\\maximus", TRUE
);
5350 delete_pf("msitest", FALSE
);
5351 DeleteFileA("msitest\\maximus");
5353 delete_test_files();
5354 DeleteFileA(msifile
);
5357 static void test_feature_override(void)
5360 REGSAM access
= KEY_ALL_ACCESS
;
5362 if (is_process_limited())
5364 skip("process is limited\n");
5368 create_test_files();
5369 create_file("msitest\\override.txt", 1000);
5370 create_file("msitest\\preselected.txt", 1000);
5371 create_file("msitest\\notpreselected.txt", 1000);
5372 create_database(msifile
, fo_tables
, sizeof(fo_tables
) / sizeof(msi_table
));
5375 access
|= KEY_WOW64_64KEY
;
5377 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5379 r
= MsiInstallProductA(msifile
, "ADDLOCAL=override");
5380 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5382 skip("Not enough rights to perform tests\n");
5385 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5387 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5388 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
5389 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5391 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5392 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5394 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5396 r
= MsiInstallProductA(msifile
, "preselect=1");
5397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5399 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5400 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5401 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5403 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5404 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5406 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5408 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5409 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5412 r
= MsiInstallProductA(msifile
, NULL
);
5413 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5415 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5416 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5417 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5419 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5420 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5422 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5424 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5425 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5428 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", access
);
5431 DeleteFileA("msitest\\override.txt");
5432 DeleteFileA("msitest\\preselected.txt");
5433 DeleteFileA("msitest\\notpreselected.txt");
5434 delete_test_files();
5435 DeleteFileA(msifile
);
5438 static void test_icon_table(void)
5440 MSIHANDLE hdb
= 0, record
;
5443 CHAR path
[MAX_PATH
];
5444 static const char prodcode
[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
5446 if (is_process_limited())
5448 skip("process is limited\n");
5452 create_database(msifile
, icon_base_tables
, sizeof(icon_base_tables
) / sizeof(msi_table
));
5454 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5456 res
= MsiOpenDatabaseW(msifileW
, MSIDBOPEN_TRANSACT
, &hdb
);
5457 ok(res
== ERROR_SUCCESS
, "failed to open db: %d\n", res
);
5459 query
= "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
5460 res
= run_query( hdb
, 0, query
);
5461 ok(res
== ERROR_SUCCESS
, "Can't create Icon table: %d\n", res
);
5463 create_file("icon.ico", 100);
5464 record
= MsiCreateRecord(1);
5465 res
= MsiRecordSetStreamA(record
, 1, "icon.ico");
5466 ok(res
== ERROR_SUCCESS
, "Failed to add stream data to record: %d\n", res
);
5468 query
= "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
5469 res
= run_query(hdb
, record
, query
);
5470 ok(res
== ERROR_SUCCESS
, "Insert into Icon table failed: %d\n", res
);
5472 res
= MsiCloseHandle(record
);
5473 ok(res
== ERROR_SUCCESS
, "Failed to close record handle: %d\n", res
);
5474 DeleteFileA("icon.ico");
5475 res
= MsiDatabaseCommit(hdb
);
5476 ok(res
== ERROR_SUCCESS
, "Failed to commit database: %d\n", res
);
5477 res
= MsiCloseHandle(hdb
);
5478 ok(res
== ERROR_SUCCESS
, "Failed to close database: %d\n", res
);
5481 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
5482 if (res
== ERROR_INSTALL_PACKAGE_REJECTED
)
5484 skip("Not enough rights to perform tests\n");
5485 DeleteFileA(msifile
);
5488 ok(res
== ERROR_SUCCESS
, "Failed to do per-user install: %d\n", res
);
5490 lstrcpyA(path
, APP_DATA_DIR
);
5491 lstrcatA(path
, "\\");
5492 lstrcatA(path
, "Microsoft\\Installer\\");
5493 lstrcatA(path
, prodcode
);
5494 lstrcatA(path
, "\\testicon");
5495 ok(file_exists(path
), "Per-user icon file isn't where it's expected (%s)\n", path
);
5497 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5498 ok(res
== ERROR_SUCCESS
, "Failed to uninstall per-user\n");
5499 ok(!file_exists(path
), "Per-user icon file not removed (%s)\n", path
);
5502 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5503 ok(res
== ERROR_SUCCESS
, "Failed to system-wide install: %d\n", res
);
5505 lstrcpyA(path
, WINDOWS_DIR
);
5506 lstrcatA(path
, "\\");
5507 lstrcatA(path
, "Installer\\");
5508 lstrcatA(path
, prodcode
);
5509 lstrcatA(path
, "\\testicon");
5510 ok(file_exists(path
), "System-wide icon file isn't where it's expected (%s)\n", path
);
5512 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5513 ok(res
== ERROR_SUCCESS
, "Failed to uninstall system-wide\n");
5514 ok(!file_exists(path
), "System-wide icon file not removed (%s)\n", path
);
5516 delete_pfmsitest_files();
5517 DeleteFileA(msifile
);
5520 static void test_package_validation(void)
5524 if (is_process_limited())
5526 skip("process is limited\n");
5530 CreateDirectoryA("msitest", NULL
);
5531 create_file("msitest\\maximus", 500);
5532 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1033");
5534 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5536 r
= MsiInstallProductA(msifile
, NULL
);
5537 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5539 skip("Not enough rights to perform tests\n");
5542 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5543 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5544 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5546 DeleteFileA(msifile
);
5547 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;9999");
5549 r
= MsiInstallProductA(msifile
, NULL
);
5550 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5552 DeleteFileA(msifile
);
5553 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,1033;9999");
5555 r
= MsiInstallProductA(msifile
, NULL
);
5556 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5558 DeleteFileA(msifile
);
5559 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;1033");
5561 r
= MsiInstallProductA(msifile
, NULL
);
5562 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5563 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5564 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5566 DeleteFileA(msifile
);
5567 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel64,9999;1033");
5569 r
= MsiInstallProductA(msifile
, NULL
);
5570 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5572 DeleteFileA(msifile
);
5573 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,1033;1033");
5575 r
= MsiInstallProductA(msifile
, NULL
);
5576 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5578 DeleteFileA(msifile
);
5579 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,9999;1033");
5581 r
= MsiInstallProductA(msifile
, NULL
);
5582 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5584 DeleteFileA(msifile
);
5585 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9999");
5587 r
= MsiInstallProductA(msifile
, NULL
);
5588 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5589 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5590 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5592 if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH
, SUBLANG_ENGLISH_US
))
5594 DeleteFileA(msifile
);
5595 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9");
5596 r
= MsiInstallProductA(msifile
, NULL
);
5597 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5598 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5599 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5601 DeleteFileA(msifile
);
5602 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1024");
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");
5609 DeleteFileA(msifile
);
5610 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel32;0");
5612 r
= MsiInstallProductA(msifile
, NULL
);
5613 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5614 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5615 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5617 if (is_64bit
&& !is_wow64
)
5619 DeleteFileA(msifile
);
5620 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5622 r
= MsiInstallProductA(msifile
, NULL
);
5623 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5624 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5625 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5627 DeleteFileA(msifile
);
5628 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5630 r
= MsiInstallProductA(msifile
, NULL
);
5631 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5632 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5633 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5635 DeleteFileA(msifile
);
5636 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5638 r
= MsiInstallProductA(msifile
, NULL
);
5639 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5640 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5641 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5645 DeleteFileA(msifile
);
5646 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5648 r
= MsiInstallProductA(msifile
, NULL
);
5649 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5650 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5651 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5653 DeleteFileA(msifile
);
5654 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5656 r
= MsiInstallProductA(msifile
, NULL
);
5657 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5658 ok(!delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5659 ok(!delete_pf_native("msitest", FALSE
), "directory exists\n");
5661 DeleteFileA(msifile
);
5662 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5664 r
= MsiInstallProductA(msifile
, NULL
);
5665 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5666 ok(delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5667 ok(delete_pf_native("msitest", FALSE
), "directory exists\n");
5671 DeleteFileA(msifile
);
5672 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5674 r
= MsiInstallProductA(msifile
, NULL
);
5675 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5676 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5677 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5679 DeleteFileA(msifile
);
5680 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Alpha,Beta,Intel;0");
5682 r
= MsiInstallProductA(msifile
, NULL
);
5683 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5684 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5685 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5687 DeleteFileA(msifile
);
5688 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5690 r
= MsiInstallProductA(msifile
, NULL
);
5691 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5692 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5693 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5695 DeleteFileA(msifile
);
5696 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5698 r
= MsiInstallProductA(msifile
, NULL
);
5699 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5700 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5701 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5705 /* Delete the files in the temp (current) folder */
5706 DeleteFileA(msifile
);
5707 DeleteFileA("msitest\\maximus");
5708 RemoveDirectoryA("msitest");
5711 static void test_upgrade_code(void)
5715 if (is_process_limited())
5717 skip("process is limited\n");
5721 CreateDirectoryA("msitest", NULL
);
5722 create_file("msitest\\upgradecode.txt", 1000);
5723 create_database(msifile
, uc_tables
, sizeof(uc_tables
) / sizeof(msi_table
));
5725 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5727 r
= MsiInstallProductA(msifile
, NULL
);
5728 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5730 ok(pf_exists("msitest\\upgradecode.txt"), "file not installed\n");
5732 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5733 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5735 ok(!delete_pf("msitest\\upgradecode.txt", TRUE
), "file not removed\n");
5736 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5738 DeleteFileA("msitest\\upgradecode.txt");
5739 RemoveDirectoryA("msitest");
5740 DeleteFileA(msifile
);
5743 static void test_mixed_package(void)
5748 char value
[MAX_PATH
];
5751 if (is_process_limited())
5753 skip("process is limited\n");
5756 if (!is_wow64
&& !is_64bit
)
5758 skip("this test must be run on 64-bit\n");
5761 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5762 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "x64;1033");
5764 r
= MsiInstallProductA(msifile
, NULL
);
5765 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5767 skip("Not enough rights to perform tests\n");
5770 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5772 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5773 ok(!res
, "can't open 32-bit component key, got %d\n", res
);
5774 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5775 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5776 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5777 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5780 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5781 ok(!res
, "can't open 64-bit component key, got %d\n", res
);
5782 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5783 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5784 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5785 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5788 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5789 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5790 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5791 ok(res
== ERROR_SUCCESS
, "can't open 32-bit CLSID key, got %d\n", res
);
5792 if (res
== ERROR_SUCCESS
) {
5793 size
= sizeof(value
);
5794 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5795 ok(!strcmp(value
, "winetest32.dll"), "got %s\n", value
);
5799 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5800 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5801 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5802 ok(res
== ERROR_SUCCESS
, "can't open 64-bit CLSID key, got %d\n", res
);
5803 if (res
== ERROR_SUCCESS
) {
5804 size
= sizeof(value
);
5805 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5806 ok(!strcmp(value
, "winetest64.dll"), "got %s\n", value
);
5810 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5811 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5813 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5814 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5816 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5817 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5819 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5820 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5821 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5822 ok(res
== ERROR_FILE_NOT_FOUND
, "32-bit CLSID key not removed\n");
5824 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5825 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5826 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5827 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit CLSID key not removed\n");
5829 DeleteFileA( msifile
);
5830 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "Intel;1033");
5832 r
= MsiInstallProductA(msifile
, NULL
);
5833 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5835 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5836 ok(!res
, "can't open 32-bit component key, got %d\n", res
);
5837 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5838 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5839 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5840 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5843 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5844 ok(!res
, "can't open 64-bit component key, got %d\n", res
);
5845 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5846 ok(res
, "expected RegQueryValueEx to fail, got %d\n", res
);
5847 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5848 ok(!res
, "expected RegQueryValueEx to succeed, got %d\n", res
);
5851 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5852 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5853 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5854 ok(res
== ERROR_SUCCESS
, "can't open 32-bit CLSID key, got %d\n", res
);
5855 if (res
== ERROR_SUCCESS
) {
5856 size
= sizeof(value
);
5857 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5858 ok(!strcmp(value
, "winetest32.dll"), "got %s\n", value
);
5862 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5863 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32",
5864 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5865 ok(res
== ERROR_SUCCESS
, "can't open 64-bit CLSID key, got %d\n", res
);
5866 if (res
== ERROR_SUCCESS
) {
5867 size
= sizeof(value
);
5868 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, (LPBYTE
)value
, &size
);
5869 ok(!strcmp(value
, "winetest64.dll"), "got %s\n", value
);
5873 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5874 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5876 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5877 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5879 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5880 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5882 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5883 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5884 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5885 ok(res
== ERROR_FILE_NOT_FOUND
, "32-bit CLSID key not removed\n");
5887 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
,
5888 "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}",
5889 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5890 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit CLSID key not removed\n");
5893 DeleteFileA( msifile
);
5896 static void test_volume_props(void)
5900 if (is_process_limited())
5902 skip("process is limited\n");
5905 CreateDirectoryA("msitest", NULL
);
5906 create_file("msitest\\volumeprop.txt", 1000);
5907 create_database(msifile
, vp_tables
, sizeof(vp_tables
)/sizeof(msi_table
));
5909 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5911 r
= MsiInstallProductA(msifile
, NULL
);
5912 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5914 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5915 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5917 DeleteFileA("msitest\\volumeprop.txt");
5918 RemoveDirectoryA("msitest");
5919 DeleteFileA(msifile
);
5922 static void test_shared_component(void)
5926 if (is_process_limited())
5928 skip("process is limited\n");
5931 CreateDirectoryA("msitest", NULL
);
5932 create_file("msitest\\sharedcomponent.txt", 1000);
5933 create_database_wordcount(msifile
, shc_tables
, sizeof(shc_tables
)/sizeof(shc_tables
[0]),
5934 100, 0, ";", "{A8826420-FD72-4E61-9E15-C1944CF4CBE1}");
5935 create_database_wordcount(msifile2
, shc2_tables
, sizeof(shc2_tables
)/sizeof(shc2_tables
[0]),
5936 100, 0, ";", "{A8B50B30-0E8A-4ACD-B3CF-1A5DC58B2739}");
5938 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5940 r
= MsiInstallProductA(msifile
, NULL
);
5941 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5943 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5945 r
= MsiInstallProductA(msifile2
, NULL
);
5946 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5948 ok(pf_exists("msitest\\sharedcomponent.txt"), "file not installed\n");
5950 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5951 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5953 ok(pf_exists("msitest\\sharedcomponent.txt"), "file removed\n");
5955 r
= MsiInstallProductA(msifile2
, "REMOVE=ALL");
5956 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5958 ok(!pf_exists("msitest\\sharedcomponent.txt"), "file not removed\n");
5960 DeleteFileA("msitest\\sharedcomponent.txt");
5961 RemoveDirectoryA("msitest");
5962 DeleteFileA(msifile
);
5963 DeleteFileA(msifile2
);
5966 static void test_remove_upgrade_code(void)
5971 REGSAM access
= KEY_ALL_ACCESS
;
5975 if (is_process_limited())
5977 skip( "process is limited\n" );
5980 if (is_wow64
) access
|= KEY_WOW64_64KEY
;
5982 create_test_files();
5983 create_database( msifile
, icon_base_tables
, sizeof(icon_base_tables
)/sizeof(icon_base_tables
[0]) );
5985 MsiSetInternalUI( INSTALLUILEVEL_NONE
, NULL
);
5987 r
= MsiInstallProductA( msifile
, "FULL=1" );
5988 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5990 res
= RegOpenKeyExA( HKEY_LOCAL_MACHINE
,
5991 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2",
5993 ok( res
== ERROR_SUCCESS
, "got %d\n", res
);
5998 res
= RegQueryValueExA( hkey
, "94A88FD7F6998CE40A22FB59F6B9C2BB", NULL
, &type
, (BYTE
*)buf
, &size
);
5999 ok( res
== ERROR_SUCCESS
, "got %d\n", res
);
6000 ok( type
== REG_SZ
, "got %u\n", type
);
6001 ok( size
== 1, "got %u\n", size
);
6002 ok( !buf
[0], "wrong data\n" );
6003 RegCloseKey( hkey
);
6005 r
= MsiInstallProductA( msifile
, "REMOVE=ALL" );
6006 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6008 res
= RegOpenKeyExA( HKEY_LOCAL_MACHINE
,
6009 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2",
6011 ok( res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6013 RemoveDirectoryA( "msitest" );
6014 DeleteFileA( msifile
);
6017 static void test_feature_tree(void)
6021 if (is_process_limited())
6023 skip( "process is limited\n" );
6027 create_file( "msitest\\featuretree.txt", 1000 );
6028 create_database( msifile
, ft_tables
, sizeof(ft_tables
)/sizeof(ft_tables
[0]) );
6030 MsiSetInternalUI( INSTALLUILEVEL_NONE
, NULL
);
6032 r
= MsiInstallProductA( msifile
, "INSTALLTYPE=\"0\"" );
6033 ok( r
== ERROR_INSTALL_FAILURE
, "got %u\n", r
);
6035 r
= MsiInstallProductA( msifile
, "INSTALLTYPE=\"1\"" );
6036 ok( r
== ERROR_SUCCESS
, "got %u\n", r
);
6038 r
= MsiInstallProductA( msifile
, "REMOVE=ALL" );
6039 ok( r
== ERROR_SUCCESS
, "got %u\n", r
);
6041 DeleteFileA( "msitest\\featuretree.txt" );
6042 RemoveDirectoryA( "msitest" );
6043 DeleteFileA( msifile
);
6049 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6050 STATEMGRSTATUS status
;
6053 init_functionpointers();
6055 if (pIsWow64Process
)
6056 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
6058 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6059 GetTempPathA(MAX_PATH
, temp_path
);
6060 SetCurrentDirectoryA(temp_path
);
6062 lstrcpyA(CURR_DIR
, temp_path
);
6063 len
= lstrlenA(CURR_DIR
);
6065 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
6066 CURR_DIR
[len
- 1] = 0;
6068 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6069 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6071 /* Create a restore point ourselves so we circumvent the multitude of restore points
6072 * that would have been created by all the installation and removal tests.
6074 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6075 * creation of restore points.
6077 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
6079 memset(&status
, 0, sizeof(status
));
6080 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
6083 /* Create only one log file and don't append. We have to pass something
6084 * for the log mode for this to work. The logfile needs to have an absolute
6085 * path otherwise we still end up with some extra logfiles as some tests
6086 * change the current directory.
6088 lstrcpyA(log_file
, temp_path
);
6089 lstrcatA(log_file
, "\\msitest.log");
6090 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
6092 if (pSRSetRestorePointA
) /* test has side-effects on win2k3 that cause failures in following tests */
6093 test_MsiInstallProduct();
6094 test_MsiSetComponentState();
6095 test_packagecoltypes();
6096 test_continuouscabs();
6099 test_samesequence();
6100 test_uiLevelFlags();
6101 test_readonlyfile();
6102 test_readonlyfile_cab();
6103 test_setdirproperty();
6104 test_cabisextracted();
6105 test_transformprop();
6106 test_currentworkingdir();
6110 test_sourcefolder();
6111 test_customaction51();
6112 test_installstate();
6114 test_missingcomponent();
6115 test_sourcedirprop();
6121 test_installed_prop();
6123 test_file_in_use_cab();
6124 test_allusers_prop();
6125 test_feature_override();
6127 test_package_validation();
6128 test_upgrade_code();
6129 test_mixed_package();
6130 test_volume_props();
6131 test_shared_component();
6132 test_remove_upgrade_code();
6133 test_feature_tree();
6135 DeleteFileA(log_file
);
6137 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
6139 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
6141 remove_restore_point(status
.llSequenceNumber
);
6143 FreeLibrary(hsrclient
);
6145 SetCurrentDirectoryA(prev_path
);