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
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
45 static BOOL (WINAPI
*pOpenProcessToken
)( HANDLE
, DWORD
, PHANDLE
);
46 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
47 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
49 static HMODULE hsrclient
= 0;
50 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
51 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
54 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
56 static const char *msifile
= "msitest.msi";
57 static const char *msifile2
= "winetest2.msi";
58 static const char *mstfile
= "winetest.mst";
59 static CHAR CURR_DIR
[MAX_PATH
];
60 static CHAR PROG_FILES_DIR
[MAX_PATH
];
61 static CHAR PROG_FILES_DIR_NATIVE
[MAX_PATH
];
62 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
63 static CHAR APP_DATA_DIR
[MAX_PATH
];
64 static CHAR WINDOWS_DIR
[MAX_PATH
];
66 /* msi database data */
68 static const CHAR component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
69 "s72\tS38\ts72\ti2\tS255\tS72\n"
70 "Component\tComponent\n"
71 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
72 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
73 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
74 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
75 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
76 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
77 "component\t\tMSITESTDIR\t0\t1\tfile\n"
78 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
80 static const CHAR directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
82 "Directory\tDirectory\n"
83 "CABOUTDIR\tMSITESTDIR\tcabout\n"
84 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
85 "FIRSTDIR\tMSITESTDIR\tfirst\n"
86 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
87 "NEWDIR\tCABOUTDIR\tnew\n"
88 "ProgramFilesFolder\tTARGETDIR\t.\n"
89 "TARGETDIR\t\tSourceDir";
91 static const CHAR feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
92 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
94 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
95 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
96 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
97 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
98 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
99 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
100 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
102 static const CHAR feature_comp_dat
[] = "Feature_\tComponent_\n"
104 "FeatureComponents\tFeature_\tComponent_\n"
110 "feature\tcomponent\n"
111 "service_feature\tservice_comp\n";
113 static const CHAR file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
114 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
116 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
117 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
118 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
119 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
120 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
121 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
122 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
124 static const CHAR install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
126 "InstallExecuteSequence\tAction\n"
127 "AllocateRegistrySpace\tNOT Installed\t1550\n"
128 "CostFinalize\t\t1000\n"
129 "CostInitialize\t\t800\n"
131 "ResolveSource\t\t950\n"
132 "MoveFiles\t\t1700\n"
133 "InstallFiles\t\t4000\n"
134 "DuplicateFiles\t\t4500\n"
135 "WriteEnvironmentStrings\t\t4550\n"
136 "CreateShortcuts\t\t4600\n"
137 "InstallServices\t\t5000\n"
138 "InstallFinalize\t\t6600\n"
139 "InstallInitialize\t\t1500\n"
140 "InstallValidate\t\t1400\n"
141 "LaunchConditions\t\t100\n"
142 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
144 static const CHAR media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
145 "i2\ti4\tL64\tS255\tS32\tS72\n"
147 "1\t3\t\t\tDISK1\t\n"
148 "2\t5\t\tmsitest.cab\tDISK2\t\n";
150 static const CHAR property_dat
[] = "Property\tValue\n"
152 "Property\tProperty\n"
153 "DefaultUIFont\tDlgFont8\n"
156 "InstallMode\tTypical\n"
157 "Manufacturer\tWine\n"
158 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
159 "PRIMARYFOLDER\tTARGETDIR\n"
160 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
162 "ProductLanguage\t1033\n"
163 "ProductName\tMSITEST\n"
164 "ProductVersion\t1.1.1\n"
165 "PROMPTROLLBACKCOST\tP\n"
167 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
168 "AdminProperties\tPOSTADMIN\n"
170 "SERVNAME\tTestService\n"
171 "SERVDISP\tTestServiceDisp\n"
172 "MSIFASTINSTALL\t1\n";
174 static const CHAR aup_property_dat
[] = "Property\tValue\n"
176 "Property\tProperty\n"
177 "DefaultUIFont\tDlgFont8\n"
181 "InstallMode\tTypical\n"
182 "Manufacturer\tWine\n"
183 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
184 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
186 "ProductLanguage\t1033\n"
187 "ProductName\tMSITEST\n"
188 "ProductVersion\t1.1.1\n"
189 "PROMPTROLLBACKCOST\tP\n"
191 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
192 "AdminProperties\tPOSTADMIN\n"
194 "SERVNAME\tTestService\n"
195 "SERVDISP\tTestServiceDisp\n"
196 "MSIFASTINSTALL\t1\n";
198 static const CHAR aup2_property_dat
[] = "Property\tValue\n"
200 "Property\tProperty\n"
201 "DefaultUIFont\tDlgFont8\n"
205 "InstallMode\tTypical\n"
206 "Manufacturer\tWine\n"
207 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
208 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
210 "ProductLanguage\t1033\n"
211 "ProductName\tMSITEST\n"
212 "ProductVersion\t1.1.1\n"
213 "PROMPTROLLBACKCOST\tP\n"
215 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
216 "AdminProperties\tPOSTADMIN\n"
218 "SERVNAME\tTestService\n"
219 "SERVDISP\tTestServiceDisp\n"
220 "MSIFASTINSTALL\t1\n";
222 static const CHAR icon_property_dat
[] = "Property\tValue\n"
224 "Property\tProperty\n"
225 "DefaultUIFont\tDlgFont8\n"
228 "InstallMode\tTypical\n"
229 "Manufacturer\tWine\n"
230 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
231 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
233 "ProductLanguage\t1033\n"
234 "ProductName\tMSITEST\n"
235 "ProductVersion\t1.1.1\n"
236 "PROMPTROLLBACKCOST\tP\n"
238 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
239 "AdminProperties\tPOSTADMIN\n"
241 "SERVNAME\tTestService\n"
242 "SERVDISP\tTestServiceDisp\n"
243 "MSIFASTINSTALL\t1\n";
245 static const CHAR shortcut_dat
[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
246 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
247 "Shortcut\tShortcut\n"
248 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
250 static const CHAR condition_dat
[] = "Feature_\tLevel\tCondition\n"
252 "Condition\tFeature_\tLevel\n"
255 static const CHAR up_property_dat
[] = "Property\tValue\n"
257 "Property\tProperty\n"
258 "DefaultUIFont\tDlgFont8\n"
261 "InstallMode\tTypical\n"
262 "Manufacturer\tWine\n"
263 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
264 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
266 "ProductLanguage\t1033\n"
267 "ProductName\tMSITEST\n"
268 "ProductVersion\t1.1.1\n"
269 "PROMPTROLLBACKCOST\tP\n"
271 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
272 "AdminProperties\tPOSTADMIN\n"
274 "SERVNAME\tTestService\n"
275 "SERVDISP\tTestServiceDisp\n"
276 "RemovePreviousVersions\t1\n"
277 "MSIFASTINSTALL\t1\n";
279 static const CHAR up2_property_dat
[] = "Property\tValue\n"
281 "Property\tProperty\n"
282 "DefaultUIFont\tDlgFont8\n"
285 "InstallMode\tTypical\n"
286 "Manufacturer\tWine\n"
287 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
288 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
290 "ProductLanguage\t1033\n"
291 "ProductName\tMSITEST\n"
292 "ProductVersion\t1.1.2\n"
293 "PROMPTROLLBACKCOST\tP\n"
295 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
296 "AdminProperties\tPOSTADMIN\n"
298 "SERVNAME\tTestService\n"
299 "SERVDISP\tTestServiceDisp\n"
300 "MSIFASTINSTALL\t1\n";
302 static const CHAR up3_property_dat
[] = "Property\tValue\n"
304 "Property\tProperty\n"
305 "DefaultUIFont\tDlgFont8\n"
308 "InstallMode\tTypical\n"
309 "Manufacturer\tWine\n"
310 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
311 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
313 "ProductLanguage\t1033\n"
314 "ProductName\tMSITEST\n"
315 "ProductVersion\t1.1.2\n"
316 "PROMPTROLLBACKCOST\tP\n"
318 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
319 "AdminProperties\tPOSTADMIN\n"
321 "SERVNAME\tTestService\n"
322 "SERVDISP\tTestServiceDisp\n"
323 "RemovePreviousVersions\t1\n"
324 "MSIFASTINSTALL\t1\n";
326 static const CHAR registry_dat
[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
327 "s72\ti2\tl255\tL255\tL0\ts72\n"
328 "Registry\tRegistry\n"
329 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
330 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
331 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
332 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
334 static const CHAR service_install_dat
[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
335 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
336 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
337 "ServiceInstall\tServiceInstall\n"
338 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
340 static const CHAR service_control_dat
[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
341 "s72\tl255\ti2\tL255\tI2\ts72\n"
342 "ServiceControl\tServiceControl\n"
343 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
345 /* tables for test_continuouscabs */
346 static const CHAR cc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
347 "s72\tS38\ts72\ti2\tS255\tS72\n"
348 "Component\tComponent\n"
349 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
350 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
351 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
353 static const CHAR cc2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
354 "s72\tS38\ts72\ti2\tS255\tS72\n"
355 "Component\tComponent\n"
356 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
357 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
358 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
360 static const CHAR cc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
361 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
363 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
365 static const CHAR cc_feature_comp_dat
[] = "Feature_\tComponent_\n"
367 "FeatureComponents\tFeature_\tComponent_\n"
369 "feature\taugustus\n"
372 static const CHAR cc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
373 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
375 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
376 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
377 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
379 static const CHAR cc2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
380 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
382 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
383 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
384 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
385 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
387 static const CHAR cc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
388 "i2\ti4\tL64\tS255\tS32\tS72\n"
390 "1\t10\t\ttest1.cab\tDISK1\t\n"
391 "2\t2\t\ttest2.cab\tDISK2\t\n"
392 "3\t12\t\ttest3.cab\tDISK3\t\n";
394 static const CHAR cc3_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
395 "i2\ti4\tL64\tS255\tS32\tS72\n"
397 "1\t10\t\ttest1.cab\tDISK1\t\n"
398 "2\t2\t\ttest2_.cab\tDISK2\t\n"
399 "3\t12\t\ttest3.cab\tDISK3\t\n";
401 static const CHAR co_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
402 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
404 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
405 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
406 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
408 static const CHAR co_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
409 "i2\ti4\tL64\tS255\tS32\tS72\n"
411 "1\t10\t\ttest1.cab\tDISK1\t\n"
412 "2\t2\t\ttest2.cab\tDISK2\t\n"
413 "3\t3\t\ttest3.cab\tDISK3\t\n";
415 static const CHAR co2_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
416 "i2\ti4\tL64\tS255\tS32\tS72\n"
418 "1\t10\t\ttest1.cab\tDISK1\t\n"
419 "2\t12\t\ttest3.cab\tDISK3\t\n"
420 "3\t2\t\ttest2.cab\tDISK2\t\n";
422 static const CHAR mm_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
423 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
425 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
426 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
427 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
429 static const CHAR mm_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
430 "i2\ti4\tL64\tS255\tS32\tS72\n"
432 "1\t3\t\ttest1.cab\tDISK1\t\n";
434 static const CHAR ss_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
435 "i2\ti4\tL64\tS255\tS32\tS72\n"
437 "1\t2\t\ttest1.cab\tDISK1\t\n"
438 "2\t2\t\ttest2.cab\tDISK2\t\n"
439 "3\t12\t\ttest3.cab\tDISK3\t\n";
441 /* tables for test_uiLevelFlags */
442 static const CHAR ui_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
443 "s72\tS38\ts72\ti2\tS255\tS72\n"
444 "Component\tComponent\n"
445 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
446 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
447 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
449 static const CHAR ui_install_ui_seq_dat
[] = "Action\tCondition\tSequence\n"
451 "InstallUISequence\tAction\n"
452 "SetUIProperty\t\t5\n"
453 "ExecuteAction\t\t1100\n";
455 static const CHAR ui_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
456 "s72\ti2\tS64\tS0\tS255\n"
457 "CustomAction\tAction\n"
458 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
460 static const CHAR rof_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
461 "s72\tS38\ts72\ti2\tS255\tS72\n"
462 "Component\tComponent\n"
463 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
465 static const CHAR rof_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
466 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
468 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
469 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
471 static const CHAR rof_feature_comp_dat
[] = "Feature_\tComponent_\n"
473 "FeatureComponents\tFeature_\tComponent_\n"
475 "montecristo\tmaximus";
477 static const CHAR rof_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
478 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
480 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
482 static const CHAR rof_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
483 "i2\ti4\tL64\tS255\tS32\tS72\n"
485 "1\t1\t\t\tDISK1\t\n";
487 static const CHAR rofc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
488 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
490 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
492 static const CHAR rofc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
493 "i2\ti4\tL64\tS255\tS32\tS72\n"
495 "1\t1\t\ttest1.cab\tDISK1\t\n";
497 static const CHAR sdp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
499 "InstallExecuteSequence\tAction\n"
500 "AllocateRegistrySpace\tNOT Installed\t1550\n"
501 "CostFinalize\t\t1000\n"
502 "CostInitialize\t\t800\n"
504 "InstallFiles\t\t4000\n"
505 "InstallFinalize\t\t6600\n"
506 "InstallInitialize\t\t1500\n"
507 "InstallValidate\t\t1400\n"
508 "LaunchConditions\t\t100\n"
509 "SetDirProperty\t\t950";
511 static const CHAR sdp_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
512 "s72\ti2\tS64\tS0\tS255\n"
513 "CustomAction\tAction\n"
514 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
516 static const CHAR pv_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
518 "InstallExecuteSequence\tAction\n"
519 "LaunchConditions\t\t100\n"
520 "CostInitialize\t\t800\n"
522 "CostFinalize\t\t1000\n"
523 "InstallValidate\t\t1400\n"
524 "InstallInitialize\t\t1500\n"
525 "InstallFiles\t\t4000\n"
526 "InstallFinalize\t\t6600\n";
528 static const CHAR cie_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
529 "s72\tS38\ts72\ti2\tS255\tS72\n"
530 "Component\tComponent\n"
531 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
532 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
533 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
534 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
536 static const CHAR cie_feature_comp_dat
[] = "Feature_\tComponent_\n"
538 "FeatureComponents\tFeature_\tComponent_\n"
540 "feature\taugustus\n"
544 static const CHAR cie_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
545 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
547 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
548 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
549 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
550 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
552 static const CHAR cie_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
553 "i2\ti4\tL64\tS255\tS32\tS72\n"
555 "1\t1\t\ttest1.cab\tDISK1\t\n"
556 "2\t2\t\ttest2.cab\tDISK2\t\n"
557 "3\t12\t\ttest3.cab\tDISK3\t\n";
559 static const CHAR ci_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
561 "InstallExecuteSequence\tAction\n"
562 "CostFinalize\t\t1000\n"
563 "CostInitialize\t\t800\n"
565 "InstallFiles\t\t4000\n"
566 "InstallServices\t\t5000\n"
567 "InstallFinalize\t\t6600\n"
568 "InstallInitialize\t\t1500\n"
569 "RunInstall\t\t1600\n"
570 "InstallValidate\t\t1400\n"
571 "LaunchConditions\t\t100";
573 static const CHAR ci_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
574 "s72\ti2\tS64\tS0\tS255\n"
575 "CustomAction\tAction\n"
576 "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n";
578 static const CHAR ci_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
579 "s72\tS38\ts72\ti2\tS255\tS72\n"
580 "Component\tComponent\n"
581 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
583 static const CHAR ci2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
584 "s72\tS38\ts72\ti2\tS255\tS72\n"
585 "Component\tComponent\n"
586 "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n";
588 static const CHAR ci2_feature_comp_dat
[] = "Feature_\tComponent_\n"
590 "FeatureComponents\tFeature_\tComponent_\n"
593 static const CHAR ci2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
594 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
596 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
598 static const CHAR pp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
600 "InstallExecuteSequence\tAction\n"
601 "ValidateProductID\t\t700\n"
602 "CostInitialize\t\t800\n"
604 "CostFinalize\t\t1000\n"
605 "InstallValidate\t\t1400\n"
606 "InstallInitialize\t\t1500\n"
607 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
608 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
609 "RemoveFiles\t\t3500\n"
610 "InstallFiles\t\t4000\n"
611 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
612 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
613 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
614 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
615 "InstallFinalize\t\t6600";
617 static const CHAR tp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
618 "s72\tS38\ts72\ti2\tS255\tS72\n"
619 "Component\tComponent\n"
620 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
622 static const CHAR cwd_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
623 "s72\tS38\ts72\ti2\tS255\tS72\n"
624 "Component\tComponent\n"
625 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
627 static const CHAR adm_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
628 "s72\tS38\ts72\ti2\tS255\tS72\n"
629 "Component\tComponent\n"
630 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
632 static const CHAR adm_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
633 "s72\ti2\tS64\tS0\tS255\n"
634 "CustomAction\tAction\n"
635 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
637 static const CHAR adm_admin_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
639 "AdminExecuteSequence\tAction\n"
640 "CostFinalize\t\t1000\n"
641 "CostInitialize\t\t800\n"
643 "SetPOSTADMIN\t\t950\n"
644 "InstallFiles\t\t4000\n"
645 "InstallFinalize\t\t6600\n"
646 "InstallInitialize\t\t1500\n"
647 "InstallValidate\t\t1400\n"
648 "LaunchConditions\t\t100";
650 static const CHAR amp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
651 "s72\tS38\ts72\ti2\tS255\tS72\n"
652 "Component\tComponent\n"
653 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
655 static const CHAR rem_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
656 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
658 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
659 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
660 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
662 static const CHAR rem_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
664 "InstallExecuteSequence\tAction\n"
665 "ValidateProductID\t\t700\n"
666 "CostInitialize\t\t800\n"
668 "CostFinalize\t\t1000\n"
669 "InstallValidate\t\t1400\n"
670 "InstallInitialize\t\t1500\n"
671 "ProcessComponents\t\t1600\n"
672 "UnpublishFeatures\t\t1800\n"
673 "RemoveFiles\t\t3500\n"
674 "InstallFiles\t\t4000\n"
675 "RegisterProduct\t\t6100\n"
676 "PublishFeatures\t\t6300\n"
677 "PublishProduct\t\t6400\n"
678 "InstallFinalize\t\t6600";
680 static const CHAR mc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
681 "s72\tS38\ts72\ti2\tS255\tS72\n"
682 "Component\tComponent\n"
683 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
684 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
685 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
686 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
687 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
689 static const CHAR mc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
690 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
692 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
693 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
694 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
695 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
696 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
698 static const CHAR mc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
699 "i2\ti4\tL64\tS255\tS32\tS72\n"
701 "1\t1\t\ttest1.cab\tDISK1\t\n"
702 "2\t2\t\ttest2.cab\tDISK2\t\n"
703 "3\t3\t\ttest3.cab\tDISK3\t\n"
704 "4\t4\t\ttest3.cab\tDISK3\t\n"
705 "5\t5\t\ttest4.cab\tDISK4\t\n";
707 static const CHAR mc_file_hash_dat
[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
708 "s72\ti2\ti4\ti4\ti4\ti4\n"
709 "MsiFileHash\tFile_\n"
710 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
712 static const CHAR wrv_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
713 "s72\tS38\ts72\ti2\tS255\tS72\n"
714 "Component\tComponent\n"
715 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
717 static const CHAR ca51_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
718 "s72\tS38\ts72\ti2\tS255\tS72\n"
719 "Component\tComponent\n"
720 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
722 static const CHAR ca51_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
724 "InstallExecuteSequence\tAction\n"
725 "ValidateProductID\t\t700\n"
726 "GoodSetProperty\t\t725\n"
727 "BadSetProperty\t\t750\n"
728 "CostInitialize\t\t800\n"
729 "ResolveSource\t\t810\n"
731 "SetSourceDir\tSRCDIR\t910\n"
732 "CostFinalize\t\t1000\n"
733 "InstallValidate\t\t1400\n"
734 "InstallInitialize\t\t1500\n"
735 "InstallFiles\t\t4000\n"
736 "InstallFinalize\t\t6600";
738 static const CHAR ca51_custom_action_dat
[] = "Action\tType\tSource\tTarget\n"
740 "CustomAction\tAction\n"
741 "GoodSetProperty\t51\tMYPROP\t42\n"
742 "BadSetProperty\t51\t\tMYPROP\n"
743 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
745 static const CHAR is_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
746 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
748 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
749 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
750 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
751 "four\t\t\t\t2\t0\t\t0"; /* disabled */
753 static const CHAR is_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
754 "s72\tS38\ts72\ti2\tS255\tS72\n"
755 "Component\tComponent\n"
756 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
757 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
758 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
759 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
760 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
761 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
762 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
763 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
764 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
765 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
766 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
767 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
769 static const CHAR is_feature_comp_dat
[] = "Feature_\tComponent_\n"
771 "FeatureComponents\tFeature_\tComponent_\n"
785 static const CHAR is_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
786 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
788 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
789 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
790 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
791 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
792 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
793 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
794 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
795 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
796 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
797 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
798 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
799 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
801 static const CHAR is_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
802 "i2\ti4\tL64\tS255\tS32\tS72\n"
804 "1\t12\t\t\tDISK1\t\n";
806 static const CHAR sp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
807 "s72\tS38\ts72\ti2\tS255\tS72\n"
808 "Component\tComponent\n"
809 "augustus\t\tTWODIR\t0\t\taugustus\n";
811 static const CHAR sp_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
813 "Directory\tDirectory\n"
814 "TARGETDIR\t\tSourceDir\n"
815 "ProgramFilesFolder\tTARGETDIR\t.\n"
816 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
817 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
818 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
820 static const CHAR mcp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
821 "s72\tS38\ts72\ti2\tS255\tS72\n"
822 "Component\tComponent\n"
823 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
824 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
825 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
827 static const CHAR mcp_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
828 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
830 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
831 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
832 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
834 static const CHAR mcp_feature_comp_dat
[] = "Feature_\tComponent_\n"
836 "FeatureComponents\tFeature_\tComponent_\n"
837 "hydroxyl\thydrogen\n"
841 static const CHAR mcp_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
842 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
844 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
845 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
846 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
847 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
849 static const CHAR ai_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
850 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
852 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
853 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
854 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
855 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
856 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
857 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
858 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
860 static const CHAR ip_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 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
881 static const CHAR ip_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
882 "s72\ti2\tS64\tS0\tS255\n"
883 "CustomAction\tAction\n"
884 "TestInstalledProp\t19\t\tTest failed\t\n";
886 static const CHAR aup_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
888 "InstallExecuteSequence\tAction\n"
889 "CostFinalize\t\t1000\n"
890 "ValidateProductID\t\t700\n"
891 "CostInitialize\t\t800\n"
893 "RemoveFiles\t\t3500\n"
894 "InstallFiles\t\t4000\n"
895 "RegisterUser\t\t6000\n"
896 "RegisterProduct\t\t6100\n"
897 "PublishFeatures\t\t6300\n"
898 "PublishProduct\t\t6400\n"
899 "InstallFinalize\t\t6600\n"
900 "InstallInitialize\t\t1500\n"
901 "ProcessComponents\t\t1600\n"
902 "UnpublishFeatures\t\t1800\n"
903 "InstallValidate\t\t1400\n"
904 "LaunchConditions\t\t100\n"
905 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
907 static const CHAR aup2_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
909 "InstallExecuteSequence\tAction\n"
910 "CostFinalize\t\t1000\n"
911 "ValidateProductID\t\t700\n"
912 "CostInitialize\t\t800\n"
914 "RemoveFiles\t\t3500\n"
915 "InstallFiles\t\t4000\n"
916 "RegisterUser\t\t6000\n"
917 "RegisterProduct\t\t6100\n"
918 "PublishFeatures\t\t6300\n"
919 "PublishProduct\t\t6400\n"
920 "InstallFinalize\t\t6600\n"
921 "InstallInitialize\t\t1500\n"
922 "ProcessComponents\t\t1600\n"
923 "UnpublishFeatures\t\t1800\n"
924 "InstallValidate\t\t1400\n"
925 "LaunchConditions\t\t100\n"
926 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
928 static const CHAR aup3_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
930 "InstallExecuteSequence\tAction\n"
931 "CostFinalize\t\t1000\n"
932 "ValidateProductID\t\t700\n"
933 "CostInitialize\t\t800\n"
935 "RemoveFiles\t\t3500\n"
936 "InstallFiles\t\t4000\n"
937 "RegisterUser\t\t6000\n"
938 "RegisterProduct\t\t6100\n"
939 "PublishFeatures\t\t6300\n"
940 "PublishProduct\t\t6400\n"
941 "InstallFinalize\t\t6600\n"
942 "InstallInitialize\t\t1500\n"
943 "ProcessComponents\t\t1600\n"
944 "UnpublishFeatures\t\t1800\n"
945 "InstallValidate\t\t1400\n"
946 "LaunchConditions\t\t100\n"
947 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
949 static const CHAR aup_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
950 "s72\ti2\tS64\tS0\tS255\n"
951 "CustomAction\tAction\n"
952 "TestAllUsersProp\t19\t\tTest failed\t\n";
954 static const CHAR fo_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
955 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
957 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
958 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
959 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
961 static const CHAR fo_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
962 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
964 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
965 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
966 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
968 static const CHAR fo_condition_dat
[] = "Feature_\tLevel\tCondition\n"
970 "Condition\tFeature_\tLevel\n"
971 "preselected\t0\tPreselected\n"
972 "notpreselected\t0\tNOT Preselected\n";
974 static const CHAR fo_feature_comp_dat
[] = "Feature_\tComponent_\n"
976 "FeatureComponents\tFeature_\tComponent_\n"
977 "override\toverride\n"
978 "preselected\tpreselected\n"
979 "notpreselected\tnotpreselected\n";
981 static const CHAR fo_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
982 "s72\tS38\ts72\ti2\tS255\tS72\n"
983 "Component\tComponent\n"
984 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
985 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
986 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
988 static const CHAR fo_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
989 "s72\ti2\tS64\tS0\tS255\n"
990 "CustomAction\tAction\n"
991 "SetPreselected\t51\tPreselected\t1\t\n";
993 static const CHAR fo_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
995 "InstallExecuteSequence\tAction\n"
996 "LaunchConditions\t\t100\n"
997 "SetPreselected\tpreselect=1\t200\n"
998 "CostInitialize\t\t800\n"
1000 "CostFinalize\t\t1000\n"
1001 "InstallValidate\t\t1400\n"
1002 "InstallInitialize\t\t1500\n"
1003 "ProcessComponents\t\t1600\n"
1004 "RemoveFiles\t\t1700\n"
1005 "InstallFiles\t\t2000\n"
1006 "RegisterProduct\t\t5000\n"
1007 "PublishFeatures\t\t5100\n"
1008 "PublishProduct\t\t5200\n"
1009 "InstallFinalize\t\t6000\n";
1011 static const CHAR uc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1012 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1014 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
1016 static const CHAR uc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1017 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1018 "Feature\tFeature\n"
1019 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
1021 static const CHAR uc_feature_comp_dat
[] = "Feature_\tComponent_\n"
1023 "FeatureComponents\tFeature_\tComponent_\n"
1024 "upgradecode\tupgradecode\n";
1026 static const CHAR uc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1027 "s72\tS38\ts72\ti2\tS255\tS72\n"
1028 "Component\tComponent\n"
1029 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
1031 static const CHAR uc_property_dat
[] = "Property\tValue\n"
1033 "Property\tProperty\n"
1035 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
1036 "ProductName\tMSITEST\n"
1037 "ProductVersion\t1.1.1\n"
1038 "UpgradeCode\t#UPGEADECODE#\n"
1039 "MSIFASTINSTALL\t1\n";
1041 static const CHAR uc_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
1043 "InstallExecuteSequence\tAction\n"
1044 "LaunchConditions\t\t100\n"
1045 "CostInitialize\t\t200\n"
1047 "CostFinalize\t\t400\n"
1048 "InstallInitialize\t\t500\n"
1049 "ProcessComponents\t\t600\n"
1050 "InstallValidate\t\t700\n"
1051 "RemoveFiles\t\t800\n"
1052 "InstallFiles\t\t900\n"
1053 "RegisterProduct\t\t1000\n"
1054 "PublishFeatures\t\t1100\n"
1055 "PublishProduct\t\t1200\n"
1056 "InstallFinalize\t\t1300\n";
1058 static const char mixed_feature_dat
[] =
1059 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1060 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1061 "Feature\tFeature\n"
1062 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1063 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1065 static const char mixed_feature_comp_dat
[] =
1066 "Feature_\tComponent_\n"
1068 "FeatureComponents\tFeature_\tComponent_\n"
1070 "feature2\tcomp2\n";
1072 static const char mixed_component_dat
[] =
1073 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1074 "s72\tS38\ts72\ti2\tS255\tS72\n"
1075 "Component\tComponent\n"
1076 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1077 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1079 static const char mixed_registry_dat
[] =
1080 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1081 "s72\ti2\tl255\tL255\tL0\ts72\n"
1082 "Registry\tRegistry\n"
1083 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1084 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n";
1086 static const char mixed_install_exec_seq_dat
[] =
1087 "Action\tCondition\tSequence\n"
1089 "InstallExecuteSequence\tAction\n"
1090 "LaunchConditions\t\t100\n"
1091 "CostInitialize\t\t200\n"
1093 "CostFinalize\t\t400\n"
1094 "InstallValidate\t\t500\n"
1095 "InstallInitialize\t\t600\n"
1096 "ProcessComponents\t\t700\n"
1097 "UnpublishFeatures\t\t800\n"
1098 "RemoveRegistryValues\t\t900\n"
1099 "WriteRegistryValues\t\t1000\n"
1100 "RegisterProduct\t\t1100\n"
1101 "PublishFeatures\t\t1200\n"
1102 "PublishProduct\t\t1300\n"
1103 "InstallFinalize\t\t1400\n";
1105 static const char vp_file_dat
[] =
1106 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1107 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1109 "volumeprop\tcomp\tvolumeprop.txt\t1000\t\t\t8192\t1\n";
1111 static const char vp_feature_dat
[] =
1112 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1113 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1114 "Feature\tFeature\n"
1115 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1117 static const char vp_feature_comp_dat
[] =
1118 "Feature_\tComponent_\n"
1120 "FeatureComponents\tFeature_\tComponent_\n"
1123 static const char vp_component_dat
[] =
1124 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1125 "s72\tS38\ts72\ti2\tS255\tS72\n"
1126 "Component\tComponent\n"
1127 "comp\t{24364AE7-5B7F-496C-AF5A-54893639C567}\tMSITESTDIR\t0\t\tvolumeprop\n";
1129 static const char vp_custom_action_dat
[] =
1130 "Action\tType\tSource\tTarget\tISComments\n"
1131 "s72\ti2\tS64\tS0\tS255\n"
1132 "CustomAction\tAction\n"
1133 "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n"
1134 "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n"
1135 "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n"
1136 "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n"
1137 "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n"
1138 "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n";
1140 static const char vp_install_exec_seq_dat
[] =
1141 "Action\tCondition\tSequence\n"
1143 "InstallExecuteSequence\tAction\n"
1144 "LaunchConditions\t\t100\n"
1145 "CostInitialize\t\t200\n"
1147 "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n"
1148 "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n"
1149 "CostFinalize\t\t600\n"
1150 "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n"
1151 "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n"
1152 "InstallValidate\t\t900\n"
1153 "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n"
1154 "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n"
1155 "InstallInitialize\t\t1200\n"
1156 "ProcessComponents\t\t1300\n"
1157 "RemoveFiles\t\t1400\n"
1158 "InstallFiles\t\t1500\n"
1159 "RegisterProduct\t\t1600\n"
1160 "PublishFeatures\t\t1700\n"
1161 "PublishProduct\t\t1800\n"
1162 "InstallFinalize\t\t1900\n";
1164 typedef struct _msi_table
1166 const CHAR
*filename
;
1171 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1173 static const msi_table tables
[] =
1175 ADD_TABLE(component
),
1176 ADD_TABLE(directory
),
1178 ADD_TABLE(feature_comp
),
1180 ADD_TABLE(install_exec_seq
),
1182 ADD_TABLE(property
),
1183 ADD_TABLE(registry
),
1184 ADD_TABLE(service_install
),
1185 ADD_TABLE(service_control
)
1188 static const msi_table sc_tables
[] =
1190 ADD_TABLE(component
),
1191 ADD_TABLE(directory
),
1193 ADD_TABLE(feature_comp
),
1195 ADD_TABLE(install_exec_seq
),
1197 ADD_TABLE(property
),
1201 static const msi_table ps_tables
[] =
1203 ADD_TABLE(component
),
1204 ADD_TABLE(directory
),
1206 ADD_TABLE(feature_comp
),
1208 ADD_TABLE(install_exec_seq
),
1210 ADD_TABLE(property
),
1211 ADD_TABLE(condition
)
1214 static const msi_table up_tables
[] =
1216 ADD_TABLE(component
),
1217 ADD_TABLE(directory
),
1219 ADD_TABLE(feature_comp
),
1221 ADD_TABLE(install_exec_seq
),
1223 ADD_TABLE(up_property
),
1224 ADD_TABLE(registry
),
1225 ADD_TABLE(service_install
),
1226 ADD_TABLE(service_control
)
1229 static const msi_table up2_tables
[] =
1231 ADD_TABLE(component
),
1232 ADD_TABLE(directory
),
1234 ADD_TABLE(feature_comp
),
1236 ADD_TABLE(install_exec_seq
),
1238 ADD_TABLE(up2_property
),
1239 ADD_TABLE(registry
),
1240 ADD_TABLE(service_install
),
1241 ADD_TABLE(service_control
)
1244 static const msi_table up3_tables
[] =
1246 ADD_TABLE(component
),
1247 ADD_TABLE(directory
),
1249 ADD_TABLE(feature_comp
),
1251 ADD_TABLE(install_exec_seq
),
1253 ADD_TABLE(up3_property
),
1254 ADD_TABLE(registry
),
1255 ADD_TABLE(service_install
),
1256 ADD_TABLE(service_control
)
1259 static const msi_table up4_tables
[] =
1261 ADD_TABLE(component
),
1262 ADD_TABLE(directory
),
1264 ADD_TABLE(feature_comp
),
1266 ADD_TABLE(pp_install_exec_seq
),
1268 ADD_TABLE(property
),
1269 ADD_TABLE(registry
),
1270 ADD_TABLE(service_install
),
1271 ADD_TABLE(service_control
)
1274 static const msi_table up5_tables
[] =
1276 ADD_TABLE(component
),
1277 ADD_TABLE(directory
),
1279 ADD_TABLE(feature_comp
),
1281 ADD_TABLE(pp_install_exec_seq
),
1283 ADD_TABLE(up_property
),
1284 ADD_TABLE(registry
),
1285 ADD_TABLE(service_install
),
1286 ADD_TABLE(service_control
)
1289 static const msi_table up6_tables
[] =
1291 ADD_TABLE(component
),
1292 ADD_TABLE(directory
),
1294 ADD_TABLE(feature_comp
),
1296 ADD_TABLE(pp_install_exec_seq
),
1298 ADD_TABLE(up2_property
),
1299 ADD_TABLE(registry
),
1300 ADD_TABLE(service_install
),
1301 ADD_TABLE(service_control
)
1304 static const msi_table up7_tables
[] =
1306 ADD_TABLE(component
),
1307 ADD_TABLE(directory
),
1309 ADD_TABLE(feature_comp
),
1311 ADD_TABLE(pp_install_exec_seq
),
1313 ADD_TABLE(up3_property
),
1314 ADD_TABLE(registry
),
1315 ADD_TABLE(service_install
),
1316 ADD_TABLE(service_control
)
1319 static const msi_table cc_tables
[] =
1321 ADD_TABLE(cc_component
),
1322 ADD_TABLE(directory
),
1323 ADD_TABLE(cc_feature
),
1324 ADD_TABLE(cc_feature_comp
),
1326 ADD_TABLE(install_exec_seq
),
1327 ADD_TABLE(cc_media
),
1328 ADD_TABLE(property
),
1331 static const msi_table cc2_tables
[] =
1333 ADD_TABLE(cc2_component
),
1334 ADD_TABLE(directory
),
1335 ADD_TABLE(cc_feature
),
1336 ADD_TABLE(cc_feature_comp
),
1337 ADD_TABLE(cc2_file
),
1338 ADD_TABLE(install_exec_seq
),
1339 ADD_TABLE(cc_media
),
1340 ADD_TABLE(property
),
1343 static const msi_table cc3_tables
[] =
1345 ADD_TABLE(cc_component
),
1346 ADD_TABLE(directory
),
1347 ADD_TABLE(cc_feature
),
1348 ADD_TABLE(cc_feature_comp
),
1350 ADD_TABLE(install_exec_seq
),
1351 ADD_TABLE(cc3_media
),
1352 ADD_TABLE(property
),
1355 static const msi_table co_tables
[] =
1357 ADD_TABLE(cc_component
),
1358 ADD_TABLE(directory
),
1359 ADD_TABLE(cc_feature
),
1360 ADD_TABLE(cc_feature_comp
),
1362 ADD_TABLE(install_exec_seq
),
1363 ADD_TABLE(co_media
),
1364 ADD_TABLE(property
),
1367 static const msi_table co2_tables
[] =
1369 ADD_TABLE(cc_component
),
1370 ADD_TABLE(directory
),
1371 ADD_TABLE(cc_feature
),
1372 ADD_TABLE(cc_feature_comp
),
1374 ADD_TABLE(install_exec_seq
),
1375 ADD_TABLE(co2_media
),
1376 ADD_TABLE(property
),
1379 static const msi_table mm_tables
[] =
1381 ADD_TABLE(cc_component
),
1382 ADD_TABLE(directory
),
1383 ADD_TABLE(cc_feature
),
1384 ADD_TABLE(cc_feature_comp
),
1386 ADD_TABLE(install_exec_seq
),
1387 ADD_TABLE(mm_media
),
1388 ADD_TABLE(property
),
1391 static const msi_table ss_tables
[] =
1393 ADD_TABLE(cc_component
),
1394 ADD_TABLE(directory
),
1395 ADD_TABLE(cc_feature
),
1396 ADD_TABLE(cc_feature_comp
),
1398 ADD_TABLE(install_exec_seq
),
1399 ADD_TABLE(ss_media
),
1400 ADD_TABLE(property
),
1403 static const msi_table ui_tables
[] =
1405 ADD_TABLE(ui_component
),
1406 ADD_TABLE(directory
),
1407 ADD_TABLE(cc_feature
),
1408 ADD_TABLE(cc_feature_comp
),
1410 ADD_TABLE(install_exec_seq
),
1411 ADD_TABLE(ui_install_ui_seq
),
1412 ADD_TABLE(ui_custom_action
),
1413 ADD_TABLE(cc_media
),
1414 ADD_TABLE(property
),
1417 static const msi_table rof_tables
[] =
1419 ADD_TABLE(rof_component
),
1420 ADD_TABLE(directory
),
1421 ADD_TABLE(rof_feature
),
1422 ADD_TABLE(rof_feature_comp
),
1423 ADD_TABLE(rof_file
),
1424 ADD_TABLE(install_exec_seq
),
1425 ADD_TABLE(rof_media
),
1426 ADD_TABLE(property
),
1429 static const msi_table rofc_tables
[] =
1431 ADD_TABLE(rof_component
),
1432 ADD_TABLE(directory
),
1433 ADD_TABLE(rof_feature
),
1434 ADD_TABLE(rof_feature_comp
),
1435 ADD_TABLE(rofc_file
),
1436 ADD_TABLE(install_exec_seq
),
1437 ADD_TABLE(rofc_media
),
1438 ADD_TABLE(property
),
1441 static const msi_table sdp_tables
[] =
1443 ADD_TABLE(rof_component
),
1444 ADD_TABLE(directory
),
1445 ADD_TABLE(rof_feature
),
1446 ADD_TABLE(rof_feature_comp
),
1447 ADD_TABLE(rof_file
),
1448 ADD_TABLE(sdp_install_exec_seq
),
1449 ADD_TABLE(sdp_custom_action
),
1450 ADD_TABLE(rof_media
),
1451 ADD_TABLE(property
),
1454 static const msi_table cie_tables
[] =
1456 ADD_TABLE(cie_component
),
1457 ADD_TABLE(directory
),
1458 ADD_TABLE(cc_feature
),
1459 ADD_TABLE(cie_feature_comp
),
1460 ADD_TABLE(cie_file
),
1461 ADD_TABLE(install_exec_seq
),
1462 ADD_TABLE(cie_media
),
1463 ADD_TABLE(property
),
1466 static const msi_table ci_tables
[] =
1468 ADD_TABLE(ci_component
),
1469 ADD_TABLE(directory
),
1470 ADD_TABLE(rof_feature
),
1471 ADD_TABLE(rof_feature_comp
),
1472 ADD_TABLE(rof_file
),
1473 ADD_TABLE(ci_install_exec_seq
),
1474 ADD_TABLE(rof_media
),
1475 ADD_TABLE(property
),
1476 ADD_TABLE(ci_custom_action
),
1479 static const msi_table ci2_tables
[] =
1481 ADD_TABLE(ci2_component
),
1482 ADD_TABLE(directory
),
1483 ADD_TABLE(rof_feature
),
1484 ADD_TABLE(ci2_feature_comp
),
1485 ADD_TABLE(ci2_file
),
1486 ADD_TABLE(install_exec_seq
),
1487 ADD_TABLE(rof_media
),
1488 ADD_TABLE(property
),
1491 static const msi_table tp_tables
[] =
1493 ADD_TABLE(tp_component
),
1494 ADD_TABLE(directory
),
1495 ADD_TABLE(rof_feature
),
1496 ADD_TABLE(ci2_feature_comp
),
1497 ADD_TABLE(ci2_file
),
1498 ADD_TABLE(install_exec_seq
),
1499 ADD_TABLE(rof_media
),
1500 ADD_TABLE(property
),
1503 static const msi_table cwd_tables
[] =
1505 ADD_TABLE(cwd_component
),
1506 ADD_TABLE(directory
),
1507 ADD_TABLE(rof_feature
),
1508 ADD_TABLE(ci2_feature_comp
),
1509 ADD_TABLE(ci2_file
),
1510 ADD_TABLE(install_exec_seq
),
1511 ADD_TABLE(rof_media
),
1512 ADD_TABLE(property
),
1515 static const msi_table adm_tables
[] =
1517 ADD_TABLE(adm_component
),
1518 ADD_TABLE(directory
),
1519 ADD_TABLE(rof_feature
),
1520 ADD_TABLE(ci2_feature_comp
),
1521 ADD_TABLE(ci2_file
),
1522 ADD_TABLE(install_exec_seq
),
1523 ADD_TABLE(rof_media
),
1524 ADD_TABLE(property
),
1525 ADD_TABLE(adm_custom_action
),
1526 ADD_TABLE(adm_admin_exec_seq
),
1529 static const msi_table amp_tables
[] =
1531 ADD_TABLE(amp_component
),
1532 ADD_TABLE(directory
),
1533 ADD_TABLE(rof_feature
),
1534 ADD_TABLE(ci2_feature_comp
),
1535 ADD_TABLE(ci2_file
),
1536 ADD_TABLE(install_exec_seq
),
1537 ADD_TABLE(rof_media
),
1538 ADD_TABLE(property
),
1541 static const msi_table mc_tables
[] =
1543 ADD_TABLE(mc_component
),
1544 ADD_TABLE(directory
),
1545 ADD_TABLE(cc_feature
),
1546 ADD_TABLE(cie_feature_comp
),
1548 ADD_TABLE(install_exec_seq
),
1549 ADD_TABLE(mc_media
),
1550 ADD_TABLE(property
),
1551 ADD_TABLE(mc_file_hash
),
1554 static const msi_table sf_tables
[] =
1556 ADD_TABLE(wrv_component
),
1557 ADD_TABLE(directory
),
1558 ADD_TABLE(rof_feature
),
1559 ADD_TABLE(ci2_feature_comp
),
1560 ADD_TABLE(ci2_file
),
1561 ADD_TABLE(install_exec_seq
),
1562 ADD_TABLE(rof_media
),
1563 ADD_TABLE(property
),
1566 static const msi_table ca51_tables
[] =
1568 ADD_TABLE(ca51_component
),
1569 ADD_TABLE(directory
),
1570 ADD_TABLE(rof_feature
),
1571 ADD_TABLE(ci2_feature_comp
),
1572 ADD_TABLE(ci2_file
),
1573 ADD_TABLE(ca51_install_exec_seq
),
1574 ADD_TABLE(rof_media
),
1575 ADD_TABLE(property
),
1576 ADD_TABLE(ca51_custom_action
),
1579 static const msi_table is_tables
[] =
1581 ADD_TABLE(is_component
),
1582 ADD_TABLE(directory
),
1583 ADD_TABLE(is_feature
),
1584 ADD_TABLE(is_feature_comp
),
1586 ADD_TABLE(install_exec_seq
),
1587 ADD_TABLE(is_media
),
1588 ADD_TABLE(property
),
1591 static const msi_table sp_tables
[] =
1593 ADD_TABLE(sp_component
),
1594 ADD_TABLE(sp_directory
),
1595 ADD_TABLE(rof_feature
),
1596 ADD_TABLE(ci2_feature_comp
),
1597 ADD_TABLE(ci2_file
),
1598 ADD_TABLE(install_exec_seq
),
1599 ADD_TABLE(rof_media
),
1600 ADD_TABLE(property
),
1603 static const msi_table mcp_tables
[] =
1605 ADD_TABLE(mcp_component
),
1606 ADD_TABLE(directory
),
1607 ADD_TABLE(mcp_feature
),
1608 ADD_TABLE(mcp_feature_comp
),
1609 ADD_TABLE(mcp_file
),
1610 ADD_TABLE(rem_install_exec_seq
),
1611 ADD_TABLE(rof_media
),
1612 ADD_TABLE(property
),
1615 static const msi_table ai_tables
[] =
1617 ADD_TABLE(component
),
1618 ADD_TABLE(directory
),
1620 ADD_TABLE(feature_comp
),
1622 ADD_TABLE(install_exec_seq
),
1627 static const msi_table pc_tables
[] =
1629 ADD_TABLE(ca51_component
),
1630 ADD_TABLE(directory
),
1631 ADD_TABLE(rof_feature
),
1632 ADD_TABLE(ci2_feature_comp
),
1633 ADD_TABLE(ci2_file
),
1634 ADD_TABLE(install_exec_seq
),
1635 ADD_TABLE(rof_media
),
1639 static const msi_table ip_tables
[] =
1641 ADD_TABLE(component
),
1642 ADD_TABLE(directory
),
1644 ADD_TABLE(feature_comp
),
1646 ADD_TABLE(ip_install_exec_seq
),
1647 ADD_TABLE(ip_custom_action
),
1652 static const msi_table aup_tables
[] =
1654 ADD_TABLE(component
),
1655 ADD_TABLE(directory
),
1657 ADD_TABLE(feature_comp
),
1659 ADD_TABLE(aup_install_exec_seq
),
1660 ADD_TABLE(aup_custom_action
),
1665 static const msi_table aup2_tables
[] =
1667 ADD_TABLE(component
),
1668 ADD_TABLE(directory
),
1670 ADD_TABLE(feature_comp
),
1672 ADD_TABLE(aup2_install_exec_seq
),
1673 ADD_TABLE(aup_custom_action
),
1675 ADD_TABLE(aup_property
)
1678 static const msi_table aup3_tables
[] =
1680 ADD_TABLE(component
),
1681 ADD_TABLE(directory
),
1683 ADD_TABLE(feature_comp
),
1685 ADD_TABLE(aup2_install_exec_seq
),
1686 ADD_TABLE(aup_custom_action
),
1688 ADD_TABLE(aup2_property
)
1691 static const msi_table aup4_tables
[] =
1693 ADD_TABLE(component
),
1694 ADD_TABLE(directory
),
1696 ADD_TABLE(feature_comp
),
1698 ADD_TABLE(aup3_install_exec_seq
),
1699 ADD_TABLE(aup_custom_action
),
1701 ADD_TABLE(aup2_property
)
1704 static const msi_table fiu_tables
[] =
1706 ADD_TABLE(rof_component
),
1707 ADD_TABLE(directory
),
1708 ADD_TABLE(rof_feature
),
1709 ADD_TABLE(rof_feature_comp
),
1710 ADD_TABLE(rof_file
),
1711 ADD_TABLE(pp_install_exec_seq
),
1712 ADD_TABLE(rof_media
),
1713 ADD_TABLE(property
),
1716 static const msi_table fiuc_tables
[] =
1718 ADD_TABLE(rof_component
),
1719 ADD_TABLE(directory
),
1720 ADD_TABLE(rof_feature
),
1721 ADD_TABLE(rof_feature_comp
),
1722 ADD_TABLE(rofc_file
),
1723 ADD_TABLE(pp_install_exec_seq
),
1724 ADD_TABLE(rofc_media
),
1725 ADD_TABLE(property
),
1728 static const msi_table fo_tables
[] =
1730 ADD_TABLE(directory
),
1732 ADD_TABLE(fo_component
),
1733 ADD_TABLE(fo_feature
),
1734 ADD_TABLE(fo_condition
),
1735 ADD_TABLE(fo_feature_comp
),
1736 ADD_TABLE(fo_custom_action
),
1737 ADD_TABLE(fo_install_exec_seq
),
1742 static const msi_table icon_base_tables
[] =
1744 ADD_TABLE(ci_component
),
1745 ADD_TABLE(directory
),
1746 ADD_TABLE(rof_feature
),
1747 ADD_TABLE(rof_feature_comp
),
1748 ADD_TABLE(rof_file
),
1749 ADD_TABLE(pp_install_exec_seq
),
1750 ADD_TABLE(rof_media
),
1751 ADD_TABLE(icon_property
),
1754 static const msi_table pv_tables
[] =
1756 ADD_TABLE(rof_component
),
1757 ADD_TABLE(directory
),
1758 ADD_TABLE(rof_feature
),
1759 ADD_TABLE(rof_feature_comp
),
1760 ADD_TABLE(rof_file
),
1761 ADD_TABLE(pv_install_exec_seq
),
1762 ADD_TABLE(rof_media
),
1766 static const msi_table uc_tables
[] =
1768 ADD_TABLE(directory
),
1769 ADD_TABLE(uc_component
),
1770 ADD_TABLE(uc_feature
),
1771 ADD_TABLE(uc_feature_comp
),
1773 ADD_TABLE(uc_install_exec_seq
),
1775 ADD_TABLE(uc_property
)
1778 static const msi_table mixed_tables
[] =
1780 ADD_TABLE(directory
),
1781 ADD_TABLE(mixed_component
),
1782 ADD_TABLE(mixed_feature
),
1783 ADD_TABLE(mixed_feature_comp
),
1784 ADD_TABLE(mixed_install_exec_seq
),
1785 ADD_TABLE(mixed_registry
),
1790 static const msi_table vp_tables
[] =
1792 ADD_TABLE(directory
),
1794 ADD_TABLE(vp_component
),
1795 ADD_TABLE(vp_feature
),
1796 ADD_TABLE(vp_feature_comp
),
1797 ADD_TABLE(vp_custom_action
),
1798 ADD_TABLE(vp_install_exec_seq
),
1803 /* cabinet definitions */
1805 /* make the max size large so there is only one cab file */
1806 #define MEDIA_SIZE 0x7FFFFFFF
1807 #define FOLDER_THRESHOLD 900000
1809 /* the FCI callbacks */
1811 static void * CDECL
mem_alloc(ULONG cb
)
1813 return HeapAlloc(GetProcessHeap(), 0, cb
);
1816 static void CDECL
mem_free(void *memory
)
1818 HeapFree(GetProcessHeap(), 0, memory
);
1821 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
1823 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
1827 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
1832 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
1833 BOOL fContinuation
, void *pv
)
1838 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
1842 DWORD dwShareMode
= 0;
1843 DWORD dwCreateDisposition
= OPEN_EXISTING
;
1845 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
1846 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1847 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
1849 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
1850 dwCreateDisposition
= OPEN_EXISTING
;
1852 dwCreateDisposition
= CREATE_NEW
;
1854 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
1855 dwCreateDisposition
, 0, NULL
);
1857 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
1859 return (INT_PTR
)handle
;
1862 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1864 HANDLE handle
= (HANDLE
)hf
;
1868 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
1869 ok(res
, "Failed to ReadFile\n");
1874 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1876 HANDLE handle
= (HANDLE
)hf
;
1880 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
1881 ok(res
, "Failed to WriteFile\n");
1886 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
1888 HANDLE handle
= (HANDLE
)hf
;
1889 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
1894 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
1896 HANDLE handle
= (HANDLE
)hf
;
1899 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
1900 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
1905 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
1907 BOOL ret
= DeleteFileA(pszFile
);
1908 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
1913 static void init_functionpointers(void)
1915 HMODULE hmsi
= GetModuleHandleA("msi.dll");
1916 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
1917 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
1919 #define GET_PROC(mod, func) \
1920 p ## func = (void*)GetProcAddress(mod, #func); \
1922 trace("GetProcAddress(%s) failed\n", #func);
1924 GET_PROC(hmsi
, MsiQueryComponentStateA
);
1925 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
1926 GET_PROC(hmsi
, MsiGetComponentPathExA
);
1928 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
1929 GET_PROC(hadvapi32
, OpenProcessToken
);
1930 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
1931 GET_PROC(hkernel32
, IsWow64Process
)
1933 hsrclient
= LoadLibraryA("srclient.dll");
1934 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
1935 GET_PROC(hsrclient
, SRSetRestorePointA
);
1940 static BOOL
is_process_limited(void)
1944 if (!pOpenProcessToken
) return FALSE
;
1946 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
1949 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
1952 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
1954 return (ret
&& type
== TokenElevationTypeLimited
);
1959 static BOOL
check_record(MSIHANDLE rec
, UINT field
, LPCSTR val
)
1966 r
= MsiRecordGetString(rec
, field
, buffer
, &sz
);
1967 return (r
== ERROR_SUCCESS
) && !strcmp(val
, buffer
);
1970 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
1974 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
1975 GetTempFileNameA(".", "xx", 0, tempname
);
1977 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
1979 lstrcpyA(pszTempName
, tempname
);
1980 HeapFree(GetProcessHeap(), 0, tempname
);
1984 HeapFree(GetProcessHeap(), 0, tempname
);
1989 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
1990 USHORT
*pattribs
, int *err
, void *pv
)
1992 BY_HANDLE_FILE_INFORMATION finfo
;
1998 handle
= CreateFile(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
1999 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2001 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2003 res
= GetFileInformationByHandle(handle
, &finfo
);
2004 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2006 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2007 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2009 attrs
= GetFileAttributes(pszName
);
2010 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2012 return (INT_PTR
)handle
;
2015 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2017 char path
[MAX_PATH
];
2018 char filename
[MAX_PATH
];
2020 lstrcpyA(path
, CURR_DIR
);
2021 lstrcatA(path
, "\\");
2022 lstrcatA(path
, file
);
2024 lstrcpyA(filename
, file
);
2026 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2027 progress
, get_open_info
, compress
);
2030 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2032 ZeroMemory(pCabParams
, sizeof(CCAB
));
2034 pCabParams
->cb
= max_size
;
2035 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2036 pCabParams
->setID
= 0xbeef;
2037 pCabParams
->iCab
= 1;
2038 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2039 lstrcatA(pCabParams
->szCabPath
, "\\");
2040 lstrcpyA(pCabParams
->szCab
, name
);
2043 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2051 set_cab_parameters(&cabParams
, name
, max_size
);
2053 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2054 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2055 get_temp_file
, &cabParams
, NULL
);
2057 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2062 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2063 ok(res
, "Failed to add file: %s\n", ptr
);
2064 ptr
+= lstrlen(ptr
) + 1;
2067 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2068 ok(res
, "Failed to flush the cabinet\n");
2070 res
= FCIDestroy(hfci
);
2071 ok(res
, "Failed to destroy the cabinet\n");
2074 static BOOL
get_user_dirs(void)
2079 if(RegOpenKey(HKEY_CURRENT_USER
,
2080 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
2085 if(RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
)){
2094 static BOOL
get_system_dirs(void)
2099 if (RegOpenKey(HKEY_LOCAL_MACHINE
,
2100 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2104 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2105 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
)) {
2111 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2112 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
)) {
2118 if (RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR_NATIVE
, &size
)) {
2125 if(!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2131 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2136 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2137 if (file
== INVALID_HANDLE_VALUE
)
2140 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2144 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2151 #define create_file(name, size) create_file_data(name, name, size)
2153 static void create_test_files(void)
2155 CreateDirectoryA("msitest", NULL
);
2156 create_file("msitest\\one.txt", 100);
2157 CreateDirectoryA("msitest\\first", NULL
);
2158 create_file("msitest\\first\\two.txt", 100);
2159 CreateDirectoryA("msitest\\second", NULL
);
2160 create_file("msitest\\second\\three.txt", 100);
2162 create_file("four.txt", 100);
2163 create_file("five.txt", 100);
2164 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2166 create_file("msitest\\filename", 100);
2167 create_file("msitest\\service.exe", 100);
2169 DeleteFileA("four.txt");
2170 DeleteFileA("five.txt");
2173 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2175 CHAR path
[MAX_PATH
];
2177 lstrcpyA(path
, PROG_FILES_DIR
);
2178 lstrcatA(path
, "\\");
2179 lstrcatA(path
, rel_path
);
2182 return DeleteFileA(path
);
2184 return RemoveDirectoryA(path
);
2187 static BOOL
delete_pf_native(const CHAR
*rel_path
, BOOL is_file
)
2189 CHAR path
[MAX_PATH
];
2191 lstrcpyA(path
, PROG_FILES_DIR_NATIVE
);
2192 lstrcatA(path
, "\\");
2193 lstrcatA(path
, rel_path
);
2196 return DeleteFileA(path
);
2198 return RemoveDirectoryA(path
);
2201 static BOOL
delete_cf(const CHAR
*rel_path
, BOOL is_file
)
2203 CHAR path
[MAX_PATH
];
2205 lstrcpyA(path
, COMMON_FILES_DIR
);
2206 lstrcatA(path
, "\\");
2207 lstrcatA(path
, rel_path
);
2210 return DeleteFileA(path
);
2212 return RemoveDirectoryA(path
);
2215 static BOOL
compare_pf_data(const char *filename
, const char *data
, DWORD size
)
2220 char *buffer
, path
[MAX_PATH
];
2222 lstrcpyA(path
, PROG_FILES_DIR
);
2223 lstrcatA(path
, "\\");
2224 lstrcatA(path
, filename
);
2226 handle
= CreateFileA(path
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2227 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
2230 ReadFile(handle
, buffer
, size
, &read
, NULL
);
2231 if (read
== size
&& !memcmp(data
, buffer
, size
)) ret
= TRUE
;
2232 HeapFree(GetProcessHeap(), 0, buffer
);
2234 CloseHandle(handle
);
2238 static void delete_test_files(void)
2240 DeleteFileA("msitest.msi");
2241 DeleteFileA("msitest.cab");
2242 DeleteFileA("msitest\\second\\three.txt");
2243 DeleteFileA("msitest\\first\\two.txt");
2244 DeleteFileA("msitest\\one.txt");
2245 DeleteFileA("msitest\\service.exe");
2246 DeleteFileA("msitest\\filename");
2247 RemoveDirectoryA("msitest\\second");
2248 RemoveDirectoryA("msitest\\first");
2249 RemoveDirectoryA("msitest");
2252 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2256 HANDLE hf
= CreateFile(filename
, GENERIC_WRITE
, 0, NULL
,
2257 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2259 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2263 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
, const char *template)
2268 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2269 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2271 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2272 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2274 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
2275 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2276 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2278 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2279 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2281 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2282 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2284 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2285 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2287 /* write the summary changes back to the stream */
2288 r
= MsiSummaryInfoPersist(summary
);
2289 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2291 MsiCloseHandle(summary
);
2294 #define create_database(name, tables, num_tables) \
2295 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2297 #define create_database_template(name, tables, num_tables, version, template) \
2298 create_database_wordcount(name, tables, num_tables, version, 0, template);
2300 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2301 int num_tables
, INT version
, INT wordcount
,
2302 const char *template)
2308 r
= MsiOpenDatabaseA(name
, MSIDBOPEN_CREATE
, &db
);
2309 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2311 /* import the tables into the database */
2312 for (j
= 0; j
< num_tables
; j
++)
2314 const msi_table
*table
= &tables
[j
];
2316 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2318 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2319 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2321 DeleteFileA(table
->filename
);
2324 write_msi_summary_info(db
, version
, wordcount
, template);
2326 r
= MsiDatabaseCommit(db
);
2327 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2332 static void check_service_is_installed(void)
2334 SC_HANDLE scm
, service
;
2337 scm
= OpenSCManager(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
2338 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
2340 service
= OpenService(scm
, "TestService", SC_MANAGER_ALL_ACCESS
);
2341 ok(service
!= NULL
, "Failed to open TestService\n");
2343 res
= DeleteService(service
);
2344 ok(res
, "Failed to delete TestService\n");
2346 CloseServiceHandle(service
);
2347 CloseServiceHandle(scm
);
2350 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2352 RESTOREPOINTINFOA spec
;
2354 spec
.dwEventType
= event_type
;
2355 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2356 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2357 lstrcpyA(spec
.szDescription
, "msitest restore point");
2359 return pSRSetRestorePointA(&spec
, status
);
2362 static void remove_restore_point(DWORD seq_number
)
2366 res
= pSRRemoveRestorePoint(seq_number
);
2367 if (res
!= ERROR_SUCCESS
)
2368 trace("Failed to remove the restore point : %08x\n", res
);
2371 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2373 if (pRegDeleteKeyExA
)
2374 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2375 return RegDeleteKeyA( key
, subkey
);
2378 static void test_MsiInstallProduct(void)
2381 CHAR path
[MAX_PATH
];
2384 DWORD num
, size
, type
;
2385 REGSAM access
= KEY_ALL_ACCESS
;
2387 if (is_process_limited())
2389 skip("process is limited\n");
2394 access
|= KEY_WOW64_64KEY
;
2396 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2398 /* szPackagePath is NULL */
2399 r
= MsiInstallProductA(NULL
, "INSTALL=ALL");
2400 ok(r
== ERROR_INVALID_PARAMETER
,
2401 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2403 /* both szPackagePath and szCommandLine are NULL */
2404 r
= MsiInstallProductA(NULL
, NULL
);
2405 ok(r
== ERROR_INVALID_PARAMETER
,
2406 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2408 /* szPackagePath is empty */
2409 r
= MsiInstallProductA("", "INSTALL=ALL");
2410 ok(r
== ERROR_PATH_NOT_FOUND
,
2411 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r
);
2413 create_test_files();
2414 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2416 /* install, don't publish */
2417 r
= MsiInstallProductA(msifile
, NULL
);
2418 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2420 skip("Not enough rights to perform tests\n");
2423 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2425 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2426 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2427 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2428 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2429 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2430 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2431 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2432 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2433 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2434 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2435 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2436 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2438 res
= RegOpenKeyEx(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", 0, access
, &hkey
);
2439 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2443 res
= RegQueryValueExA(hkey
, "Name", NULL
, &type
, (LPBYTE
)path
, &size
);
2444 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2445 ok(!lstrcmpA(path
, "imaname"), "Expected imaname, got %s\n", path
);
2449 res
= RegQueryValueExA(hkey
, "blah", NULL
, &type
, (LPBYTE
)path
, &size
);
2450 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2454 res
= RegQueryValueExA(hkey
, "number", NULL
, &type
, (LPBYTE
)&num
, &size
);
2455 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2456 ok(num
== 314, "Expected 314, got %d\n", num
);
2460 res
= RegQueryValueExA(hkey
, "OrderTestName", NULL
, &type
, (LPBYTE
)path
, &size
);
2461 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2462 ok(!lstrcmpA(path
, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path
);
2464 check_service_is_installed();
2466 delete_key(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", access
);
2468 /* not published, reinstall */
2469 r
= MsiInstallProductA(msifile
, NULL
);
2470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2472 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2473 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2474 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2475 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2476 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2477 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2478 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2479 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2480 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2481 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2482 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2483 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2485 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2486 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2487 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2489 create_database(msifile
, up_tables
, sizeof(up_tables
) / sizeof(msi_table
));
2491 /* not published, RemovePreviousVersions set */
2492 r
= MsiInstallProductA(msifile
, NULL
);
2493 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2495 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2496 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2497 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2498 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2499 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2500 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2501 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2502 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2503 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2504 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2505 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2506 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2508 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2509 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2510 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2512 create_database(msifile
, up2_tables
, sizeof(up2_tables
) / sizeof(msi_table
));
2514 /* not published, version number bumped */
2515 r
= MsiInstallProductA(msifile
, NULL
);
2516 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2518 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2519 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2520 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2521 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2522 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2523 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2524 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2525 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2526 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2527 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2528 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2529 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2531 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2532 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2533 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2535 create_database(msifile
, up3_tables
, sizeof(up3_tables
) / sizeof(msi_table
));
2537 /* not published, RemovePreviousVersions set and version number bumped */
2538 r
= MsiInstallProductA(msifile
, NULL
);
2539 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2541 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2542 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2543 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2544 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2545 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2546 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2547 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2548 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2549 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2550 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2551 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2552 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2554 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2555 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2556 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2558 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2560 /* install, publish product */
2561 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
2562 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2564 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2565 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2566 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2567 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2568 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2569 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2570 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2571 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2572 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2573 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2574 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2575 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2577 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2578 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2580 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2582 /* published, reinstall */
2583 r
= MsiInstallProductA(msifile
, NULL
);
2584 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2586 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2587 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2588 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2589 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2590 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2591 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2592 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2593 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2594 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2595 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2596 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2597 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2599 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2600 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2602 create_database(msifile
, up5_tables
, sizeof(up5_tables
) / sizeof(msi_table
));
2604 /* published product, RemovePreviousVersions set */
2605 r
= MsiInstallProductA(msifile
, NULL
);
2606 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2608 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2609 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2610 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2611 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2612 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2613 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2614 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2615 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2616 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2617 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2618 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2619 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2621 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2622 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2624 create_database(msifile
, up6_tables
, sizeof(up6_tables
) / sizeof(msi_table
));
2626 /* published product, version number bumped */
2627 r
= MsiInstallProductA(msifile
, NULL
);
2628 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2630 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2631 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2632 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2633 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2634 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2635 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2636 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2637 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2638 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2639 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2640 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2641 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2643 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2644 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2646 create_database(msifile
, up7_tables
, sizeof(up7_tables
) / sizeof(msi_table
));
2648 /* published product, RemovePreviousVersions set and version number bumped */
2649 r
= MsiInstallProductA(msifile
, NULL
);
2650 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2652 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2653 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2654 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2655 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2656 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2657 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2658 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2659 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2660 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2661 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2662 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2663 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2665 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2666 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2668 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
2669 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2672 delete_test_files();
2673 DeleteFileA(msifile
);
2676 static void test_MsiSetComponentState(void)
2678 INSTALLSTATE installed
, action
;
2680 char path
[MAX_PATH
];
2683 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2687 lstrcpy(path
, CURR_DIR
);
2688 lstrcat(path
, "\\");
2689 lstrcat(path
, msifile
);
2691 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2693 r
= MsiOpenPackage(path
, &package
);
2694 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2696 skip("Not enough rights to perform tests\n");
2699 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2701 r
= MsiDoAction(package
, "CostInitialize");
2702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2704 r
= MsiDoAction(package
, "FileCost");
2705 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2707 r
= MsiDoAction(package
, "CostFinalize");
2708 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2710 r
= MsiGetComponentState(package
, "dangler", &installed
, &action
);
2711 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2712 ok(installed
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", installed
);
2713 ok(action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2715 r
= MsiSetComponentState(package
, "dangler", INSTALLSTATE_SOURCE
);
2716 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2718 MsiCloseHandle(package
);
2722 DeleteFileA(msifile
);
2725 static void test_packagecoltypes(void)
2727 MSIHANDLE hdb
, view
, rec
;
2728 char path
[MAX_PATH
];
2732 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2736 lstrcpy(path
, CURR_DIR
);
2737 lstrcat(path
, "\\");
2738 lstrcat(path
, msifile
);
2740 r
= MsiOpenDatabase(path
, MSIDBOPEN_READONLY
, &hdb
);
2741 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2743 query
= "SELECT * FROM `Media`";
2744 r
= MsiDatabaseOpenView( hdb
, query
, &view
);
2745 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2747 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_NAMES
, &rec
);
2748 count
= MsiRecordGetFieldCount( rec
);
2749 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2750 ok(count
== 6, "Expected 6, got %d\n", count
);
2751 ok(check_record(rec
, 1, "DiskId"), "wrong column label\n");
2752 ok(check_record(rec
, 2, "LastSequence"), "wrong column label\n");
2753 ok(check_record(rec
, 3, "DiskPrompt"), "wrong column label\n");
2754 ok(check_record(rec
, 4, "Cabinet"), "wrong column label\n");
2755 ok(check_record(rec
, 5, "VolumeLabel"), "wrong column label\n");
2756 ok(check_record(rec
, 6, "Source"), "wrong column label\n");
2757 MsiCloseHandle(rec
);
2759 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_TYPES
, &rec
);
2760 count
= MsiRecordGetFieldCount( rec
);
2761 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2762 ok(count
== 6, "Expected 6, got %d\n", count
);
2763 ok(check_record(rec
, 1, "i2"), "wrong column label\n");
2764 ok(check_record(rec
, 2, "i4"), "wrong column label\n");
2765 ok(check_record(rec
, 3, "L64"), "wrong column label\n");
2766 ok(check_record(rec
, 4, "S255"), "wrong column label\n");
2767 ok(check_record(rec
, 5, "S32"), "wrong column label\n");
2768 ok(check_record(rec
, 6, "S72"), "wrong column label\n");
2770 MsiCloseHandle(rec
);
2771 MsiCloseHandle(view
);
2772 MsiCloseHandle(hdb
);
2775 DeleteFile(msifile
);
2778 static void create_cc_test_files(void)
2783 static CHAR cab_context
[] = "test%d.cab";
2786 create_file("maximus", 500);
2787 create_file("augustus", 50000);
2788 create_file("tiberius", 500);
2789 create_file("caesar", 500);
2791 set_cab_parameters(&cabParams
, "test1.cab", 40000);
2793 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2794 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2795 get_temp_file
, &cabParams
, cab_context
);
2796 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2798 res
= add_file(hfci
, "maximus", tcompTYPE_NONE
);
2799 ok(res
, "Failed to add file maximus\n");
2801 res
= add_file(hfci
, "augustus", tcompTYPE_NONE
);
2802 ok(res
, "Failed to add file augustus\n");
2804 res
= add_file(hfci
, "tiberius", tcompTYPE_NONE
);
2805 ok(res
, "Failed to add file tiberius\n");
2807 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2808 ok(res
, "Failed to flush the cabinet\n");
2810 res
= FCIDestroy(hfci
);
2811 ok(res
, "Failed to destroy the cabinet\n");
2813 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2815 DeleteFile("maximus");
2816 DeleteFile("augustus");
2817 DeleteFile("tiberius");
2818 DeleteFile("caesar");
2821 static void delete_cab_files(void)
2823 SHFILEOPSTRUCT shfl
;
2824 CHAR path
[MAX_PATH
+10];
2826 lstrcpyA(path
, CURR_DIR
);
2827 lstrcatA(path
, "\\*.cab");
2828 path
[strlen(path
) + 1] = '\0';
2831 shfl
.wFunc
= FO_DELETE
;
2834 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
;
2836 SHFileOperation(&shfl
);
2839 static void test_continuouscabs(void)
2843 if (is_process_limited())
2845 skip("process is limited\n");
2849 create_cc_test_files();
2850 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
2852 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2854 r
= MsiInstallProductA(msifile
, NULL
);
2855 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2857 skip("Not enough rights to perform tests\n");
2861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2862 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2863 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2864 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2865 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2869 DeleteFile(msifile
);
2871 create_cc_test_files();
2872 create_database(msifile
, cc2_tables
, sizeof(cc2_tables
) / sizeof(msi_table
));
2874 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2876 r
= MsiInstallProductA(msifile
, NULL
);
2877 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2879 skip("Not enough rights to perform tests\n");
2883 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2884 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2885 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
2886 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
2887 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2888 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2892 DeleteFile(msifile
);
2894 /* Tests to show that only msi cab filename is taken in case of mismatch with the one given by previous cab */
2896 /* Filename from cab is right and the one from msi is wrong */
2897 create_cc_test_files();
2898 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
2900 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2902 r
= MsiInstallProductA(msifile
, NULL
);
2903 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2905 skip("Not enough rights to perform tests\n");
2909 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAIRE, got %u\n", r
);
2910 todo_wine
ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
2911 ok(!delete_pf("msitest\\caesar", TRUE
), "File installed\n");
2912 todo_wine
ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
2913 todo_wine
ok(!delete_pf("msitest", FALSE
), "Directory created\n");
2917 DeleteFile(msifile
);
2919 /* Filename from msi is right and the one from cab is wrong */
2920 create_cc_test_files();
2921 ok(MoveFile("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
2922 create_database(msifile
, cc3_tables
, sizeof(cc3_tables
) / sizeof(msi_table
));
2924 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2926 r
= MsiInstallProductA(msifile
, NULL
);
2927 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2929 skip("Not enough rights to perform tests\n");
2933 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2934 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2935 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2936 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2937 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2941 DeleteFile(msifile
);
2944 static void test_caborder(void)
2948 create_file("imperator", 100);
2949 create_file("maximus", 500);
2950 create_file("augustus", 50000);
2951 create_file("caesar", 500);
2953 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
2955 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2957 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
2958 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
2959 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2961 r
= MsiInstallProductA(msifile
, NULL
);
2962 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2964 skip("Not enough rights to perform tests\n");
2967 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
2968 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
2969 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
2972 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
2973 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
2978 create_cab_file("test1.cab", MEDIA_SIZE
, "imperator\0");
2979 create_cab_file("test2.cab", MEDIA_SIZE
, "maximus\0augustus\0");
2980 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2982 r
= MsiInstallProductA(msifile
, NULL
);
2983 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
2984 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
2985 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
2986 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
2987 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
2990 DeleteFile(msifile
);
2992 create_cc_test_files();
2993 create_database(msifile
, co_tables
, sizeof(co_tables
) / sizeof(msi_table
));
2995 r
= MsiInstallProductA(msifile
, NULL
);
2996 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
2997 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
2998 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3001 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3002 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3006 DeleteFile(msifile
);
3008 create_cc_test_files();
3009 create_database(msifile
, co2_tables
, sizeof(co2_tables
) / sizeof(msi_table
));
3011 r
= MsiInstallProductA(msifile
, NULL
);
3012 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
3013 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3016 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
3017 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
3018 ok(!delete_pf("msitest", FALSE
), "Directory is created\n");
3023 DeleteFile("imperator");
3024 DeleteFile("maximus");
3025 DeleteFile("augustus");
3026 DeleteFile("caesar");
3027 DeleteFile(msifile
);
3030 static void test_mixedmedia(void)
3034 if (is_process_limited())
3036 skip("process is limited\n");
3040 CreateDirectoryA("msitest", NULL
);
3041 create_file("msitest\\maximus", 500);
3042 create_file("msitest\\augustus", 500);
3043 create_file("caesar", 500);
3045 create_database(msifile
, mm_tables
, sizeof(mm_tables
) / sizeof(msi_table
));
3047 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3049 create_cab_file("test1.cab", MEDIA_SIZE
, "caesar\0");
3051 r
= MsiInstallProductA(msifile
, NULL
);
3052 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3054 skip("Not enough rights to perform tests\n");
3057 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3058 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3059 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3060 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3061 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3064 /* Delete the files in the temp (current) folder */
3065 DeleteFile("msitest\\maximus");
3066 DeleteFile("msitest\\augustus");
3067 RemoveDirectory("msitest");
3068 DeleteFile("caesar");
3069 DeleteFile("test1.cab");
3070 DeleteFile(msifile
);
3073 static void test_samesequence(void)
3077 create_cc_test_files();
3078 create_database(msifile
, ss_tables
, sizeof(ss_tables
) / sizeof(msi_table
));
3080 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3082 r
= MsiInstallProductA(msifile
, NULL
);
3083 ok(r
== ERROR_SUCCESS
|| broken(r
== ERROR_INSTALL_FAILURE
), "Expected ERROR_SUCCESS, got %u\n", r
);
3084 if (r
== ERROR_SUCCESS
)
3086 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3087 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3088 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3089 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3092 DeleteFile(msifile
);
3095 static void test_uiLevelFlags(void)
3099 create_cc_test_files();
3100 create_database(msifile
, ui_tables
, sizeof(ui_tables
) / sizeof(msi_table
));
3102 MsiSetInternalUI(INSTALLUILEVEL_NONE
| INSTALLUILEVEL_SOURCERESONLY
, NULL
);
3104 r
= MsiInstallProductA(msifile
, NULL
);
3105 ok(r
== ERROR_SUCCESS
|| broken(r
== ERROR_INSTALL_FAILURE
), "Expected ERROR_SUCCESS, got %u\n", r
);
3106 if (r
== ERROR_SUCCESS
)
3108 ok(!delete_pf("msitest\\maximus", TRUE
), "UI install occurred, but execute-only was requested.\n");
3109 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3110 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3111 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3114 DeleteFile(msifile
);
3117 static BOOL
file_matches(LPSTR path
)
3123 file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3124 NULL
, OPEN_EXISTING
, 0, NULL
);
3126 ZeroMemory(buf
, MAX_PATH
);
3127 ReadFile(file
, buf
, 15, &size
, NULL
);
3130 return !lstrcmp(buf
, "msitest\\maximus");
3133 static void test_readonlyfile(void)
3138 CHAR path
[MAX_PATH
];
3140 if (is_process_limited())
3142 skip("process is limited\n");
3146 CreateDirectoryA("msitest", NULL
);
3147 create_file("msitest\\maximus", 500);
3148 create_database(msifile
, rof_tables
, sizeof(rof_tables
) / sizeof(msi_table
));
3150 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3152 lstrcpy(path
, PROG_FILES_DIR
);
3153 lstrcat(path
, "\\msitest");
3154 CreateDirectory(path
, NULL
);
3156 lstrcat(path
, "\\maximus");
3157 file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3158 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3160 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3163 r
= MsiInstallProductA(msifile
, NULL
);
3164 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3166 skip("Not enough rights to perform tests\n");
3169 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3170 ok(file_matches(path
), "Expected file to be overwritten\n");
3171 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3172 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3175 /* Delete the files in the temp (current) folder */
3176 DeleteFile("msitest\\maximus");
3177 RemoveDirectory("msitest");
3178 DeleteFile(msifile
);
3181 static void test_readonlyfile_cab(void)
3186 CHAR path
[MAX_PATH
];
3189 if (is_process_limited())
3191 skip("process is limited\n");
3195 CreateDirectoryA("msitest", NULL
);
3196 create_file("maximus", 500);
3197 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3198 DeleteFile("maximus");
3200 create_database(msifile
, rofc_tables
, sizeof(rofc_tables
) / sizeof(msi_table
));
3202 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3204 lstrcpy(path
, PROG_FILES_DIR
);
3205 lstrcat(path
, "\\msitest");
3206 CreateDirectory(path
, NULL
);
3208 lstrcat(path
, "\\maximus");
3209 file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3210 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
3212 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
3215 r
= MsiInstallProductA(msifile
, NULL
);
3216 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3218 skip("Not enough rights to perform tests\n");
3221 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3223 memset( buf
, 0, sizeof(buf
) );
3224 if ((file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
3225 NULL
, OPEN_EXISTING
, 0, NULL
)) != INVALID_HANDLE_VALUE
)
3227 ReadFile(file
, buf
, sizeof(buf
) - 1, &size
, NULL
);
3230 ok(!memcmp( buf
, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf
);
3231 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3232 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3235 /* Delete the files in the temp (current) folder */
3237 DeleteFile("msitest\\maximus");
3238 RemoveDirectory("msitest");
3239 DeleteFile(msifile
);
3242 static void test_setdirproperty(void)
3246 if (is_process_limited())
3248 skip("process is limited\n");
3252 CreateDirectoryA("msitest", NULL
);
3253 create_file("msitest\\maximus", 500);
3254 create_database(msifile
, sdp_tables
, sizeof(sdp_tables
) / sizeof(msi_table
));
3256 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3258 r
= MsiInstallProductA(msifile
, NULL
);
3259 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3261 skip("Not enough rights to perform tests\n");
3264 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3265 ok(delete_cf("msitest\\maximus", TRUE
), "File not installed\n");
3266 ok(delete_cf("msitest", FALSE
), "Directory not created\n");
3269 /* Delete the files in the temp (current) folder */
3270 DeleteFile(msifile
);
3271 DeleteFile("msitest\\maximus");
3272 RemoveDirectory("msitest");
3275 static void test_cabisextracted(void)
3279 if (is_process_limited())
3281 skip("process is limited\n");
3285 CreateDirectoryA("msitest", NULL
);
3286 create_file("msitest\\gaius", 500);
3287 create_file("maximus", 500);
3288 create_file("augustus", 500);
3289 create_file("caesar", 500);
3291 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3292 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3293 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3295 create_database(msifile
, cie_tables
, sizeof(cie_tables
) / sizeof(msi_table
));
3297 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3299 r
= MsiInstallProductA(msifile
, NULL
);
3300 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3302 skip("Not enough rights to perform tests\n");
3305 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3306 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3307 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3308 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3309 ok(delete_pf("msitest\\gaius", TRUE
), "File not installed\n");
3310 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3313 /* Delete the files in the temp (current) folder */
3315 DeleteFile(msifile
);
3316 DeleteFile("maximus");
3317 DeleteFile("augustus");
3318 DeleteFile("caesar");
3319 DeleteFile("msitest\\gaius");
3320 RemoveDirectory("msitest");
3323 static BOOL
file_exists(LPCSTR file
)
3325 return GetFileAttributes(file
) != INVALID_FILE_ATTRIBUTES
;
3328 static BOOL
pf_exists(LPCSTR file
)
3330 CHAR path
[MAX_PATH
];
3332 lstrcpyA(path
, PROG_FILES_DIR
);
3333 lstrcatA(path
, "\\");
3334 lstrcatA(path
, file
);
3336 return file_exists(path
);
3339 static void delete_pfmsitest_files(void)
3341 SHFILEOPSTRUCT shfl
;
3342 CHAR path
[MAX_PATH
+11];
3344 lstrcpyA(path
, PROG_FILES_DIR
);
3345 lstrcatA(path
, "\\msitest\\*");
3346 path
[strlen(path
) + 1] = '\0';
3349 shfl
.wFunc
= FO_DELETE
;
3352 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
3354 SHFileOperation(&shfl
);
3356 lstrcpyA(path
, PROG_FILES_DIR
);
3357 lstrcatA(path
, "\\msitest");
3358 RemoveDirectoryA(path
);
3361 static UINT
run_query(MSIHANDLE hdb
, MSIHANDLE hrec
, const char *query
)
3363 MSIHANDLE hview
= 0;
3366 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
3367 if(r
!= ERROR_SUCCESS
)
3370 r
= MsiViewExecute(hview
, hrec
);
3371 if(r
== ERROR_SUCCESS
)
3372 r
= MsiViewClose(hview
);
3373 MsiCloseHandle(hview
);
3377 static void set_transform_summary_info(void)
3380 MSIHANDLE suminfo
= 0;
3382 /* build summary info */
3383 r
= MsiGetSummaryInformation(0, mstfile
, 3, &suminfo
);
3384 ok(r
== ERROR_SUCCESS
, "Failed to open summaryinfo\n");
3386 r
= MsiSummaryInfoSetProperty(suminfo
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
3387 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3389 r
= MsiSummaryInfoSetProperty(suminfo
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
3390 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3391 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3392 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3393 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3395 r
= MsiSummaryInfoSetProperty(suminfo
, PID_PAGECOUNT
, VT_I4
, 100, NULL
, NULL
);
3396 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
3398 r
= MsiSummaryInfoPersist(suminfo
);
3399 ok(r
== ERROR_SUCCESS
, "Failed to make summary info persist\n");
3401 r
= MsiCloseHandle(suminfo
);
3402 ok(r
== ERROR_SUCCESS
, "Failed to close suminfo\n");
3405 static void generate_transform(void)
3407 MSIHANDLE hdb1
, hdb2
;
3411 /* start with two identical databases */
3412 CopyFile(msifile
, msifile2
, FALSE
);
3414 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_TRANSACT
, &hdb1
);
3415 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3417 r
= MsiDatabaseCommit(hdb1
);
3418 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
3420 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_READONLY
, &hdb2
);
3421 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
3423 query
= "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3424 r
= run_query(hdb1
, 0, query
);
3425 ok(r
== ERROR_SUCCESS
, "failed to add property\n");
3427 /* database needs to be committed */
3428 MsiDatabaseCommit(hdb1
);
3430 r
= MsiDatabaseGenerateTransform(hdb1
, hdb2
, mstfile
, 0, 0);
3431 ok(r
== ERROR_SUCCESS
, "return code %d, should be ERROR_SUCCESS\n", r
);
3433 r
= MsiCreateTransformSummaryInfo(hdb2
, hdb2
, mstfile
, 0, 0);
3434 todo_wine
ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3436 MsiCloseHandle(hdb1
);
3437 MsiCloseHandle(hdb2
);
3440 /* data for generating a transform */
3442 /* tables transform names - encoded as they would be in an msi database file */
3443 static const WCHAR name1
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
3444 static const WCHAR name2
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
3445 static const WCHAR name3
[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
3447 /* data in each table */
3448 static const char data1
[] = /* _StringData */
3449 "propval"; /* all the strings squashed together */
3451 static const WCHAR data2
[] = { /* _StringPool */
3453 0, 0, /* string 0 '' */
3454 4, 1, /* string 1 'prop' */
3455 3, 1, /* string 2 'val' */
3458 static const WCHAR data3
[] = { /* Property */
3459 0x0201, 0x0001, 0x0002,
3462 static const struct {
3466 } table_transform_data
[] =
3468 { name1
, data1
, sizeof data1
- 1 },
3469 { name2
, data2
, sizeof data2
},
3470 { name3
, data3
, sizeof data3
},
3473 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3475 static void generate_transform_manual(void)
3477 IStorage
*stg
= NULL
;
3482 const DWORD mode
= STGM_CREATE
|STGM_READWRITE
|STGM_DIRECT
|STGM_SHARE_EXCLUSIVE
;
3484 const CLSID CLSID_MsiTransform
= { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3486 MultiByteToWideChar(CP_ACP
, 0, mstfile
, -1, name
, 0x20);
3488 r
= StgCreateDocfile(name
, mode
, 0, &stg
);
3489 ok(r
== S_OK
, "failed to create storage\n");
3493 r
= IStorage_SetClass(stg
, &CLSID_MsiTransform
);
3494 ok(r
== S_OK
, "failed to set storage type\n");
3496 for (i
=0; i
<NUM_TRANSFORM_TABLES
; i
++)
3498 r
= IStorage_CreateStream(stg
, table_transform_data
[i
].name
,
3499 STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3502 ok(0, "failed to create stream %08x\n", r
);
3506 r
= IStream_Write(stm
, table_transform_data
[i
].data
,
3507 table_transform_data
[i
].size
, &count
);
3508 if (FAILED(r
) || count
!= table_transform_data
[i
].size
)
3509 ok(0, "failed to write stream\n");
3510 IStream_Release(stm
);
3513 IStorage_Release(stg
);
3515 set_transform_summary_info();
3518 static void test_transformprop(void)
3522 if (is_process_limited())
3524 skip("process is limited\n");
3528 CreateDirectoryA("msitest", NULL
);
3529 create_file("msitest\\augustus", 500);
3531 create_database(msifile
, tp_tables
, sizeof(tp_tables
) / sizeof(msi_table
));
3533 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3535 r
= MsiInstallProductA(msifile
, NULL
);
3536 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3538 skip("Not enough rights to perform tests\n");
3541 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3542 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3543 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3546 generate_transform();
3548 generate_transform_manual();
3550 r
= MsiInstallProductA(msifile
, "TRANSFORMS=winetest.mst");
3551 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3552 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3553 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3556 /* Delete the files in the temp (current) folder */
3557 DeleteFile(msifile
);
3558 DeleteFile(msifile2
);
3559 DeleteFile(mstfile
);
3560 DeleteFile("msitest\\augustus");
3561 RemoveDirectory("msitest");
3564 static void test_currentworkingdir(void)
3567 CHAR drive
[MAX_PATH
], path
[MAX_PATH
];
3570 if (is_process_limited())
3572 skip("process is limited\n");
3576 CreateDirectoryA("msitest", NULL
);
3577 create_file("msitest\\augustus", 500);
3579 create_database(msifile
, cwd_tables
, sizeof(cwd_tables
) / sizeof(msi_table
));
3581 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3583 CreateDirectoryA("diffdir", NULL
);
3584 SetCurrentDirectoryA("diffdir");
3586 sprintf(path
, "..\\%s", msifile
);
3587 r
= MsiInstallProductA(path
, NULL
);
3590 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
3591 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3592 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3595 sprintf(path
, "%s\\%s", CURR_DIR
, msifile
);
3596 r
= MsiInstallProductA(path
, NULL
);
3597 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3599 skip("Not enough rights to perform tests\n");
3602 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3603 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3604 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3606 lstrcpyA(drive
, CURR_DIR
);
3609 SetCurrentDirectoryA(drive
);
3611 lstrcpy(path
, CURR_DIR
);
3612 if (path
[lstrlenA(path
) - 1] != '\\')
3613 lstrcatA(path
, "\\");
3614 lstrcatA(path
, msifile
);
3615 ptr
= strchr(path
, ':');
3618 r
= MsiInstallProductA(ptr
, NULL
);
3619 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3620 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3621 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3624 SetCurrentDirectoryA(CURR_DIR
);
3625 DeleteFile(msifile
);
3626 DeleteFile("msitest\\augustus");
3627 RemoveDirectory("msitest");
3628 RemoveDirectory("diffdir");
3631 static void set_admin_summary_info(const CHAR
*name
)
3633 MSIHANDLE db
, summary
;
3636 r
= MsiOpenDatabaseA(name
, MSIDBOPEN_DIRECT
, &db
);
3637 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3639 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
3640 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3642 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, 5, NULL
, NULL
);
3643 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3645 /* write the summary changes back to the stream */
3646 r
= MsiSummaryInfoPersist(summary
);
3647 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3649 MsiCloseHandle(summary
);
3651 r
= MsiDatabaseCommit(db
);
3652 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3657 static void test_admin(void)
3661 CreateDirectoryA("msitest", NULL
);
3662 create_file("msitest\\augustus", 500);
3664 create_database(msifile
, adm_tables
, sizeof(adm_tables
) / sizeof(msi_table
));
3665 set_admin_summary_info(msifile
);
3667 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3669 r
= MsiInstallProductA(msifile
, NULL
);
3670 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3672 skip("Not enough rights to perform tests\n");
3675 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3676 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3677 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3678 ok(!DeleteFile("c:\\msitest\\augustus"), "File installed\n");
3679 ok(!RemoveDirectory("c:\\msitest"), "File installed\n");
3681 r
= MsiInstallProductA(msifile
, "ACTION=ADMIN");
3682 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3683 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3684 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3687 ok(DeleteFile("c:\\msitest\\augustus"), "File not installed\n");
3688 ok(RemoveDirectory("c:\\msitest"), "File not installed\n");
3692 DeleteFile(msifile
);
3693 DeleteFile("msitest\\augustus");
3694 RemoveDirectory("msitest");
3697 static void set_admin_property_stream(LPCSTR file
)
3701 WCHAR fileW
[MAX_PATH
];
3704 const DWORD mode
= STGM_DIRECT
| STGM_READWRITE
| STGM_SHARE_EXCLUSIVE
;
3706 /* AdminProperties */
3707 static const WCHAR stmname
[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
3708 static const WCHAR data
[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
3709 'M','y','P','r','o','p','=','4','2',0};
3711 MultiByteToWideChar(CP_ACP
, 0, file
, -1, fileW
, MAX_PATH
);
3713 hr
= StgOpenStorage(fileW
, NULL
, mode
, NULL
, 0, &stg
);
3714 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3718 hr
= IStorage_CreateStream(stg
, stmname
, STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
3719 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3721 hr
= IStream_Write(stm
, data
, sizeof(data
), &count
);
3722 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
3724 IStream_Release(stm
);
3725 IStorage_Release(stg
);
3728 static void test_adminprops(void)
3732 if (is_process_limited())
3734 skip("process is limited\n");
3738 CreateDirectoryA("msitest", NULL
);
3739 create_file("msitest\\augustus", 500);
3741 create_database(msifile
, amp_tables
, sizeof(amp_tables
) / sizeof(msi_table
));
3742 set_admin_summary_info(msifile
);
3743 set_admin_property_stream(msifile
);
3745 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3747 r
= MsiInstallProductA(msifile
, NULL
);
3748 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3750 skip("Not enough rights to perform tests\n");
3753 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3754 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3755 ok(delete_pf("msitest", FALSE
), "Directory created\n");
3758 DeleteFile(msifile
);
3759 DeleteFile("msitest\\augustus");
3760 RemoveDirectory("msitest");
3763 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
3765 CHAR path
[MAX_PATH
];
3767 lstrcpyA(path
, PROG_FILES_DIR
);
3768 lstrcatA(path
, "\\");
3769 lstrcatA(path
, file
);
3772 create_file_data(path
, data
, 500);
3774 CreateDirectoryA(path
, NULL
);
3777 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
3779 static void test_missingcab(void)
3783 if (is_process_limited())
3785 skip("process is limited\n");
3789 CreateDirectoryA("msitest", NULL
);
3790 create_file("msitest\\augustus", 500);
3791 create_file("maximus", 500);
3792 create_file("tiberius", 500);
3794 create_database(msifile
, mc_tables
, sizeof(mc_tables
) / sizeof(msi_table
));
3796 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3798 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3799 create_cab_file("test4.cab", MEDIA_SIZE
, "tiberius\0");
3801 create_pf("msitest", FALSE
);
3802 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3803 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3805 r
= MsiInstallProductA(msifile
, NULL
);
3806 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3808 skip("Not enough rights to perform tests\n");
3811 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3812 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3813 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3814 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3815 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3816 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
3817 ok(!delete_pf("msitest\\gaius", TRUE
), "File installed\n");
3818 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3820 create_pf("msitest", FALSE
);
3821 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
3822 create_pf_data("msitest\\tiberius", "abcdefgh", TRUE
);
3823 create_pf("msitest\\gaius", TRUE
);
3825 r
= MsiInstallProductA(msifile
, "GAIUS=1");
3826 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3829 ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
3830 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3832 ok(delete_pf("msitest\\caesar", TRUE
), "File removed\n");
3833 ok(compare_pf_data("msitest\\tiberius", "abcdefgh", sizeof("abcdefgh")), "Wrong file contents\n");
3834 ok(delete_pf("msitest\\tiberius", TRUE
), "File removed\n");
3835 ok(delete_pf("msitest\\gaius", TRUE
), "File removed\n");
3836 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3839 delete_pf("msitest", FALSE
);
3840 DeleteFile("msitest\\augustus");
3841 RemoveDirectory("msitest");
3842 DeleteFile("maximus");
3843 DeleteFile("tiberius");
3844 DeleteFile("test1.cab");
3845 DeleteFile("test4.cab");
3846 DeleteFile(msifile
);
3849 static void test_sourcefolder(void)
3853 if (is_process_limited())
3855 skip("process is limited\n");
3859 CreateDirectoryA("msitest", NULL
);
3860 create_file("augustus", 500);
3862 create_database(msifile
, sf_tables
, sizeof(sf_tables
) / sizeof(msi_table
));
3864 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3866 r
= MsiInstallProductA(msifile
, NULL
);
3867 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3869 skip("Not enough rights to perform tests\n");
3872 ok(r
== ERROR_INSTALL_FAILURE
,
3873 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3874 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3877 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3879 RemoveDirectoryA("msitest");
3881 r
= MsiInstallProductA(msifile
, NULL
);
3882 ok(r
== ERROR_INSTALL_FAILURE
,
3883 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
3884 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3887 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
3891 DeleteFile(msifile
);
3892 DeleteFile("augustus");
3895 static void test_customaction51(void)
3899 if (is_process_limited())
3901 skip("process is limited\n");
3905 CreateDirectoryA("msitest", NULL
);
3906 create_file("msitest\\augustus", 500);
3908 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
3910 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3912 r
= MsiInstallProductA(msifile
, NULL
);
3913 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3915 skip("Not enough rights to perform tests\n");
3918 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3919 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3920 ok(delete_pf("msitest", FALSE
), "Directory created\n");
3923 DeleteFile(msifile
);
3924 DeleteFile("msitest\\augustus");
3925 RemoveDirectory("msitest");
3928 static void test_installstate(void)
3932 if (is_process_limited())
3934 skip("process is limited\n");
3938 CreateDirectoryA("msitest", NULL
);
3939 create_file("msitest\\alpha", 500);
3940 create_file("msitest\\beta", 500);
3941 create_file("msitest\\gamma", 500);
3942 create_file("msitest\\theta", 500);
3943 create_file("msitest\\delta", 500);
3944 create_file("msitest\\epsilon", 500);
3945 create_file("msitest\\zeta", 500);
3946 create_file("msitest\\iota", 500);
3947 create_file("msitest\\eta", 500);
3948 create_file("msitest\\kappa", 500);
3949 create_file("msitest\\lambda", 500);
3950 create_file("msitest\\mu", 500);
3952 create_database(msifile
, is_tables
, sizeof(is_tables
) / sizeof(msi_table
));
3954 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3956 r
= MsiInstallProductA(msifile
, NULL
);
3957 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3959 skip("Not enough rights to perform tests\n");
3962 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3963 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
3964 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
3965 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
3966 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
3967 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
3968 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
3969 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
3970 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
3971 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
3972 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
3973 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
3974 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
3975 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3977 r
= MsiInstallProductA(msifile
, "ADDLOCAL=\"one,two,three,four\"");
3978 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3979 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
3980 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
3981 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
3982 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
3983 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
3984 ok(delete_pf("msitest\\epsilon", TRUE
), "File not installed\n");
3985 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
3986 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
3987 ok(delete_pf("msitest\\eta", TRUE
), "File not installed\n");
3988 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
3989 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
3990 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
3991 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3993 r
= MsiInstallProductA(msifile
, "ADDSOURCE=\"one,two,three,four\"");
3994 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3995 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
3996 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
3997 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
3998 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
3999 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4000 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4001 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
4002 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4003 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4004 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4005 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4006 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4007 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4009 r
= MsiInstallProductA(msifile
, "REMOVE=\"one,two,three,four\"");
4010 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4011 ok(!delete_pf("msitest\\alpha", TRUE
), "File installed\n");
4012 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
4013 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
4014 ok(!delete_pf("msitest\\theta", TRUE
), "File installed\n");
4015 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
4016 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
4017 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
4018 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
4019 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
4020 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
4021 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
4022 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
4023 ok(!delete_pf("msitest", FALSE
), "Directory created\n");
4026 DeleteFile(msifile
);
4027 DeleteFile("msitest\\alpha");
4028 DeleteFile("msitest\\beta");
4029 DeleteFile("msitest\\gamma");
4030 DeleteFile("msitest\\theta");
4031 DeleteFile("msitest\\delta");
4032 DeleteFile("msitest\\epsilon");
4033 DeleteFile("msitest\\zeta");
4034 DeleteFile("msitest\\iota");
4035 DeleteFile("msitest\\eta");
4036 DeleteFile("msitest\\kappa");
4037 DeleteFile("msitest\\lambda");
4038 DeleteFile("msitest\\mu");
4039 RemoveDirectory("msitest");
4042 static const struct sourcepathmap
4044 BOOL sost
; /* shortone\shorttwo */
4045 BOOL solt
; /* shortone\longtwo */
4046 BOOL lost
; /* longone\shorttwo */
4047 BOOL lolt
; /* longone\longtwo */
4048 BOOL soste
; /* shortone\shorttwo source exists */
4049 BOOL solte
; /* shortone\longtwo source exists */
4050 BOOL loste
; /* longone\shorttwo source exists */
4051 BOOL lolte
; /* longone\longtwo source exists */
4056 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4057 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4058 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4059 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4060 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4061 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4062 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4063 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4064 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4065 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4066 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4067 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4068 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4069 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4070 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4071 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4072 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4073 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4074 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4075 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4076 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4077 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4078 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4079 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4080 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4081 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4082 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4083 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4084 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4085 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4086 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4087 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4088 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4089 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4090 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4091 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4092 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4093 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4094 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4095 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4096 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4097 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4098 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4099 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4100 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4101 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4102 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4103 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4104 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4105 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4106 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4107 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4108 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4109 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4110 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4111 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4112 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4113 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4114 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4115 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4116 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4117 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4118 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4119 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4120 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4121 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4122 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4123 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4124 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4125 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4126 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4127 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4128 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4129 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4130 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4131 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4132 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4133 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4134 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4135 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4136 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4137 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4138 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4139 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4140 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4141 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4142 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4143 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4144 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4145 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4146 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4147 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4148 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4149 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4150 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4151 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4152 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4153 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4154 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4155 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4156 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4157 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4158 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4159 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4160 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4161 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4162 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4163 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4164 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4165 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4166 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4167 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4168 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4169 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4170 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4171 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4172 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4173 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4174 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4175 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4176 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4177 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4178 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4179 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4180 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4181 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4182 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4183 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4184 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4185 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4186 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4187 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4188 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4189 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4190 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4191 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4192 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4193 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4194 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4195 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4196 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4197 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4198 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4199 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4200 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4201 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4202 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4203 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4204 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4205 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4206 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4207 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4208 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4209 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4210 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4211 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4212 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4213 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4214 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4215 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4216 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4217 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4218 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4219 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4220 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4221 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4222 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4223 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4224 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4225 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4226 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4227 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4228 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4229 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4230 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4231 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4232 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4233 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4234 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4235 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4236 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4237 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4238 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4239 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4240 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4241 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4242 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4243 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4244 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4245 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4246 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4247 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4248 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4249 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4250 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4251 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4252 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4253 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4254 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4255 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4256 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4257 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4258 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4259 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4260 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4261 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4262 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4263 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4264 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4265 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4266 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4267 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4268 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4269 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4270 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4271 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4272 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4273 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4274 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4275 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4276 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4277 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4278 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4279 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4280 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4281 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4282 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4283 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4284 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4285 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4286 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4287 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4288 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4289 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4290 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4291 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4292 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
4293 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4294 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
4295 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4296 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4297 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4298 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4299 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4300 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4301 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4302 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4303 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4304 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4305 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4306 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4307 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4308 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4309 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4310 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
4311 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
4314 static DWORD
get_pf_file_size(LPCSTR file
)
4316 CHAR path
[MAX_PATH
];
4320 lstrcpyA(path
, PROG_FILES_DIR
);
4321 lstrcatA(path
, "\\");
4322 lstrcatA(path
, file
);
4324 hfile
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
4325 if (hfile
== INVALID_HANDLE_VALUE
)
4326 return INVALID_FILE_SIZE
;
4328 size
= GetFileSize(hfile
, NULL
);
4333 static void test_sourcepath(void)
4337 if (!winetest_interactive
)
4339 skip("Run in interactive mode to run source path tests.\n");
4343 create_database(msifile
, sp_tables
, sizeof(sp_tables
) / sizeof(msi_table
));
4345 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4347 for (i
= 0; i
< sizeof(spmap
) / sizeof(spmap
[0]); i
++)
4351 CreateDirectoryA("shortone", NULL
);
4352 CreateDirectoryA("shortone\\shorttwo", NULL
);
4357 CreateDirectoryA("shortone", NULL
);
4358 CreateDirectoryA("shortone\\longtwo", NULL
);
4363 CreateDirectoryA("longone", NULL
);
4364 CreateDirectoryA("longone\\shorttwo", NULL
);
4369 CreateDirectoryA("longone", NULL
);
4370 CreateDirectoryA("longone\\longtwo", NULL
);
4374 create_file("shortone\\shorttwo\\augustus", 50);
4376 create_file("shortone\\longtwo\\augustus", 100);
4378 create_file("longone\\shorttwo\\augustus", 150);
4380 create_file("longone\\longtwo\\augustus", 200);
4382 r
= MsiInstallProductA(msifile
, NULL
);
4383 ok(r
== spmap
[i
].err
, "%d: Expected %d, got %d\n", i
, spmap
[i
].err
, r
);
4384 ok(get_pf_file_size("msitest\\augustus") == spmap
[i
].size
,
4385 "%d: Expected %d, got %d\n", i
, spmap
[i
].size
,
4386 get_pf_file_size("msitest\\augustus"));
4388 if (r
== ERROR_SUCCESS
)
4390 ok(delete_pf("msitest\\augustus", TRUE
), "%d: File not installed\n", i
);
4391 ok(delete_pf("msitest", FALSE
), "%d: Directory not created\n", i
);
4395 ok(!delete_pf("msitest\\augustus", TRUE
), "%d: File installed\n", i
);
4396 todo_wine
ok(!delete_pf("msitest", FALSE
), "%d: Directory installed\n", i
);
4399 DeleteFileA("shortone\\shorttwo\\augustus");
4400 DeleteFileA("shortone\\longtwo\\augustus");
4401 DeleteFileA("longone\\shorttwo\\augustus");
4402 DeleteFileA("longone\\longtwo\\augustus");
4403 RemoveDirectoryA("shortone\\shorttwo");
4404 RemoveDirectoryA("shortone\\longtwo");
4405 RemoveDirectoryA("longone\\shorttwo");
4406 RemoveDirectoryA("longone\\longtwo");
4407 RemoveDirectoryA("shortone");
4408 RemoveDirectoryA("longone");
4411 DeleteFileA(msifile
);
4414 static void test_missingcomponent(void)
4418 if (is_process_limited())
4420 skip("process is limited\n");
4424 CreateDirectoryA("msitest", NULL
);
4425 create_file("msitest\\hydrogen", 500);
4426 create_file("msitest\\helium", 500);
4427 create_file("msitest\\lithium", 500);
4428 create_file("beryllium", 500);
4430 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
4432 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4434 r
= MsiInstallProductA(msifile
, "INSTALLLEVEL=10 PROPVAR=42");
4435 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4437 skip("Not enough rights to perform tests\n");
4440 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4441 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4442 ok(pf_exists("msitest\\helium"), "File not installed\n");
4443 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4444 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4445 ok(pf_exists("msitest"), "File not installed\n");
4447 r
= MsiInstallProductA(msifile
, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
4448 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4449 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
4450 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
4451 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
4452 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
4453 ok(!delete_pf("msitest", FALSE
), "Directory not removed\n");
4456 DeleteFileA(msifile
);
4457 DeleteFileA("msitest\\hydrogen");
4458 DeleteFileA("msitest\\helium");
4459 DeleteFileA("msitest\\lithium");
4460 DeleteFileA("beryllium");
4461 RemoveDirectoryA("msitest");
4464 static void test_sourcedirprop(void)
4467 CHAR props
[MAX_PATH
];
4469 if (is_process_limited())
4471 skip("process is limited\n");
4475 CreateDirectoryA("msitest", NULL
);
4476 create_file("msitest\\augustus", 500);
4478 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
4480 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4482 r
= MsiInstallProductA(msifile
, NULL
);
4483 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4485 skip("Not enough rights to perform tests\n");
4488 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4489 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4490 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4492 DeleteFile("msitest\\augustus");
4493 RemoveDirectory("msitest");
4495 CreateDirectoryA("altsource", NULL
);
4496 CreateDirectoryA("altsource\\msitest", NULL
);
4497 create_file("altsource\\msitest\\augustus", 500);
4499 sprintf(props
, "SRCDIR=%s\\altsource\\", CURR_DIR
);
4501 r
= MsiInstallProductA(msifile
, props
);
4502 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4503 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4504 ok(delete_pf("msitest", FALSE
), "Directory created\n");
4506 DeleteFile("altsource\\msitest\\augustus");
4507 RemoveDirectory("altsource\\msitest");
4508 RemoveDirectory("altsource");
4511 DeleteFile("msitest\\augustus");
4512 RemoveDirectory("msitest");
4513 DeleteFile(msifile
);
4516 static void test_adminimage(void)
4520 if (is_process_limited())
4522 skip("process is limited\n");
4526 CreateDirectoryA("msitest", NULL
);
4527 CreateDirectoryA("msitest\\first", NULL
);
4528 CreateDirectoryA("msitest\\second", NULL
);
4529 CreateDirectoryA("msitest\\cabout", NULL
);
4530 CreateDirectoryA("msitest\\cabout\\new", NULL
);
4531 create_file("msitest\\one.txt", 100);
4532 create_file("msitest\\first\\two.txt", 100);
4533 create_file("msitest\\second\\three.txt", 100);
4534 create_file("msitest\\cabout\\four.txt", 100);
4535 create_file("msitest\\cabout\\new\\five.txt", 100);
4536 create_file("msitest\\filename", 100);
4537 create_file("msitest\\service.exe", 100);
4539 create_database_wordcount(msifile
, ai_tables
,
4540 sizeof(ai_tables
) / sizeof(msi_table
),
4541 100, msidbSumInfoSourceTypeAdminImage
, ";1033");
4543 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4545 r
= MsiInstallProductA(msifile
, NULL
);
4546 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4548 skip("Not enough rights to perform tests\n");
4551 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4553 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4554 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4555 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4556 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4557 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4558 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4559 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4560 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4561 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4562 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4563 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4564 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4567 DeleteFileA("msifile");
4568 DeleteFileA("msitest\\cabout\\new\\five.txt");
4569 DeleteFileA("msitest\\cabout\\four.txt");
4570 DeleteFileA("msitest\\second\\three.txt");
4571 DeleteFileA("msitest\\first\\two.txt");
4572 DeleteFileA("msitest\\one.txt");
4573 DeleteFileA("msitest\\service.exe");
4574 DeleteFileA("msitest\\filename");
4575 RemoveDirectoryA("msitest\\cabout\\new");
4576 RemoveDirectoryA("msitest\\cabout");
4577 RemoveDirectoryA("msitest\\second");
4578 RemoveDirectoryA("msitest\\first");
4579 RemoveDirectoryA("msitest");
4582 static void test_propcase(void)
4586 if (is_process_limited())
4588 skip("process is limited\n");
4592 CreateDirectoryA("msitest", NULL
);
4593 create_file("msitest\\augustus", 500);
4595 create_database(msifile
, pc_tables
, sizeof(pc_tables
) / sizeof(msi_table
));
4597 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4599 r
= MsiInstallProductA(msifile
, "MyProp=42");
4600 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4602 skip("Not enough rights to perform tests\n");
4605 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4606 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4607 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4610 DeleteFile(msifile
);
4611 DeleteFile("msitest\\augustus");
4612 RemoveDirectory("msitest");
4615 static void test_int_widths( void )
4617 static const char int0
[] = "int0\ni0\nint0\tint0\n1";
4618 static const char int1
[] = "int1\ni1\nint1\tint1\n1";
4619 static const char int2
[] = "int2\ni2\nint2\tint2\n1";
4620 static const char int3
[] = "int3\ni3\nint3\tint3\n1";
4621 static const char int4
[] = "int4\ni4\nint4\tint4\n1";
4622 static const char int5
[] = "int5\ni5\nint5\tint5\n1";
4623 static const char int8
[] = "int8\ni8\nint8\tint8\n1";
4633 { int0
, sizeof(int0
) - 1, ERROR_SUCCESS
},
4634 { int1
, sizeof(int1
) - 1, ERROR_SUCCESS
},
4635 { int2
, sizeof(int2
) - 1, ERROR_SUCCESS
},
4636 { int3
, sizeof(int3
) - 1, ERROR_FUNCTION_FAILED
},
4637 { int4
, sizeof(int4
) - 1, ERROR_SUCCESS
},
4638 { int5
, sizeof(int5
) - 1, ERROR_FUNCTION_FAILED
},
4639 { int8
, sizeof(int8
) - 1, ERROR_FUNCTION_FAILED
}
4642 char tmpdir
[MAX_PATH
], msitable
[MAX_PATH
], msidb
[MAX_PATH
];
4646 GetTempPathA(MAX_PATH
, tmpdir
);
4647 CreateDirectoryA(tmpdir
, NULL
);
4649 strcpy(msitable
, tmpdir
);
4650 strcat(msitable
, "\\msitable.idt");
4652 strcpy(msidb
, tmpdir
);
4653 strcat(msidb
, "\\msitest.msi");
4655 r
= MsiOpenDatabaseA(msidb
, MSIDBOPEN_CREATE
, &db
);
4656 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4658 for (i
= 0; i
< sizeof(tests
)/sizeof(tests
[0]); i
++)
4660 write_file(msitable
, tests
[i
].data
, tests
[i
].size
);
4662 r
= MsiDatabaseImportA(db
, tmpdir
, "msitable.idt");
4663 ok(r
== tests
[i
].ret
, " %u expected %u, got %u\n", i
, tests
[i
].ret
, r
);
4665 r
= MsiDatabaseCommit(db
);
4666 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4667 DeleteFileA(msitable
);
4672 RemoveDirectoryA(tmpdir
);
4675 static void test_shortcut(void)
4680 if (is_process_limited())
4682 skip("process is limited\n");
4686 create_test_files();
4687 create_database(msifile
, sc_tables
, sizeof(sc_tables
) / sizeof(msi_table
));
4689 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4691 r
= MsiInstallProductA(msifile
, NULL
);
4692 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4694 skip("Not enough rights to perform tests\n");
4697 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4699 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
4700 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4702 r
= MsiInstallProductA(msifile
, NULL
);
4703 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4707 hr
= CoInitializeEx(NULL
, COINIT_APARTMENTTHREADED
);
4708 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
4710 r
= MsiInstallProductA(msifile
, NULL
);
4711 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4715 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4716 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4717 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4718 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4719 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4720 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4721 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4722 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4723 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4724 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4725 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4726 while (!delete_pf("msitest\\Shortcut.lnk", TRUE
) && GetLastError() == ERROR_SHARING_VIOLATION
) Sleep(1000);
4727 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4730 delete_test_files();
4731 DeleteFile(msifile
);
4734 static void test_preselected(void)
4738 if (is_process_limited())
4740 skip("process is limited\n");
4744 create_test_files();
4745 create_database(msifile
, ps_tables
, sizeof(ps_tables
) / sizeof(msi_table
));
4747 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4749 r
= MsiInstallProductA(msifile
, "ADDLOCAL=One");
4750 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4752 skip("Not enough rights to perform tests\n");
4755 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4757 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File installed\n");
4758 ok(!delete_pf("msitest\\cabout\\new", FALSE
), "Directory created\n");
4759 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE
), "File installed\n");
4760 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory created\n");
4761 ok(!delete_pf("msitest\\changed\\three.txt", TRUE
), "File installed\n");
4762 ok(!delete_pf("msitest\\changed", FALSE
), "Directory created\n");
4763 ok(!delete_pf("msitest\\first\\two.txt", TRUE
), "File installed\n");
4764 ok(!delete_pf("msitest\\first", FALSE
), "Directory created\n");
4765 ok(!delete_pf("msitest\\filename", TRUE
), "File installed\n");
4766 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
4767 ok(!delete_pf("msitest\\service.exe", TRUE
), "File installed\n");
4768 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4770 r
= MsiInstallProductA(msifile
, NULL
);
4771 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4773 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4774 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4775 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4776 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4777 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4778 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4779 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4780 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4781 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4782 ok(!delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4783 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4784 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4787 delete_test_files();
4788 DeleteFile(msifile
);
4791 static void test_installed_prop(void)
4793 static char prodcode
[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
4796 if (is_process_limited())
4798 skip("process is limited\n");
4802 create_test_files();
4803 create_database(msifile
, ip_tables
, sizeof(ip_tables
) / sizeof(msi_table
));
4805 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4807 r
= MsiInstallProductA(msifile
, "FULL=1");
4808 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4810 skip("Not enough rights to perform tests\n");
4813 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4815 r
= MsiInstallProductA(msifile
, "FULL=1");
4816 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4818 r
= MsiConfigureProductExA(prodcode
, INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
, "FULL=1");
4819 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4821 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4822 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4823 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4824 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4825 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4826 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4827 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4828 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4829 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4830 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4831 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4832 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4834 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4835 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4838 delete_test_files();
4839 DeleteFile(msifile
);
4842 static void test_allusers_prop(void)
4846 if (is_process_limited())
4848 skip("process is limited\n");
4852 create_test_files();
4853 create_database(msifile
, aup_tables
, sizeof(aup_tables
) / sizeof(msi_table
));
4855 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4857 /* ALLUSERS property unset */
4858 r
= MsiInstallProductA(msifile
, "FULL=1");
4859 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4861 skip("Not enough rights to perform tests\n");
4864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4866 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4867 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4868 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4869 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4870 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4871 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4872 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4873 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4874 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4875 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4876 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4877 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4879 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4880 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4882 delete_test_files();
4884 create_test_files();
4885 create_database(msifile
, aup2_tables
, sizeof(aup2_tables
) / sizeof(msi_table
));
4887 /* ALLUSERS property set to 1 */
4888 r
= MsiInstallProductA(msifile
, "FULL=1");
4889 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4891 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4892 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4893 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4894 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4895 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4896 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4897 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4898 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4899 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4900 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4901 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4902 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4904 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4905 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4907 delete_test_files();
4909 create_test_files();
4910 create_database(msifile
, aup3_tables
, sizeof(aup3_tables
) / sizeof(msi_table
));
4912 /* ALLUSERS property set to 2 */
4913 r
= MsiInstallProductA(msifile
, "FULL=1");
4914 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4916 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
4917 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
4918 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
4919 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
4920 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
4921 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
4922 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
4923 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
4924 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
4925 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
4926 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
4927 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4929 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4930 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4932 delete_test_files();
4934 create_test_files();
4935 create_database(msifile
, aup4_tables
, sizeof(aup4_tables
) / sizeof(msi_table
));
4937 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
4938 r
= MsiInstallProductA(msifile
, "FULL=1");
4939 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
4942 delete_test_files();
4943 DeleteFile(msifile
);
4946 static char session_manager
[] = "System\\CurrentControlSet\\Control\\Session Manager";
4947 static char rename_ops
[] = "PendingFileRenameOperations";
4949 static void process_pending_renames(HKEY hkey
)
4951 char *buf
, *src
, *dst
, *buf2
, *buf2ptr
;
4956 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
);
4957 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
4959 buf
= HeapAlloc(GetProcessHeap(), 0, size
+ 1);
4960 buf2ptr
= buf2
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, size
+ 1);
4962 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, (LPBYTE
)buf
, &size
);
4964 ok(!ret
, "RegQueryValueExA failed %d\n", ret
);
4967 for (src
= buf
; *src
; src
= dst
+ strlen(dst
) + 1)
4969 DWORD flags
= MOVEFILE_COPY_ALLOWED
;
4972 dst
= src
+ strlen(src
) + 1;
4974 if (!strstr(src
, "msitest"))
4976 lstrcpyA(buf2ptr
, src
);
4977 buf2ptr
+= strlen(src
) + 1;
4978 lstrcpyA(buf2ptr
, dst
);
4979 buf2ptr
+= strlen(dst
) + 1;
4987 flags
|= MOVEFILE_REPLACE_EXISTING
;
4990 if (src
[0] == '\\' && src
[1] == '?' && src
[2] == '?' && src
[3] == '\\') src
+= 4;
4993 if (dst
[0] == '\\' && dst
[1] == '?' && dst
[2] == '?' && dst
[3] == '\\') dst
+= 4;
4994 fileret
= MoveFileExA(src
, dst
, flags
);
4995 ok(fileret
, "Failed to move file %s -> %s (%u)\n", src
, dst
, GetLastError());
4999 fileret
= DeleteFileA(src
);
5000 ok(fileret
, "Failed to delete file %s (%u)\n", src
, GetLastError());
5004 ok(found
, "Expected a 'msitest' entry\n");
5007 RegSetValueExA(hkey
, rename_ops
, 0, REG_MULTI_SZ
, (LPBYTE
)buf2
, buf2ptr
+ 1 - buf2
);
5009 RegDeleteValueA(hkey
, rename_ops
);
5011 HeapFree(GetProcessHeap(), 0, buf
);
5012 HeapFree(GetProcessHeap(), 0, buf2
);
5015 static BOOL
file_matches_data(LPCSTR file
, LPCSTR data
)
5017 DWORD len
, data_len
= strlen(data
);
5021 handle
= CreateFile(file
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
5022 ok(handle
!= INVALID_HANDLE_VALUE
, "failed to open %s (%u)\n", file
, GetLastError());
5024 if (ReadFile(handle
, buf
, sizeof(buf
), &len
, NULL
) && len
>= data_len
)
5026 CloseHandle(handle
);
5027 return !memcmp(buf
, data
, data_len
);
5029 CloseHandle(handle
);
5033 static void test_file_in_use(void)
5038 char path
[MAX_PATH
];
5040 if (is_process_limited())
5042 skip("process is limited\n");
5046 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5048 CreateDirectoryA("msitest", NULL
);
5049 create_file("msitest\\maximus", 500);
5050 create_database(msifile
, fiu_tables
, sizeof(fiu_tables
) / sizeof(msi_table
));
5052 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5054 lstrcpy(path
, PROG_FILES_DIR
);
5055 lstrcat(path
, "\\msitest");
5056 CreateDirectoryA(path
, NULL
);
5058 lstrcat(path
, "\\maximus");
5059 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5061 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5062 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5064 skip("Not enough rights to perform tests\n");
5067 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5068 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5070 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
5072 process_pending_renames(hkey
);
5075 ok(file_matches_data(path
, "msitest\\maximus"), "Expected file to match\n");
5076 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5077 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5079 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5080 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5085 delete_pf("msitest\\maximus", TRUE
);
5086 delete_pf("msitest", FALSE
);
5087 DeleteFileA("msitest\\maximus");
5088 delete_test_files();
5089 DeleteFile(msifile
);
5092 static void test_file_in_use_cab(void)
5097 char path
[MAX_PATH
];
5099 if (is_process_limited())
5101 skip("process is limited\n");
5105 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
5107 CreateDirectoryA("msitest", NULL
);
5108 create_file("maximus", 500);
5109 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
5110 DeleteFile("maximus");
5112 create_database(msifile
, fiuc_tables
, sizeof(fiuc_tables
) / sizeof(msi_table
));
5114 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5116 lstrcpy(path
, PROG_FILES_DIR
);
5117 lstrcat(path
, "\\msitest");
5118 CreateDirectoryA(path
, NULL
);
5120 lstrcat(path
, "\\maximus");
5121 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
5123 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
5124 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5126 skip("Not enough rights to perform tests\n");
5129 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
5130 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5132 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
5134 process_pending_renames(hkey
);
5137 ok(file_matches_data(path
, "maximus"), "Expected file to match\n");
5138 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
5139 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
5141 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5142 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5147 delete_pf("msitest\\maximus", TRUE
);
5148 delete_pf("msitest", FALSE
);
5149 DeleteFileA("msitest\\maximus");
5151 delete_test_files();
5152 DeleteFile(msifile
);
5155 static void test_feature_override(void)
5158 REGSAM access
= KEY_ALL_ACCESS
;
5160 if (is_process_limited())
5162 skip("process is limited\n");
5166 create_test_files();
5167 create_file("msitest\\override.txt", 1000);
5168 create_file("msitest\\preselected.txt", 1000);
5169 create_file("msitest\\notpreselected.txt", 1000);
5170 create_database(msifile
, fo_tables
, sizeof(fo_tables
) / sizeof(msi_table
));
5173 access
|= KEY_WOW64_64KEY
;
5175 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5177 r
= MsiInstallProductA(msifile
, "ADDLOCAL=override");
5178 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5180 skip("Not enough rights to perform tests\n");
5183 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5185 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5186 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
5187 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5189 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5190 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5192 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5194 r
= MsiInstallProductA(msifile
, "preselect=1");
5195 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5197 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5198 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5199 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5201 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5202 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5204 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5206 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5207 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5210 r
= MsiInstallProductA(msifile
, NULL
);
5211 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5213 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5214 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5215 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5217 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5218 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5220 ok(!delete_pf("msitest\\override.txt", TRUE
), "file not removed\n");
5222 ok(delete_pf("msitest\\preselected.txt", TRUE
), "file removed\n");
5223 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5226 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", access
);
5229 DeleteFileA("msitest\\override.txt");
5230 DeleteFileA("msitest\\preselected.txt");
5231 DeleteFileA("msitest\\notpreselected.txt");
5232 delete_test_files();
5233 DeleteFile(msifile
);
5236 static void test_icon_table(void)
5238 MSIHANDLE hdb
= 0, record
;
5241 CHAR path
[MAX_PATH
];
5242 static const char prodcode
[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
5244 if (is_process_limited())
5246 skip("process is limited\n");
5250 create_database(msifile
, icon_base_tables
, sizeof(icon_base_tables
) / sizeof(msi_table
));
5252 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5254 res
= MsiOpenDatabase(msifile
, MSIDBOPEN_TRANSACT
, &hdb
);
5255 ok(res
== ERROR_SUCCESS
, "failed to open db: %d\n", res
);
5257 query
= "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
5258 res
= run_query( hdb
, 0, query
);
5259 ok(res
== ERROR_SUCCESS
, "Can't create Icon table: %d\n", res
);
5261 create_file("icon.ico", 100);
5262 record
= MsiCreateRecord(1);
5263 res
= MsiRecordSetStream(record
, 1, "icon.ico");
5264 ok(res
== ERROR_SUCCESS
, "Failed to add stream data to record: %d\n", res
);
5266 query
= "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
5267 res
= run_query(hdb
, record
, query
);
5268 ok(res
== ERROR_SUCCESS
, "Insert into Icon table failed: %d\n", res
);
5270 res
= MsiCloseHandle(record
);
5271 ok(res
== ERROR_SUCCESS
, "Failed to close record handle: %d\n", res
);
5272 DeleteFileA("icon.ico");
5273 res
= MsiDatabaseCommit(hdb
);
5274 ok(res
== ERROR_SUCCESS
, "Failed to commit database: %d\n", res
);
5275 res
= MsiCloseHandle(hdb
);
5276 ok(res
== ERROR_SUCCESS
, "Failed to close database: %d\n", res
);
5279 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
5280 if (res
== ERROR_INSTALL_PACKAGE_REJECTED
)
5282 skip("Not enough rights to perform tests\n");
5283 DeleteFile(msifile
);
5286 ok(res
== ERROR_SUCCESS
, "Failed to do per-user install: %d\n", res
);
5288 lstrcpyA(path
, APP_DATA_DIR
);
5289 lstrcatA(path
, "\\");
5290 lstrcatA(path
, "Microsoft\\Installer\\");
5291 lstrcatA(path
, prodcode
);
5292 lstrcatA(path
, "\\testicon");
5293 ok(file_exists(path
), "Per-user icon file isn't where it's expected (%s)\n", path
);
5295 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5296 ok(res
== ERROR_SUCCESS
, "Failed to uninstall per-user\n");
5297 ok(!file_exists(path
), "Per-user icon file not removed (%s)\n", path
);
5300 res
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5301 ok(res
== ERROR_SUCCESS
, "Failed to system-wide install: %d\n", res
);
5303 lstrcpyA(path
, WINDOWS_DIR
);
5304 lstrcatA(path
, "\\");
5305 lstrcatA(path
, "Installer\\");
5306 lstrcatA(path
, prodcode
);
5307 lstrcatA(path
, "\\testicon");
5308 ok(file_exists(path
), "System-wide icon file isn't where it's expected (%s)\n", path
);
5310 res
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5311 ok(res
== ERROR_SUCCESS
, "Failed to uninstall system-wide\n");
5312 ok(!file_exists(path
), "System-wide icon file not removed (%s)\n", path
);
5314 delete_pfmsitest_files();
5315 DeleteFile(msifile
);
5318 static void test_package_validation(void)
5322 if (is_process_limited())
5324 skip("process is limited\n");
5328 CreateDirectoryA("msitest", NULL
);
5329 create_file("msitest\\maximus", 500);
5330 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1033");
5332 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5334 r
= MsiInstallProductA(msifile
, NULL
);
5335 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5337 skip("Not enough rights to perform tests\n");
5340 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5341 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5342 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5344 DeleteFile(msifile
);
5345 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;9999");
5347 r
= MsiInstallProductA(msifile
, NULL
);
5348 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5350 DeleteFile(msifile
);
5351 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,1033;9999");
5353 r
= MsiInstallProductA(msifile
, NULL
);
5354 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5356 DeleteFile(msifile
);
5357 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel,9999;1033");
5359 r
= MsiInstallProductA(msifile
, NULL
);
5360 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5361 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5362 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5364 DeleteFile(msifile
);
5365 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel64,9999;1033");
5367 r
= MsiInstallProductA(msifile
, NULL
);
5368 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5370 DeleteFile(msifile
);
5371 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,1033;1033");
5373 r
= MsiInstallProductA(msifile
, NULL
);
5374 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5376 DeleteFile(msifile
);
5377 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "Intel32,9999;1033");
5379 r
= MsiInstallProductA(msifile
, NULL
);
5380 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5382 DeleteFile(msifile
);
5383 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9999");
5385 r
= MsiInstallProductA(msifile
, NULL
);
5386 ok(r
== ERROR_INSTALL_LANGUAGE_UNSUPPORTED
, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r
);
5387 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5388 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5390 if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH
, SUBLANG_ENGLISH_US
))
5392 DeleteFile(msifile
);
5393 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;9");
5394 r
= MsiInstallProductA(msifile
, NULL
);
5395 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5396 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5397 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5399 DeleteFile(msifile
);
5400 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;1024");
5401 r
= MsiInstallProductA(msifile
, NULL
);
5402 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5403 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5404 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5407 DeleteFile(msifile
);
5408 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel32;0");
5410 r
= MsiInstallProductA(msifile
, NULL
);
5411 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5412 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5413 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5415 if (is_64bit
&& !is_wow64
)
5417 DeleteFile(msifile
);
5418 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5420 r
= MsiInstallProductA(msifile
, NULL
);
5421 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5422 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5423 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5425 DeleteFile(msifile
);
5426 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5428 r
= MsiInstallProductA(msifile
, NULL
);
5429 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5430 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5431 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5433 DeleteFile(msifile
);
5434 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5436 r
= MsiInstallProductA(msifile
, NULL
);
5437 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5438 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5439 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5443 DeleteFile(msifile
);
5444 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5446 r
= MsiInstallProductA(msifile
, NULL
);
5447 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5448 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5449 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5451 DeleteFile(msifile
);
5452 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5454 r
= MsiInstallProductA(msifile
, NULL
);
5455 ok(r
== ERROR_INSTALL_PACKAGE_INVALID
, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r
);
5456 ok(!delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5457 ok(!delete_pf_native("msitest", FALSE
), "directory exists\n");
5459 DeleteFile(msifile
);
5460 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5462 r
= MsiInstallProductA(msifile
, NULL
);
5463 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5464 ok(delete_pf_native("msitest\\maximus", TRUE
), "file exists\n");
5465 ok(delete_pf_native("msitest", FALSE
), "directory exists\n");
5469 DeleteFile(msifile
);
5470 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Intel;0");
5472 r
= MsiInstallProductA(msifile
, NULL
);
5473 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5474 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5475 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5477 DeleteFile(msifile
);
5478 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "Alpha,Beta,Intel;0");
5480 r
= MsiInstallProductA(msifile
, NULL
);
5481 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5482 ok(delete_pf("msitest\\maximus", TRUE
), "file does not exist\n");
5483 ok(delete_pf("msitest", FALSE
), "directory does not exist\n");
5485 DeleteFile(msifile
);
5486 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 100, "x64;0");
5488 r
= MsiInstallProductA(msifile
, NULL
);
5489 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5490 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5491 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5493 DeleteFile(msifile
);
5494 create_database_template(msifile
, pv_tables
, sizeof(pv_tables
)/sizeof(msi_table
), 200, "x64;0");
5496 r
= MsiInstallProductA(msifile
, NULL
);
5497 ok(r
== ERROR_INSTALL_PLATFORM_UNSUPPORTED
, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r
);
5498 ok(!delete_pf("msitest\\maximus", TRUE
), "file exists\n");
5499 ok(!delete_pf("msitest", FALSE
), "directory exists\n");
5503 /* Delete the files in the temp (current) folder */
5504 DeleteFile(msifile
);
5505 DeleteFile("msitest\\maximus");
5506 RemoveDirectory("msitest");
5509 static void test_upgrade_code(void)
5513 if (is_process_limited())
5515 skip("process is limited\n");
5519 CreateDirectoryA("msitest", NULL
);
5520 create_file("msitest\\upgradecode.txt", 1000);
5521 create_database(msifile
, uc_tables
, sizeof(uc_tables
) / sizeof(msi_table
));
5523 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5525 r
= MsiInstallProductA(msifile
, NULL
);
5526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5528 ok(pf_exists("msitest\\upgradecode.txt"), "file not installed\n");
5530 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5531 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5533 ok(!delete_pf("msitest\\upgradecode.txt", TRUE
), "file not removed\n");
5534 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5536 DeleteFileA("msitest\\upgradecode.txt");
5537 RemoveDirectoryA("msitest");
5538 DeleteFile(msifile
);
5541 static void test_mixed_package(void)
5547 if (is_process_limited())
5549 skip("process is limited\n");
5552 if (!is_wow64
&& !is_64bit
)
5554 skip("this test must be run on 64-bit\n");
5557 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5558 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "x64;1033");
5560 r
= MsiInstallProductA(msifile
, NULL
);
5561 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5563 skip("Not enough rights to perform tests\n");
5566 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5568 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5569 ok(!res
, "can't open 32-bit component key\n");
5570 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5571 ok(!res
, "value test1 not found\n");
5574 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5575 ok(!res
, "can't open 64-bit component key\n");
5576 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5577 ok(!res
, "value test2 not found\n");
5580 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5581 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5583 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5584 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5586 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5587 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5589 DeleteFileA( msifile
);
5590 create_database_template(msifile
, mixed_tables
, sizeof(mixed_tables
)/sizeof(msi_table
), 200, "Intel;1033");
5592 r
= MsiInstallProductA(msifile
, NULL
);
5593 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5595 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5596 ok(!res
, "can't open 32-bit component key\n");
5597 res
= RegQueryValueExA(hkey
, "test1", NULL
, NULL
, NULL
, NULL
);
5598 ok(!res
, "value test1 not found\n");
5601 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5602 ok(!res
, "can't open 64-bit component key\n");
5603 res
= RegQueryValueExA(hkey
, "test2", NULL
, NULL
, NULL
, NULL
);
5604 ok(!res
, "value test2 not found\n");
5607 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5608 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5610 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_32KEY
, &hkey
);
5611 ok(res
== ERROR_FILE_NOT_FOUND
|| broken(!res
), "32-bit component key not removed\n");
5613 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS
|KEY_WOW64_64KEY
, &hkey
);
5614 ok(res
== ERROR_FILE_NOT_FOUND
, "64-bit component key not removed\n");
5617 DeleteFileA( msifile
);
5620 static void test_volume_props(void)
5624 if (is_process_limited())
5626 skip("process is limited\n");
5629 CreateDirectoryA("msitest", NULL
);
5630 create_file("msitest\\volumeprop.txt", 1000);
5631 create_database(msifile
, vp_tables
, sizeof(vp_tables
)/sizeof(msi_table
));
5633 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5635 r
= MsiInstallProductA(msifile
, NULL
);
5636 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5638 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5639 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5641 DeleteFileA("msitest\\volumeprop.txt");
5642 RemoveDirectoryA("msitest");
5643 DeleteFile(msifile
);
5649 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
5650 STATEMGRSTATUS status
;
5653 init_functionpointers();
5655 if (pIsWow64Process
)
5656 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
5658 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
5659 GetTempPath(MAX_PATH
, temp_path
);
5660 SetCurrentDirectoryA(temp_path
);
5662 lstrcpyA(CURR_DIR
, temp_path
);
5663 len
= lstrlenA(CURR_DIR
);
5665 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
5666 CURR_DIR
[len
- 1] = 0;
5668 ok(get_system_dirs(), "failed to retrieve system dirs\n");
5669 ok(get_user_dirs(), "failed to retrieve user dirs\n");
5671 /* Create a restore point ourselves so we circumvent the multitude of restore points
5672 * that would have been created by all the installation and removal tests.
5674 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
5675 * creation of restore points.
5677 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
5679 memset(&status
, 0, sizeof(status
));
5680 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
5683 /* Create only one log file and don't append. We have to pass something
5684 * for the log mode for this to work. The logfile needs to have an absolute
5685 * path otherwise we still end up with some extra logfiles as some tests
5686 * change the current directory.
5688 lstrcpyA(log_file
, temp_path
);
5689 lstrcatA(log_file
, "\\msitest.log");
5690 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
5692 test_MsiInstallProduct();
5693 test_MsiSetComponentState();
5694 test_packagecoltypes();
5695 test_continuouscabs();
5698 test_samesequence();
5699 test_uiLevelFlags();
5700 test_readonlyfile();
5701 test_readonlyfile_cab();
5702 test_setdirproperty();
5703 test_cabisextracted();
5704 test_transformprop();
5705 test_currentworkingdir();
5709 test_sourcefolder();
5710 test_customaction51();
5711 test_installstate();
5713 test_missingcomponent();
5714 test_sourcedirprop();
5720 test_installed_prop();
5722 test_file_in_use_cab();
5723 test_allusers_prop();
5724 test_feature_override();
5726 test_package_validation();
5727 test_upgrade_code();
5728 test_mixed_package();
5729 test_volume_props();
5731 DeleteFileA(log_file
);
5733 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
5735 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
5737 remove_restore_point(status
.llSequenceNumber
);
5739 FreeLibrary(hsrclient
);
5741 SetCurrentDirectoryA(prev_path
);