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>
34 #include "wine/test.h"
36 static UINT (WINAPI
*pMsiQueryComponentStateA
)
37 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
38 static UINT (WINAPI
*pMsiSetExternalUIRecord
)
39 (INSTALLUI_HANDLER_RECORD
, DWORD
, LPVOID
, PINSTALLUI_HANDLER_RECORD
);
40 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
41 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
42 static UINT (WINAPI
*pMsiSourceListGetInfoA
)
43 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, LPCSTR
, LPSTR
, LPDWORD
);
45 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
47 static HMODULE hsrclient
= 0;
48 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
49 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
51 static BOOL on_win9x
= FALSE
;
53 static const char *msifile
= "msitest.msi";
54 static const char *msifile2
= "winetest2.msi";
55 static const char *mstfile
= "winetest.mst";
56 static CHAR CURR_DIR
[MAX_PATH
];
57 static CHAR PROG_FILES_DIR
[MAX_PATH
];
58 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
60 /* msi database data */
62 static const CHAR component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
63 "s72\tS38\ts72\ti2\tS255\tS72\n"
64 "Component\tComponent\n"
65 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
66 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
67 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
68 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
69 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
70 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
71 "component\t\tMSITESTDIR\t0\t1\tfile\n"
72 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
74 static const CHAR directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
76 "Directory\tDirectory\n"
77 "CABOUTDIR\tMSITESTDIR\tcabout\n"
78 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
79 "FIRSTDIR\tMSITESTDIR\tfirst\n"
80 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
81 "NEWDIR\tCABOUTDIR\tnew\n"
82 "ProgramFilesFolder\tTARGETDIR\t.\n"
83 "TARGETDIR\t\tSourceDir";
85 static const CHAR feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
86 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
88 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
89 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
90 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
91 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
92 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
93 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
94 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
96 static const CHAR feature_comp_dat
[] = "Feature_\tComponent_\n"
98 "FeatureComponents\tFeature_\tComponent_\n"
104 "feature\tcomponent\n"
105 "service_feature\tservice_comp\n";
107 static const CHAR file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
108 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
110 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
111 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
112 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
113 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
114 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
115 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
116 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
118 static const CHAR install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
120 "InstallExecuteSequence\tAction\n"
121 "AllocateRegistrySpace\tNOT Installed\t1550\n"
122 "CostFinalize\t\t1000\n"
123 "CostInitialize\t\t800\n"
125 "ResolveSource\t\t950\n"
126 "MoveFiles\t\t1700\n"
127 "InstallFiles\t\t4000\n"
128 "DuplicateFiles\t\t4500\n"
129 "WriteEnvironmentStrings\t\t4550\n"
130 "CreateShortcuts\t\t4600\n"
131 "InstallServices\t\t5000\n"
132 "InstallFinalize\t\t6600\n"
133 "InstallInitialize\t\t1500\n"
134 "InstallValidate\t\t1400\n"
135 "LaunchConditions\t\t100\n"
136 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
138 static const CHAR media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
139 "i2\ti4\tL64\tS255\tS32\tS72\n"
141 "1\t3\t\t\tDISK1\t\n"
142 "2\t5\t\tmsitest.cab\tDISK2\t\n";
144 static const CHAR property_dat
[] = "Property\tValue\n"
146 "Property\tProperty\n"
147 "DefaultUIFont\tDlgFont8\n"
150 "InstallMode\tTypical\n"
151 "Manufacturer\tWine\n"
152 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
153 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
155 "ProductLanguage\t1033\n"
156 "ProductName\tMSITEST\n"
157 "ProductVersion\t1.1.1\n"
158 "PROMPTROLLBACKCOST\tP\n"
160 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
161 "AdminProperties\tPOSTADMIN\n"
163 "SERVNAME\tTestService\n"
164 "SERVDISP\tTestServiceDisp\n";
166 static const CHAR shortcut_dat
[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
167 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
168 "Shortcut\tShortcut\n"
169 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
171 static const CHAR environment_dat
[] = "Environment\tName\tValue\tComponent_\n"
172 "s72\tl255\tL255\ts72\n"
173 "Environment\tEnvironment\n"
174 "Var1\t=-MSITESTVAR1\t1\tOne\n"
175 "Var2\tMSITESTVAR2\t1\tOne\n"
176 "Var3\t=-MSITESTVAR3\t1\tOne\n"
177 "Var4\tMSITESTVAR4\t1\tOne\n"
178 "Var5\t-MSITESTVAR5\t\tOne\n"
179 "Var6\tMSITESTVAR6\t\tOne\n"
180 "Var7\t!-MSITESTVAR7\t\tOne\n"
181 "Var8\t!-*MSITESTVAR8\t\tOne\n"
182 "Var9\t=-MSITESTVAR9\t\tOne\n"
183 "Var10\t=MSITESTVAR10\t\tOne\n";
185 static const CHAR condition_dat
[] = "Feature_\tLevel\tCondition\n"
187 "Condition\tFeature_\tLevel\n"
190 static const CHAR up_property_dat
[] = "Property\tValue\n"
192 "Property\tProperty\n"
193 "DefaultUIFont\tDlgFont8\n"
196 "InstallMode\tTypical\n"
197 "Manufacturer\tWine\n"
198 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
199 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
201 "ProductLanguage\t1033\n"
202 "ProductName\tMSITEST\n"
203 "ProductVersion\t1.1.1\n"
204 "PROMPTROLLBACKCOST\tP\n"
206 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
207 "AdminProperties\tPOSTADMIN\n"
209 "SERVNAME\tTestService\n"
210 "SERVDISP\tTestServiceDisp\n"
211 "RemovePreviousVersions\t1\n";
213 static const CHAR up2_property_dat
[] = "Property\tValue\n"
215 "Property\tProperty\n"
216 "DefaultUIFont\tDlgFont8\n"
219 "InstallMode\tTypical\n"
220 "Manufacturer\tWine\n"
221 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
222 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
224 "ProductLanguage\t1033\n"
225 "ProductName\tMSITEST\n"
226 "ProductVersion\t1.1.2\n"
227 "PROMPTROLLBACKCOST\tP\n"
229 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
230 "AdminProperties\tPOSTADMIN\n"
232 "SERVNAME\tTestService\n"
233 "SERVDISP\tTestServiceDisp\n";
235 static const CHAR up3_property_dat
[] = "Property\tValue\n"
237 "Property\tProperty\n"
238 "DefaultUIFont\tDlgFont8\n"
241 "InstallMode\tTypical\n"
242 "Manufacturer\tWine\n"
243 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
244 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
246 "ProductLanguage\t1033\n"
247 "ProductName\tMSITEST\n"
248 "ProductVersion\t1.1.2\n"
249 "PROMPTROLLBACKCOST\tP\n"
251 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
252 "AdminProperties\tPOSTADMIN\n"
254 "SERVNAME\tTestService\n"
255 "SERVDISP\tTestServiceDisp\n"
256 "RemovePreviousVersions\t1\n";
258 static const CHAR registry_dat
[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
259 "s72\ti2\tl255\tL255\tL0\ts72\n"
260 "Registry\tRegistry\n"
261 "Apples\t2\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
262 "Oranges\t2\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
263 "regdata\t2\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
264 "OrderTest\t2\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
266 static const CHAR service_install_dat
[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
267 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
268 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
269 "ServiceInstall\tServiceInstall\n"
270 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
272 static const CHAR service_control_dat
[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
273 "s72\tl255\ti2\tL255\tI2\ts72\n"
274 "ServiceControl\tServiceControl\n"
275 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
277 /* tables for test_continuouscabs */
278 static const CHAR cc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
279 "s72\tS38\ts72\ti2\tS255\tS72\n"
280 "Component\tComponent\n"
281 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
282 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
283 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
285 static const CHAR cc2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
286 "s72\tS38\ts72\ti2\tS255\tS72\n"
287 "Component\tComponent\n"
288 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
289 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
290 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
292 static const CHAR cc_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
293 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
295 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
297 static const CHAR cc_feature_comp_dat
[] = "Feature_\tComponent_\n"
299 "FeatureComponents\tFeature_\tComponent_\n"
301 "feature\taugustus\n"
304 static const CHAR cc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
305 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
307 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
308 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
309 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
311 static const CHAR cc2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
312 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
314 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
315 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
316 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
317 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
319 static const CHAR cc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
320 "i2\ti4\tL64\tS255\tS32\tS72\n"
322 "1\t10\t\ttest1.cab\tDISK1\t\n"
323 "2\t2\t\ttest2.cab\tDISK2\t\n"
324 "3\t12\t\ttest3.cab\tDISK3\t\n";
326 static const CHAR co_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
327 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
329 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
330 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
331 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
333 static const CHAR co_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
334 "i2\ti4\tL64\tS255\tS32\tS72\n"
336 "1\t10\t\ttest1.cab\tDISK1\t\n"
337 "2\t2\t\ttest2.cab\tDISK2\t\n"
338 "3\t3\t\ttest3.cab\tDISK3\t\n";
340 static const CHAR co2_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
341 "i2\ti4\tL64\tS255\tS32\tS72\n"
343 "1\t10\t\ttest1.cab\tDISK1\t\n"
344 "2\t12\t\ttest3.cab\tDISK3\t\n"
345 "3\t2\t\ttest2.cab\tDISK2\t\n";
347 static const CHAR mm_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
348 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
350 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
351 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
352 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
354 static const CHAR mm_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
355 "i2\ti4\tL64\tS255\tS32\tS72\n"
357 "1\t3\t\ttest1.cab\tDISK1\t\n";
359 static const CHAR ss_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
360 "i2\ti4\tL64\tS255\tS32\tS72\n"
362 "1\t2\t\ttest1.cab\tDISK1\t\n"
363 "2\t2\t\ttest2.cab\tDISK2\t\n"
364 "3\t12\t\ttest3.cab\tDISK3\t\n";
366 /* tables for test_uiLevelFlags */
367 static const CHAR ui_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
368 "s72\tS38\ts72\ti2\tS255\tS72\n"
369 "Component\tComponent\n"
370 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
371 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
372 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
374 static const CHAR ui_install_ui_seq_dat
[] = "Action\tCondition\tSequence\n"
376 "InstallUISequence\tAction\n"
377 "SetUIProperty\t\t5\n"
378 "ExecuteAction\t\t1100\n";
380 static const CHAR ui_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
381 "s72\ti2\tS64\tS0\tS255\n"
382 "CustomAction\tAction\n"
383 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
385 static const CHAR rof_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
386 "s72\tS38\ts72\ti2\tS255\tS72\n"
387 "Component\tComponent\n"
388 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
390 static const CHAR rof_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
391 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
393 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
394 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
396 static const CHAR rof_feature_comp_dat
[] = "Feature_\tComponent_\n"
398 "FeatureComponents\tFeature_\tComponent_\n"
400 "montecristo\tmaximus";
402 static const CHAR rof_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
403 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
405 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
407 static const CHAR rof_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
408 "i2\ti4\tL64\tS255\tS32\tS72\n"
410 "1\t1\t\t\tDISK1\t\n";
412 static const CHAR rofc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
413 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
415 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
417 static const CHAR rofc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
418 "i2\ti4\tL64\tS255\tS32\tS72\n"
420 "1\t1\t\ttest1.cab\tDISK1\t\n";
422 static const CHAR lus2_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
423 "i2\ti4\tL64\tS255\tS32\tS72\n"
425 "1\t1\t\t#test1.cab\tDISK1\t\n";
427 static const CHAR sdp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
429 "InstallExecuteSequence\tAction\n"
430 "AllocateRegistrySpace\tNOT Installed\t1550\n"
431 "CostFinalize\t\t1000\n"
432 "CostInitialize\t\t800\n"
434 "InstallFiles\t\t4000\n"
435 "InstallFinalize\t\t6600\n"
436 "InstallInitialize\t\t1500\n"
437 "InstallValidate\t\t1400\n"
438 "LaunchConditions\t\t100\n"
439 "SetDirProperty\t\t950";
441 static const CHAR sdp_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
442 "s72\ti2\tS64\tS0\tS255\n"
443 "CustomAction\tAction\n"
444 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
446 static const CHAR cie_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
447 "s72\tS38\ts72\ti2\tS255\tS72\n"
448 "Component\tComponent\n"
449 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
450 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
451 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
452 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
454 static const CHAR cie_feature_comp_dat
[] = "Feature_\tComponent_\n"
456 "FeatureComponents\tFeature_\tComponent_\n"
458 "feature\taugustus\n"
462 static const CHAR cie_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
463 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
465 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
466 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
467 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
468 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
470 static const CHAR cie_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
471 "i2\ti4\tL64\tS255\tS32\tS72\n"
473 "1\t1\t\ttest1.cab\tDISK1\t\n"
474 "2\t2\t\ttest2.cab\tDISK2\t\n"
475 "3\t12\t\ttest3.cab\tDISK3\t\n";
477 static const CHAR ci_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
479 "InstallExecuteSequence\tAction\n"
480 "CostFinalize\t\t1000\n"
481 "CostInitialize\t\t800\n"
483 "InstallFiles\t\t4000\n"
484 "InstallServices\t\t5000\n"
485 "InstallFinalize\t\t6600\n"
486 "InstallInitialize\t\t1500\n"
487 "RunInstall\t\t1600\n"
488 "InstallValidate\t\t1400\n"
489 "LaunchConditions\t\t100";
491 static const CHAR ci_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
492 "s72\ti2\tS64\tS0\tS255\n"
493 "CustomAction\tAction\n"
494 "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n";
496 static const CHAR ci_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
497 "s72\tS38\ts72\ti2\tS255\tS72\n"
498 "Component\tComponent\n"
499 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
501 static const CHAR ci2_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
502 "s72\tS38\ts72\ti2\tS255\tS72\n"
503 "Component\tComponent\n"
504 "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n";
506 static const CHAR ci2_feature_comp_dat
[] = "Feature_\tComponent_\n"
508 "FeatureComponents\tFeature_\tComponent_\n"
511 static const CHAR ci2_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
512 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
514 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
516 static const CHAR spf_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
517 "s72\ti2\tS64\tS0\tS255\n"
518 "CustomAction\tAction\n"
519 "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n";
521 static const CHAR spf_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
523 "InstallExecuteSequence\tAction\n"
524 "CostFinalize\t\t1000\n"
525 "CostInitialize\t\t800\n"
527 "SetFolderProp\t\t950\n"
528 "InstallFiles\t\t4000\n"
529 "InstallServices\t\t5000\n"
530 "InstallFinalize\t\t6600\n"
531 "InstallInitialize\t\t1500\n"
532 "InstallValidate\t\t1400\n"
533 "LaunchConditions\t\t100";
535 static const CHAR spf_install_ui_seq_dat
[] = "Action\tCondition\tSequence\n"
537 "InstallUISequence\tAction\n"
538 "CostInitialize\t\t800\n"
540 "CostFinalize\t\t1000\n"
541 "ExecuteAction\t\t1100\n";
543 static const CHAR pp_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
545 "InstallExecuteSequence\tAction\n"
546 "ValidateProductID\t\t700\n"
547 "CostInitialize\t\t800\n"
549 "CostFinalize\t\t1000\n"
550 "InstallValidate\t\t1400\n"
551 "InstallInitialize\t\t1500\n"
552 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
553 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
554 "RemoveFiles\t\t3500\n"
555 "InstallFiles\t\t4000\n"
556 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
557 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
558 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
559 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
560 "InstallFinalize\t\t6600";
562 static const CHAR ppc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
563 "s72\tS38\ts72\ti2\tS255\tS72\n"
564 "Component\tComponent\n"
565 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n"
566 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
568 static const CHAR ppc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
569 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
571 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
572 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
574 static const CHAR ppc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
575 "i2\ti4\tL64\tS255\tS32\tS72\n"
577 "1\t2\t\t\tDISK1\t\n";
579 static const CHAR ppc_feature_comp_dat
[] = "Feature_\tComponent_\n"
581 "FeatureComponents\tFeature_\tComponent_\n"
583 "feature\taugustus\n"
584 "montecristo\tmaximus";
586 static const CHAR tp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
587 "s72\tS38\ts72\ti2\tS255\tS72\n"
588 "Component\tComponent\n"
589 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
591 static const CHAR cwd_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
592 "s72\tS38\ts72\ti2\tS255\tS72\n"
593 "Component\tComponent\n"
594 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
596 static const CHAR adm_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
597 "s72\tS38\ts72\ti2\tS255\tS72\n"
598 "Component\tComponent\n"
599 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
601 static const CHAR adm_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
602 "s72\ti2\tS64\tS0\tS255\n"
603 "CustomAction\tAction\n"
604 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
606 static const CHAR adm_admin_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
608 "AdminExecuteSequence\tAction\n"
609 "CostFinalize\t\t1000\n"
610 "CostInitialize\t\t800\n"
612 "SetPOSTADMIN\t\t950\n"
613 "InstallFiles\t\t4000\n"
614 "InstallFinalize\t\t6600\n"
615 "InstallInitialize\t\t1500\n"
616 "InstallValidate\t\t1400\n"
617 "LaunchConditions\t\t100";
619 static const CHAR amp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
620 "s72\tS38\ts72\ti2\tS255\tS72\n"
621 "Component\tComponent\n"
622 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
624 static const CHAR rem_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
625 "s72\tS38\ts72\ti2\tS255\tS72\n"
626 "Component\tComponent\n"
627 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
628 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
629 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
631 static const CHAR rem_feature_comp_dat
[] = "Feature_\tComponent_\n"
633 "FeatureComponents\tFeature_\tComponent_\n"
634 "feature\thydrogen\n"
638 static const CHAR rem_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
639 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
641 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
642 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
643 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
645 static const CHAR rem_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
647 "InstallExecuteSequence\tAction\n"
648 "ValidateProductID\t\t700\n"
649 "CostInitialize\t\t800\n"
651 "CostFinalize\t\t1000\n"
652 "InstallValidate\t\t1400\n"
653 "InstallInitialize\t\t1500\n"
654 "ProcessComponents\t\t1600\n"
655 "UnpublishFeatures\t\t1800\n"
656 "RemoveFiles\t\t3500\n"
657 "InstallFiles\t\t4000\n"
658 "RegisterProduct\t\t6100\n"
659 "PublishFeatures\t\t6300\n"
660 "PublishProduct\t\t6400\n"
661 "InstallFinalize\t\t6600";
663 static const CHAR rem_remove_files_dat
[] = "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
664 "s72\ts72\tS255\ts72\tI2\n"
665 "RemoveFile\tFileKey\n"
666 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
667 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
668 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
669 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
670 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
671 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
672 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
673 "block\thelium\tblock\tMSITESTDIR\t3\n"
674 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
675 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
677 static const CHAR mov_move_file_dat
[] = "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
678 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
679 "MoveFile\tFileKey\n"
680 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
681 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
682 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
683 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
684 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
685 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
686 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
687 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
688 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
689 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
690 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
691 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
692 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
693 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
694 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
695 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
696 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
697 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
699 static const CHAR mc_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
700 "s72\tS38\ts72\ti2\tS255\tS72\n"
701 "Component\tComponent\n"
702 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
703 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
704 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
705 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n";
707 static const CHAR mc_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
708 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
710 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
711 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
712 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
713 "gaius\tgaius\tgaius\t500\t\t\t16384\t4";
715 static const CHAR mc_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
716 "i2\ti4\tL64\tS255\tS32\tS72\n"
718 "1\t1\t\ttest1.cab\tDISK1\t\n"
719 "2\t2\t\ttest2.cab\tDISK2\t\n"
720 "3\t3\t\ttest3.cab\tDISK3\t\n"
721 "4\t4\t\ttest3.cab\tDISK3\t\n";
723 static const CHAR mc_file_hash_dat
[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
724 "s72\ti2\ti4\ti4\ti4\ti4\n"
725 "MsiFileHash\tFile_\n"
726 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
728 static const CHAR df_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
730 "Directory\tDirectory\n"
731 "THIS\tMSITESTDIR\tthis\n"
732 "DOESNOT\tTHIS\tdoesnot\n"
733 "NONEXISTENT\tDOESNOT\texist\n"
734 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
735 "ProgramFilesFolder\tTARGETDIR\t.\n"
736 "TARGETDIR\t\tSourceDir";
738 static const CHAR df_duplicate_file_dat
[] = "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
739 "s72\ts72\ts72\tS255\tS72\n"
740 "DuplicateFile\tFileKey\n"
741 "maximus\tmaximus\tmaximus\taugustus\t\n"
742 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n";
744 static const CHAR wrv_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
745 "s72\tS38\ts72\ti2\tS255\tS72\n"
746 "Component\tComponent\n"
747 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
749 static const CHAR wrv_registry_dat
[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
750 "s72\ti2\tl255\tL255\tL0\ts72\n"
751 "Registry\tRegistry\n"
752 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus";
754 static const CHAR ca51_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
755 "s72\tS38\ts72\ti2\tS255\tS72\n"
756 "Component\tComponent\n"
757 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
759 static const CHAR ca51_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
761 "InstallExecuteSequence\tAction\n"
762 "ValidateProductID\t\t700\n"
763 "GoodSetProperty\t\t725\n"
764 "BadSetProperty\t\t750\n"
765 "CostInitialize\t\t800\n"
766 "ResolveSource\t\t810\n"
768 "SetSourceDir\tSRCDIR\t910\n"
769 "CostFinalize\t\t1000\n"
770 "InstallValidate\t\t1400\n"
771 "InstallInitialize\t\t1500\n"
772 "InstallFiles\t\t4000\n"
773 "InstallFinalize\t\t6600";
775 static const CHAR ca51_custom_action_dat
[] = "Action\tType\tSource\tTarget\n"
777 "CustomAction\tAction\n"
778 "GoodSetProperty\t51\tMYPROP\t42\n"
779 "BadSetProperty\t51\t\tMYPROP\n"
780 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
782 static const CHAR is_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
783 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
785 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
786 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
787 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
788 "four\t\t\t\t2\t0\t\t0"; /* disabled */
790 static const CHAR is_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
791 "s72\tS38\ts72\ti2\tS255\tS72\n"
792 "Component\tComponent\n"
793 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
794 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
795 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
796 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
797 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
798 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
799 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
800 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
801 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
802 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
803 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
804 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
806 static const CHAR is_feature_comp_dat
[] = "Feature_\tComponent_\n"
808 "FeatureComponents\tFeature_\tComponent_\n"
822 static const CHAR is_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
823 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
825 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
826 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
827 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
828 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
829 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
830 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
831 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
832 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
833 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
834 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
835 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
836 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
838 static const CHAR is_media_dat
[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
839 "i2\ti4\tL64\tS255\tS32\tS72\n"
841 "1\t12\t\t\tDISK1\t\n";
843 static const CHAR sp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
844 "s72\tS38\ts72\ti2\tS255\tS72\n"
845 "Component\tComponent\n"
846 "augustus\t\tTWODIR\t0\t\taugustus\n";
848 static const CHAR sp_directory_dat
[] = "Directory\tDirectory_Parent\tDefaultDir\n"
850 "Directory\tDirectory\n"
851 "TARGETDIR\t\tSourceDir\n"
852 "ProgramFilesFolder\tTARGETDIR\t.\n"
853 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
854 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
855 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
857 static const CHAR mcp_component_dat
[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
858 "s72\tS38\ts72\ti2\tS255\tS72\n"
859 "Component\tComponent\n"
860 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
861 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
862 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
864 static const CHAR mcp_feature_dat
[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
865 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
867 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
868 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
869 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
871 static const CHAR mcp_feature_comp_dat
[] = "Feature_\tComponent_\n"
873 "FeatureComponents\tFeature_\tComponent_\n"
874 "hydroxyl\thydrogen\n"
878 static const CHAR mcomp_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
879 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
881 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
882 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
883 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
884 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
886 static const CHAR ai_file_dat
[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
887 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
889 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
890 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
891 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
892 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
893 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
894 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
895 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
897 static const CHAR ip_install_exec_seq_dat
[] = "Action\tCondition\tSequence\n"
899 "InstallExecuteSequence\tAction\n"
900 "CostFinalize\t\t1000\n"
901 "ValidateProductID\t\t700\n"
902 "CostInitialize\t\t800\n"
904 "RemoveFiles\t\t3500\n"
905 "InstallFiles\t\t4000\n"
906 "RegisterUser\t\t6000\n"
907 "RegisterProduct\t\t6100\n"
908 "PublishFeatures\t\t6300\n"
909 "PublishProduct\t\t6400\n"
910 "InstallFinalize\t\t6600\n"
911 "InstallInitialize\t\t1500\n"
912 "ProcessComponents\t\t1600\n"
913 "UnpublishFeatures\t\t1800\n"
914 "InstallValidate\t\t1400\n"
915 "LaunchConditions\t\t100\n"
916 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
918 static const CHAR ip_custom_action_dat
[] = "Action\tType\tSource\tTarget\tISComments\n"
919 "s72\ti2\tS64\tS0\tS255\n"
920 "CustomAction\tAction\n"
921 "TestInstalledProp\t19\t\tTest failed\t\n";
923 typedef struct _msi_table
925 const CHAR
*filename
;
930 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
932 static const msi_table tables
[] =
934 ADD_TABLE(component
),
935 ADD_TABLE(directory
),
937 ADD_TABLE(feature_comp
),
939 ADD_TABLE(install_exec_seq
),
943 ADD_TABLE(service_install
),
944 ADD_TABLE(service_control
)
947 static const msi_table sc_tables
[] =
949 ADD_TABLE(component
),
950 ADD_TABLE(directory
),
952 ADD_TABLE(feature_comp
),
954 ADD_TABLE(install_exec_seq
),
960 static const msi_table ps_tables
[] =
962 ADD_TABLE(component
),
963 ADD_TABLE(directory
),
965 ADD_TABLE(feature_comp
),
967 ADD_TABLE(install_exec_seq
),
973 static const msi_table env_tables
[] =
975 ADD_TABLE(component
),
976 ADD_TABLE(directory
),
978 ADD_TABLE(feature_comp
),
980 ADD_TABLE(install_exec_seq
),
983 ADD_TABLE(environment
)
986 static const msi_table up_tables
[] =
988 ADD_TABLE(component
),
989 ADD_TABLE(directory
),
991 ADD_TABLE(feature_comp
),
993 ADD_TABLE(install_exec_seq
),
995 ADD_TABLE(up_property
),
997 ADD_TABLE(service_install
),
998 ADD_TABLE(service_control
)
1001 static const msi_table up2_tables
[] =
1003 ADD_TABLE(component
),
1004 ADD_TABLE(directory
),
1006 ADD_TABLE(feature_comp
),
1008 ADD_TABLE(install_exec_seq
),
1010 ADD_TABLE(up2_property
),
1011 ADD_TABLE(registry
),
1012 ADD_TABLE(service_install
),
1013 ADD_TABLE(service_control
)
1016 static const msi_table up3_tables
[] =
1018 ADD_TABLE(component
),
1019 ADD_TABLE(directory
),
1021 ADD_TABLE(feature_comp
),
1023 ADD_TABLE(install_exec_seq
),
1025 ADD_TABLE(up3_property
),
1026 ADD_TABLE(registry
),
1027 ADD_TABLE(service_install
),
1028 ADD_TABLE(service_control
)
1031 static const msi_table up4_tables
[] =
1033 ADD_TABLE(component
),
1034 ADD_TABLE(directory
),
1036 ADD_TABLE(feature_comp
),
1038 ADD_TABLE(pp_install_exec_seq
),
1040 ADD_TABLE(property
),
1041 ADD_TABLE(registry
),
1042 ADD_TABLE(service_install
),
1043 ADD_TABLE(service_control
)
1046 static const msi_table up5_tables
[] =
1048 ADD_TABLE(component
),
1049 ADD_TABLE(directory
),
1051 ADD_TABLE(feature_comp
),
1053 ADD_TABLE(pp_install_exec_seq
),
1055 ADD_TABLE(up_property
),
1056 ADD_TABLE(registry
),
1057 ADD_TABLE(service_install
),
1058 ADD_TABLE(service_control
)
1061 static const msi_table up6_tables
[] =
1063 ADD_TABLE(component
),
1064 ADD_TABLE(directory
),
1066 ADD_TABLE(feature_comp
),
1068 ADD_TABLE(pp_install_exec_seq
),
1070 ADD_TABLE(up2_property
),
1071 ADD_TABLE(registry
),
1072 ADD_TABLE(service_install
),
1073 ADD_TABLE(service_control
)
1076 static const msi_table up7_tables
[] =
1078 ADD_TABLE(component
),
1079 ADD_TABLE(directory
),
1081 ADD_TABLE(feature_comp
),
1083 ADD_TABLE(pp_install_exec_seq
),
1085 ADD_TABLE(up3_property
),
1086 ADD_TABLE(registry
),
1087 ADD_TABLE(service_install
),
1088 ADD_TABLE(service_control
)
1091 static const msi_table cc_tables
[] =
1093 ADD_TABLE(cc_component
),
1094 ADD_TABLE(directory
),
1095 ADD_TABLE(cc_feature
),
1096 ADD_TABLE(cc_feature_comp
),
1098 ADD_TABLE(install_exec_seq
),
1099 ADD_TABLE(cc_media
),
1100 ADD_TABLE(property
),
1103 static const msi_table cc2_tables
[] =
1105 ADD_TABLE(cc2_component
),
1106 ADD_TABLE(directory
),
1107 ADD_TABLE(cc_feature
),
1108 ADD_TABLE(cc_feature_comp
),
1109 ADD_TABLE(cc2_file
),
1110 ADD_TABLE(install_exec_seq
),
1111 ADD_TABLE(cc_media
),
1112 ADD_TABLE(property
),
1115 static const msi_table co_tables
[] =
1117 ADD_TABLE(cc_component
),
1118 ADD_TABLE(directory
),
1119 ADD_TABLE(cc_feature
),
1120 ADD_TABLE(cc_feature_comp
),
1122 ADD_TABLE(install_exec_seq
),
1123 ADD_TABLE(co_media
),
1124 ADD_TABLE(property
),
1127 static const msi_table co2_tables
[] =
1129 ADD_TABLE(cc_component
),
1130 ADD_TABLE(directory
),
1131 ADD_TABLE(cc_feature
),
1132 ADD_TABLE(cc_feature_comp
),
1134 ADD_TABLE(install_exec_seq
),
1135 ADD_TABLE(co2_media
),
1136 ADD_TABLE(property
),
1139 static const msi_table mm_tables
[] =
1141 ADD_TABLE(cc_component
),
1142 ADD_TABLE(directory
),
1143 ADD_TABLE(cc_feature
),
1144 ADD_TABLE(cc_feature_comp
),
1146 ADD_TABLE(install_exec_seq
),
1147 ADD_TABLE(mm_media
),
1148 ADD_TABLE(property
),
1151 static const msi_table ss_tables
[] =
1153 ADD_TABLE(cc_component
),
1154 ADD_TABLE(directory
),
1155 ADD_TABLE(cc_feature
),
1156 ADD_TABLE(cc_feature_comp
),
1158 ADD_TABLE(install_exec_seq
),
1159 ADD_TABLE(ss_media
),
1160 ADD_TABLE(property
),
1163 static const msi_table ui_tables
[] =
1165 ADD_TABLE(ui_component
),
1166 ADD_TABLE(directory
),
1167 ADD_TABLE(cc_feature
),
1168 ADD_TABLE(cc_feature_comp
),
1170 ADD_TABLE(install_exec_seq
),
1171 ADD_TABLE(ui_install_ui_seq
),
1172 ADD_TABLE(ui_custom_action
),
1173 ADD_TABLE(cc_media
),
1174 ADD_TABLE(property
),
1177 static const msi_table rof_tables
[] =
1179 ADD_TABLE(rof_component
),
1180 ADD_TABLE(directory
),
1181 ADD_TABLE(rof_feature
),
1182 ADD_TABLE(rof_feature_comp
),
1183 ADD_TABLE(rof_file
),
1184 ADD_TABLE(install_exec_seq
),
1185 ADD_TABLE(rof_media
),
1186 ADD_TABLE(property
),
1189 static const msi_table rofc_tables
[] =
1191 ADD_TABLE(rof_component
),
1192 ADD_TABLE(directory
),
1193 ADD_TABLE(rof_feature
),
1194 ADD_TABLE(rof_feature_comp
),
1195 ADD_TABLE(rofc_file
),
1196 ADD_TABLE(install_exec_seq
),
1197 ADD_TABLE(rofc_media
),
1198 ADD_TABLE(property
),
1201 static const msi_table sdp_tables
[] =
1203 ADD_TABLE(rof_component
),
1204 ADD_TABLE(directory
),
1205 ADD_TABLE(rof_feature
),
1206 ADD_TABLE(rof_feature_comp
),
1207 ADD_TABLE(rof_file
),
1208 ADD_TABLE(sdp_install_exec_seq
),
1209 ADD_TABLE(sdp_custom_action
),
1210 ADD_TABLE(rof_media
),
1211 ADD_TABLE(property
),
1214 static const msi_table cie_tables
[] =
1216 ADD_TABLE(cie_component
),
1217 ADD_TABLE(directory
),
1218 ADD_TABLE(cc_feature
),
1219 ADD_TABLE(cie_feature_comp
),
1220 ADD_TABLE(cie_file
),
1221 ADD_TABLE(install_exec_seq
),
1222 ADD_TABLE(cie_media
),
1223 ADD_TABLE(property
),
1226 static const msi_table ci_tables
[] =
1228 ADD_TABLE(ci_component
),
1229 ADD_TABLE(directory
),
1230 ADD_TABLE(rof_feature
),
1231 ADD_TABLE(rof_feature_comp
),
1232 ADD_TABLE(rof_file
),
1233 ADD_TABLE(ci_install_exec_seq
),
1234 ADD_TABLE(rof_media
),
1235 ADD_TABLE(property
),
1236 ADD_TABLE(ci_custom_action
),
1239 static const msi_table ci2_tables
[] =
1241 ADD_TABLE(ci2_component
),
1242 ADD_TABLE(directory
),
1243 ADD_TABLE(rof_feature
),
1244 ADD_TABLE(ci2_feature_comp
),
1245 ADD_TABLE(ci2_file
),
1246 ADD_TABLE(install_exec_seq
),
1247 ADD_TABLE(rof_media
),
1248 ADD_TABLE(property
),
1251 static const msi_table spf_tables
[] =
1253 ADD_TABLE(ci_component
),
1254 ADD_TABLE(directory
),
1255 ADD_TABLE(rof_feature
),
1256 ADD_TABLE(rof_feature_comp
),
1257 ADD_TABLE(rof_file
),
1258 ADD_TABLE(spf_install_exec_seq
),
1259 ADD_TABLE(rof_media
),
1260 ADD_TABLE(property
),
1261 ADD_TABLE(spf_custom_action
),
1262 ADD_TABLE(spf_install_ui_seq
),
1265 static const msi_table pp_tables
[] =
1267 ADD_TABLE(ci_component
),
1268 ADD_TABLE(directory
),
1269 ADD_TABLE(rof_feature
),
1270 ADD_TABLE(rof_feature_comp
),
1271 ADD_TABLE(rof_file
),
1272 ADD_TABLE(pp_install_exec_seq
),
1273 ADD_TABLE(rof_media
),
1274 ADD_TABLE(property
),
1277 static const msi_table ppc_tables
[] =
1279 ADD_TABLE(ppc_component
),
1280 ADD_TABLE(directory
),
1281 ADD_TABLE(rof_feature
),
1282 ADD_TABLE(ppc_feature_comp
),
1283 ADD_TABLE(ppc_file
),
1284 ADD_TABLE(pp_install_exec_seq
),
1285 ADD_TABLE(ppc_media
),
1286 ADD_TABLE(property
),
1289 static const msi_table lus0_tables
[] =
1291 ADD_TABLE(ci_component
),
1292 ADD_TABLE(directory
),
1293 ADD_TABLE(rof_feature
),
1294 ADD_TABLE(rof_feature_comp
),
1295 ADD_TABLE(rof_file
),
1296 ADD_TABLE(pp_install_exec_seq
),
1297 ADD_TABLE(rof_media
),
1298 ADD_TABLE(property
),
1301 static const msi_table lus1_tables
[] =
1303 ADD_TABLE(ci_component
),
1304 ADD_TABLE(directory
),
1305 ADD_TABLE(rof_feature
),
1306 ADD_TABLE(rof_feature_comp
),
1307 ADD_TABLE(rof_file
),
1308 ADD_TABLE(pp_install_exec_seq
),
1309 ADD_TABLE(rofc_media
),
1310 ADD_TABLE(property
),
1313 static const msi_table lus2_tables
[] =
1315 ADD_TABLE(ci_component
),
1316 ADD_TABLE(directory
),
1317 ADD_TABLE(rof_feature
),
1318 ADD_TABLE(rof_feature_comp
),
1319 ADD_TABLE(rof_file
),
1320 ADD_TABLE(pp_install_exec_seq
),
1321 ADD_TABLE(lus2_media
),
1322 ADD_TABLE(property
),
1325 static const msi_table tp_tables
[] =
1327 ADD_TABLE(tp_component
),
1328 ADD_TABLE(directory
),
1329 ADD_TABLE(rof_feature
),
1330 ADD_TABLE(ci2_feature_comp
),
1331 ADD_TABLE(ci2_file
),
1332 ADD_TABLE(install_exec_seq
),
1333 ADD_TABLE(rof_media
),
1334 ADD_TABLE(property
),
1337 static const msi_table cwd_tables
[] =
1339 ADD_TABLE(cwd_component
),
1340 ADD_TABLE(directory
),
1341 ADD_TABLE(rof_feature
),
1342 ADD_TABLE(ci2_feature_comp
),
1343 ADD_TABLE(ci2_file
),
1344 ADD_TABLE(install_exec_seq
),
1345 ADD_TABLE(rof_media
),
1346 ADD_TABLE(property
),
1349 static const msi_table adm_tables
[] =
1351 ADD_TABLE(adm_component
),
1352 ADD_TABLE(directory
),
1353 ADD_TABLE(rof_feature
),
1354 ADD_TABLE(ci2_feature_comp
),
1355 ADD_TABLE(ci2_file
),
1356 ADD_TABLE(install_exec_seq
),
1357 ADD_TABLE(rof_media
),
1358 ADD_TABLE(property
),
1359 ADD_TABLE(adm_custom_action
),
1360 ADD_TABLE(adm_admin_exec_seq
),
1363 static const msi_table amp_tables
[] =
1365 ADD_TABLE(amp_component
),
1366 ADD_TABLE(directory
),
1367 ADD_TABLE(rof_feature
),
1368 ADD_TABLE(ci2_feature_comp
),
1369 ADD_TABLE(ci2_file
),
1370 ADD_TABLE(install_exec_seq
),
1371 ADD_TABLE(rof_media
),
1372 ADD_TABLE(property
),
1375 static const msi_table rem_tables
[] =
1377 ADD_TABLE(rem_component
),
1378 ADD_TABLE(directory
),
1379 ADD_TABLE(rof_feature
),
1380 ADD_TABLE(rem_feature_comp
),
1381 ADD_TABLE(rem_file
),
1382 ADD_TABLE(rem_install_exec_seq
),
1383 ADD_TABLE(rof_media
),
1384 ADD_TABLE(property
),
1385 ADD_TABLE(rem_remove_files
),
1388 static const msi_table mov_tables
[] =
1390 ADD_TABLE(cwd_component
),
1391 ADD_TABLE(directory
),
1392 ADD_TABLE(rof_feature
),
1393 ADD_TABLE(ci2_feature_comp
),
1394 ADD_TABLE(ci2_file
),
1395 ADD_TABLE(install_exec_seq
),
1396 ADD_TABLE(rof_media
),
1397 ADD_TABLE(property
),
1398 ADD_TABLE(mov_move_file
),
1401 static const msi_table mc_tables
[] =
1403 ADD_TABLE(mc_component
),
1404 ADD_TABLE(directory
),
1405 ADD_TABLE(cc_feature
),
1406 ADD_TABLE(cie_feature_comp
),
1408 ADD_TABLE(install_exec_seq
),
1409 ADD_TABLE(mc_media
),
1410 ADD_TABLE(property
),
1411 ADD_TABLE(mc_file_hash
),
1414 static const msi_table df_tables
[] =
1416 ADD_TABLE(rof_component
),
1417 ADD_TABLE(df_directory
),
1418 ADD_TABLE(rof_feature
),
1419 ADD_TABLE(rof_feature_comp
),
1420 ADD_TABLE(rof_file
),
1421 ADD_TABLE(install_exec_seq
),
1422 ADD_TABLE(rof_media
),
1423 ADD_TABLE(property
),
1424 ADD_TABLE(df_duplicate_file
),
1427 static const msi_table wrv_tables
[] =
1429 ADD_TABLE(wrv_component
),
1430 ADD_TABLE(directory
),
1431 ADD_TABLE(rof_feature
),
1432 ADD_TABLE(ci2_feature_comp
),
1433 ADD_TABLE(ci2_file
),
1434 ADD_TABLE(install_exec_seq
),
1435 ADD_TABLE(rof_media
),
1436 ADD_TABLE(property
),
1437 ADD_TABLE(wrv_registry
),
1440 static const msi_table sf_tables
[] =
1442 ADD_TABLE(wrv_component
),
1443 ADD_TABLE(directory
),
1444 ADD_TABLE(rof_feature
),
1445 ADD_TABLE(ci2_feature_comp
),
1446 ADD_TABLE(ci2_file
),
1447 ADD_TABLE(install_exec_seq
),
1448 ADD_TABLE(rof_media
),
1449 ADD_TABLE(property
),
1452 static const msi_table ca51_tables
[] =
1454 ADD_TABLE(ca51_component
),
1455 ADD_TABLE(directory
),
1456 ADD_TABLE(rof_feature
),
1457 ADD_TABLE(ci2_feature_comp
),
1458 ADD_TABLE(ci2_file
),
1459 ADD_TABLE(ca51_install_exec_seq
),
1460 ADD_TABLE(rof_media
),
1461 ADD_TABLE(property
),
1462 ADD_TABLE(ca51_custom_action
),
1465 static const msi_table is_tables
[] =
1467 ADD_TABLE(is_component
),
1468 ADD_TABLE(directory
),
1469 ADD_TABLE(is_feature
),
1470 ADD_TABLE(is_feature_comp
),
1472 ADD_TABLE(install_exec_seq
),
1473 ADD_TABLE(is_media
),
1474 ADD_TABLE(property
),
1477 static const msi_table sp_tables
[] =
1479 ADD_TABLE(sp_component
),
1480 ADD_TABLE(sp_directory
),
1481 ADD_TABLE(rof_feature
),
1482 ADD_TABLE(ci2_feature_comp
),
1483 ADD_TABLE(ci2_file
),
1484 ADD_TABLE(install_exec_seq
),
1485 ADD_TABLE(rof_media
),
1486 ADD_TABLE(property
),
1489 static const msi_table mcp_tables
[] =
1491 ADD_TABLE(mcp_component
),
1492 ADD_TABLE(directory
),
1493 ADD_TABLE(mcp_feature
),
1494 ADD_TABLE(mcp_feature_comp
),
1495 ADD_TABLE(rem_file
),
1496 ADD_TABLE(rem_install_exec_seq
),
1497 ADD_TABLE(rof_media
),
1498 ADD_TABLE(property
),
1501 static const msi_table mcomp_tables
[] =
1503 ADD_TABLE(mcp_component
),
1504 ADD_TABLE(directory
),
1505 ADD_TABLE(mcp_feature
),
1506 ADD_TABLE(mcp_feature_comp
),
1507 ADD_TABLE(mcomp_file
),
1508 ADD_TABLE(rem_install_exec_seq
),
1509 ADD_TABLE(rof_media
),
1510 ADD_TABLE(property
),
1513 static const msi_table ai_tables
[] =
1515 ADD_TABLE(component
),
1516 ADD_TABLE(directory
),
1518 ADD_TABLE(feature_comp
),
1520 ADD_TABLE(install_exec_seq
),
1525 static const msi_table pc_tables
[] =
1527 ADD_TABLE(ca51_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
),
1537 static const msi_table ip_tables
[] =
1539 ADD_TABLE(component
),
1540 ADD_TABLE(directory
),
1542 ADD_TABLE(feature_comp
),
1544 ADD_TABLE(ip_install_exec_seq
),
1545 ADD_TABLE(ip_custom_action
),
1550 static const msi_table fiu_tables
[] =
1552 ADD_TABLE(rof_component
),
1553 ADD_TABLE(directory
),
1554 ADD_TABLE(rof_feature
),
1555 ADD_TABLE(rof_feature_comp
),
1556 ADD_TABLE(rof_file
),
1557 ADD_TABLE(pp_install_exec_seq
),
1558 ADD_TABLE(rof_media
),
1559 ADD_TABLE(property
),
1562 static const msi_table fiuc_tables
[] =
1564 ADD_TABLE(rof_component
),
1565 ADD_TABLE(directory
),
1566 ADD_TABLE(rof_feature
),
1567 ADD_TABLE(rof_feature_comp
),
1568 ADD_TABLE(rofc_file
),
1569 ADD_TABLE(pp_install_exec_seq
),
1570 ADD_TABLE(rofc_media
),
1571 ADD_TABLE(property
),
1574 /* cabinet definitions */
1576 /* make the max size large so there is only one cab file */
1577 #define MEDIA_SIZE 0x7FFFFFFF
1578 #define FOLDER_THRESHOLD 900000
1580 /* the FCI callbacks */
1582 static void * CDECL
mem_alloc(ULONG cb
)
1584 return HeapAlloc(GetProcessHeap(), 0, cb
);
1587 static void CDECL
mem_free(void *memory
)
1589 HeapFree(GetProcessHeap(), 0, memory
);
1592 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
1594 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
1598 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
1603 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
1604 BOOL fContinuation
, void *pv
)
1609 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
1613 DWORD dwShareMode
= 0;
1614 DWORD dwCreateDisposition
= OPEN_EXISTING
;
1616 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
1617 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
1618 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
;
1620 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
1621 dwCreateDisposition
= OPEN_EXISTING
;
1623 dwCreateDisposition
= CREATE_NEW
;
1625 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
1626 dwCreateDisposition
, 0, NULL
);
1628 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
1630 return (INT_PTR
)handle
;
1633 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1635 HANDLE handle
= (HANDLE
)hf
;
1639 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
1640 ok(res
, "Failed to ReadFile\n");
1645 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
1647 HANDLE handle
= (HANDLE
)hf
;
1651 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
1652 ok(res
, "Failed to WriteFile\n");
1657 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
1659 HANDLE handle
= (HANDLE
)hf
;
1660 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
1665 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
1667 HANDLE handle
= (HANDLE
)hf
;
1670 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
1671 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
1676 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
1678 BOOL ret
= DeleteFileA(pszFile
);
1679 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
1684 static void init_functionpointers(void)
1686 HMODULE hmsi
= GetModuleHandleA("msi.dll");
1687 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
1689 #define GET_PROC(mod, func) \
1690 p ## func = (void*)GetProcAddress(mod, #func); \
1692 trace("GetProcAddress(%s) failed\n", #func);
1694 GET_PROC(hmsi
, MsiQueryComponentStateA
);
1695 GET_PROC(hmsi
, MsiSetExternalUIRecord
);
1696 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
1697 GET_PROC(hmsi
, MsiSourceListGetInfoA
);
1699 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
1701 hsrclient
= LoadLibraryA("srclient.dll");
1702 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
1703 GET_PROC(hsrclient
, SRSetRestorePointA
);
1708 static BOOL
check_win9x(void)
1712 scm
= OpenSCManager(NULL
, NULL
, GENERIC_ALL
);
1713 if (!scm
&& (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED
))
1716 CloseServiceHandle(scm
);
1721 static LPSTR
get_user_sid(LPSTR
*usersid
)
1728 if (!pConvertSidToStringSidA
)
1730 win_skip("ConvertSidToStringSidA is not available\n");
1735 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
1737 GetTokenInformation(token
, TokenUser
, buf
, size
, &size
);
1738 user
= (PTOKEN_USER
)buf
;
1739 pConvertSidToStringSidA(user
->User
.Sid
, usersid
);
1740 ok(*usersid
!= NULL
, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
1745 static BOOL
check_record(MSIHANDLE rec
, UINT field
, LPCSTR val
)
1752 r
= MsiRecordGetString(rec
, field
, buffer
, &sz
);
1753 return (r
== ERROR_SUCCESS
) && !strcmp(val
, buffer
);
1756 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
1760 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
1761 GetTempFileNameA(".", "xx", 0, tempname
);
1763 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
1765 lstrcpyA(pszTempName
, tempname
);
1766 HeapFree(GetProcessHeap(), 0, tempname
);
1770 HeapFree(GetProcessHeap(), 0, tempname
);
1775 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
1776 USHORT
*pattribs
, int *err
, void *pv
)
1778 BY_HANDLE_FILE_INFORMATION finfo
;
1784 handle
= CreateFile(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
1785 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
1787 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
1789 res
= GetFileInformationByHandle(handle
, &finfo
);
1790 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
1792 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
1793 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
1795 attrs
= GetFileAttributes(pszName
);
1796 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
1798 return (INT_PTR
)handle
;
1801 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
1803 char path
[MAX_PATH
];
1804 char filename
[MAX_PATH
];
1806 lstrcpyA(path
, CURR_DIR
);
1807 lstrcatA(path
, "\\");
1808 lstrcatA(path
, file
);
1810 lstrcpyA(filename
, file
);
1812 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
1813 progress
, get_open_info
, compress
);
1816 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
1818 ZeroMemory(pCabParams
, sizeof(CCAB
));
1820 pCabParams
->cb
= max_size
;
1821 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
1822 pCabParams
->setID
= 0xbeef;
1823 pCabParams
->iCab
= 1;
1824 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
1825 lstrcatA(pCabParams
->szCabPath
, "\\");
1826 lstrcpyA(pCabParams
->szCab
, name
);
1829 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
1837 set_cab_parameters(&cabParams
, name
, max_size
);
1839 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
1840 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
1841 get_temp_file
, &cabParams
, NULL
);
1843 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
1848 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
1849 ok(res
, "Failed to add file: %s\n", ptr
);
1850 ptr
+= lstrlen(ptr
) + 1;
1853 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
1854 ok(res
, "Failed to flush the cabinet\n");
1856 res
= FCIDestroy(hfci
);
1857 ok(res
, "Failed to destroy the cabinet\n");
1860 static BOOL
get_program_files_dir(LPSTR buf
, LPSTR buf2
)
1865 if (RegOpenKey(HKEY_LOCAL_MACHINE
,
1866 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
1870 if (RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)buf
, &size
)) {
1876 if (RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)buf2
, &size
)) {
1885 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
1890 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
1891 if (file
== INVALID_HANDLE_VALUE
)
1894 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
1898 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
1905 #define create_file(name, size) create_file_data(name, name, size)
1907 static void create_test_files(void)
1909 CreateDirectoryA("msitest", NULL
);
1910 create_file("msitest\\one.txt", 100);
1911 CreateDirectoryA("msitest\\first", NULL
);
1912 create_file("msitest\\first\\two.txt", 100);
1913 CreateDirectoryA("msitest\\second", NULL
);
1914 create_file("msitest\\second\\three.txt", 100);
1916 create_file("four.txt", 100);
1917 create_file("five.txt", 100);
1918 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
1920 create_file("msitest\\filename", 100);
1921 create_file("msitest\\service.exe", 100);
1923 DeleteFileA("four.txt");
1924 DeleteFileA("five.txt");
1927 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
1929 CHAR path
[MAX_PATH
];
1931 lstrcpyA(path
, PROG_FILES_DIR
);
1932 lstrcatA(path
, "\\");
1933 lstrcatA(path
, rel_path
);
1936 return DeleteFileA(path
);
1938 return RemoveDirectoryA(path
);
1941 static BOOL
delete_cf(const CHAR
*rel_path
, BOOL is_file
)
1943 CHAR path
[MAX_PATH
];
1945 lstrcpyA(path
, COMMON_FILES_DIR
);
1946 lstrcatA(path
, "\\");
1947 lstrcatA(path
, rel_path
);
1950 return DeleteFileA(path
);
1952 return RemoveDirectoryA(path
);
1955 static void delete_test_files(void)
1957 DeleteFileA("msitest.msi");
1958 DeleteFileA("msitest.cab");
1959 DeleteFileA("msitest\\second\\three.txt");
1960 DeleteFileA("msitest\\first\\two.txt");
1961 DeleteFileA("msitest\\one.txt");
1962 DeleteFileA("msitest\\service.exe");
1963 DeleteFileA("msitest\\filename");
1964 RemoveDirectoryA("msitest\\second");
1965 RemoveDirectoryA("msitest\\first");
1966 RemoveDirectoryA("msitest");
1969 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
1973 HANDLE hf
= CreateFile(filename
, GENERIC_WRITE
, 0, NULL
,
1974 CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
1976 WriteFile(hf
, data
, data_size
, &size
, NULL
);
1980 static void write_msi_summary_info(MSIHANDLE db
, INT wordcount
)
1985 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
1986 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1988 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, ";1033");
1989 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1991 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
1992 "{004757CA-5092-49c2-AD20-28E1CE0DF5F2}");
1993 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1995 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, 100, NULL
, NULL
);
1996 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
1998 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
1999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2001 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2002 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2004 /* write the summary changes back to the stream */
2005 r
= MsiSummaryInfoPersist(summary
);
2006 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2008 MsiCloseHandle(summary
);
2011 #define create_database(name, tables, num_tables) \
2012 create_database_wordcount(name, tables, num_tables, 0);
2014 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2015 int num_tables
, INT wordcount
)
2021 r
= MsiOpenDatabaseA(name
, MSIDBOPEN_CREATE
, &db
);
2022 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2024 /* import the tables into the database */
2025 for (j
= 0; j
< num_tables
; j
++)
2027 const msi_table
*table
= &tables
[j
];
2029 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2031 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2032 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2034 DeleteFileA(table
->filename
);
2037 write_msi_summary_info(db
, wordcount
);
2039 r
= MsiDatabaseCommit(db
);
2040 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2045 static void check_service_is_installed(void)
2047 SC_HANDLE scm
, service
;
2050 scm
= OpenSCManager(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
2051 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
2053 service
= OpenService(scm
, "TestService", SC_MANAGER_ALL_ACCESS
);
2054 ok(service
!= NULL
, "Failed to open TestService\n");
2056 res
= DeleteService(service
);
2057 ok(res
, "Failed to delete TestService\n");
2059 CloseServiceHandle(service
);
2060 CloseServiceHandle(scm
);
2063 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2065 RESTOREPOINTINFOA spec
;
2067 spec
.dwEventType
= event_type
;
2068 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2069 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2070 lstrcpyA(spec
.szDescription
, "msitest restore point");
2072 return pSRSetRestorePointA(&spec
, status
);
2075 static void remove_restore_point(DWORD seq_number
)
2079 res
= pSRRemoveRestorePoint(seq_number
);
2080 if (res
!= ERROR_SUCCESS
)
2081 trace("Failed to remove the restore point : %08x\n", res
);
2084 static void test_MsiInstallProduct(void)
2087 CHAR path
[MAX_PATH
];
2090 DWORD num
, size
, type
;
2094 win_skip("Services are not implemented on Win9x and WinMe\n");
2098 /* szPackagePath is NULL */
2099 r
= MsiInstallProductA(NULL
, "INSTALL=ALL");
2100 ok(r
== ERROR_INVALID_PARAMETER
,
2101 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2103 /* both szPackagePath and szCommandLine are NULL */
2104 r
= MsiInstallProductA(NULL
, NULL
);
2105 ok(r
== ERROR_INVALID_PARAMETER
,
2106 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
2108 /* szPackagePath is empty */
2109 r
= MsiInstallProductA("", "INSTALL=ALL");
2110 ok(r
== ERROR_PATH_NOT_FOUND
,
2111 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r
);
2113 create_test_files();
2114 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2116 /* install, don't publish */
2117 r
= MsiInstallProductA(msifile
, NULL
);
2118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2120 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2121 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2122 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2123 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2124 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2125 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2126 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2127 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2128 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2129 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2130 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2131 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2133 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2134 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2138 res
= RegQueryValueExA(hkey
, "Name", NULL
, &type
, (LPBYTE
)path
, &size
);
2139 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2140 ok(!lstrcmpA(path
, "imaname"), "Expected imaname, got %s\n", path
);
2144 res
= RegQueryValueExA(hkey
, "blah", NULL
, &type
, (LPBYTE
)path
, &size
);
2145 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2149 res
= RegQueryValueExA(hkey
, "number", NULL
, &type
, (LPBYTE
)&num
, &size
);
2150 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2151 ok(num
== 314, "Expected 314, got %d\n", num
);
2155 res
= RegQueryValueExA(hkey
, "OrderTestName", NULL
, &type
, (LPBYTE
)path
, &size
);
2156 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2157 ok(!lstrcmpA(path
, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path
);
2159 check_service_is_installed();
2161 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
2163 /* not published, reinstall */
2164 r
= MsiInstallProductA(msifile
, NULL
);
2165 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2167 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2168 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2169 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2170 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2171 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2172 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2173 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2174 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2175 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2176 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2177 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2178 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2180 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2181 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2182 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
2184 create_database(msifile
, up_tables
, sizeof(up_tables
) / sizeof(msi_table
));
2186 /* not published, RemovePreviousVersions set */
2187 r
= MsiInstallProductA(msifile
, NULL
);
2188 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2190 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2191 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2192 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2193 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2194 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2195 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2196 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2197 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2198 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2199 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2200 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2201 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2203 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2204 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2205 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
2207 create_database(msifile
, up2_tables
, sizeof(up2_tables
) / sizeof(msi_table
));
2209 /* not published, version number bumped */
2210 r
= MsiInstallProductA(msifile
, NULL
);
2211 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2213 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2214 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2215 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2216 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2217 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2218 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2219 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2220 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2221 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2222 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2223 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2224 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2226 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2227 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2228 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
2230 create_database(msifile
, up3_tables
, sizeof(up3_tables
) / sizeof(msi_table
));
2232 /* not published, RemovePreviousVersions set and version number bumped */
2233 r
= MsiInstallProductA(msifile
, NULL
);
2234 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2236 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2237 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2238 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2239 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2240 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2241 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2242 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2243 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2244 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2245 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2246 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2247 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2249 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2250 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2251 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
2253 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2255 /* install, publish product */
2256 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
2257 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2259 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2260 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2261 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2262 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2263 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2264 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2265 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2266 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2267 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2268 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2269 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2270 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2272 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2273 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2275 create_database(msifile
, up4_tables
, sizeof(up4_tables
) / sizeof(msi_table
));
2277 /* published, reinstall */
2278 r
= MsiInstallProductA(msifile
, NULL
);
2279 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2281 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2282 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2283 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2284 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2285 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2286 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2287 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2288 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2289 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2290 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2291 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2292 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2294 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2295 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2297 create_database(msifile
, up5_tables
, sizeof(up5_tables
) / sizeof(msi_table
));
2299 /* published product, RemovePreviousVersions set */
2300 r
= MsiInstallProductA(msifile
, NULL
);
2301 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2303 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2304 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2305 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2306 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2307 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2308 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2309 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2310 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2311 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2312 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2313 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2314 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2316 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2317 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2319 create_database(msifile
, up6_tables
, sizeof(up6_tables
) / sizeof(msi_table
));
2321 /* published product, version number bumped */
2322 r
= MsiInstallProductA(msifile
, NULL
);
2323 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2325 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2326 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2327 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2328 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2329 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2330 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2331 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2332 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2333 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2334 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2335 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2336 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2338 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2339 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2341 create_database(msifile
, up7_tables
, sizeof(up7_tables
) / sizeof(msi_table
));
2343 /* published product, RemovePreviousVersions set and version number bumped */
2344 r
= MsiInstallProductA(msifile
, NULL
);
2345 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2347 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
2348 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
2349 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
2350 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
2351 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
2352 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
2353 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
2354 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
2355 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
2356 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
2357 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
2358 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2360 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
2361 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2363 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
2364 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2366 delete_test_files();
2369 static void test_MsiSetComponentState(void)
2371 INSTALLSTATE installed
, action
;
2373 char path
[MAX_PATH
];
2376 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2380 lstrcpy(path
, CURR_DIR
);
2381 lstrcat(path
, "\\");
2382 lstrcat(path
, msifile
);
2384 r
= MsiOpenPackage(path
, &package
);
2385 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2387 r
= MsiDoAction(package
, "CostInitialize");
2388 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2390 r
= MsiDoAction(package
, "FileCost");
2391 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2393 r
= MsiDoAction(package
, "CostFinalize");
2394 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2396 r
= MsiGetComponentState(package
, "dangler", &installed
, &action
);
2397 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2398 ok(installed
== INSTALLSTATE_ABSENT
, "Expected INSTALLSTATE_ABSENT, got %d\n", installed
);
2399 ok(action
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action
);
2401 r
= MsiSetComponentState(package
, "dangler", INSTALLSTATE_SOURCE
);
2402 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2404 MsiCloseHandle(package
);
2407 DeleteFileA(msifile
);
2410 static void test_packagecoltypes(void)
2412 MSIHANDLE hdb
, view
, rec
;
2413 char path
[MAX_PATH
];
2417 create_database(msifile
, tables
, sizeof(tables
) / sizeof(msi_table
));
2421 lstrcpy(path
, CURR_DIR
);
2422 lstrcat(path
, "\\");
2423 lstrcat(path
, msifile
);
2425 r
= MsiOpenDatabase(path
, MSIDBOPEN_READONLY
, &hdb
);
2426 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2428 query
= "SELECT * FROM `Media`";
2429 r
= MsiDatabaseOpenView( hdb
, query
, &view
);
2430 ok(r
== ERROR_SUCCESS
, "MsiDatabaseOpenView failed\n");
2432 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_NAMES
, &rec
);
2433 count
= MsiRecordGetFieldCount( rec
);
2434 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2435 ok(count
== 6, "Expected 6, got %d\n", count
);
2436 ok(check_record(rec
, 1, "DiskId"), "wrong column label\n");
2437 ok(check_record(rec
, 2, "LastSequence"), "wrong column label\n");
2438 ok(check_record(rec
, 3, "DiskPrompt"), "wrong column label\n");
2439 ok(check_record(rec
, 4, "Cabinet"), "wrong column label\n");
2440 ok(check_record(rec
, 5, "VolumeLabel"), "wrong column label\n");
2441 ok(check_record(rec
, 6, "Source"), "wrong column label\n");
2442 MsiCloseHandle(rec
);
2444 r
= MsiViewGetColumnInfo( view
, MSICOLINFO_TYPES
, &rec
);
2445 count
= MsiRecordGetFieldCount( rec
);
2446 ok(r
== ERROR_SUCCESS
, "MsiViewGetColumnInfo failed\n");
2447 ok(count
== 6, "Expected 6, got %d\n", count
);
2448 ok(check_record(rec
, 1, "i2"), "wrong column label\n");
2449 ok(check_record(rec
, 2, "i4"), "wrong column label\n");
2450 ok(check_record(rec
, 3, "L64"), "wrong column label\n");
2451 ok(check_record(rec
, 4, "S255"), "wrong column label\n");
2452 ok(check_record(rec
, 5, "S32"), "wrong column label\n");
2453 ok(check_record(rec
, 6, "S72"), "wrong column label\n");
2455 MsiCloseHandle(rec
);
2456 MsiCloseHandle(view
);
2457 MsiCloseHandle(hdb
);
2460 DeleteFile(msifile
);
2463 static void create_cc_test_files(void)
2468 static CHAR cab_context
[] = "test%d.cab";
2471 create_file("maximus", 500);
2472 create_file("augustus", 50000);
2473 create_file("tiberius", 500);
2474 create_file("caesar", 500);
2476 set_cab_parameters(&cabParams
, "test1.cab", 40000);
2478 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2479 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2480 get_temp_file
, &cabParams
, cab_context
);
2481 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2483 res
= add_file(hfci
, "maximus", tcompTYPE_NONE
);
2484 ok(res
, "Failed to add file maximus\n");
2486 res
= add_file(hfci
, "augustus", tcompTYPE_NONE
);
2487 ok(res
, "Failed to add file augustus\n");
2489 res
= add_file(hfci
, "tiberius", tcompTYPE_NONE
);
2490 ok(res
, "Failed to add file tiberius\n");
2492 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2493 ok(res
, "Failed to flush the cabinet\n");
2495 res
= FCIDestroy(hfci
);
2496 ok(res
, "Failed to destroy the cabinet\n");
2498 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2500 DeleteFile("maximus");
2501 DeleteFile("augustus");
2502 DeleteFile("tiberius");
2503 DeleteFile("caesar");
2506 static void delete_cab_files(void)
2508 SHFILEOPSTRUCT shfl
;
2509 CHAR path
[MAX_PATH
+10];
2511 lstrcpyA(path
, CURR_DIR
);
2512 lstrcatA(path
, "\\*.cab");
2513 path
[strlen(path
) + 1] = '\0';
2516 shfl
.wFunc
= FO_DELETE
;
2519 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
;
2521 SHFileOperation(&shfl
);
2524 static void test_continuouscabs(void)
2528 create_cc_test_files();
2529 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
2531 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2533 r
= MsiInstallProductA(msifile
, NULL
);
2534 if (r
== ERROR_SUCCESS
) /* win9x has a problem with this */
2536 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2537 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2538 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2539 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2540 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2544 DeleteFile(msifile
);
2546 create_cc_test_files();
2547 create_database(msifile
, cc2_tables
, sizeof(cc2_tables
) / sizeof(msi_table
));
2549 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2551 r
= MsiInstallProductA(msifile
, NULL
);
2552 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2553 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2554 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
2555 ok(delete_pf("msitest\\tiberius", TRUE
), "File not installed\n");
2556 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2557 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2560 DeleteFile(msifile
);
2563 static void test_caborder(void)
2567 create_file("imperator", 100);
2568 create_file("maximus", 500);
2569 create_file("augustus", 50000);
2570 create_file("caesar", 500);
2572 create_database(msifile
, cc_tables
, sizeof(cc_tables
) / sizeof(msi_table
));
2574 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2576 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
2577 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
2578 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2580 r
= MsiInstallProductA(msifile
, NULL
);
2581 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
2582 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
2583 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
2586 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
2587 ok(!delete_pf("msitest", FALSE
), "File is installed\n");
2592 create_cab_file("test1.cab", MEDIA_SIZE
, "imperator\0");
2593 create_cab_file("test2.cab", MEDIA_SIZE
, "maximus\0augustus\0");
2594 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
2596 r
= MsiInstallProductA(msifile
, NULL
);
2597 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
2598 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
2599 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
2600 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
2603 ok(!delete_pf("msitest", FALSE
), "File is installed\n");
2607 DeleteFile(msifile
);
2609 create_cc_test_files();
2610 create_database(msifile
, co_tables
, sizeof(co_tables
) / sizeof(msi_table
));
2612 r
= MsiInstallProductA(msifile
, NULL
);
2613 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
2614 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
2615 ok(!delete_pf("msitest", FALSE
), "File is installed\n");
2618 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
2619 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
2623 DeleteFile(msifile
);
2625 create_cc_test_files();
2626 create_database(msifile
, co2_tables
, sizeof(co2_tables
) / sizeof(msi_table
));
2628 r
= MsiInstallProductA(msifile
, NULL
);
2629 ok(!delete_pf("msitest\\caesar", TRUE
), "File is installed\n");
2632 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
2633 ok(!delete_pf("msitest\\augustus", TRUE
), "File is installed\n");
2634 ok(!delete_pf("msitest\\maximus", TRUE
), "File is installed\n");
2635 ok(!delete_pf("msitest", FALSE
), "File is installed\n");
2639 DeleteFile("imperator");
2640 DeleteFile("maximus");
2641 DeleteFile("augustus");
2642 DeleteFile("caesar");
2643 DeleteFile(msifile
);
2646 static void test_mixedmedia(void)
2650 CreateDirectoryA("msitest", NULL
);
2651 create_file("msitest\\maximus", 500);
2652 create_file("msitest\\augustus", 500);
2653 create_file("caesar", 500);
2655 create_database(msifile
, mm_tables
, sizeof(mm_tables
) / sizeof(msi_table
));
2657 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2659 create_cab_file("test1.cab", MEDIA_SIZE
, "caesar\0");
2661 r
= MsiInstallProductA(msifile
, NULL
);
2662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2663 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2664 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2665 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2666 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2668 /* Delete the files in the temp (current) folder */
2669 DeleteFile("msitest\\maximus");
2670 DeleteFile("msitest\\augustus");
2671 RemoveDirectory("msitest");
2672 DeleteFile("caesar");
2673 DeleteFile("test1.cab");
2674 DeleteFile(msifile
);
2677 static void test_samesequence(void)
2681 create_cc_test_files();
2682 create_database(msifile
, ss_tables
, sizeof(ss_tables
) / sizeof(msi_table
));
2684 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2686 r
= MsiInstallProductA(msifile
, NULL
);
2687 if (r
== ERROR_SUCCESS
) /* win9x has a problem with this */
2689 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2690 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2691 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2692 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2693 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2697 DeleteFile(msifile
);
2700 static void test_uiLevelFlags(void)
2704 create_cc_test_files();
2705 create_database(msifile
, ui_tables
, sizeof(ui_tables
) / sizeof(msi_table
));
2707 MsiSetInternalUI(INSTALLUILEVEL_NONE
| INSTALLUILEVEL_SOURCERESONLY
, NULL
);
2709 r
= MsiInstallProductA(msifile
, NULL
);
2710 if (r
== ERROR_SUCCESS
) /* win9x has a problem with this */
2712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2713 ok(!delete_pf("msitest\\maximus", TRUE
), "UI install occurred, but execute-only was requested.\n");
2714 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
2715 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
2716 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2720 DeleteFile(msifile
);
2723 static BOOL
file_matches(LPSTR path
)
2729 file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
2730 NULL
, OPEN_EXISTING
, 0, NULL
);
2732 ZeroMemory(buf
, MAX_PATH
);
2733 ReadFile(file
, buf
, 15, &size
, NULL
);
2736 return !lstrcmp(buf
, "msitest\\maximus");
2739 static void test_readonlyfile(void)
2744 CHAR path
[MAX_PATH
];
2746 CreateDirectoryA("msitest", NULL
);
2747 create_file("msitest\\maximus", 500);
2748 create_database(msifile
, rof_tables
, sizeof(rof_tables
) / sizeof(msi_table
));
2750 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2752 lstrcpy(path
, PROG_FILES_DIR
);
2753 lstrcat(path
, "\\msitest");
2754 CreateDirectory(path
, NULL
);
2756 lstrcat(path
, "\\maximus");
2757 file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
2758 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
2760 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
2763 r
= MsiInstallProductA(msifile
, NULL
);
2764 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2765 ok(file_matches(path
), "Expected file to be overwritten\n");
2766 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2767 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2769 /* Delete the files in the temp (current) folder */
2770 DeleteFile("msitest\\maximus");
2771 RemoveDirectory("msitest");
2772 DeleteFile(msifile
);
2775 static void test_readonlyfile_cab(void)
2780 CHAR path
[MAX_PATH
];
2783 CreateDirectoryA("msitest", NULL
);
2784 create_file("maximus", 500);
2785 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
2786 DeleteFile("maximus");
2788 create_database(msifile
, rofc_tables
, sizeof(rofc_tables
) / sizeof(msi_table
));
2790 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2792 lstrcpy(path
, PROG_FILES_DIR
);
2793 lstrcat(path
, "\\msitest");
2794 CreateDirectory(path
, NULL
);
2796 lstrcat(path
, "\\maximus");
2797 file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
2798 NULL
, CREATE_NEW
, FILE_ATTRIBUTE_READONLY
, NULL
);
2800 WriteFile(file
, "readonlyfile", strlen("readonlyfile"), &size
, NULL
);
2803 r
= MsiInstallProductA(msifile
, NULL
);
2804 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2806 memset( buf
, 0, sizeof(buf
) );
2807 if ((file
= CreateFile(path
, GENERIC_READ
, FILE_SHARE_READ
| FILE_SHARE_WRITE
,
2808 NULL
, OPEN_EXISTING
, 0, NULL
)) != INVALID_HANDLE_VALUE
)
2810 ReadFile(file
, buf
, sizeof(buf
) - 1, &size
, NULL
);
2813 ok( !lstrcmp( buf
, "maximus" ), "Expected file to be overwritten, got '%s'\n", buf
);
2814 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2815 ok(delete_pf("msitest", FALSE
), "File not installed\n");
2817 /* Delete the files in the temp (current) folder */
2819 DeleteFile("msitest\\maximus");
2820 RemoveDirectory("msitest");
2821 DeleteFile(msifile
);
2824 static BOOL
add_cabinet_storage(LPCSTR db
, LPCSTR cabinet
)
2826 WCHAR dbW
[MAX_PATH
], cabinetW
[MAX_PATH
];
2832 MultiByteToWideChar(CP_ACP
, 0, db
, -1, dbW
, MAX_PATH
);
2833 hr
= StgOpenStorage(dbW
, NULL
, STGM_DIRECT
|STGM_READWRITE
|STGM_SHARE_EXCLUSIVE
, NULL
, 0, &stg
);
2837 MultiByteToWideChar(CP_ACP
, 0, cabinet
, -1, cabinetW
, MAX_PATH
);
2838 hr
= IStorage_CreateStream(stg
, cabinetW
, STGM_WRITE
|STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
2841 IStorage_Release(stg
);
2845 handle
= CreateFileW(cabinetW
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, 0, NULL
);
2846 if (handle
!= INVALID_HANDLE_VALUE
)
2850 if (ReadFile(handle
, buffer
, sizeof(buffer
), &count
, NULL
))
2851 IStream_Write(stm
, buffer
, count
, &count
);
2852 CloseHandle(handle
);
2855 IStream_Release(stm
);
2856 IStorage_Release(stg
);
2861 static void test_lastusedsource(void)
2863 static char prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2866 char value
[MAX_PATH
], path
[MAX_PATH
];
2869 if (!pMsiSourceListGetInfoA
)
2871 win_skip("MsiSourceListGetInfoA is not available\n");
2875 CreateDirectoryA("msitest", NULL
);
2876 create_file("maximus", 500);
2877 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
2878 DeleteFile("maximus");
2880 create_database("msifile0.msi", lus0_tables
, sizeof(lus0_tables
) / sizeof(msi_table
));
2881 create_database("msifile1.msi", lus1_tables
, sizeof(lus1_tables
) / sizeof(msi_table
));
2882 create_database("msifile2.msi", lus2_tables
, sizeof(lus2_tables
) / sizeof(msi_table
));
2884 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2886 /* no cabinet file */
2889 lstrcpyA(value
, "aaa");
2890 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
2891 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
2892 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r
);
2893 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
2895 r
= MsiInstallProductA("msifile0.msi", "PUBLISH_PRODUCT=1");
2896 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2898 lstrcpyA(path
, CURR_DIR
);
2899 lstrcatA(path
, "\\");
2902 lstrcpyA(value
, "aaa");
2903 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
2904 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
2905 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2908 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
2909 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
2912 r
= MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
2913 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2915 /* separate cabinet file */
2918 lstrcpyA(value
, "aaa");
2919 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
2920 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
2921 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r
);
2922 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
2924 r
= MsiInstallProductA("msifile1.msi", "PUBLISH_PRODUCT=1");
2925 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2927 lstrcpyA(path
, CURR_DIR
);
2928 lstrcatA(path
, "\\");
2931 lstrcpyA(value
, "aaa");
2932 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
2933 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
2934 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2937 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
2938 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
2941 r
= MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
2942 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2945 lstrcpyA(value
, "aaa");
2946 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
2947 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
2948 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r
);
2949 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
2951 /* embedded cabinet stream */
2953 add_cabinet_storage("msifile2.msi", "test1.cab");
2955 r
= MsiInstallProductA("msifile2.msi", "PUBLISH_PRODUCT=1");
2956 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2959 lstrcpyA(value
, "aaa");
2960 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
2961 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
2962 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2965 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
2966 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
2969 r
= MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
2970 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2973 lstrcpyA(value
, "aaa");
2974 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
2975 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
2976 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r
);
2977 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
2979 /* Delete the files in the temp (current) folder */
2981 DeleteFile("msitest\\maximus");
2982 RemoveDirectory("msitest");
2983 DeleteFile("msifile0.msi");
2984 DeleteFile("msifile1.msi");
2985 DeleteFile("msifile2.msi");
2988 static void test_setdirproperty(void)
2992 CreateDirectoryA("msitest", NULL
);
2993 create_file("msitest\\maximus", 500);
2994 create_database(msifile
, sdp_tables
, sizeof(sdp_tables
) / sizeof(msi_table
));
2996 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
2998 r
= MsiInstallProductA(msifile
, NULL
);
2999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3000 ok(delete_cf("msitest\\maximus", TRUE
), "File not installed\n");
3001 ok(delete_cf("msitest", FALSE
), "File not installed\n");
3003 /* Delete the files in the temp (current) folder */
3004 DeleteFile(msifile
);
3005 DeleteFile("msitest\\maximus");
3006 RemoveDirectory("msitest");
3009 static void test_cabisextracted(void)
3013 CreateDirectoryA("msitest", NULL
);
3014 create_file("msitest\\gaius", 500);
3015 create_file("maximus", 500);
3016 create_file("augustus", 500);
3017 create_file("caesar", 500);
3019 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
3020 create_cab_file("test2.cab", MEDIA_SIZE
, "augustus\0");
3021 create_cab_file("test3.cab", MEDIA_SIZE
, "caesar\0");
3023 create_database(msifile
, cie_tables
, sizeof(cie_tables
) / sizeof(msi_table
));
3025 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3027 r
= MsiInstallProductA(msifile
, NULL
);
3028 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3029 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3030 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
3031 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
3032 ok(delete_pf("msitest\\gaius", TRUE
), "File not installed\n");
3033 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3035 /* Delete the files in the temp (current) folder */
3037 DeleteFile(msifile
);
3038 DeleteFile("maximus");
3039 DeleteFile("augustus");
3040 DeleteFile("caesar");
3041 DeleteFile("msitest\\gaius");
3042 RemoveDirectory("msitest");
3045 static void test_concurrentinstall(void)
3048 CHAR path
[MAX_PATH
];
3050 CreateDirectoryA("msitest", NULL
);
3051 CreateDirectoryA("msitest\\msitest", NULL
);
3052 create_file("msitest\\maximus", 500);
3053 create_file("msitest\\msitest\\augustus", 500);
3055 create_database(msifile
, ci_tables
, sizeof(ci_tables
) / sizeof(msi_table
));
3057 lstrcpyA(path
, CURR_DIR
);
3058 lstrcatA(path
, "\\msitest\\concurrent.msi");
3059 create_database(path
, ci2_tables
, sizeof(ci2_tables
) / sizeof(msi_table
));
3061 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3063 r
= MsiInstallProductA(msifile
, NULL
);
3064 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3065 if (!delete_pf("msitest\\augustus", TRUE
))
3066 trace("concurrent installs not supported\n");
3067 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3068 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3072 r
= MsiInstallProductA(msifile
, NULL
);
3073 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3074 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3075 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
3076 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3078 DeleteFile(msifile
);
3079 DeleteFile("msitest\\msitest\\augustus");
3080 DeleteFile("msitest\\maximus");
3081 RemoveDirectory("msitest\\msitest");
3082 RemoveDirectory("msitest");
3085 static void test_setpropertyfolder(void)
3088 CHAR path
[MAX_PATH
];
3091 lstrcpyA(path
, PROG_FILES_DIR
);
3092 lstrcatA(path
, "\\msitest\\added");
3094 CreateDirectoryA("msitest", NULL
);
3095 create_file("msitest\\maximus", 500);
3097 create_database(msifile
, spf_tables
, sizeof(spf_tables
) / sizeof(msi_table
));
3099 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3101 r
= MsiInstallProductA(msifile
, NULL
);
3102 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3103 attr
= GetFileAttributesA(path
);
3104 if (attr
!= INVALID_FILE_ATTRIBUTES
&& (attr
& FILE_ATTRIBUTE_DIRECTORY
))
3106 ok(delete_pf("msitest\\added\\maximus", TRUE
), "File not installed\n");
3107 ok(delete_pf("msitest\\added", FALSE
), "File not installed\n");
3108 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3112 trace("changing folder property not supported\n");
3113 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3114 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3117 /* Delete the files in the temp (current) folder */
3118 DeleteFile(msifile
);
3119 DeleteFile("msitest\\maximus");
3120 RemoveDirectory("msitest");
3123 static BOOL
file_exists(LPCSTR file
)
3125 return GetFileAttributes(file
) != INVALID_FILE_ATTRIBUTES
;
3128 static BOOL
pf_exists(LPCSTR file
)
3130 CHAR path
[MAX_PATH
];
3132 lstrcpyA(path
, PROG_FILES_DIR
);
3133 lstrcatA(path
, "\\");
3134 lstrcatA(path
, file
);
3136 return file_exists(path
);
3139 static void delete_pfmsitest_files(void)
3141 SHFILEOPSTRUCT shfl
;
3142 CHAR path
[MAX_PATH
+11];
3144 lstrcpyA(path
, PROG_FILES_DIR
);
3145 lstrcatA(path
, "\\msitest\\*");
3146 path
[strlen(path
) + 1] = '\0';
3149 shfl
.wFunc
= FO_DELETE
;
3152 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
;
3154 SHFileOperation(&shfl
);
3156 lstrcpyA(path
, PROG_FILES_DIR
);
3157 lstrcatA(path
, "\\msitest");
3158 RemoveDirectoryA(path
);
3161 static void check_reg_str(HKEY prodkey
, LPCSTR name
, LPCSTR expected
, BOOL bcase
, DWORD line
)
3169 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)val
, &size
);
3171 if (res
!= ERROR_SUCCESS
||
3172 (type
!= REG_SZ
&& type
!= REG_EXPAND_SZ
&& type
!= REG_MULTI_SZ
))
3174 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
3179 ok_(__FILE__
, line
)(lstrlenA(val
) == 0, "Expected empty string, got %s\n", val
);
3183 ok_(__FILE__
, line
)(!lstrcmpA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
3185 ok_(__FILE__
, line
)(!lstrcmpiA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
3189 static void check_reg_dword(HKEY prodkey
, LPCSTR name
, DWORD expected
, DWORD line
)
3191 DWORD val
, size
, type
;
3194 size
= sizeof(DWORD
);
3195 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
3197 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
3199 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
3203 ok_(__FILE__
, line
)(val
== expected
, "Expected %d, got %d\n", expected
, val
);
3206 static void check_reg_dword2(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD line
)
3208 DWORD val
, size
, type
;
3211 size
= sizeof(DWORD
);
3212 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
3214 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
3216 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
3220 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
, "Expected %d or %d, got %d\n", expected1
, expected2
, val
);
3223 static void check_reg_dword3(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
, DWORD line
)
3225 DWORD val
, size
, type
;
3228 size
= sizeof(DWORD
);
3229 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
3231 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
3233 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
3237 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
,
3238 "Expected %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, val
);
3241 #define CHECK_REG_STR(prodkey, name, expected) \
3242 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
3244 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
3245 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
3246 RegDeleteValueA(prodkey, name);
3248 #define CHECK_REG_ISTR(prodkey, name, expected) \
3249 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
3251 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
3252 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
3253 RegDeleteValueA(prodkey, name);
3255 #define CHECK_REG_DWORD(prodkey, name, expected) \
3256 check_reg_dword(prodkey, name, expected, __LINE__);
3258 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
3259 check_reg_dword(prodkey, name, expected, __LINE__); \
3260 RegDeleteValueA(prodkey, name);
3262 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
3263 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
3265 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
3266 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
3267 RegDeleteValueA(prodkey, name);
3269 #define CHECK_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \
3270 check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__);
3272 #define CHECK_DEL_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \
3273 check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__); \
3274 RegDeleteValueA(prodkey, name);
3276 static void get_date_str(LPSTR date
)
3280 static const char date_fmt
[] = "%d%02d%02d";
3281 GetLocalTime(&systime
);
3282 sprintf(date
, date_fmt
, systime
.wYear
, systime
.wMonth
, systime
.wDay
);
3285 static void test_publish_registerproduct(void)
3292 char date
[MAX_PATH
];
3293 char temp
[MAX_PATH
];
3294 char keypath
[MAX_PATH
];
3296 static const CHAR uninstall
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3297 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3298 static const CHAR userdata
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
3299 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3300 static const CHAR ugkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
3301 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3302 static const CHAR userugkey
[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
3303 "\\51AAE0C44620A5E4788506E91F249BD2";
3305 if (!get_user_sid(&usersid
))
3309 GetTempPath(MAX_PATH
, temp
);
3311 CreateDirectoryA("msitest", NULL
);
3312 create_file("msitest\\maximus", 500);
3314 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3316 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3318 /* RegisterProduct */
3319 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
3320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3321 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3322 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3324 res
= RegOpenKeyA(HKEY_CURRENT_USER
, userugkey
, &hkey
);
3325 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3327 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, uninstall
, &hkey
);
3328 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3330 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
3331 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
3332 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
3333 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
3334 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3335 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
3336 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3337 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
3338 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
3339 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
3340 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
3341 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
3342 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
3343 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
3344 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
3345 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
3346 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
3347 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3348 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3349 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
3350 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
3351 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
3354 CHECK_DEL_REG_DWORD3(hkey
, "EstimatedSize", 12, -12, 4);
3357 RegDeleteKeyA(hkey
, "");
3360 sprintf(keypath
, userdata
, usersid
);
3361 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &hkey
);
3362 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3364 res
= RegOpenKeyA(hkey
, "InstallProperties", &props
);
3365 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3367 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
3368 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
3369 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
3370 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
3371 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
3372 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3373 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
3374 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3375 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
3376 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
3377 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
3378 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
3379 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
3380 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
3381 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
3382 CHECK_DEL_REG_STR(props
, "Size", NULL
);
3383 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
3384 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
3385 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
3386 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
3387 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
3388 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
3389 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
3392 CHECK_DEL_REG_DWORD3(props
, "EstimatedSize", 12, -12, 4);
3395 RegDeleteKeyA(props
, "");
3398 res
= RegOpenKeyA(hkey
, "Usage", &usage
);
3401 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3404 RegDeleteKeyA(usage
, "");
3406 RegDeleteKeyA(hkey
, "");
3409 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, ugkey
, &hkey
);
3410 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3412 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3414 RegDeleteKeyA(hkey
, "");
3417 /* RegisterProduct, machine */
3418 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 ALLUSERS=1");
3419 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3420 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3421 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3423 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, userugkey
, &hkey
);
3424 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3426 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, uninstall
, &hkey
);
3427 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3429 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
3430 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
3431 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
3432 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
3433 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3434 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
3435 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3436 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
3437 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
3438 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
3439 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
3440 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
3441 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
3442 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
3443 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
3444 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
3445 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
3446 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3447 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3448 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
3449 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
3450 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
3453 CHECK_DEL_REG_DWORD3(hkey
, "EstimatedSize", 12, -12, 4);
3456 RegDeleteKeyA(hkey
, "");
3459 sprintf(keypath
, userdata
, "S-1-5-18");
3460 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &hkey
);
3461 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3463 res
= RegOpenKeyA(hkey
, "InstallProperties", &props
);
3464 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3466 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
3467 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
3468 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
3469 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
3470 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
3471 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3472 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
3473 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3474 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
3475 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
3476 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
3477 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
3478 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
3479 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
3480 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
3481 CHECK_DEL_REG_STR(props
, "Size", NULL
);
3482 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
3483 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
3484 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
3485 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
3486 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
3487 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
3488 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
3491 CHECK_DEL_REG_DWORD3(props
, "EstimatedSize", 12, -12, 4);
3494 RegDeleteKeyA(props
, "");
3497 res
= RegOpenKeyA(hkey
, "Usage", &usage
);
3500 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3503 RegDeleteKeyA(usage
, "");
3505 RegDeleteKeyA(hkey
, "");
3508 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, ugkey
, &hkey
);
3509 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3511 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3513 RegDeleteKeyA(hkey
, "");
3516 DeleteFile(msifile
);
3517 DeleteFile("msitest\\maximus");
3518 RemoveDirectory("msitest");
3519 HeapFree(GetProcessHeap(), 0, usersid
);
3522 static void test_publish_publishproduct(void)
3527 HKEY sourcelist
, net
, props
;
3528 HKEY hkey
, patches
, media
;
3529 CHAR keypath
[MAX_PATH
];
3530 CHAR temp
[MAX_PATH
];
3531 CHAR path
[MAX_PATH
];
3533 static const CHAR prodpath
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3534 "\\Installer\\UserData\\%s\\Products"
3535 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3536 static const CHAR cuprodpath
[] = "Software\\Microsoft\\Installer\\Products"
3537 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3538 static const CHAR cuupgrades
[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
3539 "\\51AAE0C44620A5E4788506E91F249BD2";
3540 static const CHAR badprod
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3541 "\\Installer\\Products"
3542 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3543 static const CHAR machprod
[] = "Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3544 static const CHAR machup
[] = "Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3546 if (!get_user_sid(&usersid
))
3549 GetTempPath(MAX_PATH
, temp
);
3551 CreateDirectoryA("msitest", NULL
);
3552 create_file("msitest\\maximus", 500);
3554 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3556 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3558 /* PublishProduct, current user */
3559 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
3560 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3561 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3562 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3564 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, badprod
, &hkey
);
3565 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3567 sprintf(keypath
, prodpath
, usersid
);
3568 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &hkey
);
3569 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3571 res
= RegOpenKeyA(hkey
, "InstallProperties", &props
);
3572 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3574 res
= RegOpenKeyA(hkey
, "Patches", &patches
);
3577 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3579 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3582 RegDeleteKeyA(patches
, "");
3583 RegCloseKey(patches
);
3584 RegDeleteKeyA(hkey
, "");
3587 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3588 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3590 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3591 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
3592 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3593 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3594 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3595 CHECK_DEL_REG_DWORD(hkey
, "Assignment", 0);
3596 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3597 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3598 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3600 res
= RegOpenKeyA(hkey
, "SourceList", &sourcelist
);
3601 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3603 lstrcpyA(path
, "n;1;");
3604 lstrcatA(path
, temp
);
3605 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3606 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3608 res
= RegOpenKeyA(sourcelist
, "Net", &net
);
3609 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3611 CHECK_DEL_REG_STR(net
, "1", temp
);
3613 RegDeleteKeyA(net
, "");
3616 res
= RegOpenKeyA(sourcelist
, "Media", &media
);
3617 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3619 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3621 RegDeleteKeyA(media
, "");
3623 RegDeleteKeyA(sourcelist
, "");
3624 RegCloseKey(sourcelist
);
3625 RegDeleteKeyA(hkey
, "");
3628 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuupgrades
, &hkey
);
3629 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3631 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3633 RegDeleteKeyA(hkey
, "");
3636 /* PublishProduct, machine */
3637 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3638 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3639 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3640 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3642 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, badprod
, &hkey
);
3643 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3645 sprintf(keypath
, prodpath
, "S-1-5-18");
3646 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &hkey
);
3647 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3649 res
= RegOpenKeyA(hkey
, "InstallProperties", &props
);
3650 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3652 res
= RegOpenKeyA(hkey
, "Patches", &patches
);
3655 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3657 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3660 RegDeleteKeyA(patches
, "");
3661 RegCloseKey(patches
);
3662 RegDeleteKeyA(hkey
, "");
3665 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, machprod
, &hkey
);
3666 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3668 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3669 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
3670 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3671 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3672 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3673 todo_wine
CHECK_DEL_REG_DWORD(hkey
, "Assignment", 1);
3674 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3675 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3676 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3678 res
= RegOpenKeyA(hkey
, "SourceList", &sourcelist
);
3679 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3681 lstrcpyA(path
, "n;1;");
3682 lstrcatA(path
, temp
);
3683 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3684 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3686 res
= RegOpenKeyA(sourcelist
, "Net", &net
);
3687 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3689 CHECK_DEL_REG_STR(net
, "1", temp
);
3691 RegDeleteKeyA(net
, "");
3694 res
= RegOpenKeyA(sourcelist
, "Media", &media
);
3695 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3697 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3699 RegDeleteKeyA(media
, "");
3701 RegDeleteKeyA(sourcelist
, "");
3702 RegCloseKey(sourcelist
);
3703 RegDeleteKeyA(hkey
, "");
3706 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, machup
, &hkey
);
3707 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3709 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3711 RegDeleteKeyA(hkey
, "");
3714 DeleteFile(msifile
);
3715 DeleteFile("msitest\\maximus");
3716 RemoveDirectory("msitest");
3717 HeapFree(GetProcessHeap(), 0, usersid
);
3720 static void test_publish_publishfeatures(void)
3726 CHAR keypath
[MAX_PATH
];
3728 static const CHAR cupath
[] = "Software\\Microsoft\\Installer\\Features"
3729 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3730 static const CHAR udpath
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3731 "\\Installer\\UserData\\%s\\Products"
3732 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3733 static const CHAR featkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3734 "\\Installer\\Features";
3735 static const CHAR classfeat
[] = "Software\\Classes\\Installer\\Features"
3736 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3738 if (!get_user_sid(&usersid
))
3741 CreateDirectoryA("msitest", NULL
);
3742 create_file("msitest\\maximus", 500);
3744 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3746 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3748 /* PublishFeatures, current user */
3749 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
3750 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3751 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3752 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3754 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, featkey
, &hkey
);
3755 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3757 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, classfeat
, &hkey
);
3758 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3760 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3761 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3763 CHECK_REG_STR(hkey
, "feature", "");
3764 CHECK_REG_STR(hkey
, "montecristo", "");
3766 RegDeleteValueA(hkey
, "feature");
3767 RegDeleteValueA(hkey
, "montecristo");
3768 RegDeleteKeyA(hkey
, "");
3771 sprintf(keypath
, udpath
, usersid
);
3772 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &hkey
);
3773 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3775 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3776 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3778 RegDeleteValueA(hkey
, "feature");
3779 RegDeleteValueA(hkey
, "montecristo");
3780 RegDeleteKeyA(hkey
, "");
3783 /* PublishFeatures, machine */
3784 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1 ALLUSERS=1");
3785 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3786 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3787 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3789 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, featkey
, &hkey
);
3790 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3792 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3793 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3795 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, classfeat
, &hkey
);
3796 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3798 CHECK_REG_STR(hkey
, "feature", "");
3799 CHECK_REG_STR(hkey
, "montecristo", "");
3801 RegDeleteValueA(hkey
, "feature");
3802 RegDeleteValueA(hkey
, "montecristo");
3803 RegDeleteKeyA(hkey
, "");
3806 sprintf(keypath
, udpath
, "S-1-5-18");
3807 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &hkey
);
3808 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3810 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3811 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3813 RegDeleteValueA(hkey
, "feature");
3814 RegDeleteValueA(hkey
, "montecristo");
3815 RegDeleteKeyA(hkey
, "");
3818 DeleteFile(msifile
);
3819 DeleteFile("msitest\\maximus");
3820 RemoveDirectory("msitest");
3821 HeapFree(GetProcessHeap(), 0, usersid
);
3824 static LPSTR
reg_get_val_str(HKEY hkey
, LPCSTR name
)
3830 r
= RegQueryValueExA(hkey
, name
, NULL
, NULL
, NULL
, &len
);
3831 if (r
!= ERROR_SUCCESS
)
3834 len
+= sizeof (WCHAR
);
3835 val
= HeapAlloc(GetProcessHeap(), 0, len
);
3836 if (!val
) return NULL
;
3838 RegQueryValueExA(hkey
, name
, NULL
, NULL
, (LPBYTE
)val
, &len
);
3842 static void get_owner_company(LPSTR
*owner
, LPSTR
*company
)
3847 *owner
= *company
= NULL
;
3849 res
= RegOpenKeyA(HKEY_CURRENT_USER
,
3850 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey
);
3851 if (res
== ERROR_SUCCESS
)
3853 *owner
= reg_get_val_str(hkey
, "DefName");
3854 *company
= reg_get_val_str(hkey
, "DefCompany");
3858 if (!*owner
|| !*company
)
3860 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
,
3861 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
);
3862 if (res
== ERROR_SUCCESS
)
3864 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3865 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3870 if (!*owner
|| !*company
)
3872 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
,
3873 "Software\\Microsoft\\Windows NT\\CurrentVersion", &hkey
);
3874 if (res
== ERROR_SUCCESS
)
3876 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3877 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3883 static void test_publish_registeruser(void)
3889 LPSTR owner
, company
;
3890 CHAR keypath
[MAX_PATH
];
3892 static const CHAR keyfmt
[] =
3893 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3894 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3896 if (!get_user_sid(&usersid
))
3899 get_owner_company(&owner
, &company
);
3901 CreateDirectoryA("msitest", NULL
);
3902 create_file("msitest\\maximus", 500);
3904 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3906 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3908 /* RegisterUser, per-user */
3909 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1");
3910 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3911 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3912 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3914 sprintf(keypath
, keyfmt
, usersid
);
3916 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &props
);
3917 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3919 CHECK_REG_STR(props
, "ProductID", "none");
3920 CHECK_REG_STR(props
, "RegCompany", company
);
3921 CHECK_REG_STR(props
, "RegOwner", owner
);
3923 RegDeleteValueA(props
, "ProductID");
3924 RegDeleteValueA(props
, "RegCompany");
3925 RegDeleteValueA(props
, "RegOwner");
3926 RegDeleteKeyA(props
, "");
3929 /* RegisterUser, machine */
3930 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1 ALLUSERS=1");
3931 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3932 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3933 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3935 sprintf(keypath
, keyfmt
, "S-1-5-18");
3937 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &props
);
3938 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3940 CHECK_REG_STR(props
, "ProductID", "none");
3941 CHECK_REG_STR(props
, "RegCompany", company
);
3942 CHECK_REG_STR(props
, "RegOwner", owner
);
3944 RegDeleteValueA(props
, "ProductID");
3945 RegDeleteValueA(props
, "RegCompany");
3946 RegDeleteValueA(props
, "RegOwner");
3947 RegDeleteKeyA(props
, "");
3950 HeapFree(GetProcessHeap(), 0, company
);
3951 HeapFree(GetProcessHeap(), 0, owner
);
3953 DeleteFile(msifile
);
3954 DeleteFile("msitest\\maximus");
3955 RemoveDirectory("msitest");
3959 static void test_publish_processcomponents(void)
3967 CHAR keypath
[MAX_PATH
];
3968 CHAR program_files_maximus
[MAX_PATH
];
3970 static const CHAR keyfmt
[] =
3971 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3972 "UserData\\%s\\Components\\%s";
3973 static const CHAR compkey
[] =
3974 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3976 if (!get_user_sid(&usersid
))
3979 CreateDirectoryA("msitest", NULL
);
3980 create_file("msitest\\maximus", 500);
3982 create_database(msifile
, ppc_tables
, sizeof(ppc_tables
) / sizeof(msi_table
));
3984 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3986 /* ProcessComponents, per-user */
3987 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
3988 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3989 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3990 ok(delete_pf("msitest", FALSE
), "File not installed\n");
3992 sprintf(keypath
, keyfmt
, usersid
, "CBABC2FDCCB35E749A8944D8C1C098B5");
3994 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &comp
);
3995 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3998 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3999 NULL
, NULL
, (LPBYTE
)val
, &size
);
4000 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4002 lstrcpyA(program_files_maximus
,PROG_FILES_DIR
);
4003 lstrcatA(program_files_maximus
,"\\msitest\\maximus");
4005 ok(!lstrcmpiA(val
, program_files_maximus
),
4006 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
4008 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, compkey
, &hkey
);
4009 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4011 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
4012 RegDeleteKeyA(comp
, "");
4015 sprintf(keypath
, keyfmt
, usersid
, "241C3DA58FECD0945B9687D408766058");
4017 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &comp
);
4018 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4021 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
4022 NULL
, NULL
, (LPBYTE
)val
, &size
);
4023 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4024 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
4025 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
4027 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, compkey
, &hkey
);
4028 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4030 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
4031 RegDeleteKeyA(comp
, "");
4034 /* ProcessComponents, machine */
4035 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1 ALLUSERS=1");
4036 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4037 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
4038 ok(delete_pf("msitest", FALSE
), "File not installed\n");
4040 sprintf(keypath
, keyfmt
, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
4042 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &comp
);
4043 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4046 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
4047 NULL
, NULL
, (LPBYTE
)val
, &size
);
4048 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4049 ok(!lstrcmpiA(val
, program_files_maximus
),
4050 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
4052 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, compkey
, &hkey
);
4053 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4055 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
4056 RegDeleteKeyA(comp
, "");
4059 sprintf(keypath
, keyfmt
, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
4061 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &comp
);
4062 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4065 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
4066 NULL
, NULL
, (LPBYTE
)val
, &size
);
4067 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4068 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
4069 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
4071 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, compkey
, &hkey
);
4072 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4074 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
4075 RegDeleteKeyA(comp
, "");
4078 DeleteFile(msifile
);
4079 DeleteFile("msitest\\maximus");
4080 RemoveDirectory("msitest");
4084 static void test_publish(void)
4088 HKEY uninstall
, prodkey
;
4090 CHAR prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4091 char date
[MAX_PATH
];
4092 char temp
[MAX_PATH
];
4094 static const CHAR subkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
4096 if (!pMsiQueryComponentStateA
)
4098 win_skip("MsiQueryComponentStateA is not available\n");
4103 GetTempPath(MAX_PATH
, temp
);
4105 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, subkey
, &uninstall
);
4106 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4108 CreateDirectoryA("msitest", NULL
);
4109 create_file("msitest\\maximus", 500);
4111 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
4113 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
4115 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4116 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4118 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4119 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4121 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4122 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4124 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4125 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4126 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4127 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4129 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4130 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4132 /* nothing published */
4133 r
= MsiInstallProductA(msifile
, NULL
);
4134 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4135 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4136 ok(pf_exists("msitest"), "File not installed\n");
4138 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4139 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4141 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4142 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4144 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4145 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4147 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4148 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4149 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4150 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4152 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4153 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4155 /* PublishProduct and RegisterProduct */
4156 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
4157 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4158 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4159 ok(pf_exists("msitest"), "File not installed\n");
4161 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4162 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4164 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4165 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4167 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4168 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4170 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4171 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4172 ok(r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
4173 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4175 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4176 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4178 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4179 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4180 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4181 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4182 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4183 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4184 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4185 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4186 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4187 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4188 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4189 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4190 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4191 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4192 CHECK_REG_STR(prodkey
, "Size", NULL
);
4193 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4194 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4195 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4196 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4197 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4198 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4199 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4202 CHECK_REG_DWORD2(prodkey
, "EstimatedSize", 12, -12);
4205 RegCloseKey(prodkey
);
4207 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4208 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4209 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4210 ok(pf_exists("msitest"), "File deleted\n");
4212 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4213 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4215 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4216 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4218 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4219 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4221 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4222 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4223 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4224 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4226 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4227 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4229 /* complete install */
4230 r
= MsiInstallProductA(msifile
, "FULL=1");
4231 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4232 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4233 ok(pf_exists("msitest"), "File not installed\n");
4235 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4236 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4238 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4239 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4241 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4242 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4244 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4245 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4246 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4247 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4249 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4250 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4252 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4253 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4254 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4255 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4256 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4257 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4258 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4259 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4260 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4261 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4262 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4263 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4264 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4265 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4266 CHECK_REG_STR(prodkey
, "Size", NULL
);
4267 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4268 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4269 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4270 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4271 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4272 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4273 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4276 CHECK_REG_DWORD2(prodkey
, "EstimatedSize", 12, -12);
4279 RegCloseKey(prodkey
);
4281 /* no UnpublishFeatures */
4282 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4283 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4284 ok(!pf_exists("msitest\\maximus"), "File deleted\n");
4287 ok(!pf_exists("msitest"), "File deleted\n");
4290 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4291 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4293 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4294 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4296 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4297 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4299 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4300 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4301 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4302 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4304 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4305 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4307 /* complete install */
4308 r
= MsiInstallProductA(msifile
, "FULL=1");
4309 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4310 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4311 ok(pf_exists("msitest"), "File not installed\n");
4313 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4314 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4316 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4317 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4319 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4320 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4322 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4323 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4324 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4325 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4327 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4328 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4330 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4331 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4332 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4333 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4334 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4335 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4336 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4337 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4338 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4339 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4340 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4341 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4342 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4343 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4344 CHECK_REG_STR(prodkey
, "Size", NULL
);
4345 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4346 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4347 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4348 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4349 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4350 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4351 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4354 CHECK_REG_DWORD2(prodkey
, "EstimatedSize", 12, -12);
4357 RegCloseKey(prodkey
);
4359 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4360 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4361 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4362 todo_wine
ok(pf_exists("msitest\\maximus"), "File deleted\n");
4363 ok(pf_exists("msitest"), "File deleted\n");
4365 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4366 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4368 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4369 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4371 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4372 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4374 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4375 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4376 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4377 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4379 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4380 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4382 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4383 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4384 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4385 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4386 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4387 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4388 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4389 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4390 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4391 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4392 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4393 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4394 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4395 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4396 CHECK_REG_STR(prodkey
, "Size", NULL
);
4397 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4398 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4399 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4400 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4401 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4402 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4403 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4406 CHECK_REG_DWORD2(prodkey
, "EstimatedSize", 12, -12);
4409 RegCloseKey(prodkey
);
4411 /* complete install */
4412 r
= MsiInstallProductA(msifile
, "FULL=1");
4413 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4414 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4415 ok(pf_exists("msitest"), "File not installed\n");
4417 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4418 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4420 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4421 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4423 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4424 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4426 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4427 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4428 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4429 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4431 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4432 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4434 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4435 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4436 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4437 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4438 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4439 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4440 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4441 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4442 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4443 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4444 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4445 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4446 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4447 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4448 CHECK_REG_STR(prodkey
, "Size", NULL
);
4449 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4450 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4451 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4452 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4453 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4454 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4455 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4458 CHECK_REG_DWORD2(prodkey
, "EstimatedSize", 12, -20);
4461 RegCloseKey(prodkey
);
4463 /* UnpublishFeatures, both features removed */
4464 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4465 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4466 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4469 ok(!pf_exists("msitest"), "File not deleted\n");
4472 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4473 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4475 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4476 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4478 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4479 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4481 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4482 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4483 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4484 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4486 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4487 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4489 /* complete install */
4490 r
= MsiInstallProductA(msifile
, "FULL=1");
4491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4492 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4493 ok(pf_exists("msitest"), "File not installed\n");
4495 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4496 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4498 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4499 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4501 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4502 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4504 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4505 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4506 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4507 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4509 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4510 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4512 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4513 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4514 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4515 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4516 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4517 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4518 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4519 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4520 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4521 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4522 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4523 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4524 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4525 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4526 CHECK_REG_STR(prodkey
, "Size", NULL
);
4527 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4528 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4529 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4530 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4531 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4532 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4533 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4536 CHECK_REG_DWORD2(prodkey
, "EstimatedSize", 12, -12);
4539 RegCloseKey(prodkey
);
4541 /* complete uninstall */
4542 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4543 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4544 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4547 ok(!pf_exists("msitest"), "File not deleted\n");
4550 state
= MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4551 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4553 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
4554 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4556 state
= MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
4557 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4559 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4560 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4561 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4562 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4564 res
= RegOpenKeyA(uninstall
, prodcode
, &prodkey
);
4565 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4567 /* make sure 'Program Files\msitest' is removed */
4568 delete_pfmsitest_files();
4570 RegCloseKey(uninstall
);
4571 DeleteFile(msifile
);
4572 DeleteFile("msitest\\maximus");
4573 RemoveDirectory("msitest");
4576 static void test_publishsourcelist(void)
4580 CHAR value
[MAX_PATH
];
4581 CHAR path
[MAX_PATH
];
4582 CHAR prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4584 if (!pMsiSourceListEnumSourcesA
|| !pMsiSourceListGetInfoA
)
4586 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4590 CreateDirectoryA("msitest", NULL
);
4591 create_file("msitest\\maximus", 500);
4593 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
4595 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
4597 r
= MsiInstallProductA(msifile
, NULL
);
4598 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4599 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4600 ok(pf_exists("msitest"), "File not installed\n");
4602 /* nothing published */
4604 lstrcpyA(value
, "aaa");
4605 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4606 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAME
, value
, &size
);
4607 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4608 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4609 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4612 lstrcpyA(value
, "aaa");
4613 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4614 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4615 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4616 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4617 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4619 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
4620 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4621 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4622 ok(pf_exists("msitest"), "File not installed\n");
4624 /* after RegisterProduct */
4626 lstrcpyA(value
, "aaa");
4627 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4628 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAME
, value
, &size
);
4629 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4630 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4631 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4634 lstrcpyA(value
, "aaa");
4635 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4636 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4637 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4638 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4639 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4641 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
4642 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4643 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4644 ok(pf_exists("msitest"), "File not installed\n");
4646 /* after ProcessComponents */
4648 lstrcpyA(value
, "aaa");
4649 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4650 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAME
, value
, &size
);
4651 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4652 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4653 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4656 lstrcpyA(value
, "aaa");
4657 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4658 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4659 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4660 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4661 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4663 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
4664 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4665 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4666 ok(pf_exists("msitest"), "File not installed\n");
4668 /* after PublishFeatures */
4670 lstrcpyA(value
, "aaa");
4671 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4672 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAME
, value
, &size
);
4673 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4674 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4675 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4678 lstrcpyA(value
, "aaa");
4679 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4680 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4681 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4682 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4683 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4685 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
4686 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4687 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4688 ok(pf_exists("msitest"), "File not installed\n");
4690 /* after PublishProduct */
4692 lstrcpyA(value
, "aaa");
4693 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4694 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAME
, value
, &size
);
4695 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4696 ok(!lstrcmpA(value
, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value
);
4697 ok(size
== 11, "Expected 11, got %d\n", size
);
4700 lstrcpyA(value
, "aaa");
4701 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4702 MSICODE_PRODUCT
, INSTALLPROPERTY_MEDIAPACKAGEPATH
, value
, &size
);
4703 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4704 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4705 ok(size
== 0, "Expected 0, got %d\n", size
);
4708 lstrcpyA(value
, "aaa");
4709 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4710 MSICODE_PRODUCT
, INSTALLPROPERTY_DISKPROMPT
, value
, &size
);
4711 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4712 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4713 ok(size
== 0, "Expected 0, got %d\n", size
);
4715 lstrcpyA(path
, CURR_DIR
);
4716 lstrcatA(path
, "\\");
4719 lstrcpyA(value
, "aaa");
4720 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4721 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCE
, value
, &size
);
4722 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4723 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4724 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4727 lstrcpyA(value
, "aaa");
4728 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4729 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDTYPE
, value
, &size
);
4730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4731 ok(!lstrcmpA(value
, "n"), "Expected \"n\", got \"%s\"\n", value
);
4732 ok(size
== 1, "Expected 1, got %d\n", size
);
4735 lstrcpyA(value
, "aaa");
4736 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4737 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4738 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4739 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4740 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4743 lstrcpyA(value
, "aaa");
4744 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4745 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 0, value
, &size
);
4746 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4747 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4748 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4751 lstrcpyA(value
, "aaa");
4752 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4753 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 1, value
, &size
);
4754 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4755 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4756 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4758 /* complete uninstall */
4759 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4760 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4761 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4764 ok(!pf_exists("msitest"), "File not deleted\n");
4767 /* make sure 'Program Files\msitest' is removed */
4768 delete_pfmsitest_files();
4770 DeleteFile(msifile
);
4771 DeleteFile("msitest\\maximus");
4772 RemoveDirectory("msitest");
4775 static UINT
run_query(MSIHANDLE hdb
, MSIHANDLE hrec
, const char *query
)
4777 MSIHANDLE hview
= 0;
4780 r
= MsiDatabaseOpenView(hdb
, query
, &hview
);
4781 if(r
!= ERROR_SUCCESS
)
4784 r
= MsiViewExecute(hview
, hrec
);
4785 if(r
== ERROR_SUCCESS
)
4786 r
= MsiViewClose(hview
);
4787 MsiCloseHandle(hview
);
4791 static void set_transform_summary_info(void)
4794 MSIHANDLE suminfo
= 0;
4796 /* build summary info */
4797 r
= MsiGetSummaryInformation(0, mstfile
, 3, &suminfo
);
4798 ok(r
== ERROR_SUCCESS
, "Failed to open summaryinfo\n");
4800 r
= MsiSummaryInfoSetProperty(suminfo
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
4801 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
4803 r
= MsiSummaryInfoSetProperty(suminfo
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
4804 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
4805 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
4806 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
4807 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
4809 r
= MsiSummaryInfoSetProperty(suminfo
, PID_PAGECOUNT
, VT_I4
, 100, NULL
, NULL
);
4810 ok(r
== ERROR_SUCCESS
, "Failed to set summary info\n");
4812 r
= MsiSummaryInfoPersist(suminfo
);
4813 ok(r
== ERROR_SUCCESS
, "Failed to make summary info persist\n");
4815 r
= MsiCloseHandle(suminfo
);
4816 ok(r
== ERROR_SUCCESS
, "Failed to close suminfo\n");
4819 static void generate_transform(void)
4821 MSIHANDLE hdb1
, hdb2
;
4825 /* start with two identical databases */
4826 CopyFile(msifile
, msifile2
, FALSE
);
4828 r
= MsiOpenDatabase(msifile2
, MSIDBOPEN_TRANSACT
, &hdb1
);
4829 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
4831 r
= MsiDatabaseCommit(hdb1
);
4832 ok(r
== ERROR_SUCCESS
, "Failed to commit database\n");
4834 r
= MsiOpenDatabase(msifile
, MSIDBOPEN_READONLY
, &hdb2
);
4835 ok(r
== ERROR_SUCCESS
, "Failed to create database\n");
4837 query
= "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
4838 r
= run_query(hdb1
, 0, query
);
4839 ok(r
== ERROR_SUCCESS
, "failed to add property\n");
4841 /* database needs to be committed */
4842 MsiDatabaseCommit(hdb1
);
4844 r
= MsiDatabaseGenerateTransform(hdb1
, hdb2
, mstfile
, 0, 0);
4845 ok(r
== ERROR_SUCCESS
, "return code %d, should be ERROR_SUCCESS\n", r
);
4847 #if 0 /* not implemented in wine yet */
4848 r
= MsiCreateTransformSummaryInfo(hdb2
, hdb2
, mstfile
, 0, 0);
4849 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4852 MsiCloseHandle(hdb1
);
4853 MsiCloseHandle(hdb2
);
4856 /* data for generating a transform */
4858 /* tables transform names - encoded as they would be in an msi database file */
4859 static const WCHAR name1
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
4860 static const WCHAR name2
[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
4861 static const WCHAR name3
[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
4863 /* data in each table */
4864 static const char data1
[] = /* _StringData */
4865 "propval"; /* all the strings squashed together */
4867 static const WCHAR data2
[] = { /* _StringPool */
4869 0, 0, /* string 0 '' */
4870 4, 1, /* string 1 'prop' */
4871 3, 1, /* string 2 'val' */
4874 static const WCHAR data3
[] = { /* Property */
4875 0x0201, 0x0001, 0x0002,
4878 static const struct {
4882 } table_transform_data
[] =
4884 { name1
, data1
, sizeof data1
- 1 },
4885 { name2
, data2
, sizeof data2
},
4886 { name3
, data3
, sizeof data3
},
4889 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
4891 static void generate_transform_manual(void)
4893 IStorage
*stg
= NULL
;
4898 const DWORD mode
= STGM_CREATE
|STGM_READWRITE
|STGM_DIRECT
|STGM_SHARE_EXCLUSIVE
;
4900 const CLSID CLSID_MsiTransform
= { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
4902 MultiByteToWideChar(CP_ACP
, 0, mstfile
, -1, name
, 0x20);
4904 r
= StgCreateDocfile(name
, mode
, 0, &stg
);
4905 ok(r
== S_OK
, "failed to create storage\n");
4909 r
= IStorage_SetClass(stg
, &CLSID_MsiTransform
);
4910 ok(r
== S_OK
, "failed to set storage type\n");
4912 for (i
=0; i
<NUM_TRANSFORM_TABLES
; i
++)
4914 r
= IStorage_CreateStream(stg
, table_transform_data
[i
].name
,
4915 STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
4918 ok(0, "failed to create stream %08x\n", r
);
4922 r
= IStream_Write(stm
, table_transform_data
[i
].data
,
4923 table_transform_data
[i
].size
, &count
);
4924 if (FAILED(r
) || count
!= table_transform_data
[i
].size
)
4925 ok(0, "failed to write stream\n");
4926 IStream_Release(stm
);
4929 IStorage_Release(stg
);
4931 set_transform_summary_info();
4934 static void test_transformprop(void)
4938 CreateDirectoryA("msitest", NULL
);
4939 create_file("msitest\\augustus", 500);
4941 create_database(msifile
, tp_tables
, sizeof(tp_tables
) / sizeof(msi_table
));
4943 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4945 r
= MsiInstallProductA(msifile
, NULL
);
4946 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4947 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4948 ok(!delete_pf("msitest", FALSE
), "File installed\n");
4951 generate_transform();
4953 generate_transform_manual();
4955 r
= MsiInstallProductA(msifile
, "TRANSFORMS=winetest.mst");
4956 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4957 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4958 ok(delete_pf("msitest", FALSE
), "File not installed\n");
4960 /* Delete the files in the temp (current) folder */
4961 DeleteFile(msifile
);
4962 DeleteFile(msifile2
);
4963 DeleteFile(mstfile
);
4964 DeleteFile("msitest\\augustus");
4965 RemoveDirectory("msitest");
4968 static void test_currentworkingdir(void)
4971 CHAR drive
[MAX_PATH
], path
[MAX_PATH
];
4974 CreateDirectoryA("msitest", NULL
);
4975 create_file("msitest\\augustus", 500);
4977 create_database(msifile
, cwd_tables
, sizeof(cwd_tables
) / sizeof(msi_table
));
4979 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4981 CreateDirectoryA("diffdir", NULL
);
4982 SetCurrentDirectoryA("diffdir");
4984 sprintf(path
, "..\\%s", msifile
);
4985 r
= MsiInstallProductA(path
, NULL
);
4988 ok(r
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r
);
4989 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4990 ok(!delete_pf("msitest", FALSE
), "File installed\n");
4993 sprintf(path
, "%s\\%s", CURR_DIR
, msifile
);
4994 r
= MsiInstallProductA(path
, NULL
);
4995 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4996 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4997 ok(delete_pf("msitest", FALSE
), "File not installed\n");
4999 lstrcpyA(drive
, CURR_DIR
);
5002 SetCurrentDirectoryA(drive
);
5004 lstrcpy(path
, CURR_DIR
);
5005 if (path
[lstrlenA(path
) - 1] != '\\')
5006 lstrcatA(path
, "\\");
5007 lstrcatA(path
, msifile
);
5008 ptr
= strchr(path
, ':');
5011 r
= MsiInstallProductA(ptr
, NULL
);
5012 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5013 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
5014 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5016 SetCurrentDirectoryA(CURR_DIR
);
5018 DeleteFile(msifile
);
5019 DeleteFile("msitest\\augustus");
5020 RemoveDirectory("msitest");
5021 RemoveDirectory("diffdir");
5024 static void set_admin_summary_info(const CHAR
*name
)
5026 MSIHANDLE db
, summary
;
5029 r
= MsiOpenDatabaseA(name
, MSIDBOPEN_DIRECT
, &db
);
5030 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5032 r
= MsiGetSummaryInformationA(db
, NULL
, 1, &summary
);
5033 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5035 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, 5, NULL
, NULL
);
5036 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5038 /* write the summary changes back to the stream */
5039 r
= MsiSummaryInfoPersist(summary
);
5040 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5042 MsiCloseHandle(summary
);
5044 r
= MsiDatabaseCommit(db
);
5045 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5050 static void test_admin(void)
5054 CreateDirectoryA("msitest", NULL
);
5055 create_file("msitest\\augustus", 500);
5057 create_database(msifile
, adm_tables
, sizeof(adm_tables
) / sizeof(msi_table
));
5058 set_admin_summary_info(msifile
);
5060 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5062 r
= MsiInstallProductA(msifile
, NULL
);
5063 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5064 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5065 ok(!delete_pf("msitest", FALSE
), "File installed\n");
5066 ok(!DeleteFile("c:\\msitest\\augustus"), "File installed\n");
5067 ok(!RemoveDirectory("c:\\msitest"), "File installed\n");
5069 r
= MsiInstallProductA(msifile
, "ACTION=ADMIN");
5070 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5071 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5072 ok(!delete_pf("msitest", FALSE
), "File installed\n");
5075 ok(DeleteFile("c:\\msitest\\augustus"), "File not installed\n");
5076 ok(RemoveDirectory("c:\\msitest"), "File not installed\n");
5079 DeleteFile(msifile
);
5080 DeleteFile("msitest\\augustus");
5081 RemoveDirectory("msitest");
5084 static void set_admin_property_stream(LPCSTR file
)
5088 WCHAR fileW
[MAX_PATH
];
5091 const DWORD mode
= STGM_DIRECT
| STGM_READWRITE
| STGM_SHARE_EXCLUSIVE
;
5093 /* AdminProperties */
5094 static const WCHAR stmname
[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
5095 static const WCHAR data
[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
5096 'M','y','P','r','o','p','=','4','2',0};
5098 MultiByteToWideChar(CP_ACP
, 0, file
, -1, fileW
, MAX_PATH
);
5100 hr
= StgOpenStorage(fileW
, NULL
, mode
, NULL
, 0, &stg
);
5101 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
5105 hr
= IStorage_CreateStream(stg
, stmname
, STGM_WRITE
| STGM_SHARE_EXCLUSIVE
, 0, 0, &stm
);
5106 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
5108 hr
= IStream_Write(stm
, data
, sizeof(data
), &count
);
5109 ok(hr
== S_OK
, "Expected S_OK, got %d\n", hr
);
5111 IStream_Release(stm
);
5112 IStorage_Release(stg
);
5115 static void test_adminprops(void)
5119 CreateDirectoryA("msitest", NULL
);
5120 create_file("msitest\\augustus", 500);
5122 create_database(msifile
, amp_tables
, sizeof(amp_tables
) / sizeof(msi_table
));
5123 set_admin_summary_info(msifile
);
5124 set_admin_property_stream(msifile
);
5126 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5128 r
= MsiInstallProductA(msifile
, NULL
);
5129 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5130 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5131 ok(delete_pf("msitest", FALSE
), "File installed\n");
5133 DeleteFile(msifile
);
5134 DeleteFile("msitest\\augustus");
5135 RemoveDirectory("msitest");
5138 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
5140 CHAR path
[MAX_PATH
];
5142 lstrcpyA(path
, PROG_FILES_DIR
);
5143 lstrcatA(path
, "\\");
5144 lstrcatA(path
, file
);
5147 create_file_data(path
, data
, 500);
5149 CreateDirectoryA(path
, NULL
);
5152 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
5154 static void test_removefiles(void)
5158 CreateDirectoryA("msitest", NULL
);
5159 create_file("msitest\\hydrogen", 500);
5160 create_file("msitest\\helium", 500);
5161 create_file("msitest\\lithium", 500);
5163 create_database(msifile
, rem_tables
, sizeof(rem_tables
) / sizeof(msi_table
));
5165 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
5167 r
= MsiInstallProductA(msifile
, NULL
);
5168 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5169 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
5170 ok(!pf_exists("msitest\\helium"), "File installed\n");
5171 ok(pf_exists("msitest\\lithium"), "File not installed\n");
5172 ok(pf_exists("msitest"), "File not installed\n");
5174 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5175 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5176 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
5177 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
5178 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
5179 ok(delete_pf("msitest", FALSE
), "File deleted\n");
5181 create_pf("msitest", FALSE
);
5182 create_pf("msitest\\hydrogen", TRUE
);
5183 create_pf("msitest\\helium", TRUE
);
5184 create_pf("msitest\\lithium", TRUE
);
5186 r
= MsiInstallProductA(msifile
, NULL
);
5187 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5188 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
5189 ok(pf_exists("msitest\\helium"), "File not installed\n");
5190 ok(pf_exists("msitest\\lithium"), "File not installed\n");
5191 ok(pf_exists("msitest"), "File not installed\n");
5193 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5194 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5195 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
5196 ok(delete_pf("msitest\\helium", TRUE
), "File deleted\n");
5197 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
5198 ok(delete_pf("msitest", FALSE
), "File deleted\n");
5200 create_pf("msitest", FALSE
);
5201 create_pf("msitest\\furlong", TRUE
);
5202 create_pf("msitest\\firkin", TRUE
);
5203 create_pf("msitest\\fortnight", TRUE
);
5204 create_pf("msitest\\becquerel", TRUE
);
5205 create_pf("msitest\\dioptre", TRUE
);
5206 create_pf("msitest\\attoparsec", TRUE
);
5207 create_pf("msitest\\storeys", TRUE
);
5208 create_pf("msitest\\block", TRUE
);
5209 create_pf("msitest\\siriometer", TRUE
);
5210 create_pf("msitest\\cabout", FALSE
);
5211 create_pf("msitest\\cabout\\blocker", TRUE
);
5213 r
= MsiInstallProductA(msifile
, NULL
);
5214 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5215 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
5216 ok(!pf_exists("msitest\\helium"), "File installed\n");
5217 ok(pf_exists("msitest\\lithium"), "File not installed\n");
5218 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
5219 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
5220 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
5221 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
5222 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
5223 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
5224 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
5225 ok(!pf_exists("msitest\\block"), "File not deleted\n");
5226 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
5227 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
5228 ok(pf_exists("msitest"), "File not installed\n");
5230 create_pf("msitest\\furlong", TRUE
);
5231 create_pf("msitest\\firkin", TRUE
);
5232 create_pf("msitest\\fortnight", TRUE
);
5233 create_pf("msitest\\storeys", TRUE
);
5234 create_pf("msitest\\block", TRUE
);
5235 create_pf("msitest\\siriometer", TRUE
);
5237 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5238 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5239 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not deleted\n");
5240 ok(!delete_pf("msitest\\helium", TRUE
), "File not deleted\n");
5241 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
5242 ok(delete_pf("msitest\\furlong", TRUE
), "File deleted\n");
5243 ok(delete_pf("msitest\\firkin", TRUE
), "File deleted\n");
5244 ok(delete_pf("msitest\\fortnight", TRUE
), "File deleted\n");
5245 ok(!delete_pf("msitest\\becquerel", TRUE
), "File not deleted\n");
5246 ok(!delete_pf("msitest\\dioptre", TRUE
), "File not deleted\n");
5247 ok(delete_pf("msitest\\attoparsec", TRUE
), "File deleted\n");
5248 ok(!delete_pf("msitest\\storeys", TRUE
), "File not deleted\n");
5249 ok(!delete_pf("msitest\\block", TRUE
), "File not deleted\n");
5250 ok(delete_pf("msitest\\siriometer", TRUE
), "File deleted\n");
5251 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
5252 ok(pf_exists("msitest"), "Directory deleted\n");
5254 r
= MsiInstallProductA(msifile
, NULL
);
5255 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5256 ok(delete_pf("msitest\\hydrogen", TRUE
), "File not installed\n");
5257 ok(!delete_pf("msitest\\helium", TRUE
), "File installed\n");
5258 ok(delete_pf("msitest\\lithium", TRUE
), "File not installed\n");
5259 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
5260 ok(pf_exists("msitest"), "Directory deleted\n");
5262 delete_pf("msitest\\cabout\\blocker", TRUE
);
5264 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5265 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5266 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory not deleted\n");
5267 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
5269 DeleteFile(msifile
);
5270 DeleteFile("msitest\\hydrogen");
5271 DeleteFile("msitest\\helium");
5272 DeleteFile("msitest\\lithium");
5273 RemoveDirectory("msitest");
5276 static void test_movefiles(void)
5279 char props
[MAX_PATH
];
5281 CreateDirectoryA("msitest", NULL
);
5282 create_file("msitest\\augustus", 100);
5283 create_file("cameroon", 100);
5284 create_file("djibouti", 100);
5285 create_file("egypt", 100);
5286 create_file("finland", 100);
5287 create_file("gambai", 100);
5288 create_file("honduras", 100);
5289 create_file("msitest\\india", 100);
5290 create_file("japan", 100);
5291 create_file("kenya", 100);
5292 CreateDirectoryA("latvia", NULL
);
5293 create_file("nauru", 100);
5294 create_file("peru", 100);
5295 create_file("apple", 100);
5296 create_file("application", 100);
5297 create_file("ape", 100);
5298 create_file("foo", 100);
5299 create_file("fao", 100);
5300 create_file("fbod", 100);
5301 create_file("budding", 100);
5302 create_file("buddy", 100);
5303 create_file("bud", 100);
5304 create_file("bar", 100);
5305 create_file("bur", 100);
5306 create_file("bird", 100);
5308 create_database(msifile
, mov_tables
, sizeof(mov_tables
) / sizeof(msi_table
));
5310 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
5312 /* if the source or dest property is not a full path,
5313 * windows tries to access it as a network resource
5316 sprintf(props
, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
5317 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
5318 CURR_DIR
, PROG_FILES_DIR
, CURR_DIR
, CURR_DIR
);
5320 r
= MsiInstallProductA(msifile
, props
);
5321 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5322 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
5323 ok(!delete_pf("msitest\\dest", TRUE
), "File copied\n");
5324 ok(delete_pf("msitest\\canada", TRUE
), "File not copied\n");
5325 ok(delete_pf("msitest\\dominica", TRUE
), "File not moved\n");
5326 ok(!delete_pf("msitest\\elsalvador", TRUE
), "File moved\n");
5327 ok(!delete_pf("msitest\\france", TRUE
), "File moved\n");
5328 ok(!delete_pf("msitest\\georgia", TRUE
), "File moved\n");
5329 ok(delete_pf("msitest\\hungary", TRUE
), "File not moved\n");
5330 ok(!delete_pf("msitest\\indonesia", TRUE
), "File moved\n");
5331 ok(!delete_pf("msitest\\jordan", TRUE
), "File moved\n");
5332 ok(delete_pf("msitest\\kiribati", TRUE
), "File not moved\n");
5333 ok(!delete_pf("msitest\\lebanon", TRUE
), "File moved\n");
5334 ok(!delete_pf("msitest\\lebanon", FALSE
), "Directory moved\n");
5335 ok(delete_pf("msitest\\poland", TRUE
), "File not moved\n");
5336 /* either apple or application will be moved depending on directory order */
5337 if (!delete_pf("msitest\\apple", TRUE
))
5338 ok(delete_pf("msitest\\application", TRUE
), "File not moved\n");
5340 ok(!delete_pf("msitest\\application", TRUE
), "File should not exist\n");
5341 ok(delete_pf("msitest\\wildcard", TRUE
), "File not moved\n");
5342 ok(!delete_pf("msitest\\ape", TRUE
), "File moved\n");
5343 /* either fao or foo will be moved depending on directory order */
5344 if (delete_pf("msitest\\foo", TRUE
))
5345 ok(!delete_pf("msitest\\fao", TRUE
), "File should not exist\n");
5347 ok(delete_pf("msitest\\fao", TRUE
), "File not moved\n");
5348 ok(delete_pf("msitest\\single", TRUE
), "File not moved\n");
5349 ok(!delete_pf("msitest\\fbod", TRUE
), "File moved\n");
5350 ok(delete_pf("msitest\\budding", TRUE
), "File not moved\n");
5351 ok(delete_pf("msitest\\buddy", TRUE
), "File not moved\n");
5352 ok(!delete_pf("msitest\\bud", TRUE
), "File moved\n");
5353 ok(delete_pf("msitest\\bar", TRUE
), "File not moved\n");
5354 ok(delete_pf("msitest\\bur", TRUE
), "File not moved\n");
5355 ok(!delete_pf("msitest\\bird", TRUE
), "File moved\n");
5356 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5357 ok(DeleteFileA("cameroon"), "File moved\n");
5358 ok(!DeleteFileA("djibouti"), "File not moved\n");
5359 ok(DeleteFileA("egypt"), "File moved\n");
5360 ok(DeleteFileA("finland"), "File moved\n");
5361 ok(DeleteFileA("gambai"), "File moved\n");
5362 ok(!DeleteFileA("honduras"), "File not moved\n");
5363 ok(DeleteFileA("msitest\\india"), "File moved\n");
5364 ok(DeleteFileA("japan"), "File moved\n");
5365 ok(!DeleteFileA("kenya"), "File not moved\n");
5366 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
5367 ok(!DeleteFileA("nauru"), "File not moved\n");
5368 ok(!DeleteFileA("peru"), "File not moved\n");
5369 ok(!DeleteFileA("apple"), "File not moved\n");
5370 ok(!DeleteFileA("application"), "File not moved\n");
5371 ok(DeleteFileA("ape"), "File moved\n");
5372 ok(!DeleteFileA("foo"), "File not moved\n");
5373 ok(!DeleteFileA("fao"), "File not moved\n");
5374 ok(DeleteFileA("fbod"), "File moved\n");
5375 ok(!DeleteFileA("budding"), "File not moved\n");
5376 ok(!DeleteFileA("buddy"), "File not moved\n");
5377 ok(DeleteFileA("bud"), "File moved\n");
5378 ok(!DeleteFileA("bar"), "File not moved\n");
5379 ok(!DeleteFileA("bur"), "File not moved\n");
5380 ok(DeleteFileA("bird"), "File moved\n");
5382 DeleteFile("msitest\\augustus");
5383 RemoveDirectory("msitest");
5384 DeleteFile(msifile
);
5387 static void test_missingcab(void)
5391 CreateDirectoryA("msitest", NULL
);
5392 create_file("msitest\\augustus", 500);
5393 create_file("maximus", 500);
5395 create_database(msifile
, mc_tables
, sizeof(mc_tables
) / sizeof(msi_table
));
5397 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5399 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
5401 create_pf("msitest", FALSE
);
5402 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
5404 r
= MsiInstallProductA(msifile
, NULL
);
5405 ok(r
== ERROR_SUCCESS
||
5406 broken(r
== ERROR_INSTALL_FAILURE
), /* win9x */
5407 "Expected ERROR_SUCCESS, got %u\n", r
);
5408 if (r
== ERROR_SUCCESS
)
5410 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
5411 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
5413 ok(delete_pf("msitest\\caesar", TRUE
), "File not installed\n");
5414 ok(!delete_pf("msitest\\gaius", TRUE
), "File installed\n");
5415 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5417 create_pf("msitest", FALSE
);
5418 create_pf_data("msitest\\caesar", "abcdefgh", TRUE
);
5419 create_pf("msitest\\gaius", TRUE
);
5421 r
= MsiInstallProductA(msifile
, "GAIUS=1");
5422 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5425 ok(!delete_pf("msitest\\maximus", TRUE
), "File installed\n");
5426 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5428 ok(delete_pf("msitest\\caesar", TRUE
), "File removed\n");
5429 ok(delete_pf("msitest\\gaius", TRUE
), "File removed\n");
5430 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5432 DeleteFile("msitest\\augustus");
5433 RemoveDirectory("msitest");
5434 DeleteFile("maximus");
5435 DeleteFile("test1.cab");
5436 DeleteFile(msifile
);
5439 static void test_duplicatefiles(void)
5443 CreateDirectoryA("msitest", NULL
);
5444 create_file("msitest\\maximus", 500);
5445 create_database(msifile
, df_tables
, sizeof(df_tables
) / sizeof(msi_table
));
5447 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5449 /* fails if the destination folder is not a valid property */
5451 r
= MsiInstallProductA(msifile
, NULL
);
5452 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5453 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
5454 ok(delete_pf("msitest\\augustus", TRUE
), "File not duplicated\n");
5455 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE
), "File not duplicated\n");
5456 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE
), "File not duplicated\n");
5457 ok(delete_pf("msitest\\this\\doesnot", FALSE
), "File not duplicated\n");
5458 ok(delete_pf("msitest\\this", FALSE
), "File not duplicated\n");
5459 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5461 DeleteFile("msitest\\maximus");
5462 RemoveDirectory("msitest");
5463 DeleteFile(msifile
);
5466 static void test_writeregistryvalues(void)
5472 CHAR path
[MAX_PATH
];
5474 CreateDirectoryA("msitest", NULL
);
5475 create_file("msitest\\augustus", 500);
5477 create_database(msifile
, wrv_tables
, sizeof(wrv_tables
) / sizeof(msi_table
));
5479 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5481 r
= MsiInstallProductA(msifile
, NULL
);
5482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5483 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5484 ok(delete_pf("msitest", FALSE
), "File installed\n");
5486 res
= RegOpenKey(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", &hkey
);
5487 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5490 type
= REG_MULTI_SZ
;
5491 memset(path
, 'a', MAX_PATH
);
5492 res
= RegQueryValueExA(hkey
, "Value", NULL
, &type
, (LPBYTE
)path
, &size
);
5493 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5494 ok(!memcmp(path
, "one\0two\0three\0\0", size
), "Wrong multi-sz data\n");
5495 ok(size
== 15, "Expected 15, got %d\n", size
);
5496 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5498 DeleteFile(msifile
);
5499 DeleteFile("msitest\\augustus");
5500 RemoveDirectory("msitest");
5502 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
5503 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine");
5506 static void test_sourcefolder(void)
5510 CreateDirectoryA("msitest", NULL
);
5511 create_file("augustus", 500);
5513 create_database(msifile
, sf_tables
, sizeof(sf_tables
) / sizeof(msi_table
));
5515 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5517 r
= MsiInstallProductA(msifile
, NULL
);
5518 ok(r
== ERROR_INSTALL_FAILURE
,
5519 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5520 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5523 ok(!delete_pf("msitest", FALSE
), "File installed\n");
5526 RemoveDirectoryA("msitest");
5528 r
= MsiInstallProductA(msifile
, NULL
);
5529 ok(r
== ERROR_INSTALL_FAILURE
,
5530 "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5531 ok(!delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5534 ok(!delete_pf("msitest", FALSE
), "File installed\n");
5537 DeleteFile(msifile
);
5538 DeleteFile("augustus");
5541 static void test_customaction51(void)
5545 CreateDirectoryA("msitest", NULL
);
5546 create_file("msitest\\augustus", 500);
5548 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
5550 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5552 r
= MsiInstallProductA(msifile
, NULL
);
5553 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5554 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
5555 ok(delete_pf("msitest", FALSE
), "File installed\n");
5557 DeleteFile(msifile
);
5558 DeleteFile("msitest\\augustus");
5559 RemoveDirectory("msitest");
5562 static void test_installstate(void)
5566 CreateDirectoryA("msitest", NULL
);
5567 create_file("msitest\\alpha", 500);
5568 create_file("msitest\\beta", 500);
5569 create_file("msitest\\gamma", 500);
5570 create_file("msitest\\theta", 500);
5571 create_file("msitest\\delta", 500);
5572 create_file("msitest\\epsilon", 500);
5573 create_file("msitest\\zeta", 500);
5574 create_file("msitest\\iota", 500);
5575 create_file("msitest\\eta", 500);
5576 create_file("msitest\\kappa", 500);
5577 create_file("msitest\\lambda", 500);
5578 create_file("msitest\\mu", 500);
5580 create_database(msifile
, is_tables
, sizeof(is_tables
) / sizeof(msi_table
));
5582 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5584 r
= MsiInstallProductA(msifile
, NULL
);
5585 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5586 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
5587 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
5588 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
5589 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
5590 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
5591 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
5592 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
5593 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
5594 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
5595 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
5596 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
5597 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
5598 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5600 r
= MsiInstallProductA(msifile
, "ADDLOCAL=\"one,two,three,four\"");
5601 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5602 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
5603 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
5604 ok(delete_pf("msitest\\gamma", TRUE
), "File not installed\n");
5605 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
5606 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
5607 ok(delete_pf("msitest\\epsilon", TRUE
), "File not installed\n");
5608 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
5609 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
5610 ok(delete_pf("msitest\\eta", TRUE
), "File not installed\n");
5611 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
5612 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
5613 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
5614 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5616 r
= MsiInstallProductA(msifile
, "ADDSOURCE=\"one,two,three,four\"");
5617 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5618 ok(delete_pf("msitest\\alpha", TRUE
), "File not installed\n");
5619 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
5620 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
5621 ok(delete_pf("msitest\\theta", TRUE
), "File not installed\n");
5622 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
5623 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
5624 ok(delete_pf("msitest\\zeta", TRUE
), "File not installed\n");
5625 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
5626 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
5627 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
5628 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
5629 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
5630 ok(delete_pf("msitest", FALSE
), "File not installed\n");
5632 r
= MsiInstallProductA(msifile
, "REMOVE=\"one,two,three,four\"");
5633 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5634 ok(!delete_pf("msitest\\alpha", TRUE
), "File installed\n");
5635 ok(!delete_pf("msitest\\beta", TRUE
), "File installed\n");
5636 ok(!delete_pf("msitest\\gamma", TRUE
), "File installed\n");
5637 ok(!delete_pf("msitest\\theta", TRUE
), "File installed\n");
5638 ok(!delete_pf("msitest\\delta", TRUE
), "File installed\n");
5639 ok(!delete_pf("msitest\\epsilon", TRUE
), "File installed\n");
5640 ok(!delete_pf("msitest\\zeta", TRUE
), "File installed\n");
5641 ok(!delete_pf("msitest\\iota", TRUE
), "File installed\n");
5642 ok(!delete_pf("msitest\\eta", TRUE
), "File installed\n");
5643 ok(!delete_pf("msitest\\kappa", TRUE
), "File installed\n");
5644 ok(!delete_pf("msitest\\lambda", TRUE
), "File installed\n");
5645 ok(!delete_pf("msitest\\mu", TRUE
), "File installed\n");
5646 ok(!delete_pf("msitest", FALSE
), "File installed\n");
5648 DeleteFile(msifile
);
5649 DeleteFile("msitest\\alpha");
5650 DeleteFile("msitest\\beta");
5651 DeleteFile("msitest\\gamma");
5652 DeleteFile("msitest\\theta");
5653 DeleteFile("msitest\\delta");
5654 DeleteFile("msitest\\epsilon");
5655 DeleteFile("msitest\\zeta");
5656 DeleteFile("msitest\\iota");
5657 DeleteFile("msitest\\eta");
5658 DeleteFile("msitest\\kappa");
5659 DeleteFile("msitest\\lambda");
5660 DeleteFile("msitest\\mu");
5661 RemoveDirectory("msitest");
5664 struct sourcepathmap
5666 BOOL sost
; /* shortone\shorttwo */
5667 BOOL solt
; /* shortone\longtwo */
5668 BOOL lost
; /* longone\shorttwo */
5669 BOOL lolt
; /* longone\longtwo */
5670 BOOL soste
; /* shortone\shorttwo source exists */
5671 BOOL solte
; /* shortone\longtwo source exists */
5672 BOOL loste
; /* longone\shorttwo source exists */
5673 BOOL lolte
; /* longone\longtwo source exists */
5678 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5679 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5680 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5681 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5682 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5683 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5684 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5685 {TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5686 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5687 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5688 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5689 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5690 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5691 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5692 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5693 {TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5694 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5695 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5696 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5697 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5698 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5699 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5700 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5701 {TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5702 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5703 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5704 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5705 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5706 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5707 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5708 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5709 {TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5710 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5711 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5712 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5713 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5714 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5715 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5716 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5717 {TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5718 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5719 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5720 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5721 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5722 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5723 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5724 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5725 {TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5726 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5727 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5728 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5729 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5730 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5731 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5732 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5733 {TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5734 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5735 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5736 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5737 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5738 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5739 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5740 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5741 {TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5742 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5743 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5744 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5745 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5746 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5747 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5748 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5749 {TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5750 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5751 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5752 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5753 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5754 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5755 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5756 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5757 {TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5758 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5759 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5760 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5761 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5762 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5763 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5764 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5765 {TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5766 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5767 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5768 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5769 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5770 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5771 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5772 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5773 {TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5774 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5775 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5776 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5777 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5778 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5779 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5780 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5781 {TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5782 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5783 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5784 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5785 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5786 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5787 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5788 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5789 {TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5790 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5791 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5792 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5793 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5794 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5795 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5796 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5797 {TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5798 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5799 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5800 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5801 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5802 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5803 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5804 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5805 {TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5806 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5807 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5808 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5809 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5810 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5811 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5812 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5813 {FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5814 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5815 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5816 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5817 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5818 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5819 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5820 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5821 {FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5822 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5823 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5824 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5825 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5826 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5827 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5828 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5829 {FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5830 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5831 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5832 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5833 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5834 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5835 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5836 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5837 {FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5838 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5839 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5840 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5841 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5842 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5843 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5844 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5845 {FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5846 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5847 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5848 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5849 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5850 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5851 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5852 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5853 {FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5854 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5855 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5856 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5857 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5858 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5859 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5860 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5861 {FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5862 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5863 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5864 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5865 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5866 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5867 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5868 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5869 {FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5870 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5871 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5872 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5873 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5874 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5875 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5876 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5877 {FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5878 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5879 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5880 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5881 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5882 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5883 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5884 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5885 {FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5886 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5887 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5888 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5889 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5890 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5891 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5892 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5893 {FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5894 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5895 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5896 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5897 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5898 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5899 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5900 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5901 {FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5902 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5903 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5904 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5905 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5906 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5907 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5908 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5909 {FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5910 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5911 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5912 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5913 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5914 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_SUCCESS
, 200},
5915 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5916 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_SUCCESS
, 200},
5917 {FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5918 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5919 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5920 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5921 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5922 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5923 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5924 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5925 {FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5926 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5927 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5928 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5929 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5930 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5931 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5932 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, ERROR_INSTALL_FAILURE
, 0},
5933 {FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, ERROR_INSTALL_FAILURE
, 0},
5936 static DWORD
get_pf_file_size(LPCSTR file
)
5938 CHAR path
[MAX_PATH
];
5942 lstrcpyA(path
, PROG_FILES_DIR
);
5943 lstrcatA(path
, "\\");
5944 lstrcatA(path
, file
);
5946 hfile
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
5947 if (hfile
== INVALID_HANDLE_VALUE
)
5950 size
= GetFileSize(hfile
, NULL
);
5955 static void test_sourcepath(void)
5959 if (!winetest_interactive
)
5961 skip("Run in interactive mode to run source path tests.\n");
5965 create_database(msifile
, sp_tables
, sizeof(sp_tables
) / sizeof(msi_table
));
5967 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5969 for (i
= 0; i
< sizeof(spmap
) / sizeof(spmap
[0]); i
++)
5973 CreateDirectoryA("shortone", NULL
);
5974 CreateDirectoryA("shortone\\shorttwo", NULL
);
5979 CreateDirectoryA("shortone", NULL
);
5980 CreateDirectoryA("shortone\\longtwo", NULL
);
5985 CreateDirectoryA("longone", NULL
);
5986 CreateDirectoryA("longone\\shorttwo", NULL
);
5991 CreateDirectoryA("longone", NULL
);
5992 CreateDirectoryA("longone\\longtwo", NULL
);
5996 create_file("shortone\\shorttwo\\augustus", 50);
5998 create_file("shortone\\longtwo\\augustus", 100);
6000 create_file("longone\\shorttwo\\augustus", 150);
6002 create_file("longone\\longtwo\\augustus", 200);
6004 r
= MsiInstallProductA(msifile
, NULL
);
6005 ok(r
== spmap
[i
].err
, "%d: Expected %d, got %d\n", i
, spmap
[i
].err
, r
);
6006 ok(get_pf_file_size("msitest\\augustus") == spmap
[i
].size
,
6007 "%d: Expected %d, got %d\n", i
, spmap
[i
].size
,
6008 get_pf_file_size("msitest\\augustus"));
6010 if (r
== ERROR_SUCCESS
)
6012 ok(delete_pf("msitest\\augustus", TRUE
), "%d: File not installed\n", i
);
6013 ok(delete_pf("msitest", FALSE
), "%d: File not installed\n", i
);
6017 ok(!delete_pf("msitest\\augustus", TRUE
), "%d: File installed\n", i
);
6018 todo_wine
ok(!delete_pf("msitest", FALSE
), "%d: File installed\n", i
);
6021 DeleteFileA("shortone\\shorttwo\\augustus");
6022 DeleteFileA("shortone\\longtwo\\augustus");
6023 DeleteFileA("longone\\shorttwo\\augustus");
6024 DeleteFileA("longone\\longtwo\\augustus");
6025 RemoveDirectoryA("shortone\\shorttwo");
6026 RemoveDirectoryA("shortone\\longtwo");
6027 RemoveDirectoryA("longone\\shorttwo");
6028 RemoveDirectoryA("longone\\longtwo");
6029 RemoveDirectoryA("shortone");
6030 RemoveDirectoryA("longone");
6033 DeleteFileA(msifile
);
6036 static void test_MsiConfigureProductEx(void)
6042 CHAR keypath
[MAX_PATH
* 2];
6043 CHAR localpack
[MAX_PATH
];
6047 win_skip("Different registry keys on Win9x and WinMe\n");
6051 CreateDirectoryA("msitest", NULL
);
6052 create_file("msitest\\hydrogen", 500);
6053 create_file("msitest\\helium", 500);
6054 create_file("msitest\\lithium", 500);
6056 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
6058 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6060 /* NULL szProduct */
6061 r
= MsiConfigureProductExA(NULL
, INSTALLLEVEL_DEFAULT
,
6062 INSTALLSTATE_DEFAULT
, "PROPVAR=42");
6063 ok(r
== ERROR_INVALID_PARAMETER
,
6064 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
6066 /* empty szProduct */
6067 r
= MsiConfigureProductExA("", INSTALLLEVEL_DEFAULT
,
6068 INSTALLSTATE_DEFAULT
, "PROPVAR=42");
6069 ok(r
== ERROR_INVALID_PARAMETER
,
6070 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
6072 /* garbage szProduct */
6073 r
= MsiConfigureProductExA("garbage", INSTALLLEVEL_DEFAULT
,
6074 INSTALLSTATE_DEFAULT
, "PROPVAR=42");
6075 ok(r
== ERROR_INVALID_PARAMETER
,
6076 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
6078 /* guid without brackets */
6079 r
= MsiConfigureProductExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D",
6080 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
,
6082 ok(r
== ERROR_INVALID_PARAMETER
,
6083 "Expected ERROR_INVALID_PARAMETER, got %d\n", r
);
6085 /* guid with brackets */
6086 r
= MsiConfigureProductExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}",
6087 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
,
6089 ok(r
== ERROR_UNKNOWN_PRODUCT
,
6090 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
6092 /* same length as guid, but random */
6093 r
= MsiConfigureProductExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93",
6094 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
,
6096 ok(r
== ERROR_UNKNOWN_PRODUCT
,
6097 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
6099 /* product not installed yet */
6100 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6101 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
,
6103 ok(r
== ERROR_UNKNOWN_PRODUCT
,
6104 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
6106 /* install the product, per-user unmanaged */
6107 r
= MsiInstallProductA(msifile
, "INSTALLLEVEL=10 PROPVAR=42");
6108 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6109 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6110 ok(pf_exists("msitest\\helium"), "File not installed\n");
6111 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6112 ok(pf_exists("msitest"), "File not installed\n");
6114 /* product is installed per-user managed, remove it */
6115 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6116 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_ABSENT
,
6118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6119 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
6120 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
6121 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
6124 ok(!delete_pf("msitest", FALSE
), "File not removed\n");
6127 /* product has been removed */
6128 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6129 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
,
6131 ok(r
== ERROR_UNKNOWN_PRODUCT
,
6132 "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r
);
6134 /* install the product, machine */
6135 r
= MsiInstallProductA(msifile
, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
6136 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6137 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6138 ok(pf_exists("msitest\\helium"), "File not installed\n");
6139 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6140 ok(pf_exists("msitest"), "File not installed\n");
6142 /* product is installed machine, remove it */
6143 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6144 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_ABSENT
,
6146 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6147 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
6148 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
6149 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
6152 ok(!delete_pf("msitest", FALSE
), "File not removed\n");
6155 /* product has been removed */
6156 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6157 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
,
6159 ok(r
== ERROR_UNKNOWN_PRODUCT
,
6160 "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r
);
6162 /* install the product, machine */
6163 r
= MsiInstallProductA(msifile
, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
6164 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6165 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6166 ok(pf_exists("msitest\\helium"), "File not installed\n");
6167 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6168 ok(pf_exists("msitest"), "File not installed\n");
6170 DeleteFileA(msifile
);
6172 /* local msifile is removed */
6173 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6174 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_ABSENT
,
6176 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6177 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
6178 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
6179 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
6182 ok(!delete_pf("msitest", FALSE
), "File not removed\n");
6185 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
6187 /* install the product, machine */
6188 r
= MsiInstallProductA(msifile
, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
6189 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6190 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6191 ok(pf_exists("msitest\\helium"), "File not installed\n");
6192 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6193 ok(pf_exists("msitest"), "File not installed\n");
6195 DeleteFileA(msifile
);
6197 lstrcpyA(keypath
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\");
6198 lstrcatA(keypath
, "Installer\\UserData\\S-1-5-18\\Products\\");
6199 lstrcatA(keypath
, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties");
6201 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &props
);
6202 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6204 res
= RegSetValueExA(props
, "LocalPackage", 0, REG_SZ
,
6205 (const BYTE
*)"C:\\idontexist.msi", 18);
6206 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6208 /* LocalPackage is used to find the cached msi package */
6209 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6210 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_ABSENT
,
6212 ok(r
== ERROR_INSTALL_SOURCE_ABSENT
,
6213 "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r
);
6214 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6215 ok(pf_exists("msitest\\helium"), "File not installed\n");
6216 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6217 ok(pf_exists("msitest"), "File not installed\n");
6220 create_database(msifile
, mcp_tables
, sizeof(mcp_tables
) / sizeof(msi_table
));
6222 /* LastUsedSource (local msi package) can be used as a last resort */
6223 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6224 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_ABSENT
,
6226 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6227 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
6228 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
6229 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
6232 ok(!delete_pf("msitest", FALSE
), "File not removed\n");
6235 /* install the product, machine */
6236 r
= MsiInstallProductA(msifile
, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
6237 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6238 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6239 ok(pf_exists("msitest\\helium"), "File not installed\n");
6240 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6241 ok(pf_exists("msitest"), "File not installed\n");
6243 lstrcpyA(keypath
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\");
6244 lstrcatA(keypath
, "Installer\\UserData\\S-1-5-18\\Products\\");
6245 lstrcatA(keypath
, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties");
6247 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &props
);
6248 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6250 res
= RegSetValueExA(props
, "LocalPackage", 0, REG_SZ
,
6251 (const BYTE
*)"C:\\idontexist.msi", 18);
6252 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6254 lstrcpyA(keypath
, "SOFTWARE\\Classes\\Installer\\Products\\");
6255 lstrcatA(keypath
, "84A88FD7F6998CE40A22FB59F6B9C2BB\\SourceList");
6257 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, keypath
, &source
);
6258 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6262 res
= RegQueryValueExA(source
, "PackageName", NULL
, &type
,
6263 (LPBYTE
)localpack
, &size
);
6264 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6266 res
= RegSetValueExA(source
, "PackageName", 0, REG_SZ
,
6267 (const BYTE
*)"idontexist.msi", 15);
6268 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6270 /* SourceList is altered */
6271 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6272 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_ABSENT
,
6274 ok(r
== ERROR_INSTALL_SOURCE_ABSENT
,
6275 "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r
);
6276 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6277 ok(pf_exists("msitest\\helium"), "File not installed\n");
6278 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6279 ok(pf_exists("msitest"), "File not installed\n");
6281 /* restore the SourceList */
6282 res
= RegSetValueExA(source
, "PackageName", 0, REG_SZ
,
6283 (const BYTE
*)localpack
, lstrlenA(localpack
) + 1);
6284 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6286 /* finally remove the product */
6287 r
= MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
6288 INSTALLLEVEL_DEFAULT
, INSTALLSTATE_ABSENT
,
6290 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
6291 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
6292 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
6293 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
6296 ok(!delete_pf("msitest", FALSE
), "File not removed\n");
6299 DeleteFileA(msifile
);
6300 RegCloseKey(source
);
6302 DeleteFileA("msitest\\hydrogen");
6303 DeleteFileA("msitest\\helium");
6304 DeleteFileA("msitest\\lithium");
6305 RemoveDirectoryA("msitest");
6308 static void test_missingcomponent(void)
6312 CreateDirectoryA("msitest", NULL
);
6313 create_file("msitest\\hydrogen", 500);
6314 create_file("msitest\\helium", 500);
6315 create_file("msitest\\lithium", 500);
6316 create_file("beryllium", 500);
6318 create_database(msifile
, mcomp_tables
, sizeof(mcomp_tables
) / sizeof(msi_table
));
6320 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6322 r
= MsiInstallProductA(msifile
, "INSTALLLEVEL=10 PROPVAR=42");
6323 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6324 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
6325 ok(pf_exists("msitest\\helium"), "File not installed\n");
6326 ok(pf_exists("msitest\\lithium"), "File not installed\n");
6327 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
6328 ok(pf_exists("msitest"), "File not installed\n");
6330 r
= MsiInstallProductA(msifile
, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
6331 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6332 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not removed\n");
6333 ok(!delete_pf("msitest\\helium", TRUE
), "File not removed\n");
6334 ok(!delete_pf("msitest\\lithium", TRUE
), "File not removed\n");
6335 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
6338 ok(!delete_pf("msitest", FALSE
), "File not removed\n");
6341 DeleteFileA(msifile
);
6342 DeleteFileA("msitest\\hydrogen");
6343 DeleteFileA("msitest\\helium");
6344 DeleteFileA("msitest\\lithium");
6345 DeleteFileA("beryllium");
6346 RemoveDirectoryA("msitest");
6349 static void test_sourcedirprop(void)
6352 CHAR props
[MAX_PATH
];
6354 CreateDirectoryA("msitest", NULL
);
6355 create_file("msitest\\augustus", 500);
6357 create_database(msifile
, ca51_tables
, sizeof(ca51_tables
) / sizeof(msi_table
));
6359 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6361 r
= MsiInstallProductA(msifile
, NULL
);
6362 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6363 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
6364 ok(delete_pf("msitest", FALSE
), "File installed\n");
6366 DeleteFile("msitest\\augustus");
6367 RemoveDirectory("msitest");
6369 CreateDirectoryA("altsource", NULL
);
6370 CreateDirectoryA("altsource\\msitest", NULL
);
6371 create_file("altsource\\msitest\\augustus", 500);
6373 sprintf(props
, "SRCDIR=%s\\altsource\\", CURR_DIR
);
6375 r
= MsiInstallProductA(msifile
, props
);
6376 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6377 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
6378 ok(delete_pf("msitest", FALSE
), "File installed\n");
6380 DeleteFile(msifile
);
6381 DeleteFile("altsource\\msitest\\augustus");
6382 RemoveDirectory("altsource\\msitest");
6383 RemoveDirectory("altsource");
6386 static void test_adminimage(void)
6390 CreateDirectoryA("msitest", NULL
);
6391 CreateDirectoryA("msitest\\first", NULL
);
6392 CreateDirectoryA("msitest\\second", NULL
);
6393 CreateDirectoryA("msitest\\cabout", NULL
);
6394 CreateDirectoryA("msitest\\cabout\\new", NULL
);
6395 create_file("msitest\\one.txt", 100);
6396 create_file("msitest\\first\\two.txt", 100);
6397 create_file("msitest\\second\\three.txt", 100);
6398 create_file("msitest\\cabout\\four.txt", 100);
6399 create_file("msitest\\cabout\\new\\five.txt", 100);
6400 create_file("msitest\\filename", 100);
6401 create_file("msitest\\service.exe", 100);
6403 create_database_wordcount(msifile
, ai_tables
,
6404 sizeof(ai_tables
) / sizeof(msi_table
),
6405 msidbSumInfoSourceTypeAdminImage
);
6407 r
= MsiInstallProductA(msifile
, NULL
);
6408 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6410 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
6411 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
6412 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
6413 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
6414 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
6415 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
6416 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
6417 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
6418 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
6419 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
6420 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
6421 ok(delete_pf("msitest", FALSE
), "File not installed\n");
6423 DeleteFileA("msitest.msi");
6424 DeleteFileA("msitest\\cabout\\new\\five.txt");
6425 DeleteFileA("msitest\\cabout\\four.txt");
6426 DeleteFileA("msitest\\second\\three.txt");
6427 DeleteFileA("msitest\\first\\two.txt");
6428 DeleteFileA("msitest\\one.txt");
6429 DeleteFileA("msitest\\service.exe");
6430 DeleteFileA("msitest\\filename");
6431 RemoveDirectoryA("msitest\\cabout\\new");
6432 RemoveDirectoryA("msitest\\cabout");
6433 RemoveDirectoryA("msitest\\second");
6434 RemoveDirectoryA("msitest\\first");
6435 RemoveDirectoryA("msitest");
6438 static void test_propcase(void)
6442 CreateDirectoryA("msitest", NULL
);
6443 create_file("msitest\\augustus", 500);
6445 create_database(msifile
, pc_tables
, sizeof(pc_tables
) / sizeof(msi_table
));
6447 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6449 r
= MsiInstallProductA(msifile
, "MyProp=42");
6450 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6451 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
6452 ok(delete_pf("msitest", FALSE
), "File not installed\n");
6454 DeleteFile(msifile
);
6455 DeleteFile("msitest\\augustus");
6456 RemoveDirectory("msitest");
6459 static void test_int_widths( void )
6461 static const char int0
[] = "int0\ni0\nint0\tint0\n1";
6462 static const char int1
[] = "int1\ni1\nint1\tint1\n1";
6463 static const char int2
[] = "int2\ni2\nint2\tint2\n1";
6464 static const char int3
[] = "int3\ni3\nint3\tint3\n1";
6465 static const char int4
[] = "int4\ni4\nint4\tint4\n1";
6466 static const char int5
[] = "int5\ni5\nint5\tint5\n1";
6467 static const char int8
[] = "int8\ni8\nint8\tint8\n1";
6477 { int0
, sizeof(int0
) - 1, ERROR_SUCCESS
},
6478 { int1
, sizeof(int1
) - 1, ERROR_SUCCESS
},
6479 { int2
, sizeof(int2
) - 1, ERROR_SUCCESS
},
6480 { int3
, sizeof(int3
) - 1, ERROR_FUNCTION_FAILED
},
6481 { int4
, sizeof(int4
) - 1, ERROR_SUCCESS
},
6482 { int5
, sizeof(int5
) - 1, ERROR_FUNCTION_FAILED
},
6483 { int8
, sizeof(int8
) - 1, ERROR_FUNCTION_FAILED
}
6486 char tmpdir
[MAX_PATH
], msitable
[MAX_PATH
], msidb
[MAX_PATH
];
6490 GetTempPathA(MAX_PATH
, tmpdir
);
6491 CreateDirectoryA(tmpdir
, NULL
);
6493 strcpy(msitable
, tmpdir
);
6494 strcat(msitable
, "\\msitable.idt");
6496 strcpy(msidb
, tmpdir
);
6497 strcat(msidb
, "\\msitest.msi");
6499 r
= MsiOpenDatabaseA(msidb
, MSIDBOPEN_CREATE
, &db
);
6500 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6502 for (i
= 0; i
< sizeof(tests
)/sizeof(tests
[0]); i
++)
6504 write_file(msitable
, tests
[i
].data
, tests
[i
].size
);
6506 r
= MsiDatabaseImportA(db
, tmpdir
, "msitable.idt");
6507 ok(r
== tests
[i
].ret
, " %u expected %u, got %u\n", i
, tests
[i
].ret
, r
);
6509 r
= MsiDatabaseCommit(db
);
6510 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6511 DeleteFileA(msitable
);
6516 RemoveDirectoryA(tmpdir
);
6519 static void test_shortcut(void)
6524 create_test_files();
6525 create_database(msifile
, sc_tables
, sizeof(sc_tables
) / sizeof(msi_table
));
6527 r
= MsiInstallProductA(msifile
, NULL
);
6528 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6530 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
6531 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
6533 r
= MsiInstallProductA(msifile
, NULL
);
6534 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6538 hr
= CoInitializeEx(NULL
, COINIT_APARTMENTTHREADED
);
6539 ok(SUCCEEDED(hr
), "CoInitialize failed 0x%08x\n", hr
);
6541 r
= MsiInstallProductA(msifile
, NULL
);
6542 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6546 delete_pf("msitest\\cabout\\new\\five.txt", TRUE
);
6547 delete_pf("msitest\\cabout\\new", FALSE
);
6548 delete_pf("msitest\\cabout\\four.txt", TRUE
);
6549 delete_pf("msitest\\cabout", FALSE
);
6550 delete_pf("msitest\\changed\\three.txt", TRUE
);
6551 delete_pf("msitest\\changed", FALSE
);
6552 delete_pf("msitest\\first\\two.txt", TRUE
);
6553 delete_pf("msitest\\first", FALSE
);
6554 delete_pf("msitest\\filename", TRUE
);
6555 delete_pf("msitest\\one.txt", TRUE
);
6556 delete_pf("msitest\\service.exe", TRUE
);
6557 delete_pf("msitest\\Shortcut.lnk", TRUE
);
6558 delete_pf("msitest", FALSE
);
6559 delete_test_files();
6562 static void test_envvar(void)
6572 win_skip("Environment variables are handled differently on Win9x and WinMe\n");
6576 create_test_files();
6577 create_database(msifile
, env_tables
, sizeof(env_tables
) / sizeof(msi_table
));
6579 res
= RegCreateKeyExA(HKEY_CURRENT_USER
, "Environment", 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &env
, NULL
);
6580 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6582 res
= RegSetValueExA(env
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"0", 2);
6583 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6585 res
= RegSetValueExA(env
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"0", 2);
6586 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6588 r
= MsiInstallProductA(msifile
, NULL
);
6589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6592 size
= sizeof(buffer
);
6594 res
= RegQueryValueExA(env
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6595 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6596 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
6597 ok(!lstrcmp(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
6599 res
= RegDeleteValueA(env
, "MSITESTVAR1");
6600 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6603 size
= sizeof(buffer
);
6605 res
= RegQueryValueExA(env
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6606 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6607 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
6608 ok(!lstrcmp(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
6610 res
= RegDeleteValueA(env
, "MSITESTVAR2");
6611 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6613 res
= RegDeleteValueA(env
, "MSITESTVAR3");
6614 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6616 res
= RegDeleteValueA(env
, "MSITESTVAR4");
6617 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6619 res
= RegDeleteValueA(env
, "MSITESTVAR5");
6620 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6622 res
= RegDeleteValueA(env
, "MSITESTVAR6");
6623 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6625 res
= RegDeleteValueA(env
, "MSITESTVAR7");
6626 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6628 res
= RegDeleteValueA(env
, "MSITESTVAR8");
6629 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6631 res
= RegDeleteValueA(env
, "MSITESTVAR9");
6632 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6634 res
= RegDeleteValueA(env
, "MSITESTVAR10");
6635 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6639 delete_pf("msitest\\cabout\\new\\five.txt", TRUE
);
6640 delete_pf("msitest\\cabout\\new", FALSE
);
6641 delete_pf("msitest\\cabout\\four.txt", TRUE
);
6642 delete_pf("msitest\\cabout", FALSE
);
6643 delete_pf("msitest\\changed\\three.txt", TRUE
);
6644 delete_pf("msitest\\changed", FALSE
);
6645 delete_pf("msitest\\first\\two.txt", TRUE
);
6646 delete_pf("msitest\\first", FALSE
);
6647 delete_pf("msitest\\filename", TRUE
);
6648 delete_pf("msitest\\one.txt", TRUE
);
6649 delete_pf("msitest\\service.exe", TRUE
);
6650 delete_pf("msitest", FALSE
);
6651 delete_test_files();
6654 static void test_preselected(void)
6658 create_test_files();
6659 create_database(msifile
, ps_tables
, sizeof(ps_tables
) / sizeof(msi_table
));
6661 r
= MsiInstallProductA(msifile
, "ADDLOCAL=One");
6662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6664 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File installed\n");
6665 ok(!delete_pf("msitest\\cabout\\new", FALSE
), "File installed\n");
6666 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE
), "File installed\n");
6667 ok(!delete_pf("msitest\\cabout", FALSE
), "File installed\n");
6668 ok(!delete_pf("msitest\\changed\\three.txt", TRUE
), "File installed\n");
6669 ok(!delete_pf("msitest\\changed", FALSE
), "File installed\n");
6670 ok(!delete_pf("msitest\\first\\two.txt", TRUE
), "File installed\n");
6671 ok(!delete_pf("msitest\\first", FALSE
), "File installed\n");
6672 ok(!delete_pf("msitest\\filename", TRUE
), "File installed\n");
6673 todo_wine
ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
6674 ok(!delete_pf("msitest\\service.exe", TRUE
), "File installed\n");
6675 todo_wine
ok(delete_pf("msitest", FALSE
), "File not installed\n");
6677 r
= MsiInstallProductA(msifile
, NULL
);
6678 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6680 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
6681 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
6682 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
6683 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
6684 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
6685 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
6686 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
6687 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
6688 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
6689 ok(!delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
6690 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
6691 ok(delete_pf("msitest", FALSE
), "File not installed\n");
6692 delete_test_files();
6695 static void test_installed_prop(void)
6697 static char prodcode
[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
6700 create_test_files();
6701 create_database(msifile
, ip_tables
, sizeof(ip_tables
) / sizeof(msi_table
));
6703 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6705 r
= MsiInstallProductA(msifile
, "FULL=1");
6706 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6708 r
= MsiInstallProductA(msifile
, "FULL=1");
6709 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
6711 r
= MsiConfigureProductExA(prodcode
, INSTALLLEVEL_DEFAULT
, INSTALLSTATE_DEFAULT
, "FULL=1");
6712 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
6714 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
6715 ok(delete_pf("msitest\\cabout\\new", FALSE
), "File not installed\n");
6716 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
6717 ok(delete_pf("msitest\\cabout", FALSE
), "File not installed\n");
6718 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
6719 ok(delete_pf("msitest\\changed", FALSE
), "File not installed\n");
6720 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
6721 ok(delete_pf("msitest\\first", FALSE
), "File not installed\n");
6722 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
6723 ok(delete_pf("msitest\\one.txt", TRUE
), "File installed\n");
6724 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
6725 ok(delete_pf("msitest", FALSE
), "File not installed\n");
6727 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6728 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6730 delete_test_files();
6733 static char session_manager
[] = "System\\CurrentControlSet\\Control\\Session Manager";
6734 static char rename_ops
[] = "PendingFileRenameOperations";
6736 static void process_pending_renames(HKEY hkey
)
6738 char *buf
, *src
, *dst
;
6742 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
);
6743 buf
= HeapAlloc(GetProcessHeap(), 0, size
);
6746 ret
= RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, (LPBYTE
)buf
, &size
);
6747 ok(!ret
, "RegQueryValueExA failed %d (%u)\n", ret
, GetLastError());
6748 ok(strstr(buf
, "msitest\\maximus") != NULL
, "Unexpected value \"%s\"\n", buf
);
6750 for (src
= buf
; *src
; src
= dst
+ strlen(dst
) + 1)
6752 DWORD flags
= MOVEFILE_COPY_ALLOWED
;
6754 dst
= src
+ strlen(src
) + 1;
6757 flags
|= MOVEFILE_REPLACE_EXISTING
;
6760 if (src
[0] == '\\' && src
[1] == '?' && src
[2] == '?' && src
[3] == '\\') src
+= 4;
6763 if (dst
[0] == '\\' && dst
[1] == '?' && dst
[2] == '?' && dst
[3] == '\\') dst
+= 4;
6764 ok(MoveFileExA(src
, dst
, flags
), "Failed to move file %s -> %s (%u)\n", src
, dst
, GetLastError());
6767 ok(DeleteFileA(src
), "Failed to delete file %s (%u)\n", src
, GetLastError());
6769 HeapFree(GetProcessHeap(), 0, buf
);
6770 RegDeleteValueA(hkey
, rename_ops
);
6773 static BOOL
file_matches_data(LPCSTR file
, LPCSTR data
)
6775 DWORD len
, data_len
= strlen(data
);
6779 handle
= CreateFile(file
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, NULL
);
6780 ok(handle
!= INVALID_HANDLE_VALUE
, "failed to open %s (%u)\n", file
, GetLastError());
6782 if (ReadFile(handle
, buf
, sizeof(buf
), &len
, NULL
) && len
>= data_len
)
6784 CloseHandle(handle
);
6785 return !memcmp(buf
, data
, data_len
);
6787 CloseHandle(handle
);
6791 static void test_file_in_use(void)
6797 char path
[MAX_PATH
];
6801 win_skip("Pending file renaming is implemented differently on Win9x and WinMe\n");
6805 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
6806 if (!RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
))
6808 skip("Pending file rename operations, skipping test\n");
6812 CreateDirectoryA("msitest", NULL
);
6813 create_file("msitest\\maximus", 500);
6814 create_database(msifile
, fiu_tables
, sizeof(fiu_tables
) / sizeof(msi_table
));
6816 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6818 lstrcpy(path
, PROG_FILES_DIR
);
6819 lstrcat(path
, "\\msitest");
6820 CreateDirectoryA(path
, NULL
);
6822 lstrcat(path
, "\\maximus");
6823 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
6825 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
6826 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
6827 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
6829 ok(!file_matches_data(path
, "msitest\\maximus"), "Expected file not to match\n");
6831 process_pending_renames(hkey
);
6834 ok(file_matches_data(path
, "msitest\\maximus"), "Expected file to match\n");
6835 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
6836 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
6838 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6839 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6841 delete_test_files();
6844 static void test_file_in_use_cab(void)
6850 char path
[MAX_PATH
];
6854 win_skip("Pending file renaming is implemented differently on Win9x and WinMe\n");
6858 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, session_manager
, 0, KEY_ALL_ACCESS
, &hkey
);
6859 if (!RegQueryValueExA(hkey
, rename_ops
, NULL
, NULL
, NULL
, &size
))
6861 skip("Pending file rename operations, skipping test\n");
6865 CreateDirectoryA("msitest", NULL
);
6866 create_file("maximus", 500);
6867 create_cab_file("test1.cab", MEDIA_SIZE
, "maximus\0");
6868 DeleteFile("maximus");
6870 create_database(msifile
, fiuc_tables
, sizeof(fiuc_tables
) / sizeof(msi_table
));
6872 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6874 lstrcpy(path
, PROG_FILES_DIR
);
6875 lstrcat(path
, "\\msitest");
6876 CreateDirectoryA(path
, NULL
);
6878 lstrcat(path
, "\\maximus");
6879 file
= CreateFileA(path
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, CREATE_NEW
, FILE_ATTRIBUTE_NORMAL
, NULL
);
6881 r
= MsiInstallProductA(msifile
, "REBOOT=ReallySuppress FULL=1");
6882 ok(r
== ERROR_SUCCESS_REBOOT_REQUIRED
, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r
);
6883 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
6885 ok(!file_matches_data(path
, "maximus"), "Expected file not to match\n");
6887 process_pending_renames(hkey
);
6890 ok(file_matches_data(path
, "maximus"), "Expected file to match\n");
6891 ok(delete_pf("msitest\\maximus", TRUE
), "File not present\n");
6892 ok(delete_pf("msitest", FALSE
), "Directory not present or not empty\n");
6894 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6895 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6898 delete_test_files();
6901 static INT CALLBACK
handler_a(LPVOID context
, UINT type
, LPCSTR msg
)
6906 static INT CALLBACK
handler_w(LPVOID context
, UINT type
, LPCWSTR msg
)
6911 static INT CALLBACK
handler_record(LPVOID context
, UINT type
, MSIHANDLE record
)
6916 static void test_MsiSetExternalUI(void)
6918 INSTALLUI_HANDLERA ret_a
;
6919 INSTALLUI_HANDLERW ret_w
;
6920 INSTALLUI_HANDLER_RECORD prev
;
6923 ret_a
= MsiSetExternalUIA(handler_a
, INSTALLLOGMODE_ERROR
, NULL
);
6924 ok(ret_a
== NULL
, "expected NULL, got %p\n", ret_a
);
6926 ret_a
= MsiSetExternalUIA(NULL
, 0, NULL
);
6927 ok(ret_a
== handler_a
, "expected %p, got %p\n", handler_a
, ret_a
);
6929 /* Not present before Installer 3.1 */
6930 if (!pMsiSetExternalUIRecord
) {
6931 win_skip("MsiSetExternalUIRecord is not available\n");
6935 error
= pMsiSetExternalUIRecord(handler_record
, INSTALLLOGMODE_ERROR
, NULL
, &prev
);
6936 ok(!error
, "MsiSetExternalUIRecord failed %u\n", error
);
6937 ok(prev
== NULL
, "expected NULL, got %p\n", prev
);
6939 prev
= (INSTALLUI_HANDLER_RECORD
)0xdeadbeef;
6940 error
= pMsiSetExternalUIRecord(NULL
, INSTALLLOGMODE_ERROR
, NULL
, &prev
);
6941 ok(!error
, "MsiSetExternalUIRecord failed %u\n", error
);
6942 ok(prev
== handler_record
, "expected %p, got %p\n", handler_record
, prev
);
6944 ret_w
= MsiSetExternalUIW(handler_w
, INSTALLLOGMODE_ERROR
, NULL
);
6945 ok(ret_w
== NULL
, "expected NULL, got %p\n", ret_w
);
6947 ret_w
= MsiSetExternalUIW(NULL
, 0, NULL
);
6948 ok(ret_w
== handler_w
, "expected %p, got %p\n", handler_w
, ret_w
);
6950 ret_a
= MsiSetExternalUIA(handler_a
, INSTALLLOGMODE_ERROR
, NULL
);
6951 ok(ret_a
== NULL
, "expected NULL, got %p\n", ret_a
);
6953 ret_w
= MsiSetExternalUIW(handler_w
, INSTALLLOGMODE_ERROR
, NULL
);
6954 ok(ret_w
== NULL
, "expected NULL, got %p\n", ret_w
);
6956 prev
= (INSTALLUI_HANDLER_RECORD
)0xdeadbeef;
6957 error
= pMsiSetExternalUIRecord(handler_record
, INSTALLLOGMODE_ERROR
, NULL
, &prev
);
6958 ok(!error
, "MsiSetExternalUIRecord failed %u\n", error
);
6959 ok(prev
== NULL
, "expected NULL, got %p\n", prev
);
6961 ret_a
= MsiSetExternalUIA(NULL
, 0, NULL
);
6962 ok(ret_a
== NULL
, "expected NULL, got %p\n", ret_a
);
6964 ret_w
= MsiSetExternalUIW(NULL
, 0, NULL
);
6965 ok(ret_w
== NULL
, "expected NULL, got %p\n", ret_w
);
6967 prev
= (INSTALLUI_HANDLER_RECORD
)0xdeadbeef;
6968 error
= pMsiSetExternalUIRecord(NULL
, 0, NULL
, &prev
);
6969 ok(!error
, "MsiSetExternalUIRecord failed %u\n", error
);
6970 ok(prev
== handler_record
, "expected %p, got %p\n", handler_record
, prev
);
6972 error
= pMsiSetExternalUIRecord(handler_record
, INSTALLLOGMODE_ERROR
, NULL
, NULL
);
6973 ok(!error
, "MsiSetExternalUIRecord failed %u\n", error
);
6975 error
= pMsiSetExternalUIRecord(NULL
, 0, NULL
, NULL
);
6976 ok(!error
, "MsiSetExternalUIRecord failed %u\n", error
);
6982 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6983 STATEMGRSTATUS status
;
6986 init_functionpointers();
6988 on_win9x
= check_win9x();
6990 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6991 GetTempPath(MAX_PATH
, temp_path
);
6992 SetCurrentDirectoryA(temp_path
);
6994 lstrcpyA(CURR_DIR
, temp_path
);
6995 len
= lstrlenA(CURR_DIR
);
6997 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
6998 CURR_DIR
[len
- 1] = 0;
7000 get_program_files_dir(PROG_FILES_DIR
, COMMON_FILES_DIR
);
7002 /* Create a restore point ourselves so we circumvent the multitude of restore points
7003 * that would have been created by all the installation and removal tests.
7005 if (pSRSetRestorePointA
)
7007 memset(&status
, 0, sizeof(status
));
7008 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
7011 /* Create only one log file and don't append. We have to pass something
7012 * for the log mode for this to work. The logfile needs to have an absolute
7013 * path otherwise we still end up with some extra logfiles as some tests
7014 * change the current directory.
7016 lstrcpyA(log_file
, temp_path
);
7017 lstrcatA(log_file
, "\\msitest.log");
7018 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
7020 test_MsiInstallProduct();
7021 test_MsiSetComponentState();
7022 test_packagecoltypes();
7023 test_continuouscabs();
7026 test_samesequence();
7027 test_uiLevelFlags();
7028 test_readonlyfile();
7029 test_readonlyfile_cab();
7030 test_setdirproperty();
7031 test_cabisextracted();
7032 test_concurrentinstall();
7033 test_setpropertyfolder();
7034 test_publish_registerproduct();
7035 test_publish_publishproduct();
7036 test_publish_publishfeatures();
7037 test_publish_registeruser();
7038 test_publish_processcomponents();
7040 test_publishsourcelist();
7041 test_transformprop();
7042 test_currentworkingdir();
7048 test_duplicatefiles();
7049 test_writeregistryvalues();
7050 test_sourcefolder();
7051 test_customaction51();
7052 test_installstate();
7054 test_MsiConfigureProductEx();
7055 test_missingcomponent();
7056 test_sourcedirprop();
7062 test_lastusedsource();
7064 test_installed_prop();
7066 test_file_in_use_cab();
7067 test_MsiSetExternalUI();
7069 DeleteFileA(log_file
);
7071 if (pSRSetRestorePointA
&& ret
)
7073 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
7075 remove_restore_point(status
.llSequenceNumber
);
7077 FreeLibrary(hsrclient
);
7079 SetCurrentDirectoryA(prev_path
);