2 * Copyright (C) 2006 James Hawkins
4 * A test program for installing MSI products.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define _WIN32_MSI 300
32 #include <srrestoreptapi.h>
35 #include "wine/test.h"
37 static UINT (WINAPI
*pMsiQueryComponentStateA
)
38 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
39 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
40 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
41 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
42 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
44 static BOOL (WINAPI
*pCheckTokenMembership
)(HANDLE
,PSID
,PBOOL
);
45 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
46 static BOOL (WINAPI
*pOpenProcessToken
)( HANDLE
, DWORD
, PHANDLE
);
47 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
48 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
50 static HMODULE hsrclient
= 0;
51 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
52 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
55 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
57 static const char *msifile
= "msitest.msi";
58 static const char *msifile2
= "winetest2.msi";
59 static const char *mstfile
= "winetest.mst";
61 static const WCHAR msifileW
[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
62 static const WCHAR msifile2W
[] = {'w','i','n','e','t','e','s','t','2','.','m','s','i',0};
64 static CHAR CURR_DIR
[MAX_PATH
];
65 static CHAR PROG_FILES_DIR
[MAX_PATH
];
66 static CHAR PROG_FILES_DIR_NATIVE
[MAX_PATH
];
67 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
68 static CHAR APP_DATA_DIR
[MAX_PATH
];
69 static CHAR WINDOWS_DIR
[MAX_PATH
];
71 /* msi database data */
73 static const CHAR component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
74 "s72\tS38\ts72\ti2\tS255\tS72\n"
75 "Component\tComponent\n"
76 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
77 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
78 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
79 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
80 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
81 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
82 "component\t\tMSITESTDIR\t0\t1\tfile\n"
83 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
85 static const CHAR directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
87 "Directory\tDirectory\n"
88 "CABOUTDIR\tMSITESTDIR\tcabout\n"
89 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
90 "FIRSTDIR\tMSITESTDIR\tfirst\n"
91 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
92 "NEWDIR\tCABOUTDIR\tnew\n"
93 "ProgramFilesFolder\tTARGETDIR\t.\n"
94 "TARGETDIR\t\tSourceDir";
96 static const CHAR feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
97 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
99 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
100 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
101 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
102 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
103 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
104 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
105 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
107 static const CHAR feature_comp_dat
[] = "Feature_\tComponent_\n"
109 "FeatureComponents\tFeature_\tComponent_\n"
115 "feature\tcomponent\n"
116 "service_feature\tservice_comp\n";
118 static const CHAR file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
119 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
121 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
122 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
123 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
124 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
125 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
126 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
127 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
129 static const CHAR install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
131 "InstallExecuteSequence\tAction\n"
132 "AllocateRegistrySpace\tNOT Installed\t1550\n"
133 "CostFinalize\t\t1000\n"
134 "CostInitialize\t\t800\n"
136 "ResolveSource\t\t950\n"
137 "MoveFiles\t\t1700\n"
138 "InstallFiles\t\t4000\n"
139 "DuplicateFiles\t\t4500\n"
140 "WriteEnvironmentStrings\t\t4550\n"
141 "CreateShortcuts\t\t4600\n"
142 "InstallServices\t\t5000\n"
143 "InstallFinalize\t\t6600\n"
144 "InstallInitialize\t\t1500\n"
145 "InstallValidate\t\t1400\n"
146 "LaunchConditions\t\t100\n"
147 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
149 static const CHAR media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
150 "i2\ti4\tL64\tS255\tS32\tS72\n"
152 "1\t3\t\t\tDISK1\t\n"
153 "2\t5\t\tmsitest.cab\tDISK2\t\n";
155 static const CHAR property_dat
[] = "Property\tValue\n"
157 "Property\tProperty\n"
158 "DefaultUIFont\tDlgFont8\n"
161 "InstallMode\tTypical\n"
162 "Manufacturer\tWine\n"
163 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
164 "PRIMARYFOLDER\tTARGETDIR\n"
165 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
167 "ProductLanguage\t1033\n"
168 "ProductName\tMSITEST\n"
169 "ProductVersion\t1.1.1\n"
170 "PROMPTROLLBACKCOST\tP\n"
172 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
173 "AdminProperties\tPOSTADMIN\n"
175 "SERVNAME\tTestService\n"
176 "SERVDISP\tTestServiceDisp\n"
177 "MSIFASTINSTALL\t1\n";
179 static const CHAR aup_property_dat
[] = "Property\tValue\n"
181 "Property\tProperty\n"
182 "DefaultUIFont\tDlgFont8\n"
186 "InstallMode\tTypical\n"
187 "Manufacturer\tWine\n"
188 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
189 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
191 "ProductLanguage\t1033\n"
192 "ProductName\tMSITEST\n"
193 "ProductVersion\t1.1.1\n"
194 "PROMPTROLLBACKCOST\tP\n"
196 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
197 "AdminProperties\tPOSTADMIN\n"
199 "SERVNAME\tTestService\n"
200 "SERVDISP\tTestServiceDisp\n"
201 "MSIFASTINSTALL\t1\n";
203 static const CHAR aup2_property_dat
[] = "Property\tValue\n"
205 "Property\tProperty\n"
206 "DefaultUIFont\tDlgFont8\n"
210 "InstallMode\tTypical\n"
211 "Manufacturer\tWine\n"
212 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
213 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
215 "ProductLanguage\t1033\n"
216 "ProductName\tMSITEST\n"
217 "ProductVersion\t1.1.1\n"
218 "PROMPTROLLBACKCOST\tP\n"
220 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
221 "AdminProperties\tPOSTADMIN\n"
223 "SERVNAME\tTestService\n"
224 "SERVDISP\tTestServiceDisp\n"
225 "MSIFASTINSTALL\t1\n";
227 static const CHAR icon_property_dat
[] = "Property\tValue\n"
229 "Property\tProperty\n"
230 "DefaultUIFont\tDlgFont8\n"
233 "InstallMode\tTypical\n"
234 "Manufacturer\tWine\n"
235 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
236 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
238 "ProductLanguage\t1033\n"
239 "ProductName\tMSITEST\n"
240 "ProductVersion\t1.1.1\n"
241 "PROMPTROLLBACKCOST\tP\n"
243 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
244 "AdminProperties\tPOSTADMIN\n"
246 "SERVNAME\tTestService\n"
247 "SERVDISP\tTestServiceDisp\n"
248 "MSIFASTINSTALL\t1\n";
250 static const CHAR shortcut_dat
[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
251 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
252 "Shortcut\tShortcut\n"
253 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
255 static const CHAR condition_dat
[] = "Feature_\tLevel\tCondition\n"
257 "Condition\tFeature_\tLevel\n"
260 static const CHAR up_property_dat
[] = "Property\tValue\n"
262 "Property\tProperty\n"
263 "DefaultUIFont\tDlgFont8\n"
266 "InstallMode\tTypical\n"
267 "Manufacturer\tWine\n"
268 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
269 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
271 "ProductLanguage\t1033\n"
272 "ProductName\tMSITEST\n"
273 "ProductVersion\t1.1.1\n"
274 "PROMPTROLLBACKCOST\tP\n"
276 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
277 "AdminProperties\tPOSTADMIN\n"
279 "SERVNAME\tTestService\n"
280 "SERVDISP\tTestServiceDisp\n"
281 "RemovePreviousVersions\t1\n"
282 "MSIFASTINSTALL\t1\n";
284 static const CHAR up2_property_dat
[] = "Property\tValue\n"
286 "Property\tProperty\n"
287 "DefaultUIFont\tDlgFont8\n"
290 "InstallMode\tTypical\n"
291 "Manufacturer\tWine\n"
292 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
293 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
295 "ProductLanguage\t1033\n"
296 "ProductName\tMSITEST\n"
297 "ProductVersion\t1.1.2\n"
298 "PROMPTROLLBACKCOST\tP\n"
300 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
301 "AdminProperties\tPOSTADMIN\n"
303 "SERVNAME\tTestService\n"
304 "SERVDISP\tTestServiceDisp\n"
305 "MSIFASTINSTALL\t1\n";
307 static const CHAR up3_property_dat
[] = "Property\tValue\n"
309 "Property\tProperty\n"
310 "DefaultUIFont\tDlgFont8\n"
313 "InstallMode\tTypical\n"
314 "Manufacturer\tWine\n"
315 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
316 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
318 "ProductLanguage\t1033\n"
319 "ProductName\tMSITEST\n"
320 "ProductVersion\t1.1.2\n"
321 "PROMPTROLLBACKCOST\tP\n"
323 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
324 "AdminProperties\tPOSTADMIN\n"
326 "SERVNAME\tTestService\n"
327 "SERVDISP\tTestServiceDisp\n"
328 "RemovePreviousVersions\t1\n"
329 "MSIFASTINSTALL\t1\n";
331 static const CHAR registry_dat
[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
332 "s72\ti2\tl255\tL255\tL0\ts72\n"
333 "Registry\tRegistry\n"
334 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
335 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
336 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
337 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
339 static const CHAR service_install_dat
[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
340 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
341 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
342 "ServiceInstall\tServiceInstall\n"
343 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
345 static const CHAR service_control_dat
[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
346 "s72\tl255\ti2\tL255\tI2\ts72\n"
347 "ServiceControl\tServiceControl\n"
348 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
350 /* tables for test_continuouscabs */
351 static const CHAR cc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
352 "s72\tS38\ts72\ti2\tS255\tS72\n"
353 "Component\tComponent\n"
354 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
355 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
356 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
358 static const CHAR cc2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
359 "s72\tS38\ts72\ti2\tS255\tS72\n"
360 "Component\tComponent\n"
361 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
362 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
363 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
365 static const CHAR cc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
366 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
368 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
370 static const CHAR cc_feature_comp_dat
[] = "Feature_\tComponent_\n"
372 "FeatureComponents\tFeature_\tComponent_\n"
374 "feature\taugustus\n"
377 static const CHAR cc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
378 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
380 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
381 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
382 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
384 static const CHAR cc2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
385 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
387 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
388 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
389 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
390 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
392 static const CHAR cc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
393 "i2\ti4\tL64\tS255\tS32\tS72\n"
395 "1\t10\t\ttest1.cab\tDISK1\t\n"
396 "2\t2\t\ttest2.cab\tDISK2\t\n"
397 "3\t12\t\ttest3.cab\tDISK3\t\n";
399 static const CHAR cc3_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
400 "i2\ti4\tL64\tS255\tS32\tS72\n"
402 "1\t10\t\ttest1.cab\tDISK1\t\n"
403 "2\t2\t\ttest2_.cab\tDISK2\t\n"
404 "3\t12\t\ttest3.cab\tDISK3\t\n";
406 static const CHAR co_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
407 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
409 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
410 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
411 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
413 static const CHAR co_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
414 "i2\ti4\tL64\tS255\tS32\tS72\n"
416 "1\t10\t\ttest1.cab\tDISK1\t\n"
417 "2\t2\t\ttest2.cab\tDISK2\t\n"
418 "3\t3\t\ttest3.cab\tDISK3\t\n";
420 static const CHAR co2_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
421 "i2\ti4\tL64\tS255\tS32\tS72\n"
423 "1\t10\t\ttest1.cab\tDISK1\t\n"
424 "2\t12\t\ttest3.cab\tDISK3\t\n"
425 "3\t2\t\ttest2.cab\tDISK2\t\n";
427 static const CHAR mm_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
428 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
430 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
431 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
432 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
434 static const CHAR mm_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
435 "i2\ti4\tL64\tS255\tS32\tS72\n"
437 "1\t3\t\ttest1.cab\tDISK1\t\n";
439 static const CHAR ss_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
440 "i2\ti4\tL64\tS255\tS32\tS72\n"
442 "1\t2\t\ttest1.cab\tDISK1\t\n"
443 "2\t2\t\ttest2.cab\tDISK2\t\n"
444 "3\t12\t\ttest3.cab\tDISK3\t\n";
446 /* tables for test_uiLevelFlags */
447 static const CHAR ui_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
448 "s72\tS38\ts72\ti2\tS255\tS72\n"
449 "Component\tComponent\n"
450 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
451 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
452 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
454 static const CHAR ui_install_ui_seq_dat
[] = "Action\tCondition\tSequence\n"
456 "InstallUISequence\tAction\n"
457 "SetUIProperty\t\t5\n"
458 "ExecuteAction\t\t1100\n";
460 static const CHAR ui_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
461 "s72\ti2\tS64\tS0\tS255\n"
462 "CustomAction\tAction\n"
463 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
465 static const CHAR rof_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
466 "s72\tS38\ts72\ti2\tS255\tS72\n"
467 "Component\tComponent\n"
468 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
470 static const CHAR rof_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
471 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
473 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
474 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
476 static const CHAR rof_feature_comp_dat
[] = "Feature_\tComponent_\n"
478 "FeatureComponents\tFeature_\tComponent_\n"
480 "montecristo\tmaximus";
482 static const CHAR rof_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
483 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
485 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
487 static const CHAR rof_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
488 "i2\ti4\tL64\tS255\tS32\tS72\n"
490 "1\t1\t\t\tDISK1\t\n";
492 static const CHAR rofc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
493 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
495 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
497 static const CHAR rofc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
498 "i2\ti4\tL64\tS255\tS32\tS72\n"
500 "1\t1\t\ttest1.cab\tDISK1\t\n";
502 static const CHAR sdp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
504 "InstallExecuteSequence\tAction\n"
505 "AllocateRegistrySpace\tNOT Installed\t1550\n"
506 "CostFinalize\t\t1000\n"
507 "CostInitialize\t\t800\n"
509 "InstallFiles\t\t4000\n"
510 "InstallFinalize\t\t6600\n"
511 "InstallInitialize\t\t1500\n"
512 "InstallValidate\t\t1400\n"
513 "LaunchConditions\t\t100\n"
514 "SetDirProperty\t\t950";
516 static const CHAR sdp_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
517 "s72\ti2\tS64\tS0\tS255\n"
518 "CustomAction\tAction\n"
519 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
521 static const CHAR pv_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
523 "InstallExecuteSequence\tAction\n"
524 "LaunchConditions\t\t100\n"
525 "CostInitialize\t\t800\n"
527 "CostFinalize\t\t1000\n"
528 "InstallValidate\t\t1400\n"
529 "InstallInitialize\t\t1500\n"
530 "InstallFiles\t\t4000\n"
531 "InstallFinalize\t\t6600\n";
533 static const CHAR cie_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
534 "s72\tS38\ts72\ti2\tS255\tS72\n"
535 "Component\tComponent\n"
536 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
537 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
538 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
539 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
541 static const CHAR cie_feature_comp_dat
[] = "Feature_\tComponent_\n"
543 "FeatureComponents\tFeature_\tComponent_\n"
545 "feature\taugustus\n"
549 static const CHAR cie_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
550 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
552 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
553 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
554 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
555 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
557 static const CHAR cie_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
558 "i2\ti4\tL64\tS255\tS32\tS72\n"
560 "1\t1\t\ttest1.cab\tDISK1\t\n"
561 "2\t2\t\ttest2.cab\tDISK2\t\n"
562 "3\t12\t\ttest3.cab\tDISK3\t\n";
564 static const CHAR ci_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
565 "s72\tS38\ts72\ti2\tS255\tS72\n"
566 "Component\tComponent\n"
567 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
569 static const CHAR ci2_feature_comp_dat
[] = "Feature_\tComponent_\n"
571 "FeatureComponents\tFeature_\tComponent_\n"
574 static const CHAR ci2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
575 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
577 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
579 static const CHAR pp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
581 "InstallExecuteSequence\tAction\n"
582 "ValidateProductID\t\t700\n"
583 "CostInitialize\t\t800\n"
585 "CostFinalize\t\t1000\n"
586 "InstallValidate\t\t1400\n"
587 "InstallInitialize\t\t1500\n"
588 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
589 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
590 "RemoveFiles\t\t3500\n"
591 "InstallFiles\t\t4000\n"
592 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
593 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
594 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
595 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
596 "InstallFinalize\t\t6600";
598 static const CHAR tp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
599 "s72\tS38\ts72\ti2\tS255\tS72\n"
600 "Component\tComponent\n"
601 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
603 static const CHAR cwd_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
604 "s72\tS38\ts72\ti2\tS255\tS72\n"
605 "Component\tComponent\n"
606 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
608 static const CHAR adm_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
609 "s72\tS38\ts72\ti2\tS255\tS72\n"
610 "Component\tComponent\n"
611 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
613 static const CHAR adm_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
614 "s72\ti2\tS64\tS0\tS255\n"
615 "CustomAction\tAction\n"
616 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
618 static const CHAR adm_admin_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
620 "AdminExecuteSequence\tAction\n"
621 "CostFinalize\t\t1000\n"
622 "CostInitialize\t\t800\n"
624 "SetPOSTADMIN\t\t950\n"
625 "InstallFiles\t\t4000\n"
626 "InstallFinalize\t\t6600\n"
627 "InstallInitialize\t\t1500\n"
628 "InstallValidate\t\t1400\n"
629 "LaunchConditions\t\t100";
631 static const CHAR amp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
632 "s72\tS38\ts72\ti2\tS255\tS72\n"
633 "Component\tComponent\n"
634 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
636 static const CHAR rem_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
638 "InstallExecuteSequence\tAction\n"
639 "ValidateProductID\t\t700\n"
640 "CostInitialize\t\t800\n"
642 "CostFinalize\t\t1000\n"
643 "InstallValidate\t\t1400\n"
644 "InstallInitialize\t\t1500\n"
645 "ProcessComponents\t\t1600\n"
646 "UnpublishFeatures\t\t1800\n"
647 "RemoveFiles\t\t3500\n"
648 "InstallFiles\t\t4000\n"
649 "RegisterProduct\t\t6100\n"
650 "PublishFeatures\t\t6300\n"
651 "PublishProduct\t\t6400\n"
652 "InstallFinalize\t\t6600";
654 static const CHAR mc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
655 "s72\tS38\ts72\ti2\tS255\tS72\n"
656 "Component\tComponent\n"
657 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
658 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
659 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
660 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n"
661 "tiberius\t\tMSITESTDIR\t0\t\ttiberius\n";
663 static const CHAR mc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
664 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
666 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
667 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
668 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
669 "gaius\tgaius\tgaius\t500\t\t\t16384\t4\n"
670 "tiberius\ttiberius\ttiberius\t500\t\t\t0\t5\n";
672 static const CHAR mc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
673 "i2\ti4\tL64\tS255\tS32\tS72\n"
675 "1\t1\t\ttest1.cab\tDISK1\t\n"
676 "2\t2\t\ttest2.cab\tDISK2\t\n"
677 "3\t3\t\ttest3.cab\tDISK3\t\n"
678 "4\t4\t\ttest3.cab\tDISK3\t\n"
679 "5\t5\t\ttest4.cab\tDISK4\t\n";
681 static const CHAR mc_file_hash_dat
[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
682 "s72\ti2\ti4\ti4\ti4\ti4\n"
683 "MsiFileHash\tFile_\n"
684 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
686 static const CHAR wrv_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
687 "s72\tS38\ts72\ti2\tS255\tS72\n"
688 "Component\tComponent\n"
689 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
691 static const CHAR ca51_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
692 "s72\tS38\ts72\ti2\tS255\tS72\n"
693 "Component\tComponent\n"
694 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
696 static const CHAR ca51_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
698 "InstallExecuteSequence\tAction\n"
699 "ValidateProductID\t\t700\n"
700 "GoodSetProperty\t\t725\n"
701 "BadSetProperty\t\t750\n"
702 "CostInitialize\t\t800\n"
703 "ResolveSource\t\t810\n"
705 "SetSourceDir\tSRCDIR\t910\n"
706 "CostFinalize\t\t1000\n"
707 "InstallValidate\t\t1400\n"
708 "InstallInitialize\t\t1500\n"
709 "InstallFiles\t\t4000\n"
710 "InstallFinalize\t\t6600";
712 static const CHAR ca51_custom_action_dat
[] = "Action\tType\tSource\tTarget\n"
714 "CustomAction\tAction\n"
715 "GoodSetProperty\t51\tMYPROP\t42\n"
716 "BadSetProperty\t51\t\tMYPROP\n"
717 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
719 static const CHAR is_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
720 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
722 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
723 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
724 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
725 "four\t\t\t\t2\t0\t\t0"; /* disabled */
727 static const CHAR is_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
728 "s72\tS38\ts72\ti2\tS255\tS72\n"
729 "Component\tComponent\n"
730 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
731 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
732 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
733 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
734 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
735 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
736 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
737 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
738 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
739 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
740 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
741 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
743 static const CHAR is_feature_comp_dat
[] = "Feature_\tComponent_\n"
745 "FeatureComponents\tFeature_\tComponent_\n"
759 static const CHAR is_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
760 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
762 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
763 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
764 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
765 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
766 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
767 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
768 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
769 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
770 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
771 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
772 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
773 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
775 static const CHAR is_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
776 "i2\ti4\tL64\tS255\tS32\tS72\n"
778 "1\t12\t\t\tDISK1\t\n";
780 static const CHAR sp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
781 "s72\tS38\ts72\ti2\tS255\tS72\n"
782 "Component\tComponent\n"
783 "augustus\t\tTWODIR\t0\t\taugustus\n";
785 static const CHAR sp_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
787 "Directory\tDirectory\n"
788 "TARGETDIR\t\tSourceDir\n"
789 "ProgramFilesFolder\tTARGETDIR\t.\n"
790 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
791 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
792 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
794 static const CHAR mcp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
795 "s72\tS38\ts72\ti2\tS255\tS72\n"
796 "Component\tComponent\n"
797 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
798 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
799 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
801 static const CHAR mcp_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
802 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
804 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
805 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
806 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
808 static const CHAR mcp_feature_comp_dat
[] = "Feature_\tComponent_\n"
810 "FeatureComponents\tFeature_\tComponent_\n"
811 "hydroxyl\thydrogen\n"
815 static const CHAR mcp_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
816 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
818 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
819 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
820 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
821 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
823 static const CHAR ai_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
824 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
826 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
827 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
828 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
829 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
830 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
831 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
832 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
834 static const CHAR ip_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
836 "InstallExecuteSequence\tAction\n"
837 "CostFinalize\t\t1000\n"
838 "ValidateProductID\t\t700\n"
839 "CostInitialize\t\t800\n"
841 "RemoveFiles\t\t3500\n"
842 "InstallFiles\t\t4000\n"
843 "RegisterUser\t\t6000\n"
844 "RegisterProduct\t\t6100\n"
845 "PublishFeatures\t\t6300\n"
846 "PublishProduct\t\t6400\n"
847 "InstallFinalize\t\t6600\n"
848 "InstallInitialize\t\t1500\n"
849 "ProcessComponents\t\t1600\n"
850 "UnpublishFeatures\t\t1800\n"
851 "InstallValidate\t\t1400\n"
852 "LaunchConditions\t\t100\n"
853 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
855 static const CHAR ip_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
856 "s72\ti2\tS64\tS0\tS255\n"
857 "CustomAction\tAction\n"
858 "TestInstalledProp\t19\t\tTest failed\t\n";
860 static const CHAR aup_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
862 "InstallExecuteSequence\tAction\n"
863 "CostFinalize\t\t1000\n"
864 "ValidateProductID\t\t700\n"
865 "CostInitialize\t\t800\n"
867 "RemoveFiles\t\t3500\n"
868 "InstallFiles\t\t4000\n"
869 "RegisterUser\t\t6000\n"
870 "RegisterProduct\t\t6100\n"
871 "PublishFeatures\t\t6300\n"
872 "PublishProduct\t\t6400\n"
873 "InstallFinalize\t\t6600\n"
874 "InstallInitialize\t\t1500\n"
875 "ProcessComponents\t\t1600\n"
876 "UnpublishFeatures\t\t1800\n"
877 "InstallValidate\t\t1400\n"
878 "LaunchConditions\t\t100\n"
879 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
881 static const CHAR aup2_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
883 "InstallExecuteSequence\tAction\n"
884 "CostFinalize\t\t1000\n"
885 "ValidateProductID\t\t700\n"
886 "CostInitialize\t\t800\n"
888 "RemoveFiles\t\t3500\n"
889 "InstallFiles\t\t4000\n"
890 "RegisterUser\t\t6000\n"
891 "RegisterProduct\t\t6100\n"
892 "PublishFeatures\t\t6300\n"
893 "PublishProduct\t\t6400\n"
894 "InstallFinalize\t\t6600\n"
895 "InstallInitialize\t\t1500\n"
896 "ProcessComponents\t\t1600\n"
897 "UnpublishFeatures\t\t1800\n"
898 "InstallValidate\t\t1400\n"
899 "LaunchConditions\t\t100\n"
900 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
902 static const CHAR aup3_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
904 "InstallExecuteSequence\tAction\n"
905 "CostFinalize\t\t1000\n"
906 "ValidateProductID\t\t700\n"
907 "CostInitialize\t\t800\n"
909 "RemoveFiles\t\t3500\n"
910 "InstallFiles\t\t4000\n"
911 "RegisterUser\t\t6000\n"
912 "RegisterProduct\t\t6100\n"
913 "PublishFeatures\t\t6300\n"
914 "PublishProduct\t\t6400\n"
915 "InstallFinalize\t\t6600\n"
916 "InstallInitialize\t\t1500\n"
917 "ProcessComponents\t\t1600\n"
918 "UnpublishFeatures\t\t1800\n"
919 "InstallValidate\t\t1400\n"
920 "LaunchConditions\t\t100\n"
921 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
923 static const CHAR aup_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
924 "s72\ti2\tS64\tS0\tS255\n"
925 "CustomAction\tAction\n"
926 "TestAllUsersProp\t19\t\tTest failed\t\n";
928 static const CHAR fo_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
929 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
931 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
932 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
933 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
935 static const CHAR fo_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
936 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
938 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
939 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
940 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
942 static const CHAR fo_condition_dat
[] = "Feature_\tLevel\tCondition\n"
944 "Condition\tFeature_\tLevel\n"
945 "preselected\t0\tPreselected\n"
946 "notpreselected\t0\tNOT Preselected\n";
948 static const CHAR fo_feature_comp_dat
[] = "Feature_\tComponent_\n"
950 "FeatureComponents\tFeature_\tComponent_\n"
951 "override\toverride\n"
952 "preselected\tpreselected\n"
953 "notpreselected\tnotpreselected\n";
955 static const CHAR fo_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
956 "s72\tS38\ts72\ti2\tS255\tS72\n"
957 "Component\tComponent\n"
958 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
959 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
960 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
962 static const CHAR fo_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
963 "s72\ti2\tS64\tS0\tS255\n"
964 "CustomAction\tAction\n"
965 "SetPreselected\t51\tPreselected\t1\t\n";
967 static const CHAR fo_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
969 "InstallExecuteSequence\tAction\n"
970 "LaunchConditions\t\t100\n"
971 "SetPreselected\tpreselect=1\t200\n"
972 "CostInitialize\t\t800\n"
974 "CostFinalize\t\t1000\n"
975 "InstallValidate\t\t1400\n"
976 "InstallInitialize\t\t1500\n"
977 "ProcessComponents\t\t1600\n"
978 "RemoveFiles\t\t1700\n"
979 "InstallFiles\t\t2000\n"
980 "RegisterProduct\t\t5000\n"
981 "PublishFeatures\t\t5100\n"
982 "PublishProduct\t\t5200\n"
983 "InstallFinalize\t\t6000\n";
985 static const CHAR uc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
986 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
988 "upgradecode.txt\tupgradecode\tupgradecode.txt\t1000\t\t\t8192\t1\n";
990 static const CHAR uc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
991 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
993 "upgradecode\t\t\tupgradecode feature\t1\t2\tMSITESTDIR\t0\n";
995 static const CHAR uc_feature_comp_dat
[] = "Feature_\tComponent_\n"
997 "FeatureComponents\tFeature_\tComponent_\n"
998 "upgradecode\tupgradecode\n";
1000 static const CHAR uc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1001 "s72\tS38\ts72\ti2\tS255\tS72\n"
1002 "Component\tComponent\n"
1003 "upgradecode\t{6952B732-2FCB-4E47-976F-989FCBD7EDFB}\tMSITESTDIR\t0\t\tupgradecode.txt\n";
1005 static const CHAR uc_property_dat
[] = "Property\tValue\n"
1007 "Property\tProperty\n"
1009 "ProductCode\t{E5FB1241-F547-4BA7-A60E-8E75797268D4}\n"
1010 "ProductName\tMSITEST\n"
1011 "ProductVersion\t1.1.1\n"
1012 "UpgradeCode\t#UPGEADECODE#\n"
1013 "MSIFASTINSTALL\t1\n";
1015 static const CHAR uc_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
1017 "InstallExecuteSequence\tAction\n"
1018 "LaunchConditions\t\t100\n"
1019 "CostInitialize\t\t200\n"
1021 "CostFinalize\t\t400\n"
1022 "InstallInitialize\t\t500\n"
1023 "ProcessComponents\t\t600\n"
1024 "InstallValidate\t\t700\n"
1025 "RemoveFiles\t\t800\n"
1026 "InstallFiles\t\t900\n"
1027 "RegisterProduct\t\t1000\n"
1028 "PublishFeatures\t\t1100\n"
1029 "PublishProduct\t\t1200\n"
1030 "InstallFinalize\t\t1300\n";
1032 static const char mixed_feature_dat
[] =
1033 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1034 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1035 "Feature\tFeature\n"
1036 "feature1\t\t\t\t1\t2\tMSITESTDIR\t0\n"
1037 "feature2\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1039 static const char mixed_feature_comp_dat
[] =
1040 "Feature_\tComponent_\n"
1042 "FeatureComponents\tFeature_\tComponent_\n"
1044 "feature2\tcomp2\n";
1046 static const char mixed_component_dat
[] =
1047 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1048 "s72\tS38\ts72\ti2\tS255\tS72\n"
1049 "Component\tComponent\n"
1050 "comp1\t{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}\tTARGETDIR\t4\t\tregdata1\n"
1051 "comp2\t{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}\tTARGETDIR\t260\t\tregdata2\n";
1053 static const char mixed_registry_dat
[] =
1054 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1055 "s72\ti2\tl255\tL255\tL0\ts72\n"
1056 "Registry\tRegistry\n"
1057 "regdata1\t2\tSOFTWARE\\Wine\\msitest\ttest1\t\tcomp1\n"
1058 "regdata2\t2\tSOFTWARE\\Wine\\msitest\ttest2\t\tcomp2\n"
1059 "regdata3\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest32\tcomp1\n"
1060 "regdata4\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest32.dll\tcomp1\n"
1061 "regdata5\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\t\tCLSID_Winetest64\tcomp2\n"
1062 "regdata6\t0\tCLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32\t\twinetest64.dll\tcomp2\n";
1064 static const char mixed_install_exec_seq_dat
[] =
1065 "Action\tCondition\tSequence\n"
1067 "InstallExecuteSequence\tAction\n"
1068 "LaunchConditions\t\t100\n"
1069 "CostInitialize\t\t200\n"
1071 "CostFinalize\t\t400\n"
1072 "InstallValidate\t\t500\n"
1073 "InstallInitialize\t\t600\n"
1074 "ProcessComponents\t\t700\n"
1075 "UnpublishFeatures\t\t800\n"
1076 "RemoveRegistryValues\t\t900\n"
1077 "WriteRegistryValues\t\t1000\n"
1078 "RegisterProduct\t\t1100\n"
1079 "PublishFeatures\t\t1200\n"
1080 "PublishProduct\t\t1300\n"
1081 "InstallFinalize\t\t1400\n";
1083 static const char vp_file_dat
[] =
1084 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1085 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1087 "volumeprop\tcomp\tvolumeprop.txt\t1000\t\t\t8192\t1\n";
1089 static const char vp_feature_dat
[] =
1090 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1091 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1092 "Feature\tFeature\n"
1093 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1095 static const char vp_feature_comp_dat
[] =
1096 "Feature_\tComponent_\n"
1098 "FeatureComponents\tFeature_\tComponent_\n"
1101 static const char vp_component_dat
[] =
1102 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1103 "s72\tS38\ts72\ti2\tS255\tS72\n"
1104 "Component\tComponent\n"
1105 "comp\t{24364AE7-5B7F-496C-AF5A-54893639C567}\tMSITESTDIR\t0\t\tvolumeprop\n";
1107 static const char vp_custom_action_dat
[] =
1108 "Action\tType\tSource\tTarget\tISComments\n"
1109 "s72\ti2\tS64\tS0\tS255\n"
1110 "CustomAction\tAction\n"
1111 "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n"
1112 "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n"
1113 "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n"
1114 "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n"
1115 "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n"
1116 "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n";
1118 static const char vp_install_exec_seq_dat
[] =
1119 "Action\tCondition\tSequence\n"
1121 "InstallExecuteSequence\tAction\n"
1122 "LaunchConditions\t\t100\n"
1123 "CostInitialize\t\t200\n"
1125 "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n"
1126 "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n"
1127 "CostFinalize\t\t600\n"
1128 "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n"
1129 "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n"
1130 "InstallValidate\t\t900\n"
1131 "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n"
1132 "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n"
1133 "InstallInitialize\t\t1200\n"
1134 "ProcessComponents\t\t1300\n"
1135 "RemoveFiles\t\t1400\n"
1136 "InstallFiles\t\t1500\n"
1137 "RegisterProduct\t\t1600\n"
1138 "PublishFeatures\t\t1700\n"
1139 "PublishProduct\t\t1800\n"
1140 "InstallFinalize\t\t1900\n";
1142 static const char shc_property_dat
[] =
1145 "Property\tProperty\n"
1147 "ProductCode\t{5CD99CD0-69C7-409B-9905-82DD743CC840}\n"
1148 "ProductName\tMSITEST\n"
1149 "ProductVersion\t1.1.1\n"
1150 "MSIFASTINSTALL\t1\n";
1152 static const char shc2_property_dat
[] =
1155 "Property\tProperty\n"
1157 "ProductCode\t{4CEFADE5-DAFB-4C21-8EF2-4ED4F139F340}\n"
1158 "ProductName\tMSITEST2\n"
1159 "ProductVersion\t1.1.1\n"
1160 "MSIFASTINSTALL\t1\n";
1162 static const char shc_file_dat
[] =
1163 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1164 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1166 "sharedcomponent\tsharedcomponent\tsharedcomponent.txt\t1000\t\t\t8192\t1\n";
1168 static const char shc_feature_dat
[] =
1169 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1170 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1171 "Feature\tFeature\n"
1172 "feature\t\t\t\t1\t2\tMSITESTDIR\t0\n";
1174 static const char shc_feature_comp_dat
[] =
1175 "Feature_\tComponent_\n"
1177 "FeatureComponents\tFeature_\tComponent_\n"
1178 "feature\tsharedcomponent\n";
1180 static const char shc_component_dat
[] =
1181 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1182 "s72\tS38\ts72\ti2\tS255\tS72\n"
1183 "Component\tComponent\n"
1184 "sharedcomponent\t{900A4ACB-DC6F-4795-A04B-81B530183D41}\tMSITESTDIR\t0\t\tsharedcomponent\n";
1186 static const char shc_custom_action_dat
[] =
1187 "Action\tType\tSource\tTarget\tISComments\n"
1188 "s72\ti2\tS64\tS0\tS255\n"
1189 "CustomAction\tAction\n"
1190 "TestComponentAction\t19\t\twrong component action on install\t\n";
1192 static const char shc_install_exec_seq_dat
[] =
1193 "Action\tCondition\tSequence\n"
1195 "InstallExecuteSequence\tAction\n"
1196 "LaunchConditions\t\t100\n"
1197 "CostInitialize\t\t200\n"
1199 "CostFinalize\t\t600\n"
1200 "InstallValidate\t\t900\n"
1201 "InstallInitialize\t\t1200\n"
1202 "ProcessComponents\t\t1300\n"
1203 "RemoveFiles\t\t1400\n"
1204 "InstallFiles\t\t1500\n"
1205 "TestComponentAction\tNOT REMOVE AND ($sharedcomponent <> 3)\t1600\n"
1206 "RegisterProduct\t\t1700\n"
1207 "PublishFeatures\t\t1800\n"
1208 "PublishProduct\t\t1900\n"
1209 "InstallFinalize\t\t2000\n";
1211 typedef struct _msi_table
1213 const CHAR
*filename
;
1218 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1220 static const msi_table tables
[] =
1222 ADD_TABLE(component
),
1223 ADD_TABLE(directory
),
1225 ADD_TABLE(feature_comp
),
1227 ADD_TABLE(install_exec_seq
),
1229 ADD_TABLE(property
),
1230 ADD_TABLE(registry
),
1231 ADD_TABLE(service_install
),
1232 ADD_TABLE(service_control
)
1235 static const msi_table sc_tables
[] =
1237 ADD_TABLE(component
),
1238 ADD_TABLE(directory
),
1240 ADD_TABLE(feature_comp
),
1242 ADD_TABLE(install_exec_seq
),
1244 ADD_TABLE(property
),
1248 static const msi_table ps_tables
[] =
1250 ADD_TABLE(component
),
1251 ADD_TABLE(directory
),
1253 ADD_TABLE(feature_comp
),
1255 ADD_TABLE(install_exec_seq
),
1257 ADD_TABLE(property
),
1258 ADD_TABLE(condition
)
1261 static const msi_table up_tables
[] =
1263 ADD_TABLE(component
),
1264 ADD_TABLE(directory
),
1266 ADD_TABLE(feature_comp
),
1268 ADD_TABLE(install_exec_seq
),
1270 ADD_TABLE(up_property
),
1271 ADD_TABLE(registry
),
1272 ADD_TABLE(service_install
),
1273 ADD_TABLE(service_control
)
1276 static const msi_table up2_tables
[] =
1278 ADD_TABLE(component
),
1279 ADD_TABLE(directory
),
1281 ADD_TABLE(feature_comp
),
1283 ADD_TABLE(install_exec_seq
),
1285 ADD_TABLE(up2_property
),
1286 ADD_TABLE(registry
),
1287 ADD_TABLE(service_install
),
1288 ADD_TABLE(service_control
)
1291 static const msi_table up3_tables
[] =
1293 ADD_TABLE(component
),
1294 ADD_TABLE(directory
),
1296 ADD_TABLE(feature_comp
),
1298 ADD_TABLE(install_exec_seq
),
1300 ADD_TABLE(up3_property
),
1301 ADD_TABLE(registry
),
1302 ADD_TABLE(service_install
),
1303 ADD_TABLE(service_control
)
1306 static const msi_table up4_tables
[] =
1308 ADD_TABLE(component
),
1309 ADD_TABLE(directory
),
1311 ADD_TABLE(feature_comp
),
1313 ADD_TABLE(pp_install_exec_seq
),
1315 ADD_TABLE(property
),
1316 ADD_TABLE(registry
),
1317 ADD_TABLE(service_install
),
1318 ADD_TABLE(service_control
)
1321 static const msi_table up5_tables
[] =
1323 ADD_TABLE(component
),
1324 ADD_TABLE(directory
),
1326 ADD_TABLE(feature_comp
),
1328 ADD_TABLE(pp_install_exec_seq
),
1330 ADD_TABLE(up_property
),
1331 ADD_TABLE(registry
),
1332 ADD_TABLE(service_install
),
1333 ADD_TABLE(service_control
)
1336 static const msi_table up6_tables
[] =
1338 ADD_TABLE(component
),
1339 ADD_TABLE(directory
),
1341 ADD_TABLE(feature_comp
),
1343 ADD_TABLE(pp_install_exec_seq
),
1345 ADD_TABLE(up2_property
),
1346 ADD_TABLE(registry
),
1347 ADD_TABLE(service_install
),
1348 ADD_TABLE(service_control
)
1351 static const msi_table up7_tables
[] =
1353 ADD_TABLE(component
),
1354 ADD_TABLE(directory
),
1356 ADD_TABLE(feature_comp
),
1358 ADD_TABLE(pp_install_exec_seq
),
1360 ADD_TABLE(up3_property
),
1361 ADD_TABLE(registry
),
1362 ADD_TABLE(service_install
),
1363 ADD_TABLE(service_control
)
1366 static const msi_table cc_tables
[] =
1368 ADD_TABLE(cc_component
),
1369 ADD_TABLE(directory
),
1370 ADD_TABLE(cc_feature
),
1371 ADD_TABLE(cc_feature_comp
),
1373 ADD_TABLE(install_exec_seq
),
1374 ADD_TABLE(cc_media
),
1375 ADD_TABLE(property
),
1378 static const msi_table cc2_tables
[] =
1380 ADD_TABLE(cc2_component
),
1381 ADD_TABLE(directory
),
1382 ADD_TABLE(cc_feature
),
1383 ADD_TABLE(cc_feature_comp
),
1384 ADD_TABLE(cc2_file
),
1385 ADD_TABLE(install_exec_seq
),
1386 ADD_TABLE(cc_media
),
1387 ADD_TABLE(property
),
1390 static const msi_table cc3_tables
[] =
1392 ADD_TABLE(cc_component
),
1393 ADD_TABLE(directory
),
1394 ADD_TABLE(cc_feature
),
1395 ADD_TABLE(cc_feature_comp
),
1397 ADD_TABLE(install_exec_seq
),
1398 ADD_TABLE(cc3_media
),
1399 ADD_TABLE(property
),
1402 static const msi_table co_tables
[] =
1404 ADD_TABLE(cc_component
),
1405 ADD_TABLE(directory
),
1406 ADD_TABLE(cc_feature
),
1407 ADD_TABLE(cc_feature_comp
),
1409 ADD_TABLE(install_exec_seq
),
1410 ADD_TABLE(co_media
),
1411 ADD_TABLE(property
),
1414 static const msi_table co2_tables
[] =
1416 ADD_TABLE(cc_component
),
1417 ADD_TABLE(directory
),
1418 ADD_TABLE(cc_feature
),
1419 ADD_TABLE(cc_feature_comp
),
1421 ADD_TABLE(install_exec_seq
),
1422 ADD_TABLE(co2_media
),
1423 ADD_TABLE(property
),
1426 static const msi_table mm_tables
[] =
1428 ADD_TABLE(cc_component
),
1429 ADD_TABLE(directory
),
1430 ADD_TABLE(cc_feature
),
1431 ADD_TABLE(cc_feature_comp
),
1433 ADD_TABLE(install_exec_seq
),
1434 ADD_TABLE(mm_media
),
1435 ADD_TABLE(property
),
1438 static const msi_table ss_tables
[] =
1440 ADD_TABLE(cc_component
),
1441 ADD_TABLE(directory
),
1442 ADD_TABLE(cc_feature
),
1443 ADD_TABLE(cc_feature_comp
),
1445 ADD_TABLE(install_exec_seq
),
1446 ADD_TABLE(ss_media
),
1447 ADD_TABLE(property
),
1450 static const msi_table ui_tables
[] =
1452 ADD_TABLE(ui_component
),
1453 ADD_TABLE(directory
),
1454 ADD_TABLE(cc_feature
),
1455 ADD_TABLE(cc_feature_comp
),
1457 ADD_TABLE(install_exec_seq
),
1458 ADD_TABLE(ui_install_ui_seq
),
1459 ADD_TABLE(ui_custom_action
),
1460 ADD_TABLE(cc_media
),
1461 ADD_TABLE(property
),
1464 static const msi_table rof_tables
[] =
1466 ADD_TABLE(rof_component
),
1467 ADD_TABLE(directory
),
1468 ADD_TABLE(rof_feature
),
1469 ADD_TABLE(rof_feature_comp
),
1470 ADD_TABLE(rof_file
),
1471 ADD_TABLE(install_exec_seq
),
1472 ADD_TABLE(rof_media
),
1473 ADD_TABLE(property
),
1476 static const msi_table rofc_tables
[] =
1478 ADD_TABLE(rof_component
),
1479 ADD_TABLE(directory
),
1480 ADD_TABLE(rof_feature
),
1481 ADD_TABLE(rof_feature_comp
),
1482 ADD_TABLE(rofc_file
),
1483 ADD_TABLE(install_exec_seq
),
1484 ADD_TABLE(rofc_media
),
1485 ADD_TABLE(property
),
1488 static const msi_table sdp_tables
[] =
1490 ADD_TABLE(rof_component
),
1491 ADD_TABLE(directory
),
1492 ADD_TABLE(rof_feature
),
1493 ADD_TABLE(rof_feature_comp
),
1494 ADD_TABLE(rof_file
),
1495 ADD_TABLE(sdp_install_exec_seq
),
1496 ADD_TABLE(sdp_custom_action
),
1497 ADD_TABLE(rof_media
),
1498 ADD_TABLE(property
),
1501 static const msi_table cie_tables
[] =
1503 ADD_TABLE(cie_component
),
1504 ADD_TABLE(directory
),
1505 ADD_TABLE(cc_feature
),
1506 ADD_TABLE(cie_feature_comp
),
1507 ADD_TABLE(cie_file
),
1508 ADD_TABLE(install_exec_seq
),
1509 ADD_TABLE(cie_media
),
1510 ADD_TABLE(property
),
1513 static const msi_table tp_tables
[] =
1515 ADD_TABLE(tp_component
),
1516 ADD_TABLE(directory
),
1517 ADD_TABLE(rof_feature
),
1518 ADD_TABLE(ci2_feature_comp
),
1519 ADD_TABLE(ci2_file
),
1520 ADD_TABLE(install_exec_seq
),
1521 ADD_TABLE(rof_media
),
1522 ADD_TABLE(property
),
1525 static const msi_table cwd_tables
[] =
1527 ADD_TABLE(cwd_component
),
1528 ADD_TABLE(directory
),
1529 ADD_TABLE(rof_feature
),
1530 ADD_TABLE(ci2_feature_comp
),
1531 ADD_TABLE(ci2_file
),
1532 ADD_TABLE(install_exec_seq
),
1533 ADD_TABLE(rof_media
),
1534 ADD_TABLE(property
),
1537 static const msi_table adm_tables
[] =
1539 ADD_TABLE(adm_component
),
1540 ADD_TABLE(directory
),
1541 ADD_TABLE(rof_feature
),
1542 ADD_TABLE(ci2_feature_comp
),
1543 ADD_TABLE(ci2_file
),
1544 ADD_TABLE(install_exec_seq
),
1545 ADD_TABLE(rof_media
),
1546 ADD_TABLE(property
),
1547 ADD_TABLE(adm_custom_action
),
1548 ADD_TABLE(adm_admin_exec_seq
),
1551 static const msi_table amp_tables
[] =
1553 ADD_TABLE(amp_component
),
1554 ADD_TABLE(directory
),
1555 ADD_TABLE(rof_feature
),
1556 ADD_TABLE(ci2_feature_comp
),
1557 ADD_TABLE(ci2_file
),
1558 ADD_TABLE(install_exec_seq
),
1559 ADD_TABLE(rof_media
),
1560 ADD_TABLE(property
),
1563 static const msi_table mc_tables
[] =
1565 ADD_TABLE(mc_component
),
1566 ADD_TABLE(directory
),
1567 ADD_TABLE(cc_feature
),
1568 ADD_TABLE(cie_feature_comp
),
1570 ADD_TABLE(install_exec_seq
),
1571 ADD_TABLE(mc_media
),
1572 ADD_TABLE(property
),
1573 ADD_TABLE(mc_file_hash
),
1576 static const msi_table sf_tables
[] =
1578 ADD_TABLE(wrv_component
),
1579 ADD_TABLE(directory
),
1580 ADD_TABLE(rof_feature
),
1581 ADD_TABLE(ci2_feature_comp
),
1582 ADD_TABLE(ci2_file
),
1583 ADD_TABLE(install_exec_seq
),
1584 ADD_TABLE(rof_media
),
1585 ADD_TABLE(property
),
1588 static const msi_table ca51_tables
[] =
1590 ADD_TABLE(ca51_component
),
1591 ADD_TABLE(directory
),
1592 ADD_TABLE(rof_feature
),
1593 ADD_TABLE(ci2_feature_comp
),
1594 ADD_TABLE(ci2_file
),
1595 ADD_TABLE(ca51_install_exec_seq
),
1596 ADD_TABLE(rof_media
),
1597 ADD_TABLE(property
),
1598 ADD_TABLE(ca51_custom_action
),
1601 static const msi_table is_tables
[] =
1603 ADD_TABLE(is_component
),
1604 ADD_TABLE(directory
),
1605 ADD_TABLE(is_feature
),
1606 ADD_TABLE(is_feature_comp
),
1608 ADD_TABLE(install_exec_seq
),
1609 ADD_TABLE(is_media
),
1610 ADD_TABLE(property
),
1613 static const msi_table sp_tables
[] =
1615 ADD_TABLE(sp_component
),
1616 ADD_TABLE(sp_directory
),
1617 ADD_TABLE(rof_feature
),
1618 ADD_TABLE(ci2_feature_comp
),
1619 ADD_TABLE(ci2_file
),
1620 ADD_TABLE(install_exec_seq
),
1621 ADD_TABLE(rof_media
),
1622 ADD_TABLE(property
),
1625 static const msi_table mcp_tables
[] =
1627 ADD_TABLE(mcp_component
),
1628 ADD_TABLE(directory
),
1629 ADD_TABLE(mcp_feature
),
1630 ADD_TABLE(mcp_feature_comp
),
1631 ADD_TABLE(mcp_file
),
1632 ADD_TABLE(rem_install_exec_seq
),
1633 ADD_TABLE(rof_media
),
1634 ADD_TABLE(property
),
1637 static const msi_table ai_tables
[] =
1639 ADD_TABLE(component
),
1640 ADD_TABLE(directory
),
1642 ADD_TABLE(feature_comp
),
1644 ADD_TABLE(install_exec_seq
),
1649 static const msi_table pc_tables
[] =
1651 ADD_TABLE(ca51_component
),
1652 ADD_TABLE(directory
),
1653 ADD_TABLE(rof_feature
),
1654 ADD_TABLE(ci2_feature_comp
),
1655 ADD_TABLE(ci2_file
),
1656 ADD_TABLE(install_exec_seq
),
1657 ADD_TABLE(rof_media
),
1661 static const msi_table ip_tables
[] =
1663 ADD_TABLE(component
),
1664 ADD_TABLE(directory
),
1666 ADD_TABLE(feature_comp
),
1668 ADD_TABLE(ip_install_exec_seq
),
1669 ADD_TABLE(ip_custom_action
),
1674 static const msi_table aup_tables
[] =
1676 ADD_TABLE(component
),
1677 ADD_TABLE(directory
),
1679 ADD_TABLE(feature_comp
),
1681 ADD_TABLE(aup_install_exec_seq
),
1682 ADD_TABLE(aup_custom_action
),
1687 static const msi_table aup2_tables
[] =
1689 ADD_TABLE(component
),
1690 ADD_TABLE(directory
),
1692 ADD_TABLE(feature_comp
),
1694 ADD_TABLE(aup2_install_exec_seq
),
1695 ADD_TABLE(aup_custom_action
),
1697 ADD_TABLE(aup_property
)
1700 static const msi_table aup3_tables
[] =
1702 ADD_TABLE(component
),
1703 ADD_TABLE(directory
),
1705 ADD_TABLE(feature_comp
),
1707 ADD_TABLE(aup2_install_exec_seq
),
1708 ADD_TABLE(aup_custom_action
),
1710 ADD_TABLE(aup2_property
)
1713 static const msi_table aup4_tables
[] =
1715 ADD_TABLE(component
),
1716 ADD_TABLE(directory
),
1718 ADD_TABLE(feature_comp
),
1720 ADD_TABLE(aup3_install_exec_seq
),
1721 ADD_TABLE(aup_custom_action
),
1723 ADD_TABLE(aup2_property
)
1726 static const msi_table fiu_tables
[] =
1728 ADD_TABLE(rof_component
),
1729 ADD_TABLE(directory
),
1730 ADD_TABLE(rof_feature
),
1731 ADD_TABLE(rof_feature_comp
),
1732 ADD_TABLE(rof_file
),
1733 ADD_TABLE(pp_install_exec_seq
),
1734 ADD_TABLE(rof_media
),
1735 ADD_TABLE(property
),
1738 static const msi_table fiuc_tables
[] =
1740 ADD_TABLE(rof_component
),
1741 ADD_TABLE(directory
),
1742 ADD_TABLE(rof_feature
),
1743 ADD_TABLE(rof_feature_comp
),
1744 ADD_TABLE(rofc_file
),
1745 ADD_TABLE(pp_install_exec_seq
),
1746 ADD_TABLE(rofc_media
),
1747 ADD_TABLE(property
),
1750 static const msi_table fo_tables
[] =
1752 ADD_TABLE(directory
),
1754 ADD_TABLE(fo_component
),
1755 ADD_TABLE(fo_feature
),
1756 ADD_TABLE(fo_condition
),
1757 ADD_TABLE(fo_feature_comp
),
1758 ADD_TABLE(fo_custom_action
),
1759 ADD_TABLE(fo_install_exec_seq
),
1764 static const msi_table icon_base_tables
[] =
1766 ADD_TABLE(ci_component
),
1767 ADD_TABLE(directory
),
1768 ADD_TABLE(rof_feature
),
1769 ADD_TABLE(rof_feature_comp
),
1770 ADD_TABLE(rof_file
),
1771 ADD_TABLE(pp_install_exec_seq
),
1772 ADD_TABLE(rof_media
),
1773 ADD_TABLE(icon_property
),
1776 static const msi_table pv_tables
[] =
1778 ADD_TABLE(rof_component
),
1779 ADD_TABLE(directory
),
1780 ADD_TABLE(rof_feature
),
1781 ADD_TABLE(rof_feature_comp
),
1782 ADD_TABLE(rof_file
),
1783 ADD_TABLE(pv_install_exec_seq
),
1784 ADD_TABLE(rof_media
),
1788 static const msi_table uc_tables
[] =
1790 ADD_TABLE(directory
),
1791 ADD_TABLE(uc_component
),
1792 ADD_TABLE(uc_feature
),
1793 ADD_TABLE(uc_feature_comp
),
1795 ADD_TABLE(uc_install_exec_seq
),
1797 ADD_TABLE(uc_property
)
1800 static const msi_table mixed_tables
[] =
1802 ADD_TABLE(directory
),
1803 ADD_TABLE(mixed_component
),
1804 ADD_TABLE(mixed_feature
),
1805 ADD_TABLE(mixed_feature_comp
),
1806 ADD_TABLE(mixed_install_exec_seq
),
1807 ADD_TABLE(mixed_registry
),
1812 static const msi_table vp_tables
[] =
1814 ADD_TABLE(directory
),
1816 ADD_TABLE(vp_component
),
1817 ADD_TABLE(vp_feature
),
1818 ADD_TABLE(vp_feature_comp
),
1819 ADD_TABLE(vp_custom_action
),
1820 ADD_TABLE(vp_install_exec_seq
),
1825 static const msi_table shc_tables
[] =
1828 ADD_TABLE(directory
),
1829 ADD_TABLE(shc_file
),
1830 ADD_TABLE(shc_component
),
1831 ADD_TABLE(shc_feature
),
1832 ADD_TABLE(shc_feature_comp
),
1833 ADD_TABLE(shc_custom_action
),
1834 ADD_TABLE(shc_install_exec_seq
),
1835 ADD_TABLE(shc_property
)
1838 static const msi_table shc2_tables
[] =
1841 ADD_TABLE(directory
),
1842 ADD_TABLE(shc_file
),
1843 ADD_TABLE(shc_component
),
1844 ADD_TABLE(shc_feature
),
1845 ADD_TABLE(shc_feature_comp
),
1846 ADD_TABLE(shc_custom_action
),
1847 ADD_TABLE(shc_install_exec_seq
),
1848 ADD_TABLE(shc2_property
)
1851 /* cabinet definitions */
1853 /* make the max size large so there is only one cab file */
1854 #define MEDIA_SIZE 0x7FFFFFFF
1855 #define FOLDER_THRESHOLD 900000
1857 /* the FCI callbacks */
1859 static void * CDECL
mem_alloc(ULONG cb
)
1861 return HeapAlloc(GetProcessHeap(), 0, cb
);
1864 static void CDECL
mem_free(void *memory
)
1866 HeapFree(GetProcessHeap(), 0, memory
);
1869 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
1871 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
1875 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
1880 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
1881 BOOL fContinuation
, void *pv
)
1886 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
1890 DWORD dwShareMode
= 0;
1891 DWORD dwCreateDisposition
= OPEN_EXISTING
;
1893 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
1894 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1895 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
1897 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
1898 dwCreateDisposition
= OPEN_EXISTING
;
1900 dwCreateDisposition
= CREATE_NEW
;
1902 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
1903 dwCreateDisposition
, 0, NULL
);
1905 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
1907 return (INT_PTR
)handle
;
1910 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1912 HANDLE handle
= (HANDLE
)hf
;
1916 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
1917 ok(res
, "Failed to ReadFile\n");
1922 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1924 HANDLE handle
= (HANDLE
)hf
;
1928 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
1929 ok(res
, "Failed to WriteFile\n");
1934 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
1936 HANDLE handle
= (HANDLE
)hf
;
1937 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
1942 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
1944 HANDLE handle
= (HANDLE
)hf
;
1947 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
1948 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
1953 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
1955 BOOL ret
= DeleteFileA(pszFile
);
1956 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
1961 static void init_functionpointers(void)
1963 HMODULE hmsi
= GetModuleHandleA("msi.dll");
1964 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
1965 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
1967 #define GET_PROC(mod, func) \
1968 p ## func = (void*)GetProcAddress(mod, #func); \
1970 trace("GetProcAddress(%s) failed\n", #func);
1972 GET_PROC(hmsi
, MsiQueryComponentStateA
);
1973 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
1974 GET_PROC(hmsi
, MsiGetComponentPathExA
);
1976 GET_PROC(hadvapi32
, CheckTokenMembership
);
1977 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
1978 GET_PROC(hadvapi32
, OpenProcessToken
);
1979 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
1980 GET_PROC(hkernel32
, IsWow64Process
)
1982 hsrclient
= LoadLibraryA("srclient.dll");
1983 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
1984 GET_PROC(hsrclient
, SRSetRestorePointA
);
1989 static BOOL
is_process_limited(void)
1991 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
1996 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
1998 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
1999 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0, &Group
) ||
2000 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2002 trace("Could not check if the current user is an administrator\n");
2010 /* Only administrators have enough privileges for these tests */
2014 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2017 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2020 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2022 return (ret
&& type
== TokenElevationTypeLimited
);
2027 static BOOL
check_record(MSIHANDLE rec
, UINT field
, LPCSTR val
)
2034 r
= MsiRecordGetStringA(rec
, field
, buffer
, &sz
);
2035 return (r
== ERROR_SUCCESS
) && !strcmp(val
, buffer
);
2038 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2042 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2043 GetTempFileNameA(".", "xx", 0, tempname
);
2045 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2047 lstrcpyA(pszTempName
, tempname
);
2048 HeapFree(GetProcessHeap(), 0, tempname
);
2052 HeapFree(GetProcessHeap(), 0, tempname
);
2057 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2058 USHORT
*pattribs
, int *err
, void *pv
)
2060 BY_HANDLE_FILE_INFORMATION finfo
;
2066 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2067 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2069 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2071 res
= GetFileInformationByHandle(handle
, &finfo
);
2072 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2074 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2075 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2077 attrs
= GetFileAttributesA(pszName
);
2078 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2080 return (INT_PTR
)handle
;
2083 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2085 char path
[MAX_PATH
];
2086 char filename
[MAX_PATH
];
2088 lstrcpyA(path
, CURR_DIR
);
2089 lstrcatA(path
, "\\");
2090 lstrcatA(path
, file
);
2092 lstrcpyA(filename
, file
);
2094 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2095 progress
, get_open_info
, compress
);
2098 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2100 ZeroMemory(pCabParams
, sizeof(CCAB
));
2102 pCabParams
->cb
= max_size
;
2103 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2104 pCabParams
->setID
= 0xbeef;
2105 pCabParams
->iCab
= 1;
2106 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2107 lstrcatA(pCabParams
->szCabPath
, "\\");
2108 lstrcpyA(pCabParams
->szCab
, name
);
2111 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2119 set_cab_parameters(&cabParams
, name
, max_size
);
2121 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2122 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2123 get_temp_file
, &cabParams
, NULL
);
2125 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2130 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2131 ok(res
, "Failed to add file: %s\n", ptr
);
2132 ptr
+= lstrlenA(ptr
) + 1;
2135 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2136 ok(res
, "Failed to flush the cabinet\n");
2138 res
= FCIDestroy(hfci
);
2139 ok(res
, "Failed to destroy the cabinet\n");
2142 static BOOL
get_user_dirs(void)
2147 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2148 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2152 if(RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
)){
2161 static BOOL
get_system_dirs(void)
2166 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2170 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2171 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
)) {
2177 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2178 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
)) {
2184 if (RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR_NATIVE
, &size
)) {
2191 if(!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2197 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2202 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2203 if (file
== INVALID_HANDLE_VALUE
)
2206 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2210 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2217 #define create_file(name, size) create_file_data(name, name, size)
2219 static void create_test_files(void)
2221 CreateDirectoryA("msitest", NULL
);
2222 create_file("msitest\\one.txt", 100);
2223 CreateDirectoryA("msitest\\first", NULL
);
2224 create_file("msitest\\first\\two.txt", 100);
2225 CreateDirectoryA("msitest\\second", NULL
);
2226 create_file("msitest\\second\\three.txt", 100);
2228 create_file("four.txt", 100);
2229 create_file("five.txt", 100);
2230 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2232 create_file("msitest\\filename", 100);
2233 create_file("msitest\\service.exe", 100);
2235 DeleteFileA("four.txt");
2236 DeleteFileA("five.txt");
2239 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2241 CHAR path
[MAX_PATH
];
2243 lstrcpyA(path
, PROG_FILES_DIR
);
2244 lstrcatA(path
, "\\");
2245 lstrcatA(path
, rel_path
);
2248 return DeleteFileA(path
);
2250 return RemoveDirectoryA(path
);
2253 static BOOL
delete_pf_native(const CHAR
*rel_path
, BOOL is_file
)
2255 CHAR path
[MAX_PATH
];
2257 lstrcpyA(path
, PROG_FILES_DIR_NATIVE
);
2258 lstrcatA(path
, "\\");
2259 lstrcatA(path
, rel_path
);
2262 return DeleteFileA(path
);
2264 return RemoveDirectoryA(path
);
2267 static BOOL
delete_cf(const CHAR
*rel_path
, BOOL is_file
)
2269 CHAR path
[MAX_PATH
];
2271 lstrcpyA(path
, COMMON_FILES_DIR
);
2272 lstrcatA(path
, "\\");
2273 lstrcatA(path
, rel_path
);
2276 return DeleteFileA(path
);
2278 return RemoveDirectoryA(path
);
2281 static BOOL
compare_pf_data(const char *filename
, const char *data
, DWORD size
)
2286 char *buffer
, path
[MAX_PATH
];
2288 lstrcpyA(path
, PROG_FILES_DIR
);
2289 lstrcatA(path
, "\\");
2290 lstrcatA(path
, filename
);
2292 handle
= CreateFileA(path
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2293 buffer
= HeapAlloc(GetProcessHeap(), 0, size
);
2296 ReadFile(handle
, buffer
, size
, &read
, NULL
);
2297 if (read
== size
&& !memcmp(data
, buffer
, size
)) ret
= TRUE
;
2298 HeapFree(GetProcessHeap(), 0, buffer
);
2300 CloseHandle(handle
);
2304 static void delete_test_files(void)
2306 DeleteFileA("msitest.msi");
2307 DeleteFileA("msitest.cab");
2308 DeleteFileA("msitest\\second\\three.txt");
2309 DeleteFileA("msitest\\first\\two.txt");
2310 DeleteFileA("msitest\\one.txt");
2311 DeleteFileA("msitest\\service.exe");
2312 DeleteFileA("msitest\\filename");
2313 RemoveDirectoryA("msitest\\second");
2314 RemoveDirectoryA("msitest\\first");
2315 RemoveDirectoryA("msitest");
2318 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2322 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
,
2323 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2324 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2328 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
,
2329 const char *template, const char *packagecode
)
2334 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2335 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2337 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2338 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2340 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
, packagecode
);
2341 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2343 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2344 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2346 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2347 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2349 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2350 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2352 /* write the summary changes back to the stream */
2353 r
= MsiSummaryInfoPersist(summary
);
2354 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2356 MsiCloseHandle(summary
);
2359 #define create_database(name, tables, num_tables) \
2360 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033", \
2361 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2363 #define create_database_template(name, tables, num_tables, version, template) \
2364 create_database_wordcount(name, tables, num_tables, version, 0, template, \
2365 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2367 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2368 int num_tables
, INT version
, INT wordcount
,
2369 const char *template, const char *packagecode
)
2376 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2377 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2378 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2380 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2381 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2383 /* import the tables into the database */
2384 for (j
= 0; j
< num_tables
; j
++)
2386 const msi_table
*table
= &tables
[j
];
2388 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2390 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2393 DeleteFileA(table
->filename
);
2396 write_msi_summary_info(db
, version
, wordcount
, template, packagecode
);
2398 r
= MsiDatabaseCommit(db
);
2399 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2402 HeapFree( GetProcessHeap(), 0, nameW
);
2405 static void check_service_is_installed(void)
2407 SC_HANDLE scm
, service
;
2410 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
2411 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
2413 service
= OpenServiceA(scm
, "TestService", SC_MANAGER_ALL_ACCESS
);
2414 ok(service
!= NULL
, "Failed to open TestService\n");
2416 res
= DeleteService(service
);
2417 ok(res
, "Failed to delete TestService\n");
2419 CloseServiceHandle(service
);
2420 CloseServiceHandle(scm
);
2423 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2425 RESTOREPOINTINFOA spec
;
2427 spec
.dwEventType
= event_type
;
2428 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2429 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2430 lstrcpyA(spec
.szDescription
, "msitest restore point");
2432 return pSRSetRestorePointA(&spec
, status
);
2435 static void remove_restore_point(DWORD seq_number
)
2439 res
= pSRRemoveRestorePoint(seq_number
);
2440 if (res
!= ERROR_SUCCESS
)
2441 trace("Failed to remove the restore point : %08x\n", res
);
2444 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2446 if (pRegDeleteKeyExA
)
2447 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2448 return RegDeleteKeyA( key
, subkey
);
2451 static void test_MsiInstallProduct(void)
2454 CHAR path
[MAX_PATH
];
2457 DWORD num
, size
, type
;
2458 REGSAM access
= KEY_ALL_ACCESS
;
2460 if (is_process_limited())
2462 skip("process is limited\n");
2467 access
|= KEY_WOW64_64KEY
;
2469 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2471 /* szPackagePath is NULL */
2472 r
= MsiInstallProductA(NULL
, "INSTALL=ALL");
2473 ok(r
== ERROR_INVALID_PARAMETER
,
2474 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2476 /* both szPackagePath and szCommandLine are NULL */
2477 r
= MsiInstallProductA(NULL
, NULL
);
2478 ok(r
== ERROR_INVALID_PARAMETER
,
2479 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2481 /* szPackagePath is empty */
2482 r
= MsiInstallProductA("", "INSTALL=ALL");
2483 ok(r
== ERROR_PATH_NOT_FOUND
,
2484 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r
);
2486 create_test_files();
2487 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2489 /* install, don't publish */
2490 r
= MsiInstallProductA(msifile
, NULL
);
2491 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2493 skip("Not enough rights to perform tests\n");
2496 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2498 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2499 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2500 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2501 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2502 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2503 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2504 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2505 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2506 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2507 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2508 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2509 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2511 res
= RegOpenKeyExA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", 0, access
, &hkey
);
2512 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2516 res
= RegQueryValueExA(hkey
, "Name", NULL
, &type
, (LPBYTE
)path
, &size
);
2517 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2518 ok(!lstrcmpA(path
, "imaname"), "Expected imaname, got %s\n", path
);
2522 res
= RegQueryValueExA(hkey
, "blah", NULL
, &type
, (LPBYTE
)path
, &size
);
2523 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2527 res
= RegQueryValueExA(hkey
, "number", NULL
, &type
, (LPBYTE
)&num
, &size
);
2528 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2529 ok(num
== 314, "Expected 314, got %d\n", num
);
2533 res
= RegQueryValueExA(hkey
, "OrderTestName", NULL
, &type
, (LPBYTE
)path
, &size
);
2534 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2535 ok(!lstrcmpA(path
, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path
);
2537 check_service_is_installed();
2539 delete_key(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", access
);
2541 /* not published, reinstall */
2542 r
= MsiInstallProductA(msifile
, NULL
);
2543 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2545 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2546 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2547 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2548 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2549 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2550 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2551 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2552 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2553 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2554 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2555 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2556 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2558 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2559 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2560 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2562 create_database(msifile
, up_tables
, sizeof(up_tables
) / sizeof(msi_table
));
2564 /* not published, RemovePreviousVersions set */
2565 r
= MsiInstallProductA(msifile
, NULL
);
2566 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2568 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2569 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2570 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2571 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2572 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2573 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2574 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2575 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2576 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2577 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2578 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2579 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2581 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2582 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2583 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2585 create_database(msifile
, up2_tables
, sizeof(up2_tables
) / sizeof(msi_table
));
2587 /* not published, version number bumped */
2588 r
= MsiInstallProductA(msifile
, NULL
);
2589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2591 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2592 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2593 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2594 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2595 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2596 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2597 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2598 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2599 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2600 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2601 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2602 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2604 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2605 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2606 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2608 create_database(msifile
, up3_tables
, sizeof(up3_tables
) / sizeof(msi_table
));
2610 /* not published, RemovePreviousVersions set and version number bumped */
2611 r
= MsiInstallProductA(msifile
, NULL
);
2612 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2614 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2615 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2616 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2617 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2618 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2619 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2620 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2621 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2622 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2623 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2624 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2625 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2627 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2628 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2629 RegDeleteKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest");
2631 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2633 /* install, publish product */
2634 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
2635 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2637 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2638 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2639 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2640 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2641 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2642 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2643 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2644 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2645 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2646 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2647 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2648 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2650 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2651 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2653 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2655 /* published, reinstall */
2656 r
= MsiInstallProductA(msifile
, NULL
);
2657 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2659 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2660 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2661 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2662 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2663 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2664 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2665 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2666 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2667 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2668 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2669 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2670 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2672 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2673 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2675 create_database(msifile
, up5_tables
, sizeof(up5_tables
) / sizeof(msi_table
));
2677 /* published product, RemovePreviousVersions set */
2678 r
= MsiInstallProductA(msifile
, NULL
);
2679 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2681 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2682 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2683 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2684 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2685 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2686 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2687 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2688 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2689 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2690 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2691 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2692 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2694 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2695 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2697 create_database(msifile
, up6_tables
, sizeof(up6_tables
) / sizeof(msi_table
));
2699 /* published product, version number bumped */
2700 r
= MsiInstallProductA(msifile
, NULL
);
2701 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2703 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2704 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2705 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2706 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2707 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2708 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2709 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2710 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2711 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2712 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2713 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2714 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2716 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2717 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2719 create_database(msifile
, up7_tables
, sizeof(up7_tables
) / sizeof(msi_table
));
2721 /* published product, RemovePreviousVersions set and version number bumped */
2722 r
= MsiInstallProductA(msifile
, NULL
);
2723 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2725 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2726 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
2727 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2728 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
2729 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2730 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
2731 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2732 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
2733 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2734 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2735 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2736 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2738 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "SOFTWARE\\Wine\\msitest", &hkey
);
2739 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2741 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
2742 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2745 delete_test_files();
2746 DeleteFileA(msifile
);
2749 static void test_MsiSetComponentState(void)
2751 INSTALLSTATE installed
, action
;
2753 char path
[MAX_PATH
];
2756 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2760 lstrcpyA(path
, CURR_DIR
);
2761 lstrcatA(path
, "\\");
2762 lstrcatA(path
, msifile
);
2764 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2766 r
= MsiOpenPackageA(path
, &package
);
2767 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2769 skip("Not enough rights to perform tests\n");
2772 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2774 r
= MsiDoActionA(package
, "CostInitialize");
2775 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2777 r
= MsiDoActionA(package
, "FileCost");
2778 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2780 r
= MsiDoActionA(package
, "CostFinalize");
2781 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2783 r
= MsiGetComponentStateA(package
, "dangler", &installed
, &action
);
2784 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2785 ok(installed
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", installed
);
2786 ok(action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2788 r
= MsiSetComponentStateA(package
, "dangler", INSTALLSTATE_SOURCE
);
2789 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2791 MsiCloseHandle(package
);
2795 DeleteFileA(msifile
);
2798 static void test_packagecoltypes(void)
2800 MSIHANDLE hdb
, view
, rec
;
2801 char path
[MAX_PATH
];
2802 WCHAR pathW
[MAX_PATH
];
2806 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2810 lstrcpyA(path
, CURR_DIR
);
2811 lstrcatA(path
, "\\");
2812 lstrcatA(path
, msifile
);
2813 MultiByteToWideChar( CP_ACP
, 0, path
, -1, pathW
, MAX_PATH
);
2815 r
= MsiOpenDatabaseW(pathW
, MSIDBOPEN_READONLY
, &hdb
);
2816 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2818 query
= "SELECT * FROM `Media`";
2819 r
= MsiDatabaseOpenViewA( hdb
, query
, &view
);
2820 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2822 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_NAMES
, &rec
);
2823 count
= MsiRecordGetFieldCount( rec
);
2824 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2825 ok(count
== 6, "Expected 6, got %d\n", count
);
2826 ok(check_record(rec
, 1, "DiskId"), "wrong column label\n");
2827 ok(check_record(rec
, 2, "LastSequence"), "wrong column label\n");
2828 ok(check_record(rec
, 3, "DiskPrompt"), "wrong column label\n");
2829 ok(check_record(rec
, 4, "Cabinet"), "wrong column label\n");
2830 ok(check_record(rec
, 5, "VolumeLabel"), "wrong column label\n");
2831 ok(check_record(rec
, 6, "Source"), "wrong column label\n");
2832 MsiCloseHandle(rec
);
2834 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_TYPES
, &rec
);