msi/tests: Don't create a nested restore point on recent versions of MSI.
[wine.git] / dlls / msi / tests / install.c
blob8b24367e1012bbcf3352ce68d1577bbb79aca7ae
1 /*
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
22 #define COBJMACROS
24 #include <stdio.h>
26 #include <windows.h>
27 #include <msiquery.h>
28 #include <msidefs.h>
29 #include <msi.h>
30 #include <fci.h>
31 #include <objidl.h>
32 #include <srrestoreptapi.h>
33 #include <shlobj.h>
35 #include "wine/test.h"
37 static UINT (WINAPI *pMsiQueryComponentStateA)
38 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*);
39 static UINT (WINAPI *pMsiSetExternalUIRecord)
40 (INSTALLUI_HANDLER_RECORD, DWORD, LPVOID, PINSTALLUI_HANDLER_RECORD);
41 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
42 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
43 static UINT (WINAPI *pMsiSourceListGetInfoA)
44 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
45 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
46 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
48 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
49 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
50 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
51 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
52 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
54 static HMODULE hsrclient = 0;
55 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
56 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
58 static BOOL on_win9x = FALSE;
59 static BOOL is_wow64;
60 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
62 static const char *msifile = "msitest.msi";
63 static const char *msifile2 = "winetest2.msi";
64 static const char *mstfile = "winetest.mst";
65 static CHAR CURR_DIR[MAX_PATH];
66 static CHAR PROG_FILES_DIR[MAX_PATH];
67 static CHAR PROG_FILES_DIR_NATIVE[MAX_PATH];
68 static CHAR COMMON_FILES_DIR[MAX_PATH];
69 static CHAR APP_DATA_DIR[MAX_PATH];
70 static CHAR WINDOWS_DIR[MAX_PATH];
72 /* msi database data */
74 static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
75 "s72\tS38\ts72\ti2\tS255\tS72\n"
76 "Component\tComponent\n"
77 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
78 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
79 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
80 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
81 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
82 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
83 "component\t\tMSITESTDIR\t0\t1\tfile\n"
84 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
86 static const CHAR directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
87 "s72\tS72\tl255\n"
88 "Directory\tDirectory\n"
89 "CABOUTDIR\tMSITESTDIR\tcabout\n"
90 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
91 "FIRSTDIR\tMSITESTDIR\tfirst\n"
92 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
93 "NEWDIR\tCABOUTDIR\tnew\n"
94 "ProgramFilesFolder\tTARGETDIR\t.\n"
95 "TARGETDIR\t\tSourceDir";
97 static const CHAR feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
98 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
99 "Feature\tFeature\n"
100 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
101 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
102 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
103 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
104 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
105 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
106 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
108 static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n"
109 "s38\ts72\n"
110 "FeatureComponents\tFeature_\tComponent_\n"
111 "Five\tFive\n"
112 "Four\tFour\n"
113 "One\tOne\n"
114 "Three\tThree\n"
115 "Two\tTwo\n"
116 "feature\tcomponent\n"
117 "service_feature\tservice_comp\n";
119 static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
120 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
121 "File\tFile\n"
122 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
123 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
124 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
125 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
126 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
127 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
128 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
130 static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
131 "s72\tS255\tI2\n"
132 "InstallExecuteSequence\tAction\n"
133 "AllocateRegistrySpace\tNOT Installed\t1550\n"
134 "CostFinalize\t\t1000\n"
135 "CostInitialize\t\t800\n"
136 "FileCost\t\t900\n"
137 "ResolveSource\t\t950\n"
138 "MoveFiles\t\t1700\n"
139 "InstallFiles\t\t4000\n"
140 "DuplicateFiles\t\t4500\n"
141 "WriteEnvironmentStrings\t\t4550\n"
142 "CreateShortcuts\t\t4600\n"
143 "InstallServices\t\t5000\n"
144 "InstallFinalize\t\t6600\n"
145 "InstallInitialize\t\t1500\n"
146 "InstallValidate\t\t1400\n"
147 "LaunchConditions\t\t100\n"
148 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
150 static const CHAR media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
151 "i2\ti4\tL64\tS255\tS32\tS72\n"
152 "Media\tDiskId\n"
153 "1\t3\t\t\tDISK1\t\n"
154 "2\t5\t\tmsitest.cab\tDISK2\t\n";
156 static const CHAR property_dat[] = "Property\tValue\n"
157 "s72\tl0\n"
158 "Property\tProperty\n"
159 "DefaultUIFont\tDlgFont8\n"
160 "HASUIRUN\t0\n"
161 "INSTALLLEVEL\t3\n"
162 "InstallMode\tTypical\n"
163 "Manufacturer\tWine\n"
164 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
165 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
166 "ProductID\tnone\n"
167 "ProductLanguage\t1033\n"
168 "ProductName\tMSITEST\n"
169 "ProductVersion\t1.1.1\n"
170 "PROMPTROLLBACKCOST\tP\n"
171 "Setup\tSetup\n"
172 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
173 "AdminProperties\tPOSTADMIN\n"
174 "ROOTDRIVE\tC:\\\n"
175 "SERVNAME\tTestService\n"
176 "SERVDISP\tTestServiceDisp\n"
177 "MSIFASTINSTALL\t1\n";
179 static const CHAR aup_property_dat[] = "Property\tValue\n"
180 "s72\tl0\n"
181 "Property\tProperty\n"
182 "DefaultUIFont\tDlgFont8\n"
183 "HASUIRUN\t0\n"
184 "ALLUSERS\t1\n"
185 "INSTALLLEVEL\t3\n"
186 "InstallMode\tTypical\n"
187 "Manufacturer\tWine\n"
188 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
189 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
190 "ProductID\tnone\n"
191 "ProductLanguage\t1033\n"
192 "ProductName\tMSITEST\n"
193 "ProductVersion\t1.1.1\n"
194 "PROMPTROLLBACKCOST\tP\n"
195 "Setup\tSetup\n"
196 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
197 "AdminProperties\tPOSTADMIN\n"
198 "ROOTDRIVE\tC:\\\n"
199 "SERVNAME\tTestService\n"
200 "SERVDISP\tTestServiceDisp\n"
201 "MSIFASTINSTALL\t1\n";
203 static const CHAR aup2_property_dat[] = "Property\tValue\n"
204 "s72\tl0\n"
205 "Property\tProperty\n"
206 "DefaultUIFont\tDlgFont8\n"
207 "HASUIRUN\t0\n"
208 "ALLUSERS\t2\n"
209 "INSTALLLEVEL\t3\n"
210 "InstallMode\tTypical\n"
211 "Manufacturer\tWine\n"
212 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
213 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
214 "ProductID\tnone\n"
215 "ProductLanguage\t1033\n"
216 "ProductName\tMSITEST\n"
217 "ProductVersion\t1.1.1\n"
218 "PROMPTROLLBACKCOST\tP\n"
219 "Setup\tSetup\n"
220 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
221 "AdminProperties\tPOSTADMIN\n"
222 "ROOTDRIVE\tC:\\\n"
223 "SERVNAME\tTestService\n"
224 "SERVDISP\tTestServiceDisp\n"
225 "MSIFASTINSTALL\t1\n";
227 static const CHAR icon_property_dat[] = "Property\tValue\n"
228 "s72\tl0\n"
229 "Property\tProperty\n"
230 "DefaultUIFont\tDlgFont8\n"
231 "HASUIRUN\t0\n"
232 "INSTALLLEVEL\t3\n"
233 "InstallMode\tTypical\n"
234 "Manufacturer\tWine\n"
235 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
236 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
237 "ProductID\tnone\n"
238 "ProductLanguage\t1033\n"
239 "ProductName\tMSITEST\n"
240 "ProductVersion\t1.1.1\n"
241 "PROMPTROLLBACKCOST\tP\n"
242 "Setup\tSetup\n"
243 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
244 "AdminProperties\tPOSTADMIN\n"
245 "ROOTDRIVE\tC:\\\n"
246 "SERVNAME\tTestService\n"
247 "SERVDISP\tTestServiceDisp\n"
248 "MSIFASTINSTALL\t1\n";
250 static const CHAR shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
251 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
252 "Shortcut\tShortcut\n"
253 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
255 static const CHAR environment_dat[] = "Environment\tName\tValue\tComponent_\n"
256 "s72\tl255\tL255\ts72\n"
257 "Environment\tEnvironment\n"
258 "Var1\t=-MSITESTVAR1\t1\tOne\n"
259 "Var2\tMSITESTVAR2\t1\tOne\n"
260 "Var3\t=-MSITESTVAR3\t1\tOne\n"
261 "Var4\tMSITESTVAR4\t1\tOne\n"
262 "Var5\t-MSITESTVAR5\t\tOne\n"
263 "Var6\tMSITESTVAR6\t\tOne\n"
264 "Var7\t!-MSITESTVAR7\t\tOne\n"
265 "Var8\t!-*MSITESTVAR8\t\tOne\n"
266 "Var9\t=-MSITESTVAR9\t\tOne\n"
267 "Var10\t=MSITESTVAR10\t\tOne\n"
268 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
269 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
270 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
271 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
272 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
273 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
274 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
275 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
276 "Var19\t+-MSITESTVAR17\t1\tOne\n"
277 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
278 "Var21\t+-MSITESTVAR18\t1\tOne\n"
279 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
280 "Var23\t+-MSITESTVAR19\t1\tOne\n"
281 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
282 "Var25\t+-MSITESTVAR20\t1\tOne\n"
283 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n";
285 /* Expected results, starting from MSITESTVAR11 onwards */
286 static const CHAR *environment_dat_results[] = {"1;2", /*MSITESTVAR11*/
287 "1", /*MSITESTVAR12*/
288 "1;2", /*MSITESTVAR13*/
289 ";1;", /*MSITESTVAR14*/
290 ";;1;;", /*MSITESTVAR15*/
291 " 1 ", /*MSITESTVAR16*/
292 ";;2;;1", /*MSITESTVAR17*/
293 "1;;2;;", /*MSITESTVAR18*/
294 "1", /*MSITESTVAR19*/
295 "1", /*MSITESTVAR20*/
296 NULL};
298 static const CHAR condition_dat[] = "Feature_\tLevel\tCondition\n"
299 "s38\ti2\tS255\n"
300 "Condition\tFeature_\tLevel\n"
301 "One\t4\t1\n";
303 static const CHAR up_property_dat[] = "Property\tValue\n"
304 "s72\tl0\n"
305 "Property\tProperty\n"
306 "DefaultUIFont\tDlgFont8\n"
307 "HASUIRUN\t0\n"
308 "INSTALLLEVEL\t3\n"
309 "InstallMode\tTypical\n"
310 "Manufacturer\tWine\n"
311 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
312 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
313 "ProductID\tnone\n"
314 "ProductLanguage\t1033\n"
315 "ProductName\tMSITEST\n"
316 "ProductVersion\t1.1.1\n"
317 "PROMPTROLLBACKCOST\tP\n"
318 "Setup\tSetup\n"
319 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
320 "AdminProperties\tPOSTADMIN\n"
321 "ROOTDRIVE\tC:\\\n"
322 "SERVNAME\tTestService\n"
323 "SERVDISP\tTestServiceDisp\n"
324 "RemovePreviousVersions\t1\n"
325 "MSIFASTINSTALL\t1\n";
327 static const CHAR up2_property_dat[] = "Property\tValue\n"
328 "s72\tl0\n"
329 "Property\tProperty\n"
330 "DefaultUIFont\tDlgFont8\n"
331 "HASUIRUN\t0\n"
332 "INSTALLLEVEL\t3\n"
333 "InstallMode\tTypical\n"
334 "Manufacturer\tWine\n"
335 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
336 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
337 "ProductID\tnone\n"
338 "ProductLanguage\t1033\n"
339 "ProductName\tMSITEST\n"
340 "ProductVersion\t1.1.2\n"
341 "PROMPTROLLBACKCOST\tP\n"
342 "Setup\tSetup\n"
343 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
344 "AdminProperties\tPOSTADMIN\n"
345 "ROOTDRIVE\tC:\\\n"
346 "SERVNAME\tTestService\n"
347 "SERVDISP\tTestServiceDisp\n"
348 "MSIFASTINSTALL\t1\n";
350 static const CHAR up3_property_dat[] = "Property\tValue\n"
351 "s72\tl0\n"
352 "Property\tProperty\n"
353 "DefaultUIFont\tDlgFont8\n"
354 "HASUIRUN\t0\n"
355 "INSTALLLEVEL\t3\n"
356 "InstallMode\tTypical\n"
357 "Manufacturer\tWine\n"
358 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
359 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
360 "ProductID\tnone\n"
361 "ProductLanguage\t1033\n"
362 "ProductName\tMSITEST\n"
363 "ProductVersion\t1.1.2\n"
364 "PROMPTROLLBACKCOST\tP\n"
365 "Setup\tSetup\n"
366 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
367 "AdminProperties\tPOSTADMIN\n"
368 "ROOTDRIVE\tC:\\\n"
369 "SERVNAME\tTestService\n"
370 "SERVDISP\tTestServiceDisp\n"
371 "RemovePreviousVersions\t1\n"
372 "MSIFASTINSTALL\t1\n";
374 static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
375 "s72\ti2\tl255\tL255\tL0\ts72\n"
376 "Registry\tRegistry\n"
377 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
378 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
379 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
380 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
382 static const CHAR service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
383 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
384 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
385 "ServiceInstall\tServiceInstall\n"
386 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
388 static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
389 "s72\tl255\ti2\tL255\tI2\ts72\n"
390 "ServiceControl\tServiceControl\n"
391 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
393 static const CHAR sss_service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
394 "s72\tl255\ti2\tL255\tI2\ts72\n"
395 "ServiceControl\tServiceControl\n"
396 "ServiceControl\tSpooler\t1\t\t0\tservice_comp";
398 static const CHAR sss_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
399 "s72\tS255\tI2\n"
400 "InstallExecuteSequence\tAction\n"
401 "LaunchConditions\t\t100\n"
402 "CostInitialize\t\t800\n"
403 "FileCost\t\t900\n"
404 "ResolveSource\t\t950\n"
405 "CostFinalize\t\t1000\n"
406 "InstallValidate\t\t1400\n"
407 "InstallInitialize\t\t1500\n"
408 "DeleteServices\t\t5000\n"
409 "MoveFiles\t\t5100\n"
410 "InstallFiles\t\t5200\n"
411 "DuplicateFiles\t\t5300\n"
412 "StartServices\t\t5400\n"
413 "InstallFinalize\t\t6000\n";
415 static const CHAR sds_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
416 "s72\tS255\tI2\n"
417 "InstallExecuteSequence\tAction\n"
418 "LaunchConditions\t\t100\n"
419 "CostInitialize\t\t800\n"
420 "FileCost\t\t900\n"
421 "ResolveSource\t\t950\n"
422 "CostFinalize\t\t1000\n"
423 "InstallValidate\t\t1400\n"
424 "InstallInitialize\t\t1500\n"
425 "DeleteServices\tInstalled\t5000\n"
426 "MoveFiles\t\t5100\n"
427 "InstallFiles\t\t5200\n"
428 "DuplicateFiles\t\t5300\n"
429 "InstallServices\tNOT Installed\t5400\n"
430 "RegisterProduct\t\t5500\n"
431 "PublishFeatures\t\t5600\n"
432 "PublishProduct\t\t5700\n"
433 "InstallFinalize\t\t6000\n";
435 /* tables for test_continuouscabs */
436 static const CHAR cc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
437 "s72\tS38\ts72\ti2\tS255\tS72\n"
438 "Component\tComponent\n"
439 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
440 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
441 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
443 static const CHAR cc2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
444 "s72\tS38\ts72\ti2\tS255\tS72\n"
445 "Component\tComponent\n"
446 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
447 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
448 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
450 static const CHAR cc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
451 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
452 "Feature\tFeature\n"
453 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
455 static const CHAR cc_feature_comp_dat[] = "Feature_\tComponent_\n"
456 "s38\ts72\n"
457 "FeatureComponents\tFeature_\tComponent_\n"
458 "feature\tmaximus\n"
459 "feature\taugustus\n"
460 "feature\tcaesar";
462 static const CHAR cc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
463 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
464 "File\tFile\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";
469 static const CHAR cc2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
470 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
471 "File\tFile\n"
472 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
473 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
474 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
475 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
477 static const CHAR cc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
478 "i2\ti4\tL64\tS255\tS32\tS72\n"
479 "Media\tDiskId\n"
480 "1\t10\t\ttest1.cab\tDISK1\t\n"
481 "2\t2\t\ttest2.cab\tDISK2\t\n"
482 "3\t12\t\ttest3.cab\tDISK3\t\n";
484 static const CHAR co_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
485 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
486 "File\tFile\n"
487 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
488 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
489 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
491 static const CHAR co_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
492 "i2\ti4\tL64\tS255\tS32\tS72\n"
493 "Media\tDiskId\n"
494 "1\t10\t\ttest1.cab\tDISK1\t\n"
495 "2\t2\t\ttest2.cab\tDISK2\t\n"
496 "3\t3\t\ttest3.cab\tDISK3\t\n";
498 static const CHAR co2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
499 "i2\ti4\tL64\tS255\tS32\tS72\n"
500 "Media\tDiskId\n"
501 "1\t10\t\ttest1.cab\tDISK1\t\n"
502 "2\t12\t\ttest3.cab\tDISK3\t\n"
503 "3\t2\t\ttest2.cab\tDISK2\t\n";
505 static const CHAR mm_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
506 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
507 "File\tFile\n"
508 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
509 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
510 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
512 static const CHAR mm_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
513 "i2\ti4\tL64\tS255\tS32\tS72\n"
514 "Media\tDiskId\n"
515 "1\t3\t\ttest1.cab\tDISK1\t\n";
517 static const CHAR ss_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
518 "i2\ti4\tL64\tS255\tS32\tS72\n"
519 "Media\tDiskId\n"
520 "1\t2\t\ttest1.cab\tDISK1\t\n"
521 "2\t2\t\ttest2.cab\tDISK2\t\n"
522 "3\t12\t\ttest3.cab\tDISK3\t\n";
524 /* tables for test_uiLevelFlags */
525 static const CHAR ui_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
526 "s72\tS38\ts72\ti2\tS255\tS72\n"
527 "Component\tComponent\n"
528 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
529 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
530 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
532 static const CHAR ui_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
533 "s72\tS255\tI2\n"
534 "InstallUISequence\tAction\n"
535 "SetUIProperty\t\t5\n"
536 "ExecuteAction\t\t1100\n";
538 static const CHAR ui_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
539 "s72\ti2\tS64\tS0\tS255\n"
540 "CustomAction\tAction\n"
541 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
543 static const CHAR rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
544 "s72\tS38\ts72\ti2\tS255\tS72\n"
545 "Component\tComponent\n"
546 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
548 static const CHAR rof_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
549 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
550 "Feature\tFeature\n"
551 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
552 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
554 static const CHAR rof_feature_comp_dat[] = "Feature_\tComponent_\n"
555 "s38\ts72\n"
556 "FeatureComponents\tFeature_\tComponent_\n"
557 "feature\tmaximus\n"
558 "montecristo\tmaximus";
560 static const CHAR rof_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
561 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
562 "File\tFile\n"
563 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
565 static const CHAR rof_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
566 "i2\ti4\tL64\tS255\tS32\tS72\n"
567 "Media\tDiskId\n"
568 "1\t1\t\t\tDISK1\t\n";
570 static const CHAR rofc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
571 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
572 "File\tFile\n"
573 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
575 static const CHAR rofc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
576 "i2\ti4\tL64\tS255\tS32\tS72\n"
577 "Media\tDiskId\n"
578 "1\t1\t\ttest1.cab\tDISK1\t\n";
580 static const CHAR lus2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
581 "i2\ti4\tL64\tS255\tS32\tS72\n"
582 "Media\tDiskId\n"
583 "1\t1\t\t#test1.cab\tDISK1\t\n";
585 static const CHAR sdp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
586 "s72\tS255\tI2\n"
587 "InstallExecuteSequence\tAction\n"
588 "AllocateRegistrySpace\tNOT Installed\t1550\n"
589 "CostFinalize\t\t1000\n"
590 "CostInitialize\t\t800\n"
591 "FileCost\t\t900\n"
592 "InstallFiles\t\t4000\n"
593 "InstallFinalize\t\t6600\n"
594 "InstallInitialize\t\t1500\n"
595 "InstallValidate\t\t1400\n"
596 "LaunchConditions\t\t100\n"
597 "SetDirProperty\t\t950";
599 static const CHAR sdp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
600 "s72\ti2\tS64\tS0\tS255\n"
601 "CustomAction\tAction\n"
602 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
604 static const CHAR pv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
605 "s72\tS255\tI2\n"
606 "InstallExecuteSequence\tAction\n"
607 "LaunchConditions\t\t100\n"
608 "CostInitialize\t\t800\n"
609 "FileCost\t\t900\n"
610 "CostFinalize\t\t1000\n"
611 "InstallValidate\t\t1400\n"
612 "InstallInitialize\t\t1500\n"
613 "InstallFiles\t\t4000\n"
614 "InstallFinalize\t\t6600\n";
616 static const CHAR cie_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
617 "s72\tS38\ts72\ti2\tS255\tS72\n"
618 "Component\tComponent\n"
619 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
620 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
621 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
622 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
624 static const CHAR cie_feature_comp_dat[] = "Feature_\tComponent_\n"
625 "s38\ts72\n"
626 "FeatureComponents\tFeature_\tComponent_\n"
627 "feature\tmaximus\n"
628 "feature\taugustus\n"
629 "feature\tcaesar\n"
630 "feature\tgaius";
632 static const CHAR cie_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
633 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
634 "File\tFile\n"
635 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
636 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
637 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
638 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
640 static const CHAR cie_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
641 "i2\ti4\tL64\tS255\tS32\tS72\n"
642 "Media\tDiskId\n"
643 "1\t1\t\ttest1.cab\tDISK1\t\n"
644 "2\t2\t\ttest2.cab\tDISK2\t\n"
645 "3\t12\t\ttest3.cab\tDISK3\t\n";
647 static const CHAR ci_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
648 "s72\tS255\tI2\n"
649 "InstallExecuteSequence\tAction\n"
650 "CostFinalize\t\t1000\n"
651 "CostInitialize\t\t800\n"
652 "FileCost\t\t900\n"
653 "InstallFiles\t\t4000\n"
654 "InstallServices\t\t5000\n"
655 "InstallFinalize\t\t6600\n"
656 "InstallInitialize\t\t1500\n"
657 "RunInstall\t\t1600\n"
658 "InstallValidate\t\t1400\n"
659 "LaunchConditions\t\t100";
661 static const CHAR ci_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
662 "s72\ti2\tS64\tS0\tS255\n"
663 "CustomAction\tAction\n"
664 "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n";
666 static const CHAR ci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
667 "s72\tS38\ts72\ti2\tS255\tS72\n"
668 "Component\tComponent\n"
669 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
671 static const CHAR ci2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
672 "s72\tS38\ts72\ti2\tS255\tS72\n"
673 "Component\tComponent\n"
674 "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n";
676 static const CHAR ci2_feature_comp_dat[] = "Feature_\tComponent_\n"
677 "s38\ts72\n"
678 "FeatureComponents\tFeature_\tComponent_\n"
679 "feature\taugustus";
681 static const CHAR ci2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
682 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
683 "File\tFile\n"
684 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
686 static const CHAR spf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
687 "s72\ti2\tS64\tS0\tS255\n"
688 "CustomAction\tAction\n"
689 "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n";
691 static const CHAR spf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
692 "s72\tS255\tI2\n"
693 "InstallExecuteSequence\tAction\n"
694 "CostFinalize\t\t1000\n"
695 "CostInitialize\t\t800\n"
696 "FileCost\t\t900\n"
697 "SetFolderProp\t\t950\n"
698 "InstallFiles\t\t4000\n"
699 "InstallServices\t\t5000\n"
700 "InstallFinalize\t\t6600\n"
701 "InstallInitialize\t\t1500\n"
702 "InstallValidate\t\t1400\n"
703 "LaunchConditions\t\t100";
705 static const CHAR spf_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
706 "s72\tS255\tI2\n"
707 "InstallUISequence\tAction\n"
708 "CostInitialize\t\t800\n"
709 "FileCost\t\t900\n"
710 "CostFinalize\t\t1000\n"
711 "ExecuteAction\t\t1100\n";
713 static const CHAR pp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
714 "s72\tS255\tI2\n"
715 "InstallExecuteSequence\tAction\n"
716 "ValidateProductID\t\t700\n"
717 "CostInitialize\t\t800\n"
718 "FileCost\t\t900\n"
719 "CostFinalize\t\t1000\n"
720 "InstallValidate\t\t1400\n"
721 "InstallInitialize\t\t1500\n"
722 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
723 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
724 "RemoveFiles\t\t3500\n"
725 "InstallFiles\t\t4000\n"
726 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
727 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
728 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
729 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
730 "InstallFinalize\t\t6600";
732 static const CHAR pp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
733 "s72\tS38\ts72\ti2\tS255\tS72\n"
734 "Component\tComponent\n"
735 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
737 static const CHAR ppc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
738 "s72\tS38\ts72\ti2\tS255\tS72\n"
739 "Component\tComponent\n"
740 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
741 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
743 static const CHAR ppc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
744 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
745 "File\tFile\n"
746 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
747 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
749 static const CHAR ppc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
750 "i2\ti4\tL64\tS255\tS32\tS72\n"
751 "Media\tDiskId\n"
752 "1\t2\t\t\tDISK1\t\n";
754 static const CHAR ppc_feature_comp_dat[] = "Feature_\tComponent_\n"
755 "s38\ts72\n"
756 "FeatureComponents\tFeature_\tComponent_\n"
757 "feature\tmaximus\n"
758 "feature\taugustus\n"
759 "montecristo\tmaximus";
761 static const CHAR tp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
762 "s72\tS38\ts72\ti2\tS255\tS72\n"
763 "Component\tComponent\n"
764 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
766 static const CHAR cwd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
767 "s72\tS38\ts72\ti2\tS255\tS72\n"
768 "Component\tComponent\n"
769 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
771 static const CHAR adm_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
772 "s72\tS38\ts72\ti2\tS255\tS72\n"
773 "Component\tComponent\n"
774 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
776 static const CHAR adm_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
777 "s72\ti2\tS64\tS0\tS255\n"
778 "CustomAction\tAction\n"
779 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
781 static const CHAR adm_admin_exec_seq_dat[] = "Action\tCondition\tSequence\n"
782 "s72\tS255\tI2\n"
783 "AdminExecuteSequence\tAction\n"
784 "CostFinalize\t\t1000\n"
785 "CostInitialize\t\t800\n"
786 "FileCost\t\t900\n"
787 "SetPOSTADMIN\t\t950\n"
788 "InstallFiles\t\t4000\n"
789 "InstallFinalize\t\t6600\n"
790 "InstallInitialize\t\t1500\n"
791 "InstallValidate\t\t1400\n"
792 "LaunchConditions\t\t100";
794 static const CHAR amp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
795 "s72\tS38\ts72\ti2\tS255\tS72\n"
796 "Component\tComponent\n"
797 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
799 static const CHAR rem_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
800 "s72\tS38\ts72\ti2\tS255\tS72\n"
801 "Component\tComponent\n"
802 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
803 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
804 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
806 static const CHAR rem_feature_comp_dat[] = "Feature_\tComponent_\n"
807 "s38\ts72\n"
808 "FeatureComponents\tFeature_\tComponent_\n"
809 "feature\thydrogen\n"
810 "feature\thelium\n"
811 "feature\tlithium";
813 static const CHAR rem_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
814 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
815 "File\tFile\n"
816 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
817 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
818 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
820 static const CHAR rem_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
821 "s72\tS255\tI2\n"
822 "InstallExecuteSequence\tAction\n"
823 "ValidateProductID\t\t700\n"
824 "CostInitialize\t\t800\n"
825 "FileCost\t\t900\n"
826 "CostFinalize\t\t1000\n"
827 "InstallValidate\t\t1400\n"
828 "InstallInitialize\t\t1500\n"
829 "ProcessComponents\t\t1600\n"
830 "UnpublishFeatures\t\t1800\n"
831 "RemoveFiles\t\t3500\n"
832 "InstallFiles\t\t4000\n"
833 "RegisterProduct\t\t6100\n"
834 "PublishFeatures\t\t6300\n"
835 "PublishProduct\t\t6400\n"
836 "InstallFinalize\t\t6600";
838 static const CHAR rem_remove_files_dat[] = "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
839 "s72\ts72\tS255\ts72\tI2\n"
840 "RemoveFile\tFileKey\n"
841 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
842 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
843 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
844 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
845 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
846 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
847 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
848 "block\thelium\tblock\tMSITESTDIR\t3\n"
849 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
850 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
852 static const CHAR mov_move_file_dat[] = "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
853 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
854 "MoveFile\tFileKey\n"
855 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
856 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
857 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
858 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
859 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
860 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
861 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
862 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
863 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
864 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
865 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
866 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
867 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
868 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
869 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
870 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
871 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
872 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
874 static const CHAR mc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
875 "s72\tS38\ts72\ti2\tS255\tS72\n"
876 "Component\tComponent\n"
877 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
878 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
879 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
880 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n";
882 static const CHAR mc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
883 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
884 "File\tFile\n"
885 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
886 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
887 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
888 "gaius\tgaius\tgaius\t500\t\t\t16384\t4";
890 static const CHAR mc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
891 "i2\ti4\tL64\tS255\tS32\tS72\n"
892 "Media\tDiskId\n"
893 "1\t1\t\ttest1.cab\tDISK1\t\n"
894 "2\t2\t\ttest2.cab\tDISK2\t\n"
895 "3\t3\t\ttest3.cab\tDISK3\t\n"
896 "4\t4\t\ttest3.cab\tDISK3\t\n";
898 static const CHAR mc_file_hash_dat[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
899 "s72\ti2\ti4\ti4\ti4\ti4\n"
900 "MsiFileHash\tFile_\n"
901 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
903 static const CHAR df_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
904 "s72\tS72\tl255\n"
905 "Directory\tDirectory\n"
906 "THIS\tMSITESTDIR\tthis\n"
907 "DOESNOT\tTHIS\tdoesnot\n"
908 "NONEXISTENT\tDOESNOT\texist\n"
909 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
910 "ProgramFilesFolder\tTARGETDIR\t.\n"
911 "TARGETDIR\t\tSourceDir";
913 static const CHAR df_duplicate_file_dat[] = "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
914 "s72\ts72\ts72\tS255\tS72\n"
915 "DuplicateFile\tFileKey\n"
916 "maximus\tmaximus\tmaximus\taugustus\t\n"
917 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
918 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
920 static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
921 "s72\tS38\ts72\ti2\tS255\tS72\n"
922 "Component\tComponent\n"
923 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
925 static const CHAR wrv_registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
926 "s72\ti2\tl255\tL255\tL0\ts72\n"
927 "Registry\tRegistry\n"
928 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus";
930 static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
931 "s72\tS38\ts72\ti2\tS255\tS72\n"
932 "Component\tComponent\n"
933 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
935 static const CHAR ca51_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
936 "s72\tS255\tI2\n"
937 "InstallExecuteSequence\tAction\n"
938 "ValidateProductID\t\t700\n"
939 "GoodSetProperty\t\t725\n"
940 "BadSetProperty\t\t750\n"
941 "CostInitialize\t\t800\n"
942 "ResolveSource\t\t810\n"
943 "FileCost\t\t900\n"
944 "SetSourceDir\tSRCDIR\t910\n"
945 "CostFinalize\t\t1000\n"
946 "InstallValidate\t\t1400\n"
947 "InstallInitialize\t\t1500\n"
948 "InstallFiles\t\t4000\n"
949 "InstallFinalize\t\t6600";
951 static const CHAR ca51_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
952 "s72\ti2\tS64\tS0\n"
953 "CustomAction\tAction\n"
954 "GoodSetProperty\t51\tMYPROP\t42\n"
955 "BadSetProperty\t51\t\tMYPROP\n"
956 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
958 static const CHAR is_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
959 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
960 "Feature\tFeature\n"
961 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
962 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
963 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
964 "four\t\t\t\t2\t0\t\t0"; /* disabled */
966 static const CHAR is_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
967 "s72\tS38\ts72\ti2\tS255\tS72\n"
968 "Component\tComponent\n"
969 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
970 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
971 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
972 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
973 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
974 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
975 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
976 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
977 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
978 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
979 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
980 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
982 static const CHAR is_feature_comp_dat[] = "Feature_\tComponent_\n"
983 "s38\ts72\n"
984 "FeatureComponents\tFeature_\tComponent_\n"
985 "one\talpha\n"
986 "one\tbeta\n"
987 "one\tgamma\n"
988 "two\ttheta\n"
989 "two\tdelta\n"
990 "two\tepsilon\n"
991 "three\tzeta\n"
992 "three\tiota\n"
993 "three\teta\n"
994 "four\tkappa\n"
995 "four\tlambda\n"
996 "four\tmu";
998 static const CHAR is_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
999 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1000 "File\tFile\n"
1001 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
1002 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
1003 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
1004 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
1005 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
1006 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
1007 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
1008 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
1009 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
1010 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
1011 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
1012 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
1014 static const CHAR is_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1015 "i2\ti4\tL64\tS255\tS32\tS72\n"
1016 "Media\tDiskId\n"
1017 "1\t12\t\t\tDISK1\t\n";
1019 static const CHAR sp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1020 "s72\tS38\ts72\ti2\tS255\tS72\n"
1021 "Component\tComponent\n"
1022 "augustus\t\tTWODIR\t0\t\taugustus\n";
1024 static const CHAR sp_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
1025 "s72\tS72\tl255\n"
1026 "Directory\tDirectory\n"
1027 "TARGETDIR\t\tSourceDir\n"
1028 "ProgramFilesFolder\tTARGETDIR\t.\n"
1029 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
1030 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
1031 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
1033 static const CHAR mcp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1034 "s72\tS38\ts72\ti2\tS255\tS72\n"
1035 "Component\tComponent\n"
1036 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
1037 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
1038 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
1040 static const CHAR mcp_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1041 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1042 "Feature\tFeature\n"
1043 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
1044 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
1045 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
1047 static const CHAR mcp_feature_comp_dat[] = "Feature_\tComponent_\n"
1048 "s38\ts72\n"
1049 "FeatureComponents\tFeature_\tComponent_\n"
1050 "hydroxyl\thydrogen\n"
1051 "heliox\thelium\n"
1052 "lithia\tlithium";
1054 static const CHAR mcomp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1055 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1056 "File\tFile\n"
1057 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
1058 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
1059 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
1060 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
1062 static const CHAR ai_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1063 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1064 "File\tFile\n"
1065 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
1066 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
1067 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
1068 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
1069 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
1070 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
1071 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
1073 static const CHAR ip_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1074 "s72\tS255\tI2\n"
1075 "InstallExecuteSequence\tAction\n"
1076 "CostFinalize\t\t1000\n"
1077 "ValidateProductID\t\t700\n"
1078 "CostInitialize\t\t800\n"
1079 "FileCost\t\t900\n"
1080 "RemoveFiles\t\t3500\n"
1081 "InstallFiles\t\t4000\n"
1082 "RegisterUser\t\t6000\n"
1083 "RegisterProduct\t\t6100\n"
1084 "PublishFeatures\t\t6300\n"
1085 "PublishProduct\t\t6400\n"
1086 "InstallFinalize\t\t6600\n"
1087 "InstallInitialize\t\t1500\n"
1088 "ProcessComponents\t\t1600\n"
1089 "UnpublishFeatures\t\t1800\n"
1090 "InstallValidate\t\t1400\n"
1091 "LaunchConditions\t\t100\n"
1092 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
1094 static const CHAR ip_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1095 "s72\ti2\tS64\tS0\tS255\n"
1096 "CustomAction\tAction\n"
1097 "TestInstalledProp\t19\t\tTest failed\t\n";
1099 static const CHAR aup_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1100 "s72\tS255\tI2\n"
1101 "InstallExecuteSequence\tAction\n"
1102 "CostFinalize\t\t1000\n"
1103 "ValidateProductID\t\t700\n"
1104 "CostInitialize\t\t800\n"
1105 "FileCost\t\t900\n"
1106 "RemoveFiles\t\t3500\n"
1107 "InstallFiles\t\t4000\n"
1108 "RegisterUser\t\t6000\n"
1109 "RegisterProduct\t\t6100\n"
1110 "PublishFeatures\t\t6300\n"
1111 "PublishProduct\t\t6400\n"
1112 "InstallFinalize\t\t6600\n"
1113 "InstallInitialize\t\t1500\n"
1114 "ProcessComponents\t\t1600\n"
1115 "UnpublishFeatures\t\t1800\n"
1116 "InstallValidate\t\t1400\n"
1117 "LaunchConditions\t\t100\n"
1118 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
1120 static const CHAR aup2_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1121 "s72\tS255\tI2\n"
1122 "InstallExecuteSequence\tAction\n"
1123 "CostFinalize\t\t1000\n"
1124 "ValidateProductID\t\t700\n"
1125 "CostInitialize\t\t800\n"
1126 "FileCost\t\t900\n"
1127 "RemoveFiles\t\t3500\n"
1128 "InstallFiles\t\t4000\n"
1129 "RegisterUser\t\t6000\n"
1130 "RegisterProduct\t\t6100\n"
1131 "PublishFeatures\t\t6300\n"
1132 "PublishProduct\t\t6400\n"
1133 "InstallFinalize\t\t6600\n"
1134 "InstallInitialize\t\t1500\n"
1135 "ProcessComponents\t\t1600\n"
1136 "UnpublishFeatures\t\t1800\n"
1137 "InstallValidate\t\t1400\n"
1138 "LaunchConditions\t\t100\n"
1139 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
1141 static const CHAR aup3_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1142 "s72\tS255\tI2\n"
1143 "InstallExecuteSequence\tAction\n"
1144 "CostFinalize\t\t1000\n"
1145 "ValidateProductID\t\t700\n"
1146 "CostInitialize\t\t800\n"
1147 "FileCost\t\t900\n"
1148 "RemoveFiles\t\t3500\n"
1149 "InstallFiles\t\t4000\n"
1150 "RegisterUser\t\t6000\n"
1151 "RegisterProduct\t\t6100\n"
1152 "PublishFeatures\t\t6300\n"
1153 "PublishProduct\t\t6400\n"
1154 "InstallFinalize\t\t6600\n"
1155 "InstallInitialize\t\t1500\n"
1156 "ProcessComponents\t\t1600\n"
1157 "UnpublishFeatures\t\t1800\n"
1158 "InstallValidate\t\t1400\n"
1159 "LaunchConditions\t\t100\n"
1160 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
1162 static const CHAR aup_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1163 "s72\ti2\tS64\tS0\tS255\n"
1164 "CustomAction\tAction\n"
1165 "TestAllUsersProp\t19\t\tTest failed\t\n";
1167 static const CHAR cf_create_folders_dat[] = "Directory_\tComponent_\n"
1168 "s72\ts72\n"
1169 "CreateFolder\tDirectory_\tComponent_\n"
1170 "FIRSTDIR\tOne\n";
1172 static const CHAR cf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1173 "s72\tS255\tI2\n"
1174 "InstallExecuteSequence\tAction\n"
1175 "CostFinalize\t\t1000\n"
1176 "ValidateProductID\t\t700\n"
1177 "CostInitialize\t\t800\n"
1178 "FileCost\t\t900\n"
1179 "RemoveFiles\t\t3500\n"
1180 "CreateFolders\t\t3700\n"
1181 "InstallExecute\t\t3800\n"
1182 "TestCreateFolders\t\t3900\n"
1183 "InstallFiles\t\t4000\n"
1184 "RegisterUser\t\t6000\n"
1185 "RegisterProduct\t\t6100\n"
1186 "PublishFeatures\t\t6300\n"
1187 "PublishProduct\t\t6400\n"
1188 "InstallFinalize\t\t6600\n"
1189 "InstallInitialize\t\t1500\n"
1190 "ProcessComponents\t\t1600\n"
1191 "UnpublishFeatures\t\t1800\n"
1192 "InstallValidate\t\t1400\n"
1193 "LaunchConditions\t\t100\n";
1195 static const CHAR cf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1196 "s72\ti2\tS64\tS0\tS255\n"
1197 "CustomAction\tAction\n"
1198 "TestCreateFolders\t19\t\tHalts installation\t\n";
1200 static const CHAR rf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1201 "s72\tS255\tI2\n"
1202 "InstallExecuteSequence\tAction\n"
1203 "CostFinalize\t\t1000\n"
1204 "ValidateProductID\t\t700\n"
1205 "CostInitialize\t\t800\n"
1206 "FileCost\t\t900\n"
1207 "RemoveFiles\t\t3500\n"
1208 "CreateFolders\t\t3600\n"
1209 "RemoveFolders\t\t3700\n"
1210 "InstallExecute\t\t3800\n"
1211 "TestCreateFolders\t\t3900\n"
1212 "InstallFiles\t\t4000\n"
1213 "RegisterUser\t\t6000\n"
1214 "RegisterProduct\t\t6100\n"
1215 "PublishFeatures\t\t6300\n"
1216 "PublishProduct\t\t6400\n"
1217 "InstallFinalize\t\t6600\n"
1218 "InstallInitialize\t\t1500\n"
1219 "ProcessComponents\t\t1600\n"
1220 "UnpublishFeatures\t\t1800\n"
1221 "InstallValidate\t\t1400\n"
1222 "LaunchConditions\t\t100\n";
1225 static const CHAR sr_selfreg_dat[] = "File_\tCost\n"
1226 "s72\tI2\n"
1227 "SelfReg\tFile_\n"
1228 "one.txt\t1\n";
1230 static const CHAR sr_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1231 "s72\tS255\tI2\n"
1232 "InstallExecuteSequence\tAction\n"
1233 "CostFinalize\t\t1000\n"
1234 "CostInitialize\t\t800\n"
1235 "FileCost\t\t900\n"
1236 "ResolveSource\t\t950\n"
1237 "MoveFiles\t\t1700\n"
1238 "SelfUnregModules\t\t3900\n"
1239 "InstallFiles\t\t4000\n"
1240 "DuplicateFiles\t\t4500\n"
1241 "WriteEnvironmentStrings\t\t4550\n"
1242 "CreateShortcuts\t\t4600\n"
1243 "InstallFinalize\t\t6600\n"
1244 "InstallInitialize\t\t1500\n"
1245 "InstallValidate\t\t1400\n"
1246 "LaunchConditions\t\t100\n";
1248 static const CHAR font_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1249 "i2\ti4\tL64\tS255\tS32\tS72\n"
1250 "Media\tDiskId\n"
1251 "1\t3\t\t\tDISK1\t\n";
1253 static const CHAR font_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1254 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1255 "File\tFile\n"
1256 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
1258 static const CHAR font_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1259 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1260 "Feature\tFeature\n"
1261 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
1263 static const CHAR font_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1264 "s72\tS38\ts72\ti2\tS255\tS72\n"
1265 "Component\tComponent\n"
1266 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
1268 static const CHAR font_feature_comp_dat[] = "Feature_\tComponent_\n"
1269 "s38\ts72\n"
1270 "FeatureComponents\tFeature_\tComponent_\n"
1271 "fonts\tfonts\n";
1273 static const CHAR font_dat[] = "File_\tFontTitle\n"
1274 "s72\tS128\n"
1275 "Font\tFile_\n"
1276 "font.ttf\tmsi test font\n";
1278 static const CHAR font_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1279 "s72\tS255\tI2\n"
1280 "InstallExecuteSequence\tAction\n"
1281 "ValidateProductID\t\t700\n"
1282 "CostInitialize\t\t800\n"
1283 "FileCost\t\t900\n"
1284 "CostFinalize\t\t1000\n"
1285 "InstallValidate\t\t1400\n"
1286 "InstallInitialize\t\t1500\n"
1287 "ProcessComponents\t\t1600\n"
1288 "UnpublishFeatures\t\t1800\n"
1289 "RemoveFiles\t\t3500\n"
1290 "InstallFiles\t\t4000\n"
1291 "RegisterFonts\t\t4100\n"
1292 "UnregisterFonts\t\t4200\n"
1293 "RegisterUser\t\t6000\n"
1294 "RegisterProduct\t\t6100\n"
1295 "PublishFeatures\t\t6300\n"
1296 "PublishProduct\t\t6400\n"
1297 "InstallFinalize\t\t6600";
1299 static const CHAR vp_property_dat[] = "Property\tValue\n"
1300 "s72\tl0\n"
1301 "Property\tProperty\n"
1302 "HASUIRUN\t0\n"
1303 "INSTALLLEVEL\t3\n"
1304 "InstallMode\tTypical\n"
1305 "Manufacturer\tWine\n"
1306 "PIDTemplate\t###-#######\n"
1307 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
1308 "ProductLanguage\t1033\n"
1309 "ProductName\tMSITEST\n"
1310 "ProductVersion\t1.1.1\n"
1311 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
1312 "MSIFASTINSTALL\t1\n";
1314 static const CHAR vp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1315 "s72\ti2\tS64\tS0\tS255\n"
1316 "CustomAction\tAction\n"
1317 "SetProductID1\t51\tProductID\t1\t\n"
1318 "SetProductID2\t51\tProductID\t2\t\n"
1319 "TestProductID1\t19\t\t\tHalts installation\n"
1320 "TestProductID2\t19\t\t\tHalts installation\n";
1322 static const CHAR vp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1323 "s72\tS255\tI2\n"
1324 "InstallExecuteSequence\tAction\n"
1325 "LaunchConditions\t\t100\n"
1326 "CostInitialize\t\t800\n"
1327 "FileCost\t\t900\n"
1328 "CostFinalize\t\t1000\n"
1329 "InstallValidate\t\t1400\n"
1330 "InstallInitialize\t\t1500\n"
1331 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
1332 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
1333 "ValidateProductID\t\t3200\n"
1334 "InstallExecute\t\t3300\n"
1335 "TestProductID1\tProductID=1\t3400\n"
1336 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
1337 "InstallFiles\t\t4000\n"
1338 "InstallFinalize\t\t6000\n";
1340 static const CHAR odbc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1341 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1342 "File\tFile\n"
1343 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
1344 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
1345 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
1346 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
1347 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
1349 static const CHAR odbc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1350 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1351 "Feature\tFeature\n"
1352 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
1354 static const CHAR odbc_feature_comp_dat[] = "Feature_\tComponent_\n"
1355 "s38\ts72\n"
1356 "FeatureComponents\tFeature_\tComponent_\n"
1357 "odbc\todbc\n";
1359 static const CHAR odbc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1360 "s72\tS38\ts72\ti2\tS255\tS72\n"
1361 "Component\tComponent\n"
1362 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
1364 static const CHAR odbc_driver_dat[] = "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
1365 "s72\ts72\ts255\ts72\tS72\n"
1366 "ODBCDriver\tDriver\n"
1367 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
1368 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
1370 static const CHAR odbc_translator_dat[] = "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
1371 "s72\ts72\ts255\ts72\tS72\n"
1372 "ODBCTranslator\tTranslator\n"
1373 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
1374 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
1376 static const CHAR odbc_datasource_dat[] = "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
1377 "s72\ts72\ts255\ts255\ti2\n"
1378 "ODBCDataSource\tDataSource\n"
1379 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
1381 static const CHAR odbc_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1382 "s72\tS255\tI2\n"
1383 "InstallExecuteSequence\tAction\n"
1384 "LaunchConditions\t\t100\n"
1385 "CostInitialize\t\t800\n"
1386 "FileCost\t\t900\n"
1387 "CostFinalize\t\t1000\n"
1388 "InstallValidate\t\t1400\n"
1389 "InstallInitialize\t\t1500\n"
1390 "ProcessComponents\t\t1600\n"
1391 "InstallODBC\t\t3000\n"
1392 "RemoveODBC\t\t3100\n"
1393 "RemoveFiles\t\t3900\n"
1394 "InstallFiles\t\t4000\n"
1395 "RegisterProduct\t\t5000\n"
1396 "PublishFeatures\t\t5100\n"
1397 "PublishProduct\t\t5200\n"
1398 "InstallFinalize\t\t6000\n";
1400 static const CHAR odbc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1401 "i2\ti4\tL64\tS255\tS32\tS72\n"
1402 "Media\tDiskId\n"
1403 "1\t5\t\t\tDISK1\t\n";
1405 static const CHAR tl_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1406 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1407 "File\tFile\n"
1408 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
1410 static const CHAR tl_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1411 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1412 "Feature\tFeature\n"
1413 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
1415 static const CHAR tl_feature_comp_dat[] = "Feature_\tComponent_\n"
1416 "s38\ts72\n"
1417 "FeatureComponents\tFeature_\tComponent_\n"
1418 "typelib\ttypelib\n";
1420 static const CHAR tl_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1421 "s72\tS38\ts72\ti2\tS255\tS72\n"
1422 "Component\tComponent\n"
1423 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
1425 static const CHAR tl_typelib_dat[] = "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
1426 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
1427 "TypeLib\tLibID\tLanguage\tComponent_\n"
1428 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
1430 static const CHAR tl_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1431 "s72\tS255\tI2\n"
1432 "InstallExecuteSequence\tAction\n"
1433 "LaunchConditions\t\t100\n"
1434 "CostInitialize\t\t800\n"
1435 "FileCost\t\t900\n"
1436 "CostFinalize\t\t1000\n"
1437 "InstallValidate\t\t1400\n"
1438 "InstallInitialize\t\t1500\n"
1439 "ProcessComponents\t\t1600\n"
1440 "RemoveFiles\t\t1700\n"
1441 "InstallFiles\t\t2000\n"
1442 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
1443 "UnregisterTypeLibraries\t\t3100\n"
1444 "RegisterProduct\t\t5100\n"
1445 "PublishFeatures\t\t5200\n"
1446 "PublishProduct\t\t5300\n"
1447 "InstallFinalize\t\t6000\n";
1449 static const CHAR crs_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1450 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1451 "File\tFile\n"
1452 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
1454 static const CHAR crs_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1455 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1456 "Feature\tFeature\n"
1457 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
1459 static const CHAR crs_feature_comp_dat[] = "Feature_\tComponent_\n"
1460 "s38\ts72\n"
1461 "FeatureComponents\tFeature_\tComponent_\n"
1462 "shortcut\tshortcut\n";
1464 static const CHAR crs_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1465 "s72\tS38\ts72\ti2\tS255\tS72\n"
1466 "Component\tComponent\n"
1467 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
1469 static const CHAR crs_shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
1470 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
1471 "Shortcut\tShortcut\n"
1472 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
1474 static const CHAR crs_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1475 "s72\tS255\tI2\n"
1476 "InstallExecuteSequence\tAction\n"
1477 "LaunchConditions\t\t100\n"
1478 "CostInitialize\t\t800\n"
1479 "FileCost\t\t900\n"
1480 "CostFinalize\t\t1000\n"
1481 "InstallValidate\t\t1400\n"
1482 "InstallInitialize\t\t1500\n"
1483 "ProcessComponents\t\t1600\n"
1484 "RemoveFiles\t\t1700\n"
1485 "InstallFiles\t\t2000\n"
1486 "RemoveShortcuts\t\t3000\n"
1487 "CreateShortcuts\t\t3100\n"
1488 "RegisterProduct\t\t5000\n"
1489 "PublishFeatures\t\t5100\n"
1490 "PublishProduct\t\t5200\n"
1491 "InstallFinalize\t\t6000\n";
1493 static const CHAR fo_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1494 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1495 "File\tFile\n"
1496 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
1497 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
1498 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
1500 static const CHAR fo_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1501 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1502 "Feature\tFeature\n"
1503 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
1504 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
1505 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
1507 static const CHAR fo_condition_dat[] = "Feature_\tLevel\tCondition\n"
1508 "s38\ti2\tS255\n"
1509 "Condition\tFeature_\tLevel\n"
1510 "preselected\t0\tPreselected\n"
1511 "notpreselected\t0\tNOT Preselected\n";
1513 static const CHAR fo_feature_comp_dat[] = "Feature_\tComponent_\n"
1514 "s38\ts72\n"
1515 "FeatureComponents\tFeature_\tComponent_\n"
1516 "override\toverride\n"
1517 "preselected\tpreselected\n"
1518 "notpreselected\tnotpreselected\n";
1520 static const CHAR fo_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1521 "s72\tS38\ts72\ti2\tS255\tS72\n"
1522 "Component\tComponent\n"
1523 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
1524 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
1525 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
1527 static const CHAR fo_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1528 "s72\ti2\tS64\tS0\tS255\n"
1529 "CustomAction\tAction\n"
1530 "SetPreselected\t51\tPreselected\t1\t\n";
1532 static const CHAR fo_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1533 "s72\tS255\tI2\n"
1534 "InstallExecuteSequence\tAction\n"
1535 "LaunchConditions\t\t100\n"
1536 "SetPreselected\tpreselect=1\t200\n"
1537 "CostInitialize\t\t800\n"
1538 "FileCost\t\t900\n"
1539 "CostFinalize\t\t1000\n"
1540 "InstallValidate\t\t1400\n"
1541 "InstallInitialize\t\t1500\n"
1542 "ProcessComponents\t\t1600\n"
1543 "RemoveFiles\t\t1700\n"
1544 "InstallFiles\t\t2000\n"
1545 "RegisterProduct\t\t5000\n"
1546 "PublishFeatures\t\t5100\n"
1547 "PublishProduct\t\t5200\n"
1548 "InstallFinalize\t\t6000\n";
1550 static const CHAR pub_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1551 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1552 "File\tFile\n"
1553 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
1555 static const CHAR pub_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1556 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1557 "Feature\tFeature\n"
1558 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
1560 static const CHAR pub_feature_comp_dat[] = "Feature_\tComponent_\n"
1561 "s38\ts72\n"
1562 "FeatureComponents\tFeature_\tComponent_\n"
1563 "publish\tpublish\n";
1565 static const CHAR pub_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1566 "s72\tS38\ts72\ti2\tS255\tS72\n"
1567 "Component\tComponent\n"
1568 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
1570 static const CHAR pub_publish_component_dat[] = "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
1571 "s38\ts255\ts72\tL255\ts38\n"
1572 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
1573 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
1575 static const CHAR pub_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1576 "s72\tS255\tI2\n"
1577 "InstallExecuteSequence\tAction\n"
1578 "LaunchConditions\t\t100\n"
1579 "CostInitialize\t\t800\n"
1580 "FileCost\t\t900\n"
1581 "CostFinalize\t\t1000\n"
1582 "InstallValidate\t\t1400\n"
1583 "InstallInitialize\t\t1500\n"
1584 "ProcessComponents\t\t1600\n"
1585 "RemoveFiles\t\t1700\n"
1586 "InstallFiles\t\t2000\n"
1587 "PublishComponents\t\t3000\n"
1588 "UnpublishComponents\t\t3100\n"
1589 "RegisterProduct\t\t5000\n"
1590 "PublishFeatures\t\t5100\n"
1591 "PublishProduct\t\t5200\n"
1592 "InstallFinalize\t\t6000\n";
1594 static const CHAR rd_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1595 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1596 "File\tFile\n"
1597 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
1598 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
1599 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
1601 static const CHAR rd_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1602 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1603 "Feature\tFeature\n"
1604 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
1606 static const CHAR rd_feature_comp_dat[] = "Feature_\tComponent_\n"
1607 "s38\ts72\n"
1608 "FeatureComponents\tFeature_\tComponent_\n"
1609 "duplicate\tduplicate\n";
1611 static const CHAR rd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1612 "s72\tS38\ts72\ti2\tS255\tS72\n"
1613 "Component\tComponent\n"
1614 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
1615 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
1617 static const CHAR rd_duplicate_file_dat[] = "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
1618 "s72\ts72\ts72\tS255\tS72\n"
1619 "DuplicateFile\tFileKey\n"
1620 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
1621 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
1622 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
1624 static const CHAR rd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1625 "s72\tS255\tI2\n"
1626 "InstallExecuteSequence\tAction\n"
1627 "LaunchConditions\t\t100\n"
1628 "CostInitialize\t\t800\n"
1629 "FileCost\t\t900\n"
1630 "CostFinalize\t\t1000\n"
1631 "InstallValidate\t\t1400\n"
1632 "InstallInitialize\t\t1500\n"
1633 "ProcessComponents\t\t1600\n"
1634 "RemoveDuplicateFiles\t\t1900\n"
1635 "InstallFiles\t\t2000\n"
1636 "DuplicateFiles\t\t2100\n"
1637 "RegisterProduct\t\t5000\n"
1638 "PublishFeatures\t\t5100\n"
1639 "PublishProduct\t\t5200\n"
1640 "InstallFinalize\t\t6000\n";
1642 static const CHAR rrv_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1643 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1644 "File\tFile\n"
1645 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1647 static const CHAR rrv_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1648 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1649 "Feature\tFeature\n"
1650 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1652 static const CHAR rrv_feature_comp_dat[] = "Feature_\tComponent_\n"
1653 "s38\ts72\n"
1654 "FeatureComponents\tFeature_\tComponent_\n"
1655 "registry\tregistry\n";
1657 static const CHAR rrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1658 "s72\tS38\ts72\ti2\tS255\tS72\n"
1659 "Component\tComponent\n"
1660 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1662 static const CHAR rrv_registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1663 "s72\ti2\tl255\tL255\tL0\ts72\n"
1664 "Registry\tRegistry\n"
1665 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1666 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1667 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1669 static const CHAR rrv_remove_registry_dat[] = "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1670 "s72\ti2\tl255\tL255\ts72\n"
1671 "RemoveRegistry\tRemoveRegistry\n"
1672 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1673 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1674 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1676 static const CHAR rrv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1677 "s72\tS255\tI2\n"
1678 "InstallExecuteSequence\tAction\n"
1679 "LaunchConditions\t\t100\n"
1680 "CostInitialize\t\t800\n"
1681 "FileCost\t\t900\n"
1682 "CostFinalize\t\t1000\n"
1683 "InstallValidate\t\t1400\n"
1684 "InstallInitialize\t\t1500\n"
1685 "ProcessComponents\t\t1600\n"
1686 "RemoveFiles\t\t1700\n"
1687 "InstallFiles\t\t2000\n"
1688 "RemoveRegistryValues\t\t3000\n"
1689 "RegisterProduct\t\t5000\n"
1690 "PublishFeatures\t\t5100\n"
1691 "PublishProduct\t\t5200\n"
1692 "InstallFinalize\t\t6000\n";
1694 static const CHAR frp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1695 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1696 "File\tFile\n"
1697 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1699 static const CHAR frp_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1700 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1701 "Feature\tFeature\n"
1702 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1704 static const CHAR frp_feature_comp_dat[] = "Feature_\tComponent_\n"
1705 "s38\ts72\n"
1706 "FeatureComponents\tFeature_\tComponent_\n"
1707 "product\tproduct\n";
1709 static const CHAR frp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1710 "s72\tS38\ts72\ti2\tS255\tS72\n"
1711 "Component\tComponent\n"
1712 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1714 static const CHAR frp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1715 "s72\ti2\tS64\tS0\tS255\n"
1716 "CustomAction\tAction\n"
1717 "TestProp\t19\t\t\tPROP set\n";
1719 static const CHAR frp_upgrade_dat[] = "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1720 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1721 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1722 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1724 static const CHAR frp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1725 "s72\tS255\tI2\n"
1726 "InstallExecuteSequence\tAction\n"
1727 "FindRelatedProducts\t\t50\n"
1728 "TestProp\tPROP AND NOT REMOVE\t51\n"
1729 "LaunchConditions\t\t100\n"
1730 "CostInitialize\t\t800\n"
1731 "FileCost\t\t900\n"
1732 "CostFinalize\t\t1000\n"
1733 "InstallValidate\t\t1400\n"
1734 "InstallInitialize\t\t1500\n"
1735 "ProcessComponents\t\t1600\n"
1736 "RemoveFiles\t\t1700\n"
1737 "InstallFiles\t\t2000\n"
1738 "RegisterProduct\t\t5000\n"
1739 "PublishFeatures\t\t5100\n"
1740 "PublishProduct\t\t5200\n"
1741 "InstallFinalize\t\t6000\n";
1743 static const CHAR riv_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1744 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1745 "File\tFile\n"
1746 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1748 static const CHAR riv_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1749 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1750 "Feature\tFeature\n"
1751 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1753 static const CHAR riv_feature_comp_dat[] = "Feature_\tComponent_\n"
1754 "s38\ts72\n"
1755 "FeatureComponents\tFeature_\tComponent_\n"
1756 "inifile\tinifile\n";
1758 static const CHAR riv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1759 "s72\tS38\ts72\ti2\tS255\tS72\n"
1760 "Component\tComponent\n"
1761 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1763 static const CHAR riv_ini_file_dat[] = "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1764 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1765 "IniFile\tIniFile\n"
1766 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1768 static const CHAR riv_remove_ini_file_dat[] = "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1769 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1770 "RemoveIniFile\tRemoveIniFile\n"
1771 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1773 static const CHAR riv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1774 "s72\tS255\tI2\n"
1775 "InstallExecuteSequence\tAction\n"
1776 "LaunchConditions\t\t100\n"
1777 "CostInitialize\t\t800\n"
1778 "FileCost\t\t900\n"
1779 "CostFinalize\t\t1000\n"
1780 "InstallValidate\t\t1400\n"
1781 "InstallInitialize\t\t1500\n"
1782 "ProcessComponents\t\t1600\n"
1783 "RemoveFiles\t\t1700\n"
1784 "InstallFiles\t\t2000\n"
1785 "RemoveIniValues\t\t3000\n"
1786 "RegisterProduct\t\t5000\n"
1787 "PublishFeatures\t\t5100\n"
1788 "PublishProduct\t\t5200\n"
1789 "InstallFinalize\t\t6000\n";
1791 static const CHAR res_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1792 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1793 "File\tFile\n"
1794 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1796 static const CHAR res_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1797 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1798 "Feature\tFeature\n"
1799 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1801 static const CHAR res_feature_comp_dat[] = "Feature_\tComponent_\n"
1802 "s38\ts72\n"
1803 "FeatureComponents\tFeature_\tComponent_\n"
1804 "envvar\tenvvar\n";
1806 static const CHAR res_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1807 "s72\tS38\ts72\ti2\tS255\tS72\n"
1808 "Component\tComponent\n"
1809 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1811 static const CHAR res_environment_dat[] = "Environment\tName\tValue\tComponent_\n"
1812 "s72\tl255\tL255\ts72\n"
1813 "Environment\tEnvironment\n"
1814 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1815 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1816 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1817 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1818 "var5\t=MSITESTVAR5\t\tenvvar\n";
1820 static const CHAR res_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1821 "s72\tS255\tI2\n"
1822 "InstallExecuteSequence\tAction\n"
1823 "LaunchConditions\t\t100\n"
1824 "CostInitialize\t\t800\n"
1825 "FileCost\t\t900\n"
1826 "CostFinalize\t\t1000\n"
1827 "InstallValidate\t\t1400\n"
1828 "InstallInitialize\t\t1500\n"
1829 "ProcessComponents\t\t1600\n"
1830 "RemoveFiles\t\t1700\n"
1831 "InstallFiles\t\t2000\n"
1832 "RemoveEnvironmentStrings\t\t3000\n"
1833 "RegisterProduct\t\t5000\n"
1834 "PublishFeatures\t\t5100\n"
1835 "PublishProduct\t\t5200\n"
1836 "InstallFinalize\t\t6000\n";
1838 static const CHAR rci_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1839 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1840 "File\tFile\n"
1841 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1843 static const CHAR rci_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1844 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1845 "Feature\tFeature\n"
1846 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1848 static const CHAR rci_feature_comp_dat[] = "Feature_\tComponent_\n"
1849 "s38\ts72\n"
1850 "FeatureComponents\tFeature_\tComponent_\n"
1851 "class\tclass\n";
1853 static const CHAR rci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1854 "s72\tS38\ts72\ti2\tS255\tS72\n"
1855 "Component\tComponent\n"
1856 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1858 static const CHAR rci_appid_dat[] = "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1859 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1860 "AppId\tAppId\n"
1861 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1863 static const CHAR rci_class_dat[] = "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1864 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1865 "Class\tCLSID\tContext\tComponent_\n"
1866 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1868 static const CHAR rci_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1869 "s72\tS255\tI2\n"
1870 "InstallExecuteSequence\tAction\n"
1871 "LaunchConditions\t\t100\n"
1872 "CostInitialize\t\t800\n"
1873 "FileCost\t\t900\n"
1874 "CostFinalize\t\t1000\n"
1875 "InstallValidate\t\t1400\n"
1876 "InstallInitialize\t\t1500\n"
1877 "ProcessComponents\t\t1600\n"
1878 "RemoveFiles\t\t1700\n"
1879 "InstallFiles\t\t2000\n"
1880 "UnregisterClassInfo\t\t3000\n"
1881 "RegisterClassInfo\t\t4000\n"
1882 "RegisterProduct\t\t5000\n"
1883 "PublishFeatures\t\t5100\n"
1884 "PublishProduct\t\t5200\n"
1885 "InstallFinalize\t\t6000\n";
1887 static const CHAR rei_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1888 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1889 "File\tFile\n"
1890 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1892 static const CHAR rei_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1893 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1894 "Feature\tFeature\n"
1895 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1897 static const CHAR rei_feature_comp_dat[] = "Feature_\tComponent_\n"
1898 "s38\ts72\n"
1899 "FeatureComponents\tFeature_\tComponent_\n"
1900 "extension\textension\n";
1902 static const CHAR rei_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1903 "s72\tS38\ts72\ti2\tS255\tS72\n"
1904 "Component\tComponent\n"
1905 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1907 static const CHAR rei_extension_dat[] = "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1908 "s255\ts72\tS255\tS64\ts38\n"
1909 "Extension\tExtension\tComponent_\n"
1910 "extension\textension\tProg.Id.1\t\textension\n";
1912 static const CHAR rei_verb_dat[] = "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1913 "s255\ts32\tI2\tL255\tL255\n"
1914 "Verb\tExtension_\tVerb\n"
1915 "extension\tOpen\t1\t&Open\t/argument\n";
1917 static const CHAR rei_progid_dat[] = "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1918 "s255\tS255\tS38\tL255\tS72\tI2\n"
1919 "ProgId\tProgId\n"
1920 "Prog.Id.1\t\t\tdescription\t\t\n";
1922 static const CHAR rei_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1923 "s72\tS255\tI2\n"
1924 "InstallExecuteSequence\tAction\n"
1925 "LaunchConditions\t\t100\n"
1926 "CostInitialize\t\t800\n"
1927 "FileCost\t\t900\n"
1928 "CostFinalize\t\t1000\n"
1929 "InstallValidate\t\t1400\n"
1930 "InstallInitialize\t\t1500\n"
1931 "ProcessComponents\t\t1600\n"
1932 "RemoveFiles\t\t1700\n"
1933 "InstallFiles\t\t2000\n"
1934 "UnregisterExtensionInfo\t\t3000\n"
1935 "RegisterExtensionInfo\t\t4000\n"
1936 "RegisterProduct\t\t5000\n"
1937 "PublishFeatures\t\t5100\n"
1938 "PublishProduct\t\t5200\n"
1939 "InstallFinalize\t\t6000\n";
1941 static const CHAR rmi_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1942 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1943 "File\tFile\n"
1944 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1946 static const CHAR rmi_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1947 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1948 "Feature\tFeature\n"
1949 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1951 static const CHAR rmi_feature_comp_dat[] = "Feature_\tComponent_\n"
1952 "s38\ts72\n"
1953 "FeatureComponents\tFeature_\tComponent_\n"
1954 "mime\tmime\n";
1956 static const CHAR rmi_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1957 "s72\tS38\ts72\ti2\tS255\tS72\n"
1958 "Component\tComponent\n"
1959 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1961 static const CHAR rmi_extension_dat[] = "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1962 "s255\ts72\tS255\tS64\ts38\n"
1963 "Extension\tExtension\tComponent_\n"
1964 "mime\tmime\t\tmime/type\tmime\n";
1966 static const CHAR rmi_verb_dat[] = "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1967 "s255\ts32\tI2\tL255\tL255\n"
1968 "Verb\tExtension_\tVerb\n"
1969 "mime\tOpen\t1\t&Open\t/argument\n";
1971 static const CHAR rmi_mime_dat[] = "ContentType\tExtension_\tCLSID\n"
1972 "s64\ts255\tS38\n"
1973 "MIME\tContentType\n"
1974 "mime/type\tmime\t\n";
1976 static const CHAR rmi_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1977 "s72\tS255\tI2\n"
1978 "InstallExecuteSequence\tAction\n"
1979 "LaunchConditions\t\t100\n"
1980 "CostInitialize\t\t800\n"
1981 "FileCost\t\t900\n"
1982 "CostFinalize\t\t1000\n"
1983 "InstallValidate\t\t1400\n"
1984 "InstallInitialize\t\t1500\n"
1985 "ProcessComponents\t\t1600\n"
1986 "RemoveFiles\t\t1700\n"
1987 "InstallFiles\t\t2000\n"
1988 "UnregisterExtensionInfo\t\t3000\n"
1989 "UnregisterMIMEInfo\t\t3500\n"
1990 "RegisterExtensionInfo\t\t4000\n"
1991 "RegisterMIMEInfo\t\t4500\n"
1992 "RegisterProduct\t\t5000\n"
1993 "PublishFeatures\t\t5100\n"
1994 "PublishProduct\t\t5200\n"
1995 "InstallFinalize\t\t6000\n";
1997 static const CHAR sd_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1998 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1999 "File\tFile\n"
2000 "sourcedir.txt\tsourcedir\tsourcedir.txt\t1000\t\t\t8192\t1\n";
2002 static const CHAR sd_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
2003 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
2004 "Feature\tFeature\n"
2005 "sourcedir\t\t\tsourcedir feature\t1\t2\tMSITESTDIR\t0\n";
2007 static const CHAR sd_feature_comp_dat[] = "Feature_\tComponent_\n"
2008 "s38\ts72\n"
2009 "FeatureComponents\tFeature_\tComponent_\n"
2010 "sourcedir\tsourcedir\n";
2012 static const CHAR sd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
2013 "s72\tS38\ts72\ti2\tS255\tS72\n"
2014 "Component\tComponent\n"
2015 "sourcedir\t{DD422F92-3ED8-49B5-A0B7-F266F98357DF}\tMSITESTDIR\t0\t\tsourcedir.txt\n";
2017 static const CHAR sd_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
2018 "s72\tS255\tI2\n"
2019 "InstallUISequence\tAction\n"
2020 "TestSourceDirProp1\tnot SourceDir and not SOURCEDIR and not Installed\t99\n"
2021 "AppSearch\t\t100\n"
2022 "TestSourceDirProp2\tnot SourceDir and not SOURCEDIR and not Installed\t101\n"
2023 "LaunchConditions\tnot Installed \t110\n"
2024 "TestSourceDirProp3\tnot SourceDir and not SOURCEDIR and not Installed\t111\n"
2025 "FindRelatedProducts\t\t120\n"
2026 "TestSourceDirProp4\tnot SourceDir and not SOURCEDIR and not Installed\t121\n"
2027 "CCPSearch\t\t130\n"
2028 "TestSourceDirProp5\tnot SourceDir and not SOURCEDIR and not Installed\t131\n"
2029 "RMCCPSearch\t\t140\n"
2030 "TestSourceDirProp6\tnot SourceDir and not SOURCEDIR and not Installed\t141\n"
2031 "ValidateProductID\t\t150\n"
2032 "TestSourceDirProp7\tnot SourceDir and not SOURCEDIR and not Installed\t151\n"
2033 "CostInitialize\t\t800\n"
2034 "TestSourceDirProp8\tnot SourceDir and not SOURCEDIR and not Installed\t801\n"
2035 "FileCost\t\t900\n"
2036 "TestSourceDirProp9\tnot SourceDir and not SOURCEDIR and not Installed\t901\n"
2037 "IsolateComponents\t\t1000\n"
2038 "TestSourceDirProp10\tnot SourceDir and not SOURCEDIR and not Installed\t1001\n"
2039 "CostFinalize\t\t1100\n"
2040 "TestSourceDirProp11\tnot SourceDir and not SOURCEDIR and not Installed\t1101\n"
2041 "MigrateFeatureStates\t\t1200\n"
2042 "TestSourceDirProp12\tnot SourceDir and not SOURCEDIR and not Installed\t1201\n"
2043 "ExecuteAction\t\t1300\n"
2044 "TestSourceDirProp13\tnot SourceDir and not SOURCEDIR and not Installed\t1301\n";
2046 static const CHAR sd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
2047 "s72\tS255\tI2\n"
2048 "InstallExecuteSequence\tAction\n"
2049 "TestSourceDirProp14\tSourceDir and SOURCEDIR and not Installed\t99\n"
2050 "LaunchConditions\t\t100\n"
2051 "TestSourceDirProp15\tSourceDir and SOURCEDIR and not Installed\t101\n"
2052 "ValidateProductID\t\t700\n"
2053 "TestSourceDirProp16\tSourceDir and SOURCEDIR and not Installed\t701\n"
2054 "CostInitialize\t\t800\n"
2055 "TestSourceDirProp17\tSourceDir and SOURCEDIR and not Installed\t801\n"
2056 "ResolveSource\tResolveSource and not Installed\t850\n"
2057 "TestSourceDirProp18\tResolveSource and not SourceDir and not SOURCEDIR and not Installed\t851\n"
2058 "TestSourceDirProp19\tnot ResolveSource and SourceDir and SOURCEDIR and not Installed\t852\n"
2059 "FileCost\t\t900\n"
2060 "TestSourceDirProp20\tSourceDir and SOURCEDIR and not Installed\t901\n"
2061 "IsolateComponents\t\t1000\n"
2062 "TestSourceDirProp21\tSourceDir and SOURCEDIR and not Installed\t1001\n"
2063 "CostFinalize\t\t1100\n"
2064 "TestSourceDirProp22\tSourceDir and SOURCEDIR and not Installed\t1101\n"
2065 "MigrateFeatureStates\t\t1200\n"
2066 "TestSourceDirProp23\tSourceDir and SOURCEDIR and not Installed\t1201\n"
2067 "InstallValidate\t\t1400\n"
2068 "TestSourceDirProp24\tSourceDir and SOURCEDIR and not Installed\t1401\n"
2069 "InstallInitialize\t\t1500\n"
2070 "TestSourceDirProp25\tSourceDir and SOURCEDIR and not Installed\t1501\n"
2071 "ProcessComponents\t\t1600\n"
2072 "TestSourceDirProp26\tnot SourceDir and not SOURCEDIR and not Installed\t1601\n"
2073 "UnpublishFeatures\t\t1800\n"
2074 "TestSourceDirProp27\tnot SourceDir and not SOURCEDIR and not Installed\t1801\n"
2075 "RemoveFiles\t\t3500\n"
2076 "TestSourceDirProp28\tnot SourceDir and not SOURCEDIR and not Installed\t3501\n"
2077 "InstallFiles\t\t4000\n"
2078 "TestSourceDirProp29\tnot SourceDir and not SOURCEDIR and not Installed\t4001\n"
2079 "RegisterUser\t\t6000\n"
2080 "TestSourceDirProp30\tnot SourceDir and not SOURCEDIR and not Installed\t6001\n"
2081 "RegisterProduct\t\t6100\n"
2082 "TestSourceDirProp31\tnot SourceDir and not SOURCEDIR and not Installed\t6101\n"
2083 "PublishFeatures\t\t6300\n"
2084 "TestSourceDirProp32\tnot SourceDir and not SOURCEDIR and not Installed\t6301\n"
2085 "PublishProduct\t\t6400\n"
2086 "TestSourceDirProp33\tnot SourceDir and not SOURCEDIR and not Installed\t6401\n"
2087 "InstallExecute\t\t6500\n"
2088 "TestSourceDirProp34\tnot SourceDir and not SOURCEDIR and not Installed\t6501\n"
2089 "InstallFinalize\t\t6600\n"
2090 "TestSourceDirProp35\tnot SourceDir and not SOURCEDIR and not Installed\t6601\n";
2092 static const CHAR sd_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
2093 "s72\ti2\tS64\tS0\tS255\n"
2094 "CustomAction\tAction\n"
2095 "TestSourceDirProp1\t19\t\tTest 1 failed\t\n"
2096 "TestSourceDirProp2\t19\t\tTest 2 failed\t\n"
2097 "TestSourceDirProp3\t19\t\tTest 3 failed\t\n"
2098 "TestSourceDirProp4\t19\t\tTest 4 failed\t\n"
2099 "TestSourceDirProp5\t19\t\tTest 5 failed\t\n"
2100 "TestSourceDirProp6\t19\t\tTest 6 failed\t\n"
2101 "TestSourceDirProp7\t19\t\tTest 7 failed\t\n"
2102 "TestSourceDirProp8\t19\t\tTest 8 failed\t\n"
2103 "TestSourceDirProp9\t19\t\tTest 9 failed\t\n"
2104 "TestSourceDirProp10\t19\t\tTest 10 failed\t\n"
2105 "TestSourceDirProp11\t19\t\tTest 11 failed\t\n"
2106 "TestSourceDirProp12\t19\t\tTest 12 failed\t\n"
2107 "TestSourceDirProp13\t19\t\tTest 13 failed\t\n"
2108 "TestSourceDirProp14\t19\t\tTest 14 failed\t\n"
2109 "TestSourceDirProp15\t19\t\tTest 15 failed\t\n"
2110 "TestSourceDirProp16\t19\t\tTest 16 failed\t\n"
2111 "TestSourceDirProp17\t19\t\tTest 17 failed\t\n"
2112 "TestSourceDirProp18\t19\t\tTest 18 failed\t\n"
2113 "TestSourceDirProp19\t19\t\tTest 19 failed\t\n"
2114 "TestSourceDirProp20\t19\t\tTest 20 failed\t\n"
2115 "TestSourceDirProp21\t19\t\tTest 21 failed\t\n"
2116 "TestSourceDirProp22\t19\t\tTest 22 failed\t\n"
2117 "TestSourceDirProp23\t19\t\tTest 23 failed\t\n"
2118 "TestSourceDirProp24\t19\t\tTest 24 failed\t\n"
2119 "TestSourceDirProp25\t19\t\tTest 25 failed\t\n"
2120 "TestSourceDirProp26\t19\t\tTest 26 failed\t\n"
2121 "TestSourceDirProp27\t19\t\tTest 27 failed\t\n"
2122 "TestSourceDirProp28\t19\t\tTest 28 failed\t\n"
2123 "TestSourceDirProp29\t19\t\tTest 29 failed\t\n"
2124 "TestSourceDirProp30\t19\t\tTest 30 failed\t\n"
2125 "TestSourceDirProp31\t19\t\tTest 31 failed\t\n"
2126 "TestSourceDirProp32\t19\t\tTest 32 failed\t\n"
2127 "TestSourceDirProp33\t19\t\tTest 33 failed\t\n"
2128 "TestSourceDirProp34\t19\t\tTest 34 failed\t\n"
2129 "TestSourceDirProp35\t19\t\tTest 35 failed\t\n";
2131 typedef struct _msi_table
2133 const CHAR *filename;
2134 const CHAR *data;
2135 int size;
2136 } msi_table;
2138 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
2140 static const msi_table tables[] =
2142 ADD_TABLE(component),
2143 ADD_TABLE(directory),
2144 ADD_TABLE(feature),
2145 ADD_TABLE(feature_comp),
2146 ADD_TABLE(file),
2147 ADD_TABLE(install_exec_seq),
2148 ADD_TABLE(media),
2149 ADD_TABLE(property),
2150 ADD_TABLE(registry),
2151 ADD_TABLE(service_install),
2152 ADD_TABLE(service_control)
2155 static const msi_table sc_tables[] =
2157 ADD_TABLE(component),
2158 ADD_TABLE(directory),
2159 ADD_TABLE(feature),
2160 ADD_TABLE(feature_comp),
2161 ADD_TABLE(file),
2162 ADD_TABLE(install_exec_seq),
2163 ADD_TABLE(media),
2164 ADD_TABLE(property),
2165 ADD_TABLE(shortcut)
2168 static const msi_table ps_tables[] =
2170 ADD_TABLE(component),
2171 ADD_TABLE(directory),
2172 ADD_TABLE(feature),
2173 ADD_TABLE(feature_comp),
2174 ADD_TABLE(file),
2175 ADD_TABLE(install_exec_seq),
2176 ADD_TABLE(media),
2177 ADD_TABLE(property),
2178 ADD_TABLE(condition)
2181 static const msi_table env_tables[] =
2183 ADD_TABLE(component),
2184 ADD_TABLE(directory),
2185 ADD_TABLE(feature),
2186 ADD_TABLE(feature_comp),
2187 ADD_TABLE(file),
2188 ADD_TABLE(install_exec_seq),
2189 ADD_TABLE(media),
2190 ADD_TABLE(property),
2191 ADD_TABLE(environment)
2194 static const msi_table up_tables[] =
2196 ADD_TABLE(component),
2197 ADD_TABLE(directory),
2198 ADD_TABLE(feature),
2199 ADD_TABLE(feature_comp),
2200 ADD_TABLE(file),
2201 ADD_TABLE(install_exec_seq),
2202 ADD_TABLE(media),
2203 ADD_TABLE(up_property),
2204 ADD_TABLE(registry),
2205 ADD_TABLE(service_install),
2206 ADD_TABLE(service_control)
2209 static const msi_table up2_tables[] =
2211 ADD_TABLE(component),
2212 ADD_TABLE(directory),
2213 ADD_TABLE(feature),
2214 ADD_TABLE(feature_comp),
2215 ADD_TABLE(file),
2216 ADD_TABLE(install_exec_seq),
2217 ADD_TABLE(media),
2218 ADD_TABLE(up2_property),
2219 ADD_TABLE(registry),
2220 ADD_TABLE(service_install),
2221 ADD_TABLE(service_control)
2224 static const msi_table up3_tables[] =
2226 ADD_TABLE(component),
2227 ADD_TABLE(directory),
2228 ADD_TABLE(feature),
2229 ADD_TABLE(feature_comp),
2230 ADD_TABLE(file),
2231 ADD_TABLE(install_exec_seq),
2232 ADD_TABLE(media),
2233 ADD_TABLE(up3_property),
2234 ADD_TABLE(registry),
2235 ADD_TABLE(service_install),
2236 ADD_TABLE(service_control)
2239 static const msi_table up4_tables[] =
2241 ADD_TABLE(component),
2242 ADD_TABLE(directory),
2243 ADD_TABLE(feature),
2244 ADD_TABLE(feature_comp),
2245 ADD_TABLE(file),
2246 ADD_TABLE(pp_install_exec_seq),
2247 ADD_TABLE(media),
2248 ADD_TABLE(property),
2249 ADD_TABLE(registry),
2250 ADD_TABLE(service_install),
2251 ADD_TABLE(service_control)
2254 static const msi_table up5_tables[] =
2256 ADD_TABLE(component),
2257 ADD_TABLE(directory),
2258 ADD_TABLE(feature),
2259 ADD_TABLE(feature_comp),
2260 ADD_TABLE(file),
2261 ADD_TABLE(pp_install_exec_seq),
2262 ADD_TABLE(media),
2263 ADD_TABLE(up_property),
2264 ADD_TABLE(registry),
2265 ADD_TABLE(service_install),
2266 ADD_TABLE(service_control)
2269 static const msi_table up6_tables[] =
2271 ADD_TABLE(component),
2272 ADD_TABLE(directory),
2273 ADD_TABLE(feature),
2274 ADD_TABLE(feature_comp),
2275 ADD_TABLE(file),
2276 ADD_TABLE(pp_install_exec_seq),
2277 ADD_TABLE(media),
2278 ADD_TABLE(up2_property),
2279 ADD_TABLE(registry),
2280 ADD_TABLE(service_install),
2281 ADD_TABLE(service_control)
2284 static const msi_table up7_tables[] =
2286 ADD_TABLE(component),
2287 ADD_TABLE(directory),
2288 ADD_TABLE(feature),
2289 ADD_TABLE(feature_comp),
2290 ADD_TABLE(file),
2291 ADD_TABLE(pp_install_exec_seq),
2292 ADD_TABLE(media),
2293 ADD_TABLE(up3_property),
2294 ADD_TABLE(registry),
2295 ADD_TABLE(service_install),
2296 ADD_TABLE(service_control)
2299 static const msi_table cc_tables[] =
2301 ADD_TABLE(cc_component),
2302 ADD_TABLE(directory),
2303 ADD_TABLE(cc_feature),
2304 ADD_TABLE(cc_feature_comp),
2305 ADD_TABLE(cc_file),
2306 ADD_TABLE(install_exec_seq),
2307 ADD_TABLE(cc_media),
2308 ADD_TABLE(property),
2311 static const msi_table cc2_tables[] =
2313 ADD_TABLE(cc2_component),
2314 ADD_TABLE(directory),
2315 ADD_TABLE(cc_feature),
2316 ADD_TABLE(cc_feature_comp),
2317 ADD_TABLE(cc2_file),
2318 ADD_TABLE(install_exec_seq),
2319 ADD_TABLE(cc_media),
2320 ADD_TABLE(property),
2323 static const msi_table co_tables[] =
2325 ADD_TABLE(cc_component),
2326 ADD_TABLE(directory),
2327 ADD_TABLE(cc_feature),
2328 ADD_TABLE(cc_feature_comp),
2329 ADD_TABLE(co_file),
2330 ADD_TABLE(install_exec_seq),
2331 ADD_TABLE(co_media),
2332 ADD_TABLE(property),
2335 static const msi_table co2_tables[] =
2337 ADD_TABLE(cc_component),
2338 ADD_TABLE(directory),
2339 ADD_TABLE(cc_feature),
2340 ADD_TABLE(cc_feature_comp),
2341 ADD_TABLE(cc_file),
2342 ADD_TABLE(install_exec_seq),
2343 ADD_TABLE(co2_media),
2344 ADD_TABLE(property),
2347 static const msi_table mm_tables[] =
2349 ADD_TABLE(cc_component),
2350 ADD_TABLE(directory),
2351 ADD_TABLE(cc_feature),
2352 ADD_TABLE(cc_feature_comp),
2353 ADD_TABLE(mm_file),
2354 ADD_TABLE(install_exec_seq),
2355 ADD_TABLE(mm_media),
2356 ADD_TABLE(property),
2359 static const msi_table ss_tables[] =
2361 ADD_TABLE(cc_component),
2362 ADD_TABLE(directory),
2363 ADD_TABLE(cc_feature),
2364 ADD_TABLE(cc_feature_comp),
2365 ADD_TABLE(cc_file),
2366 ADD_TABLE(install_exec_seq),
2367 ADD_TABLE(ss_media),
2368 ADD_TABLE(property),
2371 static const msi_table ui_tables[] =
2373 ADD_TABLE(ui_component),
2374 ADD_TABLE(directory),
2375 ADD_TABLE(cc_feature),
2376 ADD_TABLE(cc_feature_comp),
2377 ADD_TABLE(cc_file),
2378 ADD_TABLE(install_exec_seq),
2379 ADD_TABLE(ui_install_ui_seq),
2380 ADD_TABLE(ui_custom_action),
2381 ADD_TABLE(cc_media),
2382 ADD_TABLE(property),
2385 static const msi_table rof_tables[] =
2387 ADD_TABLE(rof_component),
2388 ADD_TABLE(directory),
2389 ADD_TABLE(rof_feature),
2390 ADD_TABLE(rof_feature_comp),
2391 ADD_TABLE(rof_file),
2392 ADD_TABLE(install_exec_seq),
2393 ADD_TABLE(rof_media),
2394 ADD_TABLE(property),
2397 static const msi_table rofc_tables[] =
2399 ADD_TABLE(rof_component),
2400 ADD_TABLE(directory),
2401 ADD_TABLE(rof_feature),
2402 ADD_TABLE(rof_feature_comp),
2403 ADD_TABLE(rofc_file),
2404 ADD_TABLE(install_exec_seq),
2405 ADD_TABLE(rofc_media),
2406 ADD_TABLE(property),
2409 static const msi_table sdp_tables[] =
2411 ADD_TABLE(rof_component),
2412 ADD_TABLE(directory),
2413 ADD_TABLE(rof_feature),
2414 ADD_TABLE(rof_feature_comp),
2415 ADD_TABLE(rof_file),
2416 ADD_TABLE(sdp_install_exec_seq),
2417 ADD_TABLE(sdp_custom_action),
2418 ADD_TABLE(rof_media),
2419 ADD_TABLE(property),
2422 static const msi_table cie_tables[] =
2424 ADD_TABLE(cie_component),
2425 ADD_TABLE(directory),
2426 ADD_TABLE(cc_feature),
2427 ADD_TABLE(cie_feature_comp),
2428 ADD_TABLE(cie_file),
2429 ADD_TABLE(install_exec_seq),
2430 ADD_TABLE(cie_media),
2431 ADD_TABLE(property),
2434 static const msi_table ci_tables[] =
2436 ADD_TABLE(ci_component),
2437 ADD_TABLE(directory),
2438 ADD_TABLE(rof_feature),
2439 ADD_TABLE(rof_feature_comp),
2440 ADD_TABLE(rof_file),
2441 ADD_TABLE(ci_install_exec_seq),
2442 ADD_TABLE(rof_media),
2443 ADD_TABLE(property),
2444 ADD_TABLE(ci_custom_action),
2447 static const msi_table ci2_tables[] =
2449 ADD_TABLE(ci2_component),
2450 ADD_TABLE(directory),
2451 ADD_TABLE(rof_feature),
2452 ADD_TABLE(ci2_feature_comp),
2453 ADD_TABLE(ci2_file),
2454 ADD_TABLE(install_exec_seq),
2455 ADD_TABLE(rof_media),
2456 ADD_TABLE(property),
2459 static const msi_table spf_tables[] =
2461 ADD_TABLE(ci_component),
2462 ADD_TABLE(directory),
2463 ADD_TABLE(rof_feature),
2464 ADD_TABLE(rof_feature_comp),
2465 ADD_TABLE(rof_file),
2466 ADD_TABLE(spf_install_exec_seq),
2467 ADD_TABLE(rof_media),
2468 ADD_TABLE(property),
2469 ADD_TABLE(spf_custom_action),
2470 ADD_TABLE(spf_install_ui_seq),
2473 static const msi_table pp_tables[] =
2475 ADD_TABLE(pp_component),
2476 ADD_TABLE(directory),
2477 ADD_TABLE(rof_feature),
2478 ADD_TABLE(rof_feature_comp),
2479 ADD_TABLE(rof_file),
2480 ADD_TABLE(pp_install_exec_seq),
2481 ADD_TABLE(rof_media),
2482 ADD_TABLE(property),
2485 static const msi_table ppc_tables[] =
2487 ADD_TABLE(ppc_component),
2488 ADD_TABLE(directory),
2489 ADD_TABLE(rof_feature),
2490 ADD_TABLE(ppc_feature_comp),
2491 ADD_TABLE(ppc_file),
2492 ADD_TABLE(pp_install_exec_seq),
2493 ADD_TABLE(ppc_media),
2494 ADD_TABLE(property),
2497 static const msi_table lus0_tables[] =
2499 ADD_TABLE(ci_component),
2500 ADD_TABLE(directory),
2501 ADD_TABLE(rof_feature),
2502 ADD_TABLE(rof_feature_comp),
2503 ADD_TABLE(rof_file),
2504 ADD_TABLE(pp_install_exec_seq),
2505 ADD_TABLE(rof_media),
2506 ADD_TABLE(property),
2509 static const msi_table lus1_tables[] =
2511 ADD_TABLE(ci_component),
2512 ADD_TABLE(directory),
2513 ADD_TABLE(rof_feature),
2514 ADD_TABLE(rof_feature_comp),
2515 ADD_TABLE(rof_file),
2516 ADD_TABLE(pp_install_exec_seq),
2517 ADD_TABLE(rofc_media),
2518 ADD_TABLE(property),
2521 static const msi_table lus2_tables[] =
2523 ADD_TABLE(ci_component),
2524 ADD_TABLE(directory),
2525 ADD_TABLE(rof_feature),
2526 ADD_TABLE(rof_feature_comp),
2527 ADD_TABLE(rof_file),
2528 ADD_TABLE(pp_install_exec_seq),
2529 ADD_TABLE(lus2_media),
2530 ADD_TABLE(property),
2533 static const msi_table tp_tables[] =
2535 ADD_TABLE(tp_component),
2536 ADD_TABLE(directory),
2537 ADD_TABLE(rof_feature),
2538 ADD_TABLE(ci2_feature_comp),
2539 ADD_TABLE(ci2_file),
2540 ADD_TABLE(install_exec_seq),
2541 ADD_TABLE(rof_media),
2542 ADD_TABLE(property),
2545 static const msi_table cwd_tables[] =
2547 ADD_TABLE(cwd_component),
2548 ADD_TABLE(directory),
2549 ADD_TABLE(rof_feature),
2550 ADD_TABLE(ci2_feature_comp),
2551 ADD_TABLE(ci2_file),
2552 ADD_TABLE(install_exec_seq),
2553 ADD_TABLE(rof_media),
2554 ADD_TABLE(property),
2557 static const msi_table adm_tables[] =
2559 ADD_TABLE(adm_component),
2560 ADD_TABLE(directory),
2561 ADD_TABLE(rof_feature),
2562 ADD_TABLE(ci2_feature_comp),
2563 ADD_TABLE(ci2_file),
2564 ADD_TABLE(install_exec_seq),
2565 ADD_TABLE(rof_media),
2566 ADD_TABLE(property),
2567 ADD_TABLE(adm_custom_action),
2568 ADD_TABLE(adm_admin_exec_seq),
2571 static const msi_table amp_tables[] =
2573 ADD_TABLE(amp_component),
2574 ADD_TABLE(directory),
2575 ADD_TABLE(rof_feature),
2576 ADD_TABLE(ci2_feature_comp),
2577 ADD_TABLE(ci2_file),
2578 ADD_TABLE(install_exec_seq),
2579 ADD_TABLE(rof_media),
2580 ADD_TABLE(property),
2583 static const msi_table rem_tables[] =
2585 ADD_TABLE(rem_component),
2586 ADD_TABLE(directory),
2587 ADD_TABLE(rof_feature),
2588 ADD_TABLE(rem_feature_comp),
2589 ADD_TABLE(rem_file),
2590 ADD_TABLE(rem_install_exec_seq),
2591 ADD_TABLE(rof_media),
2592 ADD_TABLE(property),
2593 ADD_TABLE(rem_remove_files),
2596 static const msi_table mov_tables[] =
2598 ADD_TABLE(cwd_component),
2599 ADD_TABLE(directory),
2600 ADD_TABLE(rof_feature),
2601 ADD_TABLE(ci2_feature_comp),
2602 ADD_TABLE(ci2_file),
2603 ADD_TABLE(install_exec_seq),
2604 ADD_TABLE(rof_media),
2605 ADD_TABLE(property),
2606 ADD_TABLE(mov_move_file),
2609 static const msi_table mc_tables[] =
2611 ADD_TABLE(mc_component),
2612 ADD_TABLE(directory),
2613 ADD_TABLE(cc_feature),
2614 ADD_TABLE(cie_feature_comp),
2615 ADD_TABLE(mc_file),
2616 ADD_TABLE(install_exec_seq),
2617 ADD_TABLE(mc_media),
2618 ADD_TABLE(property),
2619 ADD_TABLE(mc_file_hash),
2622 static const msi_table df_tables[] =
2624 ADD_TABLE(rof_component),
2625 ADD_TABLE(df_directory),
2626 ADD_TABLE(rof_feature),
2627 ADD_TABLE(rof_feature_comp),
2628 ADD_TABLE(rof_file),
2629 ADD_TABLE(install_exec_seq),
2630 ADD_TABLE(rof_media),
2631 ADD_TABLE(property),
2632 ADD_TABLE(df_duplicate_file),
2635 static const msi_table wrv_tables[] =
2637 ADD_TABLE(wrv_component),
2638 ADD_TABLE(directory),
2639 ADD_TABLE(rof_feature),
2640 ADD_TABLE(ci2_feature_comp),
2641 ADD_TABLE(ci2_file),
2642 ADD_TABLE(install_exec_seq),
2643 ADD_TABLE(rof_media),
2644 ADD_TABLE(property),
2645 ADD_TABLE(wrv_registry),
2648 static const msi_table sf_tables[] =
2650 ADD_TABLE(wrv_component),
2651 ADD_TABLE(directory),
2652 ADD_TABLE(rof_feature),
2653 ADD_TABLE(ci2_feature_comp),
2654 ADD_TABLE(ci2_file),
2655 ADD_TABLE(install_exec_seq),
2656 ADD_TABLE(rof_media),
2657 ADD_TABLE(property),
2660 static const msi_table ca51_tables[] =
2662 ADD_TABLE(ca51_component),
2663 ADD_TABLE(directory),
2664 ADD_TABLE(rof_feature),
2665 ADD_TABLE(ci2_feature_comp),
2666 ADD_TABLE(ci2_file),
2667 ADD_TABLE(ca51_install_exec_seq),
2668 ADD_TABLE(rof_media),
2669 ADD_TABLE(property),
2670 ADD_TABLE(ca51_custom_action),
2673 static const msi_table is_tables[] =
2675 ADD_TABLE(is_component),
2676 ADD_TABLE(directory),
2677 ADD_TABLE(is_feature),
2678 ADD_TABLE(is_feature_comp),
2679 ADD_TABLE(is_file),
2680 ADD_TABLE(install_exec_seq),
2681 ADD_TABLE(is_media),
2682 ADD_TABLE(property),
2685 static const msi_table sp_tables[] =
2687 ADD_TABLE(sp_component),
2688 ADD_TABLE(sp_directory),
2689 ADD_TABLE(rof_feature),
2690 ADD_TABLE(ci2_feature_comp),
2691 ADD_TABLE(ci2_file),
2692 ADD_TABLE(install_exec_seq),
2693 ADD_TABLE(rof_media),
2694 ADD_TABLE(property),
2697 static const msi_table mcp_tables[] =
2699 ADD_TABLE(mcp_component),
2700 ADD_TABLE(directory),
2701 ADD_TABLE(mcp_feature),
2702 ADD_TABLE(mcp_feature_comp),
2703 ADD_TABLE(rem_file),
2704 ADD_TABLE(rem_install_exec_seq),
2705 ADD_TABLE(rof_media),
2706 ADD_TABLE(property),
2709 static const msi_table mcomp_tables[] =
2711 ADD_TABLE(mcp_component),
2712 ADD_TABLE(directory),
2713 ADD_TABLE(mcp_feature),
2714 ADD_TABLE(mcp_feature_comp),
2715 ADD_TABLE(mcomp_file),
2716 ADD_TABLE(rem_install_exec_seq),
2717 ADD_TABLE(rof_media),
2718 ADD_TABLE(property),
2721 static const msi_table ai_tables[] =
2723 ADD_TABLE(component),
2724 ADD_TABLE(directory),
2725 ADD_TABLE(feature),
2726 ADD_TABLE(feature_comp),
2727 ADD_TABLE(ai_file),
2728 ADD_TABLE(install_exec_seq),
2729 ADD_TABLE(media),
2730 ADD_TABLE(property)
2733 static const msi_table pc_tables[] =
2735 ADD_TABLE(ca51_component),
2736 ADD_TABLE(directory),
2737 ADD_TABLE(rof_feature),
2738 ADD_TABLE(ci2_feature_comp),
2739 ADD_TABLE(ci2_file),
2740 ADD_TABLE(install_exec_seq),
2741 ADD_TABLE(rof_media),
2742 ADD_TABLE(property)
2745 static const msi_table ip_tables[] =
2747 ADD_TABLE(component),
2748 ADD_TABLE(directory),
2749 ADD_TABLE(feature),
2750 ADD_TABLE(feature_comp),
2751 ADD_TABLE(file),
2752 ADD_TABLE(ip_install_exec_seq),
2753 ADD_TABLE(ip_custom_action),
2754 ADD_TABLE(media),
2755 ADD_TABLE(property)
2758 static const msi_table aup_tables[] =
2760 ADD_TABLE(component),
2761 ADD_TABLE(directory),
2762 ADD_TABLE(feature),
2763 ADD_TABLE(feature_comp),
2764 ADD_TABLE(file),
2765 ADD_TABLE(aup_install_exec_seq),
2766 ADD_TABLE(aup_custom_action),
2767 ADD_TABLE(media),
2768 ADD_TABLE(property)
2771 static const msi_table aup2_tables[] =
2773 ADD_TABLE(component),
2774 ADD_TABLE(directory),
2775 ADD_TABLE(feature),
2776 ADD_TABLE(feature_comp),
2777 ADD_TABLE(file),
2778 ADD_TABLE(aup2_install_exec_seq),
2779 ADD_TABLE(aup_custom_action),
2780 ADD_TABLE(media),
2781 ADD_TABLE(aup_property)
2784 static const msi_table aup3_tables[] =
2786 ADD_TABLE(component),
2787 ADD_TABLE(directory),
2788 ADD_TABLE(feature),
2789 ADD_TABLE(feature_comp),
2790 ADD_TABLE(file),
2791 ADD_TABLE(aup2_install_exec_seq),
2792 ADD_TABLE(aup_custom_action),
2793 ADD_TABLE(media),
2794 ADD_TABLE(aup2_property)
2797 static const msi_table aup4_tables[] =
2799 ADD_TABLE(component),
2800 ADD_TABLE(directory),
2801 ADD_TABLE(feature),
2802 ADD_TABLE(feature_comp),
2803 ADD_TABLE(file),
2804 ADD_TABLE(aup3_install_exec_seq),
2805 ADD_TABLE(aup_custom_action),
2806 ADD_TABLE(media),
2807 ADD_TABLE(aup2_property)
2810 static const msi_table fiu_tables[] =
2812 ADD_TABLE(rof_component),
2813 ADD_TABLE(directory),
2814 ADD_TABLE(rof_feature),
2815 ADD_TABLE(rof_feature_comp),
2816 ADD_TABLE(rof_file),
2817 ADD_TABLE(pp_install_exec_seq),
2818 ADD_TABLE(rof_media),
2819 ADD_TABLE(property),
2822 static const msi_table fiuc_tables[] =
2824 ADD_TABLE(rof_component),
2825 ADD_TABLE(directory),
2826 ADD_TABLE(rof_feature),
2827 ADD_TABLE(rof_feature_comp),
2828 ADD_TABLE(rofc_file),
2829 ADD_TABLE(pp_install_exec_seq),
2830 ADD_TABLE(rofc_media),
2831 ADD_TABLE(property),
2834 static const msi_table cf_tables[] =
2836 ADD_TABLE(component),
2837 ADD_TABLE(directory),
2838 ADD_TABLE(feature),
2839 ADD_TABLE(feature_comp),
2840 ADD_TABLE(file),
2841 ADD_TABLE(cf_create_folders),
2842 ADD_TABLE(cf_install_exec_seq),
2843 ADD_TABLE(cf_custom_action),
2844 ADD_TABLE(media),
2845 ADD_TABLE(property)
2848 static const msi_table rf_tables[] =
2850 ADD_TABLE(component),
2851 ADD_TABLE(directory),
2852 ADD_TABLE(feature),
2853 ADD_TABLE(feature_comp),
2854 ADD_TABLE(file),
2855 ADD_TABLE(cf_create_folders),
2856 ADD_TABLE(rf_install_exec_seq),
2857 ADD_TABLE(cf_custom_action),
2858 ADD_TABLE(media),
2859 ADD_TABLE(property)
2862 static const msi_table sss_tables[] =
2864 ADD_TABLE(component),
2865 ADD_TABLE(directory),
2866 ADD_TABLE(feature),
2867 ADD_TABLE(feature_comp),
2868 ADD_TABLE(file),
2869 ADD_TABLE(sss_install_exec_seq),
2870 ADD_TABLE(sss_service_control),
2871 ADD_TABLE(media),
2872 ADD_TABLE(property)
2875 static const msi_table sds_tables[] =
2877 ADD_TABLE(component),
2878 ADD_TABLE(directory),
2879 ADD_TABLE(feature),
2880 ADD_TABLE(feature_comp),
2881 ADD_TABLE(file),
2882 ADD_TABLE(sds_install_exec_seq),
2883 ADD_TABLE(service_control),
2884 ADD_TABLE(service_install),
2885 ADD_TABLE(media),
2886 ADD_TABLE(property)
2889 static const msi_table sr_tables[] =
2891 ADD_TABLE(component),
2892 ADD_TABLE(directory),
2893 ADD_TABLE(feature),
2894 ADD_TABLE(feature_comp),
2895 ADD_TABLE(file),
2896 ADD_TABLE(sr_selfreg),
2897 ADD_TABLE(sr_install_exec_seq),
2898 ADD_TABLE(media),
2899 ADD_TABLE(property)
2902 static const msi_table font_tables[] =
2904 ADD_TABLE(font_component),
2905 ADD_TABLE(directory),
2906 ADD_TABLE(font_feature),
2907 ADD_TABLE(font_feature_comp),
2908 ADD_TABLE(font_file),
2909 ADD_TABLE(font),
2910 ADD_TABLE(font_install_exec_seq),
2911 ADD_TABLE(font_media),
2912 ADD_TABLE(property)
2915 static const msi_table vp_tables[] =
2917 ADD_TABLE(component),
2918 ADD_TABLE(directory),
2919 ADD_TABLE(feature),
2920 ADD_TABLE(feature_comp),
2921 ADD_TABLE(file),
2922 ADD_TABLE(vp_custom_action),
2923 ADD_TABLE(vp_install_exec_seq),
2924 ADD_TABLE(media),
2925 ADD_TABLE(vp_property)
2928 static const msi_table odbc_tables[] =
2930 ADD_TABLE(odbc_component),
2931 ADD_TABLE(directory),
2932 ADD_TABLE(odbc_feature),
2933 ADD_TABLE(odbc_feature_comp),
2934 ADD_TABLE(odbc_file),
2935 ADD_TABLE(odbc_driver),
2936 ADD_TABLE(odbc_translator),
2937 ADD_TABLE(odbc_datasource),
2938 ADD_TABLE(odbc_install_exec_seq),
2939 ADD_TABLE(odbc_media),
2940 ADD_TABLE(property)
2943 static const msi_table tl_tables[] =
2945 ADD_TABLE(tl_component),
2946 ADD_TABLE(directory),
2947 ADD_TABLE(tl_feature),
2948 ADD_TABLE(tl_feature_comp),
2949 ADD_TABLE(tl_file),
2950 ADD_TABLE(tl_typelib),
2951 ADD_TABLE(tl_install_exec_seq),
2952 ADD_TABLE(media),
2953 ADD_TABLE(property)
2956 static const msi_table crs_tables[] =
2958 ADD_TABLE(crs_component),
2959 ADD_TABLE(directory),
2960 ADD_TABLE(crs_feature),
2961 ADD_TABLE(crs_feature_comp),
2962 ADD_TABLE(crs_file),
2963 ADD_TABLE(crs_shortcut),
2964 ADD_TABLE(crs_install_exec_seq),
2965 ADD_TABLE(media),
2966 ADD_TABLE(property)
2969 static const msi_table pub_tables[] =
2971 ADD_TABLE(directory),
2972 ADD_TABLE(pub_component),
2973 ADD_TABLE(pub_feature),
2974 ADD_TABLE(pub_feature_comp),
2975 ADD_TABLE(pub_file),
2976 ADD_TABLE(pub_publish_component),
2977 ADD_TABLE(pub_install_exec_seq),
2978 ADD_TABLE(media),
2979 ADD_TABLE(property)
2982 static const msi_table rd_tables[] =
2984 ADD_TABLE(directory),
2985 ADD_TABLE(rd_component),
2986 ADD_TABLE(rd_feature),
2987 ADD_TABLE(rd_feature_comp),
2988 ADD_TABLE(rd_file),
2989 ADD_TABLE(rd_duplicate_file),
2990 ADD_TABLE(rd_install_exec_seq),
2991 ADD_TABLE(media),
2992 ADD_TABLE(property)
2995 static const msi_table rrv_tables[] =
2997 ADD_TABLE(directory),
2998 ADD_TABLE(rrv_component),
2999 ADD_TABLE(rrv_feature),
3000 ADD_TABLE(rrv_feature_comp),
3001 ADD_TABLE(rrv_file),
3002 ADD_TABLE(rrv_registry),
3003 ADD_TABLE(rrv_remove_registry),
3004 ADD_TABLE(rrv_install_exec_seq),
3005 ADD_TABLE(media),
3006 ADD_TABLE(property)
3009 static const msi_table frp_tables[] =
3011 ADD_TABLE(directory),
3012 ADD_TABLE(frp_component),
3013 ADD_TABLE(frp_feature),
3014 ADD_TABLE(frp_feature_comp),
3015 ADD_TABLE(frp_file),
3016 ADD_TABLE(frp_upgrade),
3017 ADD_TABLE(frp_custom_action),
3018 ADD_TABLE(frp_install_exec_seq),
3019 ADD_TABLE(media),
3020 ADD_TABLE(property)
3023 static const msi_table riv_tables[] =
3025 ADD_TABLE(directory),
3026 ADD_TABLE(riv_component),
3027 ADD_TABLE(riv_feature),
3028 ADD_TABLE(riv_feature_comp),
3029 ADD_TABLE(riv_file),
3030 ADD_TABLE(riv_ini_file),
3031 ADD_TABLE(riv_remove_ini_file),
3032 ADD_TABLE(riv_install_exec_seq),
3033 ADD_TABLE(media),
3034 ADD_TABLE(property)
3037 static const msi_table res_tables[] =
3039 ADD_TABLE(directory),
3040 ADD_TABLE(res_component),
3041 ADD_TABLE(res_feature),
3042 ADD_TABLE(res_feature_comp),
3043 ADD_TABLE(res_file),
3044 ADD_TABLE(res_environment),
3045 ADD_TABLE(res_install_exec_seq),
3046 ADD_TABLE(media),
3047 ADD_TABLE(property)
3050 static const msi_table rci_tables[] =
3052 ADD_TABLE(directory),
3053 ADD_TABLE(rci_component),
3054 ADD_TABLE(rci_feature),
3055 ADD_TABLE(rci_feature_comp),
3056 ADD_TABLE(rci_file),
3057 ADD_TABLE(rci_appid),
3058 ADD_TABLE(rci_class),
3059 ADD_TABLE(rci_install_exec_seq),
3060 ADD_TABLE(media),
3061 ADD_TABLE(property)
3064 static const msi_table rei_tables[] =
3066 ADD_TABLE(directory),
3067 ADD_TABLE(rei_component),
3068 ADD_TABLE(rei_feature),
3069 ADD_TABLE(rei_feature_comp),
3070 ADD_TABLE(rei_file),
3071 ADD_TABLE(rei_extension),
3072 ADD_TABLE(rei_verb),
3073 ADD_TABLE(rei_progid),
3074 ADD_TABLE(rei_install_exec_seq),
3075 ADD_TABLE(media),
3076 ADD_TABLE(property)
3079 static const msi_table rmi_tables[] =
3081 ADD_TABLE(directory),
3082 ADD_TABLE(rmi_component),
3083 ADD_TABLE(rmi_feature),
3084 ADD_TABLE(rmi_feature_comp),
3085 ADD_TABLE(rmi_file),
3086 ADD_TABLE(rmi_extension),
3087 ADD_TABLE(rmi_verb),
3088 ADD_TABLE(rmi_mime),
3089 ADD_TABLE(rmi_install_exec_seq),
3090 ADD_TABLE(media),
3091 ADD_TABLE(property)
3094 static const msi_table sd_tables[] =
3096 ADD_TABLE(directory),
3097 ADD_TABLE(sd_component),
3098 ADD_TABLE(sd_feature),
3099 ADD_TABLE(sd_feature_comp),
3100 ADD_TABLE(sd_file),
3101 ADD_TABLE(sd_install_exec_seq),
3102 ADD_TABLE(sd_install_ui_seq),
3103 ADD_TABLE(sd_custom_action),
3104 ADD_TABLE(media),
3105 ADD_TABLE(property)
3108 static const msi_table fo_tables[] =
3110 ADD_TABLE(directory),
3111 ADD_TABLE(fo_file),
3112 ADD_TABLE(fo_component),
3113 ADD_TABLE(fo_feature),
3114 ADD_TABLE(fo_condition),
3115 ADD_TABLE(fo_feature_comp),
3116 ADD_TABLE(fo_custom_action),
3117 ADD_TABLE(fo_install_exec_seq),
3118 ADD_TABLE(media),
3119 ADD_TABLE(property)
3122 static const msi_table icon_base_tables[] =
3124 ADD_TABLE(ci_component),
3125 ADD_TABLE(directory),
3126 ADD_TABLE(rof_feature),
3127 ADD_TABLE(rof_feature_comp),
3128 ADD_TABLE(rof_file),
3129 ADD_TABLE(pp_install_exec_seq),
3130 ADD_TABLE(rof_media),
3131 ADD_TABLE(icon_property),
3134 static const msi_table pv_tables[] =
3136 ADD_TABLE(rof_component),
3137 ADD_TABLE(directory),
3138 ADD_TABLE(rof_feature),
3139 ADD_TABLE(rof_feature_comp),
3140 ADD_TABLE(rof_file),
3141 ADD_TABLE(pv_install_exec_seq),
3142 ADD_TABLE(rof_media),
3143 ADD_TABLE(property)
3146 /* cabinet definitions */
3148 /* make the max size large so there is only one cab file */
3149 #define MEDIA_SIZE 0x7FFFFFFF
3150 #define FOLDER_THRESHOLD 900000
3152 /* the FCI callbacks */
3154 static void * CDECL mem_alloc(ULONG cb)
3156 return HeapAlloc(GetProcessHeap(), 0, cb);
3159 static void CDECL mem_free(void *memory)
3161 HeapFree(GetProcessHeap(), 0, memory);
3164 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
3166 sprintf(pccab->szCab, pv, pccab->iCab);
3167 return TRUE;
3170 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
3172 return 0;
3175 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
3176 BOOL fContinuation, void *pv)
3178 return 0;
3181 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
3183 HANDLE handle;
3184 DWORD dwAccess = 0;
3185 DWORD dwShareMode = 0;
3186 DWORD dwCreateDisposition = OPEN_EXISTING;
3188 dwAccess = GENERIC_READ | GENERIC_WRITE;
3189 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
3190 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
3192 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
3193 dwCreateDisposition = OPEN_EXISTING;
3194 else
3195 dwCreateDisposition = CREATE_NEW;
3197 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
3198 dwCreateDisposition, 0, NULL);
3200 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
3202 return (INT_PTR)handle;
3205 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
3207 HANDLE handle = (HANDLE)hf;
3208 DWORD dwRead;
3209 BOOL res;
3211 res = ReadFile(handle, memory, cb, &dwRead, NULL);
3212 ok(res, "Failed to ReadFile\n");
3214 return dwRead;
3217 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
3219 HANDLE handle = (HANDLE)hf;
3220 DWORD dwWritten;
3221 BOOL res;
3223 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
3224 ok(res, "Failed to WriteFile\n");
3226 return dwWritten;
3229 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
3231 HANDLE handle = (HANDLE)hf;
3232 ok(CloseHandle(handle), "Failed to CloseHandle\n");
3234 return 0;
3237 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
3239 HANDLE handle = (HANDLE)hf;
3240 DWORD ret;
3242 ret = SetFilePointer(handle, dist, NULL, seektype);
3243 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
3245 return ret;
3248 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
3250 BOOL ret = DeleteFileA(pszFile);
3251 ok(ret, "Failed to DeleteFile %s\n", pszFile);
3253 return 0;
3256 static void init_functionpointers(void)
3258 HMODULE hmsi = GetModuleHandleA("msi.dll");
3259 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
3260 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
3262 #define GET_PROC(mod, func) \
3263 p ## func = (void*)GetProcAddress(mod, #func); \
3264 if(!p ## func) \
3265 trace("GetProcAddress(%s) failed\n", #func);
3267 GET_PROC(hmsi, MsiQueryComponentStateA);
3268 GET_PROC(hmsi, MsiSetExternalUIRecord);
3269 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
3270 GET_PROC(hmsi, MsiSourceListGetInfoA);
3271 GET_PROC(hmsi, MsiGetComponentPathExA);
3273 GET_PROC(hadvapi32, ConvertSidToStringSidA);
3274 GET_PROC(hadvapi32, GetTokenInformation);
3275 GET_PROC(hadvapi32, OpenProcessToken);
3276 GET_PROC(hadvapi32, RegDeleteKeyExA)
3277 GET_PROC(hkernel32, IsWow64Process)
3279 hsrclient = LoadLibraryA("srclient.dll");
3280 GET_PROC(hsrclient, SRRemoveRestorePoint);
3281 GET_PROC(hsrclient, SRSetRestorePointA);
3283 #undef GET_PROC
3286 static BOOL is_process_limited(void)
3288 HANDLE token;
3290 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
3292 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
3294 BOOL ret;
3295 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
3296 DWORD size;
3298 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
3299 CloseHandle(token);
3300 return (ret && type == TokenElevationTypeLimited);
3302 return FALSE;
3305 static BOOL check_win9x(void)
3307 SC_HANDLE scm;
3309 scm = OpenSCManager(NULL, NULL, GENERIC_ALL);
3310 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
3311 return TRUE;
3313 CloseServiceHandle(scm);
3315 return FALSE;
3318 static LPSTR get_user_sid(LPSTR *usersid)
3320 HANDLE token;
3321 BYTE buf[1024];
3322 DWORD size;
3323 PTOKEN_USER user;
3325 if (!pConvertSidToStringSidA)
3327 win_skip("ConvertSidToStringSidA is not available\n");
3328 return NULL;
3331 *usersid = NULL;
3332 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
3333 size = sizeof(buf);
3334 GetTokenInformation(token, TokenUser, buf, size, &size);
3335 user = (PTOKEN_USER)buf;
3336 pConvertSidToStringSidA(user->User.Sid, usersid);
3337 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
3338 CloseHandle(token);
3339 return *usersid;
3342 static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val)
3344 CHAR buffer[0x20];
3345 UINT r;
3346 DWORD sz;
3348 sz = sizeof buffer;
3349 r = MsiRecordGetString(rec, field, buffer, &sz);
3350 return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
3353 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
3355 LPSTR tempname;
3357 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
3358 GetTempFileNameA(".", "xx", 0, tempname);
3360 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
3362 lstrcpyA(pszTempName, tempname);
3363 HeapFree(GetProcessHeap(), 0, tempname);
3364 return TRUE;
3367 HeapFree(GetProcessHeap(), 0, tempname);
3369 return FALSE;
3372 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
3373 USHORT *pattribs, int *err, void *pv)
3375 BY_HANDLE_FILE_INFORMATION finfo;
3376 FILETIME filetime;
3377 HANDLE handle;
3378 DWORD attrs;
3379 BOOL res;
3381 handle = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
3382 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
3384 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
3386 res = GetFileInformationByHandle(handle, &finfo);
3387 ok(res, "Expected GetFileInformationByHandle to succeed\n");
3389 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
3390 FileTimeToDosDateTime(&filetime, pdate, ptime);
3392 attrs = GetFileAttributes(pszName);
3393 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
3395 return (INT_PTR)handle;
3398 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
3400 char path[MAX_PATH];
3401 char filename[MAX_PATH];
3403 lstrcpyA(path, CURR_DIR);
3404 lstrcatA(path, "\\");
3405 lstrcatA(path, file);
3407 lstrcpyA(filename, file);
3409 return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
3410 progress, get_open_info, compress);
3413 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
3415 ZeroMemory(pCabParams, sizeof(CCAB));
3417 pCabParams->cb = max_size;
3418 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
3419 pCabParams->setID = 0xbeef;
3420 pCabParams->iCab = 1;
3421 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
3422 lstrcatA(pCabParams->szCabPath, "\\");
3423 lstrcpyA(pCabParams->szCab, name);
3426 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
3428 CCAB cabParams;
3429 LPCSTR ptr;
3430 HFCI hfci;
3431 ERF erf;
3432 BOOL res;
3434 set_cab_parameters(&cabParams, name, max_size);
3436 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
3437 fci_read, fci_write, fci_close, fci_seek, fci_delete,
3438 get_temp_file, &cabParams, NULL);
3440 ok(hfci != NULL, "Failed to create an FCI context\n");
3442 ptr = files;
3443 while (*ptr)
3445 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
3446 ok(res, "Failed to add file: %s\n", ptr);
3447 ptr += lstrlen(ptr) + 1;
3450 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
3451 ok(res, "Failed to flush the cabinet\n");
3453 res = FCIDestroy(hfci);
3454 ok(res, "Failed to destroy the cabinet\n");
3457 static BOOL get_user_dirs(void)
3459 HKEY hkey;
3460 DWORD type, size;
3462 if(RegOpenKey(HKEY_CURRENT_USER,
3463 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
3464 &hkey))
3465 return FALSE;
3467 size = MAX_PATH;
3468 if(RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size)){
3469 RegCloseKey(hkey);
3470 return FALSE;
3473 RegCloseKey(hkey);
3474 return TRUE;
3477 static BOOL get_system_dirs(void)
3479 HKEY hkey;
3480 DWORD type, size;
3482 if (RegOpenKey(HKEY_LOCAL_MACHINE,
3483 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
3484 return FALSE;
3486 size = MAX_PATH;
3487 if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
3488 RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size)) {
3489 RegCloseKey(hkey);
3490 return FALSE;
3493 size = MAX_PATH;
3494 if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
3495 RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size)) {
3496 RegCloseKey(hkey);
3497 return FALSE;
3500 size = MAX_PATH;
3501 if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR_NATIVE, &size)) {
3502 RegCloseKey(hkey);
3503 return FALSE;
3506 RegCloseKey(hkey);
3508 if(GetWindowsDirectoryA(WINDOWS_DIR, MAX_PATH) != ERROR_SUCCESS)
3509 return FALSE;
3511 return TRUE;
3514 static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
3516 HANDLE file;
3517 DWORD written;
3519 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
3520 if (file == INVALID_HANDLE_VALUE)
3521 return;
3523 WriteFile(file, data, strlen(data), &written, NULL);
3525 if (size)
3527 SetFilePointer(file, size, NULL, FILE_BEGIN);
3528 SetEndOfFile(file);
3531 CloseHandle(file);
3534 #define create_file(name, size) create_file_data(name, name, size)
3536 static void create_test_files(void)
3538 CreateDirectoryA("msitest", NULL);
3539 create_file("msitest\\one.txt", 100);
3540 CreateDirectoryA("msitest\\first", NULL);
3541 create_file("msitest\\first\\two.txt", 100);
3542 CreateDirectoryA("msitest\\second", NULL);
3543 create_file("msitest\\second\\three.txt", 100);
3545 create_file("four.txt", 100);
3546 create_file("five.txt", 100);
3547 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
3549 create_file("msitest\\filename", 100);
3550 create_file("msitest\\service.exe", 100);
3552 DeleteFileA("four.txt");
3553 DeleteFileA("five.txt");
3556 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
3558 CHAR path[MAX_PATH];
3560 lstrcpyA(path, PROG_FILES_DIR);
3561 lstrcatA(path, "\\");
3562 lstrcatA(path, rel_path);
3564 if (is_file)
3565 return DeleteFileA(path);
3566 else
3567 return RemoveDirectoryA(path);
3570 static BOOL delete_pf_native(const CHAR *rel_path, BOOL is_file)
3572 CHAR path[MAX_PATH];
3574 lstrcpyA(path, PROG_FILES_DIR_NATIVE);
3575 lstrcatA(path, "\\");
3576 lstrcatA(path, rel_path);
3578 if (is_file)
3579 return DeleteFileA(path);
3580 else
3581 return RemoveDirectoryA(path);
3584 static BOOL delete_cf(const CHAR *rel_path, BOOL is_file)
3586 CHAR path[MAX_PATH];
3588 lstrcpyA(path, COMMON_FILES_DIR);
3589 lstrcatA(path, "\\");
3590 lstrcatA(path, rel_path);
3592 if (is_file)
3593 return DeleteFileA(path);
3594 else
3595 return RemoveDirectoryA(path);
3598 static void delete_test_files(void)
3600 DeleteFileA("msitest.msi");
3601 DeleteFileA("msitest.cab");
3602 DeleteFileA("msitest\\second\\three.txt");
3603 DeleteFileA("msitest\\first\\two.txt");
3604 DeleteFileA("msitest\\one.txt");
3605 DeleteFileA("msitest\\service.exe");
3606 DeleteFileA("msitest\\filename");
3607 RemoveDirectoryA("msitest\\second");
3608 RemoveDirectoryA("msitest\\first");
3609 RemoveDirectoryA("msitest");
3612 static void write_file(const CHAR *filename, const char *data, int data_size)
3614 DWORD size;
3616 HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
3617 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
3619 WriteFile(hf, data, data_size, &size, NULL);
3620 CloseHandle(hf);
3623 static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template)
3625 MSIHANDLE summary;
3626 UINT r;
3628 r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
3629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3631 r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template);
3632 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3634 r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL,
3635 "{004757CA-5092-49c2-AD20-28E1CE0DF5F2}");
3636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3638 r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, version, NULL, NULL);
3639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3641 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
3642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3644 r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
3645 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3647 /* write the summary changes back to the stream */
3648 r = MsiSummaryInfoPersist(summary);
3649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3651 MsiCloseHandle(summary);
3654 #define create_database(name, tables, num_tables) \
3655 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
3657 #define create_database_template(name, tables, num_tables, version, template) \
3658 create_database_wordcount(name, tables, num_tables, version, 0, template);
3660 static void create_database_wordcount(const CHAR *name, const msi_table *tables,
3661 int num_tables, INT version, INT wordcount,
3662 const char *template)
3664 MSIHANDLE db;
3665 UINT r;
3666 int j;
3668 r = MsiOpenDatabaseA(name, MSIDBOPEN_CREATE, &db);
3669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3671 /* import the tables into the database */
3672 for (j = 0; j < num_tables; j++)
3674 const msi_table *table = &tables[j];
3676 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
3678 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
3679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3681 DeleteFileA(table->filename);
3684 write_msi_summary_info(db, version, wordcount, template);
3686 r = MsiDatabaseCommit(db);
3687 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3689 MsiCloseHandle(db);
3692 static void check_service_is_installed(void)
3694 SC_HANDLE scm, service;
3695 BOOL res;
3697 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
3698 ok(scm != NULL, "Failed to open the SC Manager\n");
3700 service = OpenService(scm, "TestService", SC_MANAGER_ALL_ACCESS);
3701 ok(service != NULL, "Failed to open TestService\n");
3703 res = DeleteService(service);
3704 ok(res, "Failed to delete TestService\n");
3706 CloseServiceHandle(service);
3707 CloseServiceHandle(scm);
3710 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
3712 RESTOREPOINTINFOA spec;
3714 spec.dwEventType = event_type;
3715 spec.dwRestorePtType = APPLICATION_INSTALL;
3716 spec.llSequenceNumber = status->llSequenceNumber;
3717 lstrcpyA(spec.szDescription, "msitest restore point");
3719 return pSRSetRestorePointA(&spec, status);
3722 static void remove_restore_point(DWORD seq_number)
3724 DWORD res;
3726 res = pSRRemoveRestorePoint(seq_number);
3727 if (res != ERROR_SUCCESS)
3728 trace("Failed to remove the restore point : %08x\n", res);
3731 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
3733 if (pRegDeleteKeyExA)
3734 return pRegDeleteKeyExA( key, subkey, access, 0 );
3735 return RegDeleteKeyA( key, subkey );
3738 static void test_MsiInstallProduct(void)
3740 UINT r;
3741 CHAR path[MAX_PATH];
3742 LONG res;
3743 HKEY hkey;
3744 DWORD num, size, type;
3745 REGSAM access = KEY_ALL_ACCESS;
3747 if (on_win9x)
3749 win_skip("Services are not implemented on Win9x and WinMe\n");
3750 return;
3752 if (is_process_limited())
3754 skip("process is limited\n");
3755 return;
3758 if (is_wow64)
3759 access |= KEY_WOW64_64KEY;
3761 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3763 /* szPackagePath is NULL */
3764 r = MsiInstallProductA(NULL, "INSTALL=ALL");
3765 ok(r == ERROR_INVALID_PARAMETER,
3766 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
3768 /* both szPackagePath and szCommandLine are NULL */
3769 r = MsiInstallProductA(NULL, NULL);
3770 ok(r == ERROR_INVALID_PARAMETER,
3771 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
3773 /* szPackagePath is empty */
3774 r = MsiInstallProductA("", "INSTALL=ALL");
3775 ok(r == ERROR_PATH_NOT_FOUND,
3776 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r);
3778 create_test_files();
3779 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
3781 /* install, don't publish */
3782 r = MsiInstallProductA(msifile, NULL);
3783 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3785 skip("Not enough rights to perform tests\n");
3786 goto error;
3788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3790 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3791 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3792 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3793 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3794 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3795 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3796 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3797 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3798 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3799 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3800 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3801 ok(delete_pf("msitest", FALSE), "File not installed\n");
3803 res = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", 0, access, &hkey);
3804 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3806 size = MAX_PATH;
3807 type = REG_SZ;
3808 res = RegQueryValueExA(hkey, "Name", NULL, &type, (LPBYTE)path, &size);
3809 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3810 ok(!lstrcmpA(path, "imaname"), "Expected imaname, got %s\n", path);
3812 size = MAX_PATH;
3813 type = REG_SZ;
3814 res = RegQueryValueExA(hkey, "blah", NULL, &type, (LPBYTE)path, &size);
3815 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3817 size = sizeof(num);
3818 type = REG_DWORD;
3819 res = RegQueryValueExA(hkey, "number", NULL, &type, (LPBYTE)&num, &size);
3820 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3821 ok(num == 314, "Expected 314, got %d\n", num);
3823 size = MAX_PATH;
3824 type = REG_SZ;
3825 res = RegQueryValueExA(hkey, "OrderTestName", NULL, &type, (LPBYTE)path, &size);
3826 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3827 ok(!lstrcmpA(path, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path);
3829 check_service_is_installed();
3831 delete_key(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access);
3833 /* not published, reinstall */
3834 r = MsiInstallProductA(msifile, NULL);
3835 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3837 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3838 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3839 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3840 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3841 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3842 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3843 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3844 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3845 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3846 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3847 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3848 ok(delete_pf("msitest", FALSE), "File not installed\n");
3850 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3851 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3852 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3854 create_database(msifile, up_tables, sizeof(up_tables) / sizeof(msi_table));
3856 /* not published, RemovePreviousVersions set */
3857 r = MsiInstallProductA(msifile, NULL);
3858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3860 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3861 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3862 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3863 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3864 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3865 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3866 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3867 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3868 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3869 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3870 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3871 ok(delete_pf("msitest", FALSE), "File not installed\n");
3873 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3874 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3875 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3877 create_database(msifile, up2_tables, sizeof(up2_tables) / sizeof(msi_table));
3879 /* not published, version number bumped */
3880 r = MsiInstallProductA(msifile, NULL);
3881 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3883 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3884 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3885 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3886 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3887 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3888 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3889 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3890 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3891 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3892 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3893 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3894 ok(delete_pf("msitest", FALSE), "File not installed\n");
3896 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3897 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3898 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3900 create_database(msifile, up3_tables, sizeof(up3_tables) / sizeof(msi_table));
3902 /* not published, RemovePreviousVersions set and version number bumped */
3903 r = MsiInstallProductA(msifile, NULL);
3904 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3906 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3907 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3908 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3909 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3910 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3911 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3912 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3913 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3914 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3915 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3916 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3917 ok(delete_pf("msitest", FALSE), "File not installed\n");
3919 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3920 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3921 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3923 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
3925 /* install, publish product */
3926 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
3927 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3929 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3930 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3931 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3932 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3933 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3934 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3935 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3936 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3937 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3938 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3939 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3940 ok(delete_pf("msitest", FALSE), "File not installed\n");
3942 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3943 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3945 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
3947 /* published, reinstall */
3948 r = MsiInstallProductA(msifile, NULL);
3949 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3951 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3952 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3953 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3954 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3955 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3956 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3957 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3958 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3959 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3960 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3961 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3962 ok(delete_pf("msitest", FALSE), "File not installed\n");
3964 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3965 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3967 create_database(msifile, up5_tables, sizeof(up5_tables) / sizeof(msi_table));
3969 /* published product, RemovePreviousVersions set */
3970 r = MsiInstallProductA(msifile, NULL);
3971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3973 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3974 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3975 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3976 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3977 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3978 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3979 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3980 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3981 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3982 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3983 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3984 ok(delete_pf("msitest", FALSE), "File not installed\n");
3986 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3987 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3989 create_database(msifile, up6_tables, sizeof(up6_tables) / sizeof(msi_table));
3991 /* published product, version number bumped */
3992 r = MsiInstallProductA(msifile, NULL);
3993 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3995 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3996 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3997 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3998 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3999 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
4000 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
4001 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
4002 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
4003 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4004 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4005 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4006 ok(delete_pf("msitest", FALSE), "File not installed\n");
4008 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
4009 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4011 create_database(msifile, up7_tables, sizeof(up7_tables) / sizeof(msi_table));
4013 /* published product, RemovePreviousVersions set and version number bumped */
4014 r = MsiInstallProductA(msifile, NULL);
4015 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4017 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4018 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
4019 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4020 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
4021 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
4022 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
4023 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
4024 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
4025 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4026 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4027 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4028 ok(delete_pf("msitest", FALSE), "File not installed\n");
4030 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
4031 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4033 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4034 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4036 error:
4037 delete_test_files();
4038 DeleteFileA(msifile);
4041 static void test_MsiSetComponentState(void)
4043 INSTALLSTATE installed, action;
4044 MSIHANDLE package;
4045 char path[MAX_PATH];
4046 UINT r;
4048 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
4050 CoInitialize(NULL);
4052 lstrcpy(path, CURR_DIR);
4053 lstrcat(path, "\\");
4054 lstrcat(path, msifile);
4056 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4058 r = MsiOpenPackage(path, &package);
4059 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4061 skip("Not enough rights to perform tests\n");
4062 goto error;
4064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4066 r = MsiDoAction(package, "CostInitialize");
4067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4069 r = MsiDoAction(package, "FileCost");
4070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4072 r = MsiDoAction(package, "CostFinalize");
4073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4075 r = MsiGetComponentState(package, "dangler", &installed, &action);
4076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4077 ok(installed == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", installed);
4078 ok(action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4080 r = MsiSetComponentState(package, "dangler", INSTALLSTATE_SOURCE);
4081 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4083 MsiCloseHandle(package);
4085 error:
4086 CoUninitialize();
4087 DeleteFileA(msifile);
4090 static void test_packagecoltypes(void)
4092 MSIHANDLE hdb, view, rec;
4093 char path[MAX_PATH];
4094 LPCSTR query;
4095 UINT r, count;
4097 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
4099 CoInitialize(NULL);
4101 lstrcpy(path, CURR_DIR);
4102 lstrcat(path, "\\");
4103 lstrcat(path, msifile);
4105 r = MsiOpenDatabase(path, MSIDBOPEN_READONLY, &hdb);
4106 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4108 query = "SELECT * FROM `Media`";
4109 r = MsiDatabaseOpenView( hdb, query, &view );
4110 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
4112 r = MsiViewGetColumnInfo( view, MSICOLINFO_NAMES, &rec );
4113 count = MsiRecordGetFieldCount( rec );
4114 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
4115 ok(count == 6, "Expected 6, got %d\n", count);
4116 ok(check_record(rec, 1, "DiskId"), "wrong column label\n");
4117 ok(check_record(rec, 2, "LastSequence"), "wrong column label\n");
4118 ok(check_record(rec, 3, "DiskPrompt"), "wrong column label\n");
4119 ok(check_record(rec, 4, "Cabinet"), "wrong column label\n");
4120 ok(check_record(rec, 5, "VolumeLabel"), "wrong column label\n");
4121 ok(check_record(rec, 6, "Source"), "wrong column label\n");
4122 MsiCloseHandle(rec);
4124 r = MsiViewGetColumnInfo( view, MSICOLINFO_TYPES, &rec );
4125 count = MsiRecordGetFieldCount( rec );
4126 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
4127 ok(count == 6, "Expected 6, got %d\n", count);
4128 ok(check_record(rec, 1, "i2"), "wrong column label\n");
4129 ok(check_record(rec, 2, "i4"), "wrong column label\n");
4130 ok(check_record(rec, 3, "L64"), "wrong column label\n");
4131 ok(check_record(rec, 4, "S255"), "wrong column label\n");
4132 ok(check_record(rec, 5, "S32"), "wrong column label\n");
4133 ok(check_record(rec, 6, "S72"), "wrong column label\n");
4135 MsiCloseHandle(rec);
4136 MsiCloseHandle(view);
4137 MsiCloseHandle(hdb);
4138 CoUninitialize();
4140 DeleteFile(msifile);
4143 static void create_cc_test_files(void)
4145 CCAB cabParams;
4146 HFCI hfci;
4147 ERF erf;
4148 static CHAR cab_context[] = "test%d.cab";
4149 BOOL res;
4151 create_file("maximus", 500);
4152 create_file("augustus", 50000);
4153 create_file("tiberius", 500);
4154 create_file("caesar", 500);
4156 set_cab_parameters(&cabParams, "test1.cab", 40000);
4158 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
4159 fci_read, fci_write, fci_close, fci_seek, fci_delete,
4160 get_temp_file, &cabParams, cab_context);
4161 ok(hfci != NULL, "Failed to create an FCI context\n");
4163 res = add_file(hfci, "maximus", tcompTYPE_NONE);
4164 ok(res, "Failed to add file maximus\n");
4166 res = add_file(hfci, "augustus", tcompTYPE_NONE);
4167 ok(res, "Failed to add file augustus\n");
4169 res = add_file(hfci, "tiberius", tcompTYPE_NONE);
4170 ok(res, "Failed to add file tiberius\n");
4172 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
4173 ok(res, "Failed to flush the cabinet\n");
4175 res = FCIDestroy(hfci);
4176 ok(res, "Failed to destroy the cabinet\n");
4178 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4180 DeleteFile("maximus");
4181 DeleteFile("augustus");
4182 DeleteFile("tiberius");
4183 DeleteFile("caesar");
4186 static void delete_cab_files(void)
4188 SHFILEOPSTRUCT shfl;
4189 CHAR path[MAX_PATH+10];
4191 lstrcpyA(path, CURR_DIR);
4192 lstrcatA(path, "\\*.cab");
4193 path[strlen(path) + 1] = '\0';
4195 shfl.hwnd = NULL;
4196 shfl.wFunc = FO_DELETE;
4197 shfl.pFrom = path;
4198 shfl.pTo = NULL;
4199 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT;
4201 SHFileOperation(&shfl);
4204 static void test_continuouscabs(void)
4206 UINT r;
4208 if (is_process_limited())
4210 skip("process is limited\n");
4211 return;
4214 create_cc_test_files();
4215 create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
4217 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4219 r = MsiInstallProductA(msifile, NULL);
4220 if (r == ERROR_SUCCESS) /* win9x has a problem with this */
4222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4223 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4224 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4225 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4226 ok(delete_pf("msitest", FALSE), "File not installed\n");
4229 delete_cab_files();
4230 DeleteFile(msifile);
4232 create_cc_test_files();
4233 create_database(msifile, cc2_tables, sizeof(cc2_tables) / sizeof(msi_table));
4235 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4237 r = MsiInstallProductA(msifile, NULL);
4238 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4240 skip("Not enough rights to perform tests\n");
4241 goto error;
4243 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4244 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4245 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4246 ok(delete_pf("msitest\\tiberius", TRUE), "File not installed\n");
4247 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4248 ok(delete_pf("msitest", FALSE), "File not installed\n");
4250 error:
4251 delete_cab_files();
4252 DeleteFile(msifile);
4255 static void test_caborder(void)
4257 UINT r;
4259 create_file("imperator", 100);
4260 create_file("maximus", 500);
4261 create_file("augustus", 50000);
4262 create_file("caesar", 500);
4264 create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
4266 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4268 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4269 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
4270 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4272 r = MsiInstallProductA(msifile, NULL);
4273 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4275 skip("Not enough rights to perform tests\n");
4276 goto error;
4278 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4279 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4280 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4281 todo_wine
4283 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4284 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4287 delete_cab_files();
4289 create_cab_file("test1.cab", MEDIA_SIZE, "imperator\0");
4290 create_cab_file("test2.cab", MEDIA_SIZE, "maximus\0augustus\0");
4291 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4293 r = MsiInstallProductA(msifile, NULL);
4294 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4295 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4296 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4297 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4298 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4300 delete_cab_files();
4301 DeleteFile(msifile);
4303 create_cc_test_files();
4304 create_database(msifile, co_tables, sizeof(co_tables) / sizeof(msi_table));
4306 r = MsiInstallProductA(msifile, NULL);
4307 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4308 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4309 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4310 todo_wine
4312 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4313 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4316 delete_cab_files();
4317 DeleteFile(msifile);
4319 create_cc_test_files();
4320 create_database(msifile, co2_tables, sizeof(co2_tables) / sizeof(msi_table));
4322 r = MsiInstallProductA(msifile, NULL);
4323 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4324 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4325 todo_wine
4327 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4328 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4329 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4332 error:
4333 delete_cab_files();
4334 DeleteFile("imperator");
4335 DeleteFile("maximus");
4336 DeleteFile("augustus");
4337 DeleteFile("caesar");
4338 DeleteFile(msifile);
4341 static void test_mixedmedia(void)
4343 UINT r;
4345 if (is_process_limited())
4347 skip("process is limited\n");
4348 return;
4351 CreateDirectoryA("msitest", NULL);
4352 create_file("msitest\\maximus", 500);
4353 create_file("msitest\\augustus", 500);
4354 create_file("caesar", 500);
4356 create_database(msifile, mm_tables, sizeof(mm_tables) / sizeof(msi_table));
4358 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4360 create_cab_file("test1.cab", MEDIA_SIZE, "caesar\0");
4362 r = MsiInstallProductA(msifile, NULL);
4363 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4365 skip("Not enough rights to perform tests\n");
4366 goto error;
4368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4369 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4370 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4371 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4372 ok(delete_pf("msitest", FALSE), "File not installed\n");
4374 error:
4375 /* Delete the files in the temp (current) folder */
4376 DeleteFile("msitest\\maximus");
4377 DeleteFile("msitest\\augustus");
4378 RemoveDirectory("msitest");
4379 DeleteFile("caesar");
4380 DeleteFile("test1.cab");
4381 DeleteFile(msifile);
4384 static void test_samesequence(void)
4386 UINT r;
4388 create_cc_test_files();
4389 create_database(msifile, ss_tables, sizeof(ss_tables) / sizeof(msi_table));
4391 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4393 r = MsiInstallProductA(msifile, NULL);
4394 if (r == ERROR_SUCCESS) /* win9x has a problem with this */
4396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4397 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4398 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4399 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4400 ok(delete_pf("msitest", FALSE), "File not installed\n");
4403 delete_cab_files();
4404 DeleteFile(msifile);
4407 static void test_uiLevelFlags(void)
4409 UINT r;
4411 create_cc_test_files();
4412 create_database(msifile, ui_tables, sizeof(ui_tables) / sizeof(msi_table));
4414 MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL);
4416 r = MsiInstallProductA(msifile, NULL);
4417 if (r == ERROR_SUCCESS) /* win9x has a problem with this */
4419 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4420 ok(!delete_pf("msitest\\maximus", TRUE), "UI install occurred, but execute-only was requested.\n");
4421 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4422 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4423 ok(delete_pf("msitest", FALSE), "File not installed\n");
4426 delete_cab_files();
4427 DeleteFile(msifile);
4430 static BOOL file_matches(LPSTR path)
4432 CHAR buf[MAX_PATH];
4433 HANDLE file;
4434 DWORD size;
4436 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4437 NULL, OPEN_EXISTING, 0, NULL);
4439 ZeroMemory(buf, MAX_PATH);
4440 ReadFile(file, buf, 15, &size, NULL);
4441 CloseHandle(file);
4443 return !lstrcmp(buf, "msitest\\maximus");
4446 static void test_readonlyfile(void)
4448 UINT r;
4449 DWORD size;
4450 HANDLE file;
4451 CHAR path[MAX_PATH];
4453 if (is_process_limited())
4455 skip("process is limited\n");
4456 return;
4459 CreateDirectoryA("msitest", NULL);
4460 create_file("msitest\\maximus", 500);
4461 create_database(msifile, rof_tables, sizeof(rof_tables) / sizeof(msi_table));
4463 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4465 lstrcpy(path, PROG_FILES_DIR);
4466 lstrcat(path, "\\msitest");
4467 CreateDirectory(path, NULL);
4469 lstrcat(path, "\\maximus");
4470 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4471 NULL, CREATE_NEW, FILE_ATTRIBUTE_READONLY, NULL);
4473 WriteFile(file, "readonlyfile", strlen("readonlyfile"), &size, NULL);
4474 CloseHandle(file);
4476 r = MsiInstallProductA(msifile, NULL);
4477 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4479 skip("Not enough rights to perform tests\n");
4480 goto error;
4482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4483 ok(file_matches(path), "Expected file to be overwritten\n");
4484 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4485 ok(delete_pf("msitest", FALSE), "File not installed\n");
4487 error:
4488 /* Delete the files in the temp (current) folder */
4489 DeleteFile("msitest\\maximus");
4490 RemoveDirectory("msitest");
4491 DeleteFile(msifile);
4494 static void test_readonlyfile_cab(void)
4496 UINT r;
4497 DWORD size;
4498 HANDLE file;
4499 CHAR path[MAX_PATH];
4500 CHAR buf[16];
4502 if (is_process_limited())
4504 skip("process is limited\n");
4505 return;
4508 CreateDirectoryA("msitest", NULL);
4509 create_file("maximus", 500);
4510 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4511 DeleteFile("maximus");
4513 create_database(msifile, rofc_tables, sizeof(rofc_tables) / sizeof(msi_table));
4515 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4517 lstrcpy(path, PROG_FILES_DIR);
4518 lstrcat(path, "\\msitest");
4519 CreateDirectory(path, NULL);
4521 lstrcat(path, "\\maximus");
4522 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4523 NULL, CREATE_NEW, FILE_ATTRIBUTE_READONLY, NULL);
4525 WriteFile(file, "readonlyfile", strlen("readonlyfile"), &size, NULL);
4526 CloseHandle(file);
4528 r = MsiInstallProductA(msifile, NULL);
4529 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4531 skip("Not enough rights to perform tests\n");
4532 goto error;
4534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4536 memset( buf, 0, sizeof(buf) );
4537 if ((file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4538 NULL, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE)
4540 ReadFile(file, buf, sizeof(buf) - 1, &size, NULL);
4541 CloseHandle(file);
4543 ok(!memcmp( buf, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf);
4544 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4545 ok(delete_pf("msitest", FALSE), "File not installed\n");
4547 error:
4548 /* Delete the files in the temp (current) folder */
4549 delete_cab_files();
4550 DeleteFile("msitest\\maximus");
4551 RemoveDirectory("msitest");
4552 DeleteFile(msifile);
4555 static BOOL add_cabinet_storage(LPCSTR db, LPCSTR cabinet)
4557 WCHAR dbW[MAX_PATH], cabinetW[MAX_PATH];
4558 IStorage *stg;
4559 IStream *stm;
4560 HRESULT hr;
4561 HANDLE handle;
4563 MultiByteToWideChar(CP_ACP, 0, db, -1, dbW, MAX_PATH);
4564 hr = StgOpenStorage(dbW, NULL, STGM_DIRECT|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, NULL, 0, &stg);
4565 if (FAILED(hr))
4566 return FALSE;
4568 MultiByteToWideChar(CP_ACP, 0, cabinet, -1, cabinetW, MAX_PATH);
4569 hr = IStorage_CreateStream(stg, cabinetW, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
4570 if (FAILED(hr))
4572 IStorage_Release(stg);
4573 return FALSE;
4576 handle = CreateFileW(cabinetW, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
4577 if (handle != INVALID_HANDLE_VALUE)
4579 DWORD count;
4580 char buffer[1024];
4581 if (ReadFile(handle, buffer, sizeof(buffer), &count, NULL))
4582 IStream_Write(stm, buffer, count, &count);
4583 CloseHandle(handle);
4586 IStream_Release(stm);
4587 IStorage_Release(stg);
4589 return TRUE;
4592 static void test_lastusedsource(void)
4594 static char prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4596 UINT r;
4597 char value[MAX_PATH], path[MAX_PATH];
4598 DWORD size;
4600 if (!pMsiSourceListGetInfoA)
4602 win_skip("MsiSourceListGetInfoA is not available\n");
4603 return;
4606 CreateDirectoryA("msitest", NULL);
4607 create_file("maximus", 500);
4608 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4609 DeleteFile("maximus");
4611 create_database("msifile0.msi", lus0_tables, sizeof(lus0_tables) / sizeof(msi_table));
4612 create_database("msifile1.msi", lus1_tables, sizeof(lus1_tables) / sizeof(msi_table));
4613 create_database("msifile2.msi", lus2_tables, sizeof(lus2_tables) / sizeof(msi_table));
4615 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4617 /* no cabinet file */
4619 size = MAX_PATH;
4620 lstrcpyA(value, "aaa");
4621 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4622 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4623 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4624 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4626 r = MsiInstallProductA("msifile0.msi", "PUBLISH_PRODUCT=1");
4627 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4629 skip("Not enough rights to perform tests\n");
4630 goto error;
4632 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4634 lstrcpyA(path, CURR_DIR);
4635 lstrcatA(path, "\\");
4637 size = MAX_PATH;
4638 lstrcpyA(value, "aaa");
4639 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4640 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4642 todo_wine
4644 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4645 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4648 r = MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
4649 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4651 /* separate cabinet file */
4653 size = MAX_PATH;
4654 lstrcpyA(value, "aaa");
4655 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4656 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4657 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4658 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4660 r = MsiInstallProductA("msifile1.msi", "PUBLISH_PRODUCT=1");
4661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4663 lstrcpyA(path, CURR_DIR);
4664 lstrcatA(path, "\\");
4666 size = MAX_PATH;
4667 lstrcpyA(value, "aaa");
4668 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4669 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4670 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4671 todo_wine
4673 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4674 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4677 r = MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
4678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4680 size = MAX_PATH;
4681 lstrcpyA(value, "aaa");
4682 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4683 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4684 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4685 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4687 /* embedded cabinet stream */
4689 add_cabinet_storage("msifile2.msi", "test1.cab");
4691 r = MsiInstallProductA("msifile2.msi", "PUBLISH_PRODUCT=1");
4692 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4694 size = MAX_PATH;
4695 lstrcpyA(value, "aaa");
4696 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4697 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4699 todo_wine
4701 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4702 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4705 r = MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
4706 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4708 size = MAX_PATH;
4709 lstrcpyA(value, "aaa");
4710 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4711 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4712 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4713 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4715 error:
4716 /* Delete the files in the temp (current) folder */
4717 delete_cab_files();
4718 DeleteFile("msitest\\maximus");
4719 RemoveDirectory("msitest");
4720 DeleteFile("msifile0.msi");
4721 DeleteFile("msifile1.msi");
4722 DeleteFile("msifile2.msi");
4725 static void test_setdirproperty(void)
4727 UINT r;
4729 if (is_process_limited())
4731 skip("process is limited\n");
4732 return;
4735 CreateDirectoryA("msitest", NULL);
4736 create_file("msitest\\maximus", 500);
4737 create_database(msifile, sdp_tables, sizeof(sdp_tables) / sizeof(msi_table));
4739 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4741 r = MsiInstallProductA(msifile, NULL);
4742 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4744 skip("Not enough rights to perform tests\n");
4745 goto error;
4747 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4748 ok(delete_cf("msitest\\maximus", TRUE), "File not installed\n");
4749 ok(delete_cf("msitest", FALSE), "File not installed\n");
4751 error:
4752 /* Delete the files in the temp (current) folder */
4753 DeleteFile(msifile);
4754 DeleteFile("msitest\\maximus");
4755 RemoveDirectory("msitest");
4758 static void test_cabisextracted(void)
4760 UINT r;
4762 if (is_process_limited())
4764 skip("process is limited\n");
4765 return;
4768 CreateDirectoryA("msitest", NULL);
4769 create_file("msitest\\gaius", 500);
4770 create_file("maximus", 500);
4771 create_file("augustus", 500);
4772 create_file("caesar", 500);
4774 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4775 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
4776 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4778 create_database(msifile, cie_tables, sizeof(cie_tables) / sizeof(msi_table));
4780 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4782 r = MsiInstallProductA(msifile, NULL);
4783 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4785 skip("Not enough rights to perform tests\n");
4786 goto error;
4788 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4789 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4790 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4791 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4792 ok(delete_pf("msitest\\gaius", TRUE), "File not installed\n");
4793 ok(delete_pf("msitest", FALSE), "File not installed\n");
4795 error:
4796 /* Delete the files in the temp (current) folder */
4797 delete_cab_files();
4798 DeleteFile(msifile);
4799 DeleteFile("maximus");
4800 DeleteFile("augustus");
4801 DeleteFile("caesar");
4802 DeleteFile("msitest\\gaius");
4803 RemoveDirectory("msitest");
4806 static void test_concurrentinstall(void)
4808 UINT r;
4809 CHAR path[MAX_PATH];
4811 if (is_process_limited())
4813 skip("process is limited\n");
4814 return;
4817 CreateDirectoryA("msitest", NULL);
4818 CreateDirectoryA("msitest\\msitest", NULL);
4819 create_file("msitest\\maximus", 500);
4820 create_file("msitest\\msitest\\augustus", 500);
4822 create_database(msifile, ci_tables, sizeof(ci_tables) / sizeof(msi_table));
4824 lstrcpyA(path, CURR_DIR);
4825 lstrcatA(path, "\\msitest\\concurrent.msi");
4826 create_database(path, ci2_tables, sizeof(ci2_tables) / sizeof(msi_table));
4828 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
4830 r = MsiInstallProductA(msifile, NULL);
4831 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4833 skip("Not enough rights to perform tests\n");
4834 DeleteFile(path);
4835 goto error;
4837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4838 if (!delete_pf("msitest\\augustus", TRUE))
4839 trace("concurrent installs not supported\n");
4840 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4841 ok(delete_pf("msitest", FALSE), "File not installed\n");
4843 DeleteFile(path);
4845 r = MsiInstallProductA(msifile, NULL);
4846 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4847 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4848 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4849 ok(delete_pf("msitest", FALSE), "File not installed\n");
4851 error:
4852 DeleteFile(msifile);
4853 DeleteFile("msitest\\msitest\\augustus");
4854 DeleteFile("msitest\\maximus");
4855 RemoveDirectory("msitest\\msitest");
4856 RemoveDirectory("msitest");
4859 static void test_setpropertyfolder(void)
4861 UINT r;
4862 CHAR path[MAX_PATH];
4863 DWORD attr;
4865 if (is_process_limited())
4867 skip("process is limited\n");
4868 return;
4871 lstrcpyA(path, PROG_FILES_DIR);
4872 lstrcatA(path, "\\msitest\\added");
4874 CreateDirectoryA("msitest", NULL);
4875 create_file("msitest\\maximus", 500);
4877 create_database(msifile, spf_tables, sizeof(spf_tables) / sizeof(msi_table));
4879 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
4881 r = MsiInstallProductA(msifile, NULL);
4882 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4884 skip("Not enough rights to perform tests\n");
4885 goto error;
4887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4888 attr = GetFileAttributesA(path);
4889 if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
4891 ok(delete_pf("msitest\\added\\maximus", TRUE), "File not installed\n");
4892 ok(delete_pf("msitest\\added", FALSE), "File not installed\n");
4893 ok(delete_pf("msitest", FALSE), "File not installed\n");
4895 else
4897 trace("changing folder property not supported\n");
4898 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4899 ok(delete_pf("msitest", FALSE), "File not installed\n");
4902 error:
4903 /* Delete the files in the temp (current) folder */
4904 DeleteFile(msifile);
4905 DeleteFile("msitest\\maximus");
4906 RemoveDirectory("msitest");
4909 static BOOL file_exists(LPCSTR file)
4911 return GetFileAttributes(file) != INVALID_FILE_ATTRIBUTES;
4914 static BOOL pf_exists(LPCSTR file)
4916 CHAR path[MAX_PATH];
4918 lstrcpyA(path, PROG_FILES_DIR);
4919 lstrcatA(path, "\\");
4920 lstrcatA(path, file);
4922 return file_exists(path);
4925 static void delete_pfmsitest_files(void)
4927 SHFILEOPSTRUCT shfl;
4928 CHAR path[MAX_PATH+11];
4930 lstrcpyA(path, PROG_FILES_DIR);
4931 lstrcatA(path, "\\msitest\\*");
4932 path[strlen(path) + 1] = '\0';
4934 shfl.hwnd = NULL;
4935 shfl.wFunc = FO_DELETE;
4936 shfl.pFrom = path;
4937 shfl.pTo = NULL;
4938 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
4940 SHFileOperation(&shfl);
4942 lstrcpyA(path, PROG_FILES_DIR);
4943 lstrcatA(path, "\\msitest");
4944 RemoveDirectoryA(path);
4947 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, DWORD line)
4949 char val[MAX_PATH];
4950 DWORD size, type;
4951 LONG res;
4953 size = MAX_PATH;
4954 val[0] = '\0';
4955 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)val, &size);
4957 if (res != ERROR_SUCCESS ||
4958 (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_MULTI_SZ))
4960 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
4961 return;
4964 if (!expected)
4965 ok_(__FILE__, line)(lstrlenA(val) == 0, "Expected empty string, got %s\n", val);
4966 else
4968 if (bcase)
4969 ok_(__FILE__, line)(!lstrcmpA(val, expected), "Expected %s, got %s\n", expected, val);
4970 else
4971 ok_(__FILE__, line)(!lstrcmpiA(val, expected), "Expected %s, got %s\n", expected, val);
4975 static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line)
4977 DWORD val, size, type;
4978 LONG res;
4980 size = sizeof(DWORD);
4981 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
4983 if (res != ERROR_SUCCESS || type != REG_DWORD)
4985 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
4986 return;
4989 ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val);
4992 static void check_reg_dword2(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD line)
4994 DWORD val, size, type;
4995 LONG res;
4997 size = sizeof(DWORD);
4998 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
5000 if (res != ERROR_SUCCESS || type != REG_DWORD)
5002 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
5003 return;
5006 ok_(__FILE__, line)(val == expected1 || val == expected2, "Expected %d or %d, got %d\n", expected1, expected2, val);
5009 static void check_reg_dword3(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD expected3, DWORD line)
5011 DWORD val, size, type;
5012 LONG res;
5014 size = sizeof(DWORD);
5015 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
5017 if (res != ERROR_SUCCESS || type != REG_DWORD)
5019 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
5020 return;
5023 ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3,
5024 "Expected %d, %d or %d, got %d\n", expected1, expected2, expected3, val);
5027 #define CHECK_REG_STR(prodkey, name, expected) \
5028 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
5030 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
5031 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
5032 RegDeleteValueA(prodkey, name);
5034 #define CHECK_REG_ISTR(prodkey, name, expected) \
5035 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
5037 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
5038 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
5039 RegDeleteValueA(prodkey, name);
5041 #define CHECK_REG_DWORD(prodkey, name, expected) \
5042 check_reg_dword(prodkey, name, expected, __LINE__);
5044 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
5045 check_reg_dword(prodkey, name, expected, __LINE__); \
5046 RegDeleteValueA(prodkey, name);
5048 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
5049 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
5051 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
5052 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
5053 RegDeleteValueA(prodkey, name);
5055 #define CHECK_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \
5056 check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__);
5058 #define CHECK_DEL_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \
5059 check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__); \
5060 RegDeleteValueA(prodkey, name);
5062 static void get_date_str(LPSTR date)
5064 SYSTEMTIME systime;
5066 static const char date_fmt[] = "%d%02d%02d";
5067 GetLocalTime(&systime);
5068 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
5071 static void test_publish_registerproduct(void)
5073 UINT r;
5074 LONG res;
5075 HKEY hkey;
5076 HKEY props, usage;
5077 LPSTR usersid;
5078 char date[MAX_PATH];
5079 char temp[MAX_PATH];
5080 char keypath[MAX_PATH];
5081 REGSAM access = KEY_ALL_ACCESS;
5083 static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5084 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
5085 static const CHAR uninstall_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
5086 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
5087 static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
5088 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5089 static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
5090 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
5091 static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
5092 "\\51AAE0C44620A5E4788506E91F249BD2";
5094 if (is_process_limited())
5096 skip("process is limited\n");
5097 return;
5100 if (!get_user_sid(&usersid))
5101 return;
5103 get_date_str(date);
5104 GetTempPath(MAX_PATH, temp);
5106 CreateDirectoryA("msitest", NULL);
5107 create_file("msitest\\maximus", 500);
5109 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5111 if (is_wow64)
5112 access |= KEY_WOW64_64KEY;
5114 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
5116 /* RegisterProduct */
5117 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
5118 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5120 skip("Not enough rights to perform tests\n");
5121 goto error;
5123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5124 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5125 ok(delete_pf("msitest", FALSE), "File not installed\n");
5127 res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
5128 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5130 if (is_64bit && !is_wow64)
5132 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
5133 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5135 else
5137 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
5138 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5141 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
5142 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
5143 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
5144 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
5145 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5146 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
5147 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5148 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
5149 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
5150 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
5151 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
5152 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
5153 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
5154 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
5155 CHECK_DEL_REG_STR(hkey, "Size", NULL);
5156 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
5157 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
5158 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5159 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5160 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
5161 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
5162 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
5163 todo_wine
5165 CHECK_DEL_REG_DWORD3(hkey, "EstimatedSize", 12, -12, 4);
5168 delete_key(hkey, "", access);
5169 RegCloseKey(hkey);
5171 sprintf(keypath, userdata, usersid);
5172 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5173 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5175 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5176 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5178 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
5179 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
5180 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
5181 CHECK_DEL_REG_STR(props, "InstallDate", date);
5182 CHECK_DEL_REG_STR(props, "InstallSource", temp);
5183 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5184 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
5185 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5186 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
5187 CHECK_DEL_REG_STR(props, "Comments", NULL);
5188 CHECK_DEL_REG_STR(props, "Contact", NULL);
5189 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
5190 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
5191 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
5192 CHECK_DEL_REG_STR(props, "Readme", NULL);
5193 CHECK_DEL_REG_STR(props, "Size", NULL);
5194 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
5195 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
5196 CHECK_DEL_REG_DWORD(props, "Language", 1033);
5197 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
5198 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
5199 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
5200 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
5201 todo_wine
5203 CHECK_DEL_REG_DWORD3(props, "EstimatedSize", 12, -12, 4);
5206 delete_key(props, "", access);
5207 RegCloseKey(props);
5209 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
5210 todo_wine
5212 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5215 delete_key(usage, "", access);
5216 RegCloseKey(usage);
5217 delete_key(hkey, "", access);
5218 RegCloseKey(hkey);
5220 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
5221 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5223 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5225 delete_key(hkey, "", access);
5226 RegCloseKey(hkey);
5228 /* RegisterProduct, machine */
5229 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1");
5230 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5231 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5232 ok(delete_pf("msitest", FALSE), "File not installed\n");
5234 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, access, &hkey);
5235 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5237 if (is_64bit && !is_wow64)
5239 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
5240 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5242 else
5244 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
5245 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5248 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
5249 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
5250 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
5251 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
5252 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5253 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
5254 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5255 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
5256 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
5257 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
5258 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
5259 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
5260 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
5261 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
5262 CHECK_DEL_REG_STR(hkey, "Size", NULL);
5263 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
5264 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
5265 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5266 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5267 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
5268 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
5269 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
5270 todo_wine
5272 CHECK_DEL_REG_DWORD3(hkey, "EstimatedSize", 12, -12, 4);
5275 delete_key(hkey, "", access);
5276 RegCloseKey(hkey);
5278 sprintf(keypath, userdata, "S-1-5-18");
5279 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5280 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5282 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5283 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5285 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
5286 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
5287 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
5288 CHECK_DEL_REG_STR(props, "InstallDate", date);
5289 CHECK_DEL_REG_STR(props, "InstallSource", temp);
5290 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5291 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
5292 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5293 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
5294 CHECK_DEL_REG_STR(props, "Comments", NULL);
5295 CHECK_DEL_REG_STR(props, "Contact", NULL);
5296 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
5297 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
5298 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
5299 CHECK_DEL_REG_STR(props, "Readme", NULL);
5300 CHECK_DEL_REG_STR(props, "Size", NULL);
5301 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
5302 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
5303 CHECK_DEL_REG_DWORD(props, "Language", 1033);
5304 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
5305 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
5306 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
5307 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
5308 todo_wine
5310 CHECK_DEL_REG_DWORD3(props, "EstimatedSize", 12, -12, 4);
5313 delete_key(props, "", access);
5314 RegCloseKey(props);
5316 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
5317 todo_wine
5319 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5322 delete_key(usage, "", access);
5323 RegCloseKey(usage);
5324 delete_key(hkey, "", access);
5325 RegCloseKey(hkey);
5327 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
5328 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5330 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5332 delete_key(hkey, "", access);
5333 RegCloseKey(hkey);
5335 error:
5336 DeleteFile(msifile);
5337 DeleteFile("msitest\\maximus");
5338 RemoveDirectory("msitest");
5339 HeapFree(GetProcessHeap(), 0, usersid);
5342 static void test_publish_publishproduct(void)
5344 UINT r;
5345 LONG res;
5346 LPSTR usersid;
5347 HKEY sourcelist, net, props;
5348 HKEY hkey, patches, media;
5349 CHAR keypath[MAX_PATH];
5350 CHAR temp[MAX_PATH];
5351 CHAR path[MAX_PATH];
5352 BOOL old_installer = FALSE;
5353 REGSAM access = KEY_ALL_ACCESS;
5355 static const CHAR prodpath[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5356 "\\Installer\\UserData\\%s\\Products"
5357 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5358 static const CHAR cuprodpath[] = "Software\\Microsoft\\Installer\\Products"
5359 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5360 static const CHAR cuupgrades[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
5361 "\\51AAE0C44620A5E4788506E91F249BD2";
5362 static const CHAR badprod[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5363 "\\Installer\\Products"
5364 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5365 static const CHAR machprod[] = "Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5366 static const CHAR machup[] = "Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
5368 if (is_process_limited())
5370 skip("process is limited\n");
5371 return;
5374 if (!get_user_sid(&usersid))
5375 return;
5377 GetTempPath(MAX_PATH, temp);
5379 CreateDirectoryA("msitest", NULL);
5380 create_file("msitest\\maximus", 500);
5382 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5384 if (is_wow64)
5385 access |= KEY_WOW64_64KEY;
5387 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
5389 /* PublishProduct, current user */
5390 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
5391 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5393 skip("Not enough rights to perform tests\n");
5394 goto error;
5396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5397 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5398 ok(delete_pf("msitest", FALSE), "File not installed\n");
5400 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
5401 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5403 sprintf(keypath, prodpath, usersid);
5404 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5405 if (res == ERROR_FILE_NOT_FOUND)
5407 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
5408 if (res == ERROR_SUCCESS)
5410 win_skip("Windows Installer < 3.0 detected\n");
5411 RegCloseKey(hkey);
5412 old_installer = TRUE;
5413 goto currentuser;
5415 else
5417 win_skip("Install failed, no need to continue\n");
5418 return;
5421 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5423 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5424 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5426 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
5427 todo_wine
5429 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5430 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
5433 delete_key(patches, "", access);
5434 RegCloseKey(patches);
5435 delete_key(hkey, "", access);
5436 RegCloseKey(hkey);
5438 currentuser:
5439 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
5440 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5442 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
5443 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
5444 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5445 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5446 if (!old_installer)
5447 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
5448 CHECK_DEL_REG_DWORD(hkey, "Assignment", 0);
5449 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
5450 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
5451 CHECK_DEL_REG_STR(hkey, "Clients", ":");
5453 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
5454 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5456 lstrcpyA(path, "n;1;");
5457 lstrcatA(path, temp);
5458 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
5459 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
5461 res = RegOpenKeyA(sourcelist, "Net", &net);
5462 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5464 CHECK_DEL_REG_STR(net, "1", temp);
5466 RegDeleteKeyA(net, "");
5467 RegCloseKey(net);
5469 res = RegOpenKeyA(sourcelist, "Media", &media);
5470 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5472 CHECK_DEL_REG_STR(media, "1", "DISK1;");
5474 RegDeleteKeyA(media, "");
5475 RegCloseKey(media);
5476 RegDeleteKeyA(sourcelist, "");
5477 RegCloseKey(sourcelist);
5478 RegDeleteKeyA(hkey, "");
5479 RegCloseKey(hkey);
5481 res = RegOpenKeyA(HKEY_CURRENT_USER, cuupgrades, &hkey);
5482 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5484 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5486 RegDeleteKeyA(hkey, "");
5487 RegCloseKey(hkey);
5489 /* PublishProduct, machine */
5490 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5491 if (old_installer)
5492 goto machprod;
5493 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5494 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5495 ok(delete_pf("msitest", FALSE), "File not installed\n");
5497 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
5498 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5500 sprintf(keypath, prodpath, "S-1-5-18");
5501 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5502 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5504 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5505 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5507 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
5508 todo_wine
5510 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5511 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
5514 delete_key(patches, "", access);
5515 RegCloseKey(patches);
5516 delete_key(hkey, "", access);
5517 RegCloseKey(hkey);
5519 machprod:
5520 res = RegOpenKeyA(HKEY_CLASSES_ROOT, machprod, &hkey);
5521 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5523 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
5524 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
5525 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5526 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5527 if (!old_installer)
5528 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
5529 todo_wine CHECK_DEL_REG_DWORD(hkey, "Assignment", 1);
5530 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
5531 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
5532 CHECK_DEL_REG_STR(hkey, "Clients", ":");
5534 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
5535 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5537 lstrcpyA(path, "n;1;");
5538 lstrcatA(path, temp);
5539 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
5540 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
5542 res = RegOpenKeyA(sourcelist, "Net", &net);
5543 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5545 CHECK_DEL_REG_STR(net, "1", temp);
5547 RegDeleteKeyA(net, "");
5548 RegCloseKey(net);
5550 res = RegOpenKeyA(sourcelist, "Media", &media);
5551 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5553 CHECK_DEL_REG_STR(media, "1", "DISK1;");
5555 RegDeleteKeyA(media, "");
5556 RegCloseKey(media);
5557 RegDeleteKeyA(sourcelist, "");
5558 RegCloseKey(sourcelist);
5559 RegDeleteKeyA(hkey, "");
5560 RegCloseKey(hkey);
5562 res = RegOpenKeyA(HKEY_CLASSES_ROOT, machup, &hkey);
5563 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5565 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5567 RegDeleteKeyA(hkey, "");
5568 RegCloseKey(hkey);
5570 error:
5571 DeleteFile(msifile);
5572 DeleteFile("msitest\\maximus");
5573 RemoveDirectory("msitest");
5574 HeapFree(GetProcessHeap(), 0, usersid);
5577 static void test_publish_publishfeatures(void)
5579 UINT r;
5580 LONG res;
5581 HKEY hkey;
5582 LPSTR usersid;
5583 CHAR keypath[MAX_PATH];
5584 REGSAM access = KEY_ALL_ACCESS;
5586 static const CHAR cupath[] = "Software\\Microsoft\\Installer\\Features"
5587 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5588 static const CHAR udpath[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5589 "\\Installer\\UserData\\%s\\Products"
5590 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
5591 static const CHAR featkey[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5592 "\\Installer\\Features";
5593 static const CHAR classfeat[] = "Software\\Classes\\Installer\\Features"
5594 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5596 if (is_process_limited())
5598 skip("process is limited\n");
5599 return;
5602 if (!get_user_sid(&usersid))
5603 return;
5605 CreateDirectoryA("msitest", NULL);
5606 create_file("msitest\\maximus", 500);
5608 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5610 if (is_wow64)
5611 access |= KEY_WOW64_64KEY;
5613 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
5615 /* PublishFeatures, current user */
5616 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
5617 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5619 skip("Not enough rights to perform tests\n");
5620 goto error;
5622 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5623 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5624 ok(delete_pf("msitest", FALSE), "File not installed\n");
5626 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
5627 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5629 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
5630 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5632 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
5633 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5635 CHECK_REG_STR(hkey, "feature", "");
5636 CHECK_REG_STR(hkey, "montecristo", "");
5638 RegDeleteValueA(hkey, "feature");
5639 RegDeleteValueA(hkey, "montecristo");
5640 RegDeleteKeyA(hkey, "");
5641 RegCloseKey(hkey);
5643 sprintf(keypath, udpath, usersid);
5644 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5645 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5647 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
5648 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
5650 RegDeleteValueA(hkey, "feature");
5651 RegDeleteValueA(hkey, "montecristo");
5652 RegDeleteKeyA(hkey, "");
5653 RegCloseKey(hkey);
5655 /* PublishFeatures, machine */
5656 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
5657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5658 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5659 ok(delete_pf("msitest", FALSE), "File not installed\n");
5661 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
5662 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5664 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
5665 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5667 res = RegOpenKeyA(HKEY_LOCAL_MACHINE, classfeat, &hkey);
5668 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5670 CHECK_REG_STR(hkey, "feature", "");
5671 CHECK_REG_STR(hkey, "montecristo", "");
5673 RegDeleteValueA(hkey, "feature");
5674 RegDeleteValueA(hkey, "montecristo");
5675 RegDeleteKeyA(hkey, "");
5676 RegCloseKey(hkey);
5678 sprintf(keypath, udpath, "S-1-5-18");
5679 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5680 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5682 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
5683 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
5685 RegDeleteValueA(hkey, "feature");
5686 RegDeleteValueA(hkey, "montecristo");
5687 RegDeleteKeyA(hkey, "");
5688 RegCloseKey(hkey);
5690 error:
5691 DeleteFile(msifile);
5692 DeleteFile("msitest\\maximus");
5693 RemoveDirectory("msitest");
5694 HeapFree(GetProcessHeap(), 0, usersid);
5697 static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
5699 DWORD len = 0;
5700 LPSTR val;
5701 LONG r;
5703 r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
5704 if (r != ERROR_SUCCESS)
5705 return NULL;
5707 len += sizeof (WCHAR);
5708 val = HeapAlloc(GetProcessHeap(), 0, len);
5709 if (!val) return NULL;
5710 val[0] = 0;
5711 RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len);
5712 return val;
5715 static void get_owner_company(LPSTR *owner, LPSTR *company)
5717 LONG res;
5718 HKEY hkey;
5719 REGSAM access = KEY_ALL_ACCESS;
5721 *owner = *company = NULL;
5723 if (is_wow64)
5724 access |= KEY_WOW64_64KEY;
5726 res = RegOpenKeyA(HKEY_CURRENT_USER,
5727 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
5728 if (res == ERROR_SUCCESS)
5730 *owner = reg_get_val_str(hkey, "DefName");
5731 *company = reg_get_val_str(hkey, "DefCompany");
5732 RegCloseKey(hkey);
5735 if (!*owner || !*company)
5737 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
5738 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
5739 if (res == ERROR_SUCCESS)
5741 *owner = reg_get_val_str(hkey, "RegisteredOwner");
5742 *company = reg_get_val_str(hkey, "RegisteredOrganization");
5743 RegCloseKey(hkey);
5747 if (!*owner || !*company)
5749 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
5750 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
5751 if (res == ERROR_SUCCESS)
5753 *owner = reg_get_val_str(hkey, "RegisteredOwner");
5754 *company = reg_get_val_str(hkey, "RegisteredOrganization");
5755 RegCloseKey(hkey);
5760 static void test_publish_registeruser(void)
5762 UINT r;
5763 LONG res;
5764 HKEY props;
5765 LPSTR usersid;
5766 LPSTR owner, company;
5767 CHAR keypath[MAX_PATH];
5768 REGSAM access = KEY_ALL_ACCESS;
5770 static const CHAR keyfmt[] =
5771 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
5772 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
5774 if (is_process_limited())
5776 skip("process is limited\n");
5777 return;
5780 if (!get_user_sid(&usersid))
5781 return;
5783 get_owner_company(&owner, &company);
5785 CreateDirectoryA("msitest", NULL);
5786 create_file("msitest\\maximus", 500);
5788 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5790 if (is_wow64)
5791 access |= KEY_WOW64_64KEY;
5793 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5795 /* RegisterUser, per-user */
5796 r = MsiInstallProductA(msifile, "REGISTER_USER=1");
5797 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5799 skip("Not enough rights to perform tests\n");
5800 goto error;
5802 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5803 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5804 ok(delete_pf("msitest", FALSE), "File not installed\n");
5806 sprintf(keypath, keyfmt, usersid);
5807 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
5808 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5810 CHECK_REG_STR(props, "ProductID", "none");
5811 CHECK_REG_STR(props, "RegCompany", company);
5812 CHECK_REG_STR(props, "RegOwner", owner);
5814 RegDeleteValueA(props, "ProductID");
5815 RegDeleteValueA(props, "RegCompany");
5816 RegDeleteValueA(props, "RegOwner");
5817 delete_key(props, "", access);
5818 RegCloseKey(props);
5820 /* RegisterUser, machine */
5821 r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
5822 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5823 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5824 ok(delete_pf("msitest", FALSE), "File not installed\n");
5826 sprintf(keypath, keyfmt, "S-1-5-18");
5827 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
5828 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5830 CHECK_REG_STR(props, "ProductID", "none");
5831 CHECK_REG_STR(props, "RegCompany", company);
5832 CHECK_REG_STR(props, "RegOwner", owner);
5834 RegDeleteValueA(props, "ProductID");
5835 RegDeleteValueA(props, "RegCompany");
5836 RegDeleteValueA(props, "RegOwner");
5837 delete_key(props, "", access);
5838 RegCloseKey(props);
5840 error:
5841 HeapFree(GetProcessHeap(), 0, company);
5842 HeapFree(GetProcessHeap(), 0, owner);
5844 DeleteFile(msifile);
5845 DeleteFile("msitest\\maximus");
5846 RemoveDirectory("msitest");
5847 LocalFree(usersid);
5850 static void test_publish_processcomponents(void)
5852 UINT r;
5853 LONG res;
5854 DWORD size;
5855 HKEY comp, hkey;
5856 LPSTR usersid;
5857 CHAR val[MAX_PATH];
5858 CHAR keypath[MAX_PATH];
5859 CHAR program_files_maximus[MAX_PATH];
5860 REGSAM access = KEY_ALL_ACCESS;
5862 static const CHAR keyfmt[] =
5863 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
5864 "UserData\\%s\\Components\\%s";
5865 static const CHAR compkey[] =
5866 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
5868 if (is_process_limited())
5870 skip("process is limited\n");
5871 return;
5874 if (!get_user_sid(&usersid))
5875 return;
5877 CreateDirectoryA("msitest", NULL);
5878 create_file("msitest\\maximus", 500);
5880 create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table));
5882 if (is_wow64)
5883 access |= KEY_WOW64_64KEY;
5885 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5887 /* ProcessComponents, per-user */
5888 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
5889 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5891 skip("Not enough rights to perform tests\n");
5892 goto error;
5894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5895 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5896 ok(delete_pf("msitest", FALSE), "File not installed\n");
5898 sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
5899 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5900 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5902 size = MAX_PATH;
5903 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5904 NULL, NULL, (LPBYTE)val, &size);
5905 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5907 lstrcpyA(program_files_maximus,PROG_FILES_DIR);
5908 lstrcatA(program_files_maximus,"\\msitest\\maximus");
5910 ok(!lstrcmpiA(val, program_files_maximus),
5911 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
5913 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5914 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5916 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5917 delete_key(comp, "", access);
5918 RegCloseKey(comp);
5920 sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
5921 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5922 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5924 size = MAX_PATH;
5925 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5926 NULL, NULL, (LPBYTE)val, &size);
5927 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5928 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
5929 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
5931 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5932 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5934 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5935 delete_key(comp, "", access);
5936 RegCloseKey(comp);
5938 /* ProcessComponents, machine */
5939 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
5940 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5941 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5942 ok(delete_pf("msitest", FALSE), "File not installed\n");
5944 sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
5945 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5946 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5948 size = MAX_PATH;
5949 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5950 NULL, NULL, (LPBYTE)val, &size);
5951 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5952 ok(!lstrcmpiA(val, program_files_maximus),
5953 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
5955 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5956 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5958 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5959 delete_key(comp, "", access);
5960 RegCloseKey(comp);
5962 sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
5963 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5964 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5966 size = MAX_PATH;
5967 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5968 NULL, NULL, (LPBYTE)val, &size);
5969 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5970 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
5971 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
5973 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5974 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5976 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5977 delete_key(comp, "", access);
5978 RegCloseKey(comp);
5980 error:
5981 DeleteFile(msifile);
5982 DeleteFile("msitest\\maximus");
5983 RemoveDirectory("msitest");
5984 LocalFree(usersid);
5987 static void test_publish(void)
5989 UINT r;
5990 LONG res;
5991 HKEY uninstall, prodkey, uninstall_32node = NULL;
5992 INSTALLSTATE state;
5993 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
5994 char date[MAX_PATH], temp[MAX_PATH];
5995 REGSAM access = KEY_ALL_ACCESS;
5997 static const CHAR subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
5998 static const CHAR subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
6000 if (!pMsiQueryComponentStateA)
6002 win_skip("MsiQueryComponentStateA is not available\n");
6003 return;
6005 if (is_process_limited())
6007 skip("process is limited\n");
6008 return;
6011 get_date_str(date);
6012 GetTempPath(MAX_PATH, temp);
6014 if (is_wow64)
6015 access |= KEY_WOW64_64KEY;
6017 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
6018 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6020 if (is_64bit)
6022 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
6023 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6026 CreateDirectoryA("msitest", NULL);
6027 create_file("msitest\\maximus", 500);
6029 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
6031 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6033 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6034 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6036 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6037 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6039 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6040 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6042 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6043 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6044 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6045 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6047 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6048 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6050 /* nothing published */
6051 r = MsiInstallProductA(msifile, NULL);
6052 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6054 skip("Not enough rights to perform tests\n");
6055 goto error;
6057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6058 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6059 ok(pf_exists("msitest"), "File not installed\n");
6061 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6062 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6064 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6065 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6067 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6068 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6070 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6071 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6072 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6073 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6075 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6076 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6078 /* PublishProduct and RegisterProduct */
6079 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
6080 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6081 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6082 ok(pf_exists("msitest"), "File not installed\n");
6084 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6085 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6087 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6088 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6090 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6091 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6093 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6094 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6095 ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
6096 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6098 if (is_64bit && !is_wow64)
6100 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6101 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6103 else
6105 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6106 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6109 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6110 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6111 CHECK_REG_STR(prodkey, "InstallDate", date);
6112 CHECK_REG_STR(prodkey, "InstallSource", temp);
6113 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6114 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6115 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6116 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6117 CHECK_REG_STR(prodkey, "Comments", NULL);
6118 CHECK_REG_STR(prodkey, "Contact", NULL);
6119 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6120 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6121 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6122 CHECK_REG_STR(prodkey, "Readme", NULL);
6123 CHECK_REG_STR(prodkey, "Size", NULL);
6124 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6125 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6126 CHECK_REG_DWORD(prodkey, "Language", 1033);
6127 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6128 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6129 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6130 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6131 todo_wine
6133 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6136 RegCloseKey(prodkey);
6138 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
6139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6140 ok(pf_exists("msitest\\maximus"), "File deleted\n");
6141 ok(pf_exists("msitest"), "File deleted\n");
6143 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6144 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6146 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6147 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6149 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6150 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6152 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6153 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6154 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6155 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6157 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6158 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6160 /* complete install */
6161 r = MsiInstallProductA(msifile, "FULL=1");
6162 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6163 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6164 ok(pf_exists("msitest"), "File not installed\n");
6166 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6167 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6169 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6170 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6172 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6173 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6175 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6176 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6177 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6178 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6180 if (is_64bit && !is_wow64)
6182 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6183 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6185 else
6187 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6188 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6191 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6192 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6193 CHECK_REG_STR(prodkey, "InstallDate", date);
6194 CHECK_REG_STR(prodkey, "InstallSource", temp);
6195 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6196 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6197 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6198 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6199 CHECK_REG_STR(prodkey, "Comments", NULL);
6200 CHECK_REG_STR(prodkey, "Contact", NULL);
6201 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6202 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6203 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6204 CHECK_REG_STR(prodkey, "Readme", NULL);
6205 CHECK_REG_STR(prodkey, "Size", NULL);
6206 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6207 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6208 CHECK_REG_DWORD(prodkey, "Language", 1033);
6209 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6210 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6211 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6212 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6213 todo_wine
6215 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6218 RegCloseKey(prodkey);
6220 /* no UnpublishFeatures */
6221 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6222 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6223 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6224 ok(!pf_exists("msitest"), "Directory not deleted\n");
6226 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6227 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6229 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6230 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6232 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6233 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6235 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6236 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6237 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6238 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6240 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6241 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6243 /* complete install */
6244 r = MsiInstallProductA(msifile, "FULL=1");
6245 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6246 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6247 ok(pf_exists("msitest"), "File not installed\n");
6249 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6250 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6252 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6253 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6255 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6256 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6258 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6259 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6260 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6261 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6263 if (is_64bit && !is_wow64)
6265 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6266 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6268 else
6270 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6271 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6274 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6275 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6276 CHECK_REG_STR(prodkey, "InstallDate", date);
6277 CHECK_REG_STR(prodkey, "InstallSource", temp);
6278 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6279 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6280 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6281 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6282 CHECK_REG_STR(prodkey, "Comments", NULL);
6283 CHECK_REG_STR(prodkey, "Contact", NULL);
6284 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6285 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6286 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6287 CHECK_REG_STR(prodkey, "Readme", NULL);
6288 CHECK_REG_STR(prodkey, "Size", NULL);
6289 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6290 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6291 CHECK_REG_DWORD(prodkey, "Language", 1033);
6292 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6293 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6294 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6295 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6296 todo_wine
6298 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6301 RegCloseKey(prodkey);
6303 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
6304 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
6305 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6306 ok(pf_exists("msitest\\maximus"), "File deleted\n");
6307 ok(pf_exists("msitest"), "Directory deleted\n");
6309 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6310 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6312 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6313 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6315 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6316 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6318 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6319 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6321 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6323 if (is_64bit && !is_wow64)
6325 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6326 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6328 else
6330 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6331 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6334 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6335 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6336 CHECK_REG_STR(prodkey, "InstallDate", date);
6337 CHECK_REG_STR(prodkey, "InstallSource", temp);
6338 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6339 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6340 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6341 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6342 CHECK_REG_STR(prodkey, "Comments", NULL);
6343 CHECK_REG_STR(prodkey, "Contact", NULL);
6344 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6345 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6346 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6347 CHECK_REG_STR(prodkey, "Readme", NULL);
6348 CHECK_REG_STR(prodkey, "Size", NULL);
6349 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6350 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6351 CHECK_REG_DWORD(prodkey, "Language", 1033);
6352 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6353 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6354 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6355 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6356 todo_wine
6358 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6361 RegCloseKey(prodkey);
6363 /* complete install */
6364 r = MsiInstallProductA(msifile, "FULL=1");
6365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6366 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6367 ok(pf_exists("msitest"), "File not installed\n");
6369 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6370 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6372 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6373 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6375 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6376 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6378 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6379 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6380 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6381 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6383 if (is_64bit && !is_wow64)
6385 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6386 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6388 else
6390 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6391 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6394 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6395 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6396 CHECK_REG_STR(prodkey, "InstallDate", date);
6397 CHECK_REG_STR(prodkey, "InstallSource", temp);
6398 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6399 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6400 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6401 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6402 CHECK_REG_STR(prodkey, "Comments", NULL);
6403 CHECK_REG_STR(prodkey, "Contact", NULL);
6404 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6405 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6406 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6407 CHECK_REG_STR(prodkey, "Readme", NULL);
6408 CHECK_REG_STR(prodkey, "Size", NULL);
6409 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6410 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6411 CHECK_REG_DWORD(prodkey, "Language", 1033);
6412 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6413 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6414 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6415 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6416 todo_wine
6418 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -20);
6421 RegCloseKey(prodkey);
6423 /* UnpublishFeatures, both features removed */
6424 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
6425 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6426 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6427 ok(!pf_exists("msitest"), "Directory not deleted\n");
6429 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6430 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6432 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6433 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6435 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6436 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6438 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6439 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6440 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6441 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6443 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6444 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6446 /* complete install */
6447 r = MsiInstallProductA(msifile, "FULL=1");
6448 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6449 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6450 ok(pf_exists("msitest"), "File not installed\n");
6452 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6453 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6455 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6456 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6458 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6459 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6461 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6462 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6464 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6466 if (is_64bit && !is_wow64)
6468 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6469 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6471 else
6473 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6474 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6477 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6478 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6479 CHECK_REG_STR(prodkey, "InstallDate", date);
6480 CHECK_REG_STR(prodkey, "InstallSource", temp);
6481 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6482 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6483 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6484 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6485 CHECK_REG_STR(prodkey, "Comments", NULL);
6486 CHECK_REG_STR(prodkey, "Contact", NULL);
6487 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6488 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6489 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6490 CHECK_REG_STR(prodkey, "Readme", NULL);
6491 CHECK_REG_STR(prodkey, "Size", NULL);
6492 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6493 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6494 CHECK_REG_DWORD(prodkey, "Language", 1033);
6495 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6496 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6497 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6498 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6499 todo_wine
6501 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6504 RegCloseKey(prodkey);
6506 /* complete uninstall */
6507 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
6508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6509 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6510 ok(!pf_exists("msitest"), "Directory not deleted\n");
6512 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6513 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6515 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6516 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6518 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6519 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6521 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6522 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6523 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6524 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6526 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6527 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6529 /* make sure 'Program Files\msitest' is removed */
6530 delete_pfmsitest_files();
6532 error:
6533 RegCloseKey(uninstall);
6534 RegCloseKey(uninstall_32node);
6535 DeleteFile(msifile);
6536 DeleteFile("msitest\\maximus");
6537 RemoveDirectory("msitest");
6540 static void test_publishsourcelist(void)
6542 UINT r;
6543 DWORD size;
6544 CHAR value[MAX_PATH];
6545 CHAR path[MAX_PATH];
6546 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
6548 if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
6550 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
6551 return;
6553 if (is_process_limited())
6555 skip("process is limited\n");
6556 return;
6559 CreateDirectoryA("msitest", NULL);
6560 create_file("msitest\\maximus", 500);
6562 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
6564 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6566 r = MsiInstallProductA(msifile, NULL);
6567 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6569 skip("Not enough rights to perform tests\n");
6570 goto error;
6572 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6573 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6574 ok(pf_exists("msitest"), "File not installed\n");
6576 /* nothing published */
6577 size = MAX_PATH;
6578 lstrcpyA(value, "aaa");
6579 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6580 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6581 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6582 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6583 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6585 size = MAX_PATH;
6586 lstrcpyA(value, "aaa");
6587 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6588 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6589 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6590 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6591 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6593 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
6594 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6595 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6596 ok(pf_exists("msitest"), "File not installed\n");
6598 /* after RegisterProduct */
6599 size = MAX_PATH;
6600 lstrcpyA(value, "aaa");
6601 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6602 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6603 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6604 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6605 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6607 size = MAX_PATH;
6608 lstrcpyA(value, "aaa");
6609 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6610 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6611 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6612 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6613 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6615 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
6616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6617 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6618 ok(pf_exists("msitest"), "File not installed\n");
6620 /* after ProcessComponents */
6621 size = MAX_PATH;
6622 lstrcpyA(value, "aaa");
6623 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6624 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6625 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6626 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6627 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6629 size = MAX_PATH;
6630 lstrcpyA(value, "aaa");
6631 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6632 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6633 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6634 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6635 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6637 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
6638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6639 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6640 ok(pf_exists("msitest"), "File not installed\n");
6642 /* after PublishFeatures */
6643 size = MAX_PATH;
6644 lstrcpyA(value, "aaa");
6645 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6646 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6647 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6648 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6649 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6651 size = MAX_PATH;
6652 lstrcpyA(value, "aaa");
6653 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6654 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6655 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6656 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6657 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6659 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
6660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6661 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6662 ok(pf_exists("msitest"), "File not installed\n");
6664 /* after PublishProduct */
6665 size = MAX_PATH;
6666 lstrcpyA(value, "aaa");
6667 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6668 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6669 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6670 ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
6671 ok(size == 11, "Expected 11, got %d\n", size);
6673 size = MAX_PATH;
6674 lstrcpyA(value, "aaa");
6675 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6676 MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATH, value, &size);
6677 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6678 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
6679 ok(size == 0, "Expected 0, got %d\n", size);
6681 size = MAX_PATH;
6682 lstrcpyA(value, "aaa");
6683 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6684 MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPT, value, &size);
6685 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6686 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
6687 ok(size == 0, "Expected 0, got %d\n", size);
6689 lstrcpyA(path, CURR_DIR);
6690 lstrcatA(path, "\\");
6692 size = MAX_PATH;
6693 lstrcpyA(value, "aaa");
6694 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6695 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
6696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6697 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
6698 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
6700 size = MAX_PATH;
6701 lstrcpyA(value, "aaa");
6702 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6703 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPE, value, &size);
6704 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6705 ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
6706 ok(size == 1, "Expected 1, got %d\n", size);
6708 size = MAX_PATH;
6709 lstrcpyA(value, "aaa");
6710 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6711 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6712 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
6713 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
6714 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
6716 size = MAX_PATH;
6717 lstrcpyA(value, "aaa");
6718 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6719 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
6720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6721 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
6722 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
6724 size = MAX_PATH;
6725 lstrcpyA(value, "aaa");
6726 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6727 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
6728 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
6729 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
6730 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
6732 /* complete uninstall */
6733 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
6734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6735 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6736 ok(!pf_exists("msitest"), "Directory not deleted\n");
6738 /* make sure 'Program Files\msitest' is removed */
6739 delete_pfmsitest_files();
6741 error:
6742 DeleteFile(msifile);
6743 DeleteFile("msitest\\maximus");
6744 RemoveDirectory("msitest");
6747 static UINT run_query(MSIHANDLE hdb, MSIHANDLE hrec, const char *query)
6749 MSIHANDLE hview = 0;
6750 UINT r;
6752 r = MsiDatabaseOpenView(hdb, query, &hview);
6753 if(r != ERROR_SUCCESS)
6754 return r;
6756 r = MsiViewExecute(hview, hrec);
6757 if(r == ERROR_SUCCESS)
6758 r = MsiViewClose(hview);
6759 MsiCloseHandle(hview);
6760 return r;
6763 static void set_transform_summary_info(void)
6765 UINT r;
6766 MSIHANDLE suminfo = 0;
6768 /* build summary info */
6769 r = MsiGetSummaryInformation(0, mstfile, 3, &suminfo);
6770 ok(r == ERROR_SUCCESS , "Failed to open summaryinfo\n");
6772 r = MsiSummaryInfoSetProperty(suminfo, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
6773 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
6775 r = MsiSummaryInfoSetProperty(suminfo, PID_REVNUMBER, VT_LPSTR, 0, NULL,
6776 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
6777 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
6778 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
6779 ok(r == ERROR_SUCCESS , "Failed to set summary info\n");
6781 r = MsiSummaryInfoSetProperty(suminfo, PID_PAGECOUNT, VT_I4, 100, NULL, NULL);
6782 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
6784 r = MsiSummaryInfoPersist(suminfo);
6785 ok(r == ERROR_SUCCESS , "Failed to make summary info persist\n");
6787 r = MsiCloseHandle(suminfo);
6788 ok(r == ERROR_SUCCESS , "Failed to close suminfo\n");
6791 static void generate_transform(void)
6793 MSIHANDLE hdb1, hdb2;
6794 LPCSTR query;
6795 UINT r;
6797 /* start with two identical databases */
6798 CopyFile(msifile, msifile2, FALSE);
6800 r = MsiOpenDatabase(msifile2, MSIDBOPEN_TRANSACT, &hdb1);
6801 ok(r == ERROR_SUCCESS , "Failed to create database\n");
6803 r = MsiDatabaseCommit(hdb1);
6804 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
6806 r = MsiOpenDatabase(msifile, MSIDBOPEN_READONLY, &hdb2);
6807 ok(r == ERROR_SUCCESS , "Failed to create database\n");
6809 query = "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
6810 r = run_query(hdb1, 0, query);
6811 ok(r == ERROR_SUCCESS, "failed to add property\n");
6813 /* database needs to be committed */
6814 MsiDatabaseCommit(hdb1);
6816 r = MsiDatabaseGenerateTransform(hdb1, hdb2, mstfile, 0, 0);
6817 ok(r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r);
6819 #if 0 /* not implemented in wine yet */
6820 r = MsiCreateTransformSummaryInfo(hdb2, hdb2, mstfile, 0, 0);
6821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6822 #endif
6824 MsiCloseHandle(hdb1);
6825 MsiCloseHandle(hdb2);
6828 /* data for generating a transform */
6830 /* tables transform names - encoded as they would be in an msi database file */
6831 static const WCHAR name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
6832 static const WCHAR name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
6833 static const WCHAR name3[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
6835 /* data in each table */
6836 static const char data1[] = /* _StringData */
6837 "propval"; /* all the strings squashed together */
6839 static const WCHAR data2[] = { /* _StringPool */
6840 /* len, refs */
6841 0, 0, /* string 0 '' */
6842 4, 1, /* string 1 'prop' */
6843 3, 1, /* string 2 'val' */
6846 static const WCHAR data3[] = { /* Property */
6847 0x0201, 0x0001, 0x0002,
6850 static const struct {
6851 LPCWSTR name;
6852 const void *data;
6853 DWORD size;
6854 } table_transform_data[] =
6856 { name1, data1, sizeof data1 - 1 },
6857 { name2, data2, sizeof data2 },
6858 { name3, data3, sizeof data3 },
6861 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
6863 static void generate_transform_manual(void)
6865 IStorage *stg = NULL;
6866 IStream *stm;
6867 WCHAR name[0x20];
6868 HRESULT r;
6869 DWORD i, count;
6870 const DWORD mode = STGM_CREATE|STGM_READWRITE|STGM_DIRECT|STGM_SHARE_EXCLUSIVE;
6872 const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
6874 MultiByteToWideChar(CP_ACP, 0, mstfile, -1, name, 0x20);
6876 r = StgCreateDocfile(name, mode, 0, &stg);
6877 ok(r == S_OK, "failed to create storage\n");
6878 if (!stg)
6879 return;
6881 r = IStorage_SetClass(stg, &CLSID_MsiTransform);
6882 ok(r == S_OK, "failed to set storage type\n");
6884 for (i=0; i<NUM_TRANSFORM_TABLES; i++)
6886 r = IStorage_CreateStream(stg, table_transform_data[i].name,
6887 STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
6888 if (FAILED(r))
6890 ok(0, "failed to create stream %08x\n", r);
6891 continue;
6894 r = IStream_Write(stm, table_transform_data[i].data,
6895 table_transform_data[i].size, &count);
6896 if (FAILED(r) || count != table_transform_data[i].size)
6897 ok(0, "failed to write stream\n");
6898 IStream_Release(stm);
6901 IStorage_Release(stg);
6903 set_transform_summary_info();
6906 static void test_transformprop(void)
6908 UINT r;
6910 if (is_process_limited())
6912 skip("process is limited\n");
6913 return;
6916 CreateDirectoryA("msitest", NULL);
6917 create_file("msitest\\augustus", 500);
6919 create_database(msifile, tp_tables, sizeof(tp_tables) / sizeof(msi_table));
6921 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6923 r = MsiInstallProductA(msifile, NULL);
6924 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6926 skip("Not enough rights to perform tests\n");
6927 goto error;
6929 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6930 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
6931 ok(!delete_pf("msitest", FALSE), "File installed\n");
6933 if (0)
6934 generate_transform();
6935 else
6936 generate_transform_manual();
6938 r = MsiInstallProductA(msifile, "TRANSFORMS=winetest.mst");
6939 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6940 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
6941 ok(delete_pf("msitest", FALSE), "File not installed\n");
6943 error:
6944 /* Delete the files in the temp (current) folder */
6945 DeleteFile(msifile);
6946 DeleteFile(msifile2);
6947 DeleteFile(mstfile);
6948 DeleteFile("msitest\\augustus");
6949 RemoveDirectory("msitest");
6952 static void test_currentworkingdir(void)
6954 UINT r;
6955 CHAR drive[MAX_PATH], path[MAX_PATH];
6956 LPSTR ptr;
6958 if (is_process_limited())
6960 skip("process is limited\n");
6961 return;
6964 CreateDirectoryA("msitest", NULL);
6965 create_file("msitest\\augustus", 500);
6967 create_database(msifile, cwd_tables, sizeof(cwd_tables) / sizeof(msi_table));
6969 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6971 CreateDirectoryA("diffdir", NULL);
6972 SetCurrentDirectoryA("diffdir");
6974 sprintf(path, "..\\%s", msifile);
6975 r = MsiInstallProductA(path, NULL);
6976 todo_wine
6978 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
6979 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
6980 ok(!delete_pf("msitest", FALSE), "File installed\n");
6983 sprintf(path, "%s\\%s", CURR_DIR, msifile);
6984 r = MsiInstallProductA(path, NULL);
6985 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6987 skip("Not enough rights to perform tests\n");
6988 goto error;
6990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6991 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
6992 ok(delete_pf("msitest", FALSE), "File not installed\n");
6994 lstrcpyA(drive, CURR_DIR);
6995 drive[2] = '\\';
6996 drive[3] = '\0';
6997 SetCurrentDirectoryA(drive);
6999 lstrcpy(path, CURR_DIR);
7000 if (path[lstrlenA(path) - 1] != '\\')
7001 lstrcatA(path, "\\");
7002 lstrcatA(path, msifile);
7003 ptr = strchr(path, ':');
7004 ptr +=2;
7006 r = MsiInstallProductA(ptr, NULL);
7007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7008 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
7009 ok(delete_pf("msitest", FALSE), "File not installed\n");
7011 error:
7012 SetCurrentDirectoryA(CURR_DIR);
7013 DeleteFile(msifile);
7014 DeleteFile("msitest\\augustus");
7015 RemoveDirectory("msitest");
7016 RemoveDirectory("diffdir");
7019 static void set_admin_summary_info(const CHAR *name)
7021 MSIHANDLE db, summary;
7022 UINT r;
7024 r = MsiOpenDatabaseA(name, MSIDBOPEN_DIRECT, &db);
7025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7027 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
7028 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7030 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, 5, NULL, NULL);
7031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7033 /* write the summary changes back to the stream */
7034 r = MsiSummaryInfoPersist(summary);
7035 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7037 MsiCloseHandle(summary);
7039 r = MsiDatabaseCommit(db);
7040 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7042 MsiCloseHandle(db);
7045 static void test_admin(void)
7047 UINT r;
7049 CreateDirectoryA("msitest", NULL);
7050 create_file("msitest\\augustus", 500);
7052 create_database(msifile, adm_tables, sizeof(adm_tables) / sizeof(msi_table));
7053 set_admin_summary_info(msifile);
7055 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7057 r = MsiInstallProductA(msifile, NULL);
7058 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7060 skip("Not enough rights to perform tests\n");
7061 goto error;
7063 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7064 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7065 ok(!delete_pf("msitest", FALSE), "File installed\n");
7066 ok(!DeleteFile("c:\\msitest\\augustus"), "File installed\n");
7067 ok(!RemoveDirectory("c:\\msitest"), "File installed\n");
7069 r = MsiInstallProductA(msifile, "ACTION=ADMIN");
7070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7071 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7072 ok(!delete_pf("msitest", FALSE), "File installed\n");
7073 todo_wine
7075 ok(DeleteFile("c:\\msitest\\augustus"), "File not installed\n");
7076 ok(RemoveDirectory("c:\\msitest"), "File not installed\n");
7079 error:
7080 DeleteFile(msifile);
7081 DeleteFile("msitest\\augustus");
7082 RemoveDirectory("msitest");
7085 static void set_admin_property_stream(LPCSTR file)
7087 IStorage *stg;
7088 IStream *stm;
7089 WCHAR fileW[MAX_PATH];
7090 HRESULT hr;
7091 DWORD count;
7092 const DWORD mode = STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
7094 /* AdminProperties */
7095 static const WCHAR stmname[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
7096 static const WCHAR data[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
7097 'M','y','P','r','o','p','=','4','2',0};
7099 MultiByteToWideChar(CP_ACP, 0, file, -1, fileW, MAX_PATH);
7101 hr = StgOpenStorage(fileW, NULL, mode, NULL, 0, &stg);
7102 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
7103 if (!stg)
7104 return;
7106 hr = IStorage_CreateStream(stg, stmname, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
7107 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
7109 hr = IStream_Write(stm, data, sizeof(data), &count);
7110 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
7112 IStream_Release(stm);
7113 IStorage_Release(stg);
7116 static void test_adminprops(void)
7118 UINT r;
7120 if (is_process_limited())
7122 skip("process is limited\n");
7123 return;
7126 CreateDirectoryA("msitest", NULL);
7127 create_file("msitest\\augustus", 500);
7129 create_database(msifile, amp_tables, sizeof(amp_tables) / sizeof(msi_table));
7130 set_admin_summary_info(msifile);
7131 set_admin_property_stream(msifile);
7133 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7135 r = MsiInstallProductA(msifile, NULL);
7136 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7138 skip("Not enough rights to perform tests\n");
7139 goto error;
7141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7142 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
7143 ok(delete_pf("msitest", FALSE), "File installed\n");
7145 error:
7146 DeleteFile(msifile);
7147 DeleteFile("msitest\\augustus");
7148 RemoveDirectory("msitest");
7151 static void create_pf_data(LPCSTR file, LPCSTR data, BOOL is_file)
7153 CHAR path[MAX_PATH];
7155 lstrcpyA(path, PROG_FILES_DIR);
7156 lstrcatA(path, "\\");
7157 lstrcatA(path, file);
7159 if (is_file)
7160 create_file_data(path, data, 500);
7161 else
7162 CreateDirectoryA(path, NULL);
7165 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
7167 static void test_removefiles(void)
7169 UINT r;
7171 if (is_process_limited())
7173 skip("process is limited\n");
7174 return;
7177 CreateDirectoryA("msitest", NULL);
7178 create_file("msitest\\hydrogen", 500);
7179 create_file("msitest\\helium", 500);
7180 create_file("msitest\\lithium", 500);
7182 create_database(msifile, rem_tables, sizeof(rem_tables) / sizeof(msi_table));
7184 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7186 r = MsiInstallProductA(msifile, NULL);
7187 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7189 skip("Not enough rights to perform tests\n");
7190 goto error;
7192 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7193 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
7194 ok(!pf_exists("msitest\\helium"), "File installed\n");
7195 ok(pf_exists("msitest\\lithium"), "File not installed\n");
7196 ok(pf_exists("msitest"), "File not installed\n");
7198 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7200 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
7201 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
7202 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
7203 ok(delete_pf("msitest", FALSE), "File deleted\n");
7205 create_pf("msitest", FALSE);
7206 create_pf("msitest\\hydrogen", TRUE);
7207 create_pf("msitest\\helium", TRUE);
7208 create_pf("msitest\\lithium", TRUE);
7210 r = MsiInstallProductA(msifile, NULL);
7211 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7212 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
7213 ok(pf_exists("msitest\\helium"), "File not installed\n");
7214 ok(pf_exists("msitest\\lithium"), "File not installed\n");
7215 ok(pf_exists("msitest"), "File not installed\n");
7217 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7218 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7219 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
7220 ok(delete_pf("msitest\\helium", TRUE), "File deleted\n");
7221 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
7222 ok(delete_pf("msitest", FALSE), "File deleted\n");
7224 create_pf("msitest", FALSE);
7225 create_pf("msitest\\furlong", TRUE);
7226 create_pf("msitest\\firkin", TRUE);
7227 create_pf("msitest\\fortnight", TRUE);
7228 create_pf("msitest\\becquerel", TRUE);
7229 create_pf("msitest\\dioptre", TRUE);
7230 create_pf("msitest\\attoparsec", TRUE);
7231 create_pf("msitest\\storeys", TRUE);
7232 create_pf("msitest\\block", TRUE);
7233 create_pf("msitest\\siriometer", TRUE);
7234 create_pf("msitest\\cabout", FALSE);
7235 create_pf("msitest\\cabout\\blocker", TRUE);
7237 r = MsiInstallProductA(msifile, NULL);
7238 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7239 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
7240 ok(!pf_exists("msitest\\helium"), "File installed\n");
7241 ok(pf_exists("msitest\\lithium"), "File not installed\n");
7242 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
7243 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
7244 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
7245 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
7246 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
7247 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
7248 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
7249 ok(!pf_exists("msitest\\block"), "File not deleted\n");
7250 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
7251 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
7252 ok(pf_exists("msitest"), "File not installed\n");
7254 create_pf("msitest\\furlong", TRUE);
7255 create_pf("msitest\\firkin", TRUE);
7256 create_pf("msitest\\fortnight", TRUE);
7257 create_pf("msitest\\storeys", TRUE);
7258 create_pf("msitest\\block", TRUE);
7259 create_pf("msitest\\siriometer", TRUE);
7261 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7263 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
7264 ok(!delete_pf("msitest\\helium", TRUE), "File not deleted\n");
7265 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
7266 ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
7267 ok(delete_pf("msitest\\firkin", TRUE), "File deleted\n");
7268 ok(delete_pf("msitest\\fortnight", TRUE), "File deleted\n");
7269 ok(!delete_pf("msitest\\becquerel", TRUE), "File not deleted\n");
7270 ok(!delete_pf("msitest\\dioptre", TRUE), "File not deleted\n");
7271 ok(delete_pf("msitest\\attoparsec", TRUE), "File deleted\n");
7272 ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
7273 ok(!delete_pf("msitest\\block", TRUE), "File not deleted\n");
7274 ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
7275 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
7276 ok(pf_exists("msitest"), "Directory deleted\n");
7278 r = MsiInstallProductA(msifile, NULL);
7279 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7280 ok(delete_pf("msitest\\hydrogen", TRUE), "File not installed\n");
7281 ok(!delete_pf("msitest\\helium", TRUE), "File installed\n");
7282 ok(delete_pf("msitest\\lithium", TRUE), "File not installed\n");
7283 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
7284 ok(pf_exists("msitest"), "Directory deleted\n");
7286 delete_pf("msitest\\cabout\\blocker", TRUE);
7288 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7289 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7290 ok(!delete_pf("msitest\\cabout", FALSE), "Directory not deleted\n");
7291 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
7293 error:
7294 DeleteFile(msifile);
7295 DeleteFile("msitest\\hydrogen");
7296 DeleteFile("msitest\\helium");
7297 DeleteFile("msitest\\lithium");
7298 RemoveDirectory("msitest");
7301 static void test_movefiles(void)
7303 UINT r;
7304 char props[MAX_PATH];
7306 if (is_process_limited())
7308 skip("process is limited\n");
7309 return;
7312 CreateDirectoryA("msitest", NULL);
7313 create_file("msitest\\augustus", 100);
7314 create_file("cameroon", 100);
7315 create_file("djibouti", 100);
7316 create_file("egypt", 100);
7317 create_file("finland", 100);
7318 create_file("gambai", 100);
7319 create_file("honduras", 100);
7320 create_file("msitest\\india", 100);
7321 create_file("japan", 100);
7322 create_file("kenya", 100);
7323 CreateDirectoryA("latvia", NULL);
7324 create_file("nauru", 100);
7325 create_file("peru", 100);
7326 create_file("apple", 100);
7327 create_file("application", 100);
7328 create_file("ape", 100);
7329 create_file("foo", 100);
7330 create_file("fao", 100);
7331 create_file("fbod", 100);
7332 create_file("budding", 100);
7333 create_file("buddy", 100);
7334 create_file("bud", 100);
7335 create_file("bar", 100);
7336 create_file("bur", 100);
7337 create_file("bird", 100);
7339 create_database(msifile, mov_tables, sizeof(mov_tables) / sizeof(msi_table));
7341 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7343 /* if the source or dest property is not a full path,
7344 * windows tries to access it as a network resource
7347 sprintf(props, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
7348 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
7349 CURR_DIR, PROG_FILES_DIR, CURR_DIR, CURR_DIR);
7351 r = MsiInstallProductA(msifile, props);
7352 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7354 skip("Not enough rights to perform tests\n");
7355 goto error;
7357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7358 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
7359 ok(!delete_pf("msitest\\dest", TRUE), "File copied\n");
7360 ok(delete_pf("msitest\\canada", TRUE), "File not copied\n");
7361 ok(delete_pf("msitest\\dominica", TRUE), "File not moved\n");
7362 ok(!delete_pf("msitest\\elsalvador", TRUE), "File moved\n");
7363 ok(!delete_pf("msitest\\france", TRUE), "File moved\n");
7364 ok(!delete_pf("msitest\\georgia", TRUE), "File moved\n");
7365 ok(delete_pf("msitest\\hungary", TRUE), "File not moved\n");
7366 ok(!delete_pf("msitest\\indonesia", TRUE), "File moved\n");
7367 ok(!delete_pf("msitest\\jordan", TRUE), "File moved\n");
7368 ok(delete_pf("msitest\\kiribati", TRUE), "File not moved\n");
7369 ok(!delete_pf("msitest\\lebanon", TRUE), "File moved\n");
7370 ok(!delete_pf("msitest\\lebanon", FALSE), "Directory moved\n");
7371 ok(delete_pf("msitest\\poland", TRUE), "File not moved\n");
7372 /* either apple or application will be moved depending on directory order */
7373 if (!delete_pf("msitest\\apple", TRUE))
7374 ok(delete_pf("msitest\\application", TRUE), "File not moved\n");
7375 else
7376 ok(!delete_pf("msitest\\application", TRUE), "File should not exist\n");
7377 ok(delete_pf("msitest\\wildcard", TRUE), "File not moved\n");
7378 ok(!delete_pf("msitest\\ape", TRUE), "File moved\n");
7379 /* either fao or foo will be moved depending on directory order */
7380 if (delete_pf("msitest\\foo", TRUE))
7381 ok(!delete_pf("msitest\\fao", TRUE), "File should not exist\n");
7382 else
7383 ok(delete_pf("msitest\\fao", TRUE), "File not moved\n");
7384 ok(delete_pf("msitest\\single", TRUE), "File not moved\n");
7385 ok(!delete_pf("msitest\\fbod", TRUE), "File moved\n");
7386 ok(delete_pf("msitest\\budding", TRUE), "File not moved\n");
7387 ok(delete_pf("msitest\\buddy", TRUE), "File not moved\n");
7388 ok(!delete_pf("msitest\\bud", TRUE), "File moved\n");
7389 ok(delete_pf("msitest\\bar", TRUE), "File not moved\n");
7390 ok(delete_pf("msitest\\bur", TRUE), "File not moved\n");
7391 ok(!delete_pf("msitest\\bird", TRUE), "File moved\n");
7392 ok(delete_pf("msitest", FALSE), "File not installed\n");
7393 ok(DeleteFileA("cameroon"), "File moved\n");
7394 ok(!DeleteFileA("djibouti"), "File not moved\n");
7395 ok(DeleteFileA("egypt"), "File moved\n");
7396 ok(DeleteFileA("finland"), "File moved\n");
7397 ok(DeleteFileA("gambai"), "File moved\n");
7398 ok(!DeleteFileA("honduras"), "File not moved\n");
7399 ok(DeleteFileA("msitest\\india"), "File moved\n");
7400 ok(DeleteFileA("japan"), "File moved\n");
7401 ok(!DeleteFileA("kenya"), "File not moved\n");
7402 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
7403 ok(!DeleteFileA("nauru"), "File not moved\n");
7404 ok(!DeleteFileA("peru"), "File not moved\n");
7405 ok(!DeleteFileA("apple"), "File not moved\n");
7406 ok(!DeleteFileA("application"), "File not moved\n");
7407 ok(DeleteFileA("ape"), "File moved\n");
7408 ok(!DeleteFileA("foo"), "File not moved\n");
7409 ok(!DeleteFileA("fao"), "File not moved\n");
7410 ok(DeleteFileA("fbod"), "File moved\n");
7411 ok(!DeleteFileA("budding"), "File not moved\n");
7412 ok(!DeleteFileA("buddy"), "File not moved\n");
7413 ok(DeleteFileA("bud"), "File moved\n");
7414 ok(!DeleteFileA("bar"), "File not moved\n");
7415 ok(!DeleteFileA("bur"), "File not moved\n");
7416 ok(DeleteFileA("bird"), "File moved\n");
7418 error:
7419 DeleteFile("cameroon");
7420 DeleteFile("djibouti");
7421 DeleteFile("egypt");
7422 DeleteFile("finland");
7423 DeleteFile("gambai");
7424 DeleteFile("honduras");
7425 DeleteFile("japan");
7426 DeleteFile("kenya");
7427 DeleteFile("nauru");
7428 DeleteFile("peru");
7429 DeleteFile("apple");
7430 DeleteFile("application");
7431 DeleteFile("ape");
7432 DeleteFile("foo");
7433 DeleteFile("fao");
7434 DeleteFile("fbod");
7435 DeleteFile("budding");
7436 DeleteFile("buddy");
7437 DeleteFile("bud");
7438 DeleteFile("bar");
7439 DeleteFile("bur");
7440 DeleteFile("bird");
7441 DeleteFile("msitest\\india");
7442 DeleteFile("msitest\\augustus");
7443 RemoveDirectory("latvia");
7444 RemoveDirectory("msitest");
7445 DeleteFile(msifile);
7448 static void test_missingcab(void)
7450 UINT r;
7452 if (is_process_limited())
7454 skip("process is limited\n");
7455 return;
7458 CreateDirectoryA("msitest", NULL);
7459 create_file("msitest\\augustus", 500);
7460 create_file("maximus", 500);
7462 create_database(msifile, mc_tables, sizeof(mc_tables) / sizeof(msi_table));
7464 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7466 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
7468 create_pf("msitest", FALSE);
7469 create_pf_data("msitest\\caesar", "abcdefgh", TRUE);
7471 r = MsiInstallProductA(msifile, NULL);
7472 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7474 skip("Not enough rights to perform tests\n");
7475 goto error;
7477 ok(r == ERROR_SUCCESS ||
7478 broken(r == ERROR_INSTALL_FAILURE), /* win9x */
7479 "Expected ERROR_SUCCESS, got %u\n", r);
7480 if (r == ERROR_SUCCESS)
7482 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
7483 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
7485 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
7486 ok(!delete_pf("msitest\\gaius", TRUE), "File installed\n");
7487 ok(delete_pf("msitest", FALSE), "File not installed\n");
7489 create_pf("msitest", FALSE);
7490 create_pf_data("msitest\\caesar", "abcdefgh", TRUE);
7491 create_pf("msitest\\gaius", TRUE);
7493 r = MsiInstallProductA(msifile, "GAIUS=1");
7494 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
7495 todo_wine
7497 ok(!delete_pf("msitest\\maximus", TRUE), "File installed\n");
7498 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7500 ok(delete_pf("msitest\\caesar", TRUE), "File removed\n");
7501 ok(delete_pf("msitest\\gaius", TRUE), "File removed\n");
7502 ok(delete_pf("msitest", FALSE), "File not installed\n");
7504 error:
7505 delete_pf("msitest\\caesar", TRUE);
7506 delete_pf("msitest", FALSE);
7507 DeleteFile("msitest\\augustus");
7508 RemoveDirectory("msitest");
7509 DeleteFile("maximus");
7510 DeleteFile("test1.cab");
7511 DeleteFile(msifile);
7514 static void test_duplicatefiles(void)
7516 UINT r;
7518 if (is_process_limited())
7520 skip("process is limited\n");
7521 return;
7524 CreateDirectoryA("msitest", NULL);
7525 create_file("msitest\\maximus", 500);
7526 create_database(msifile, df_tables, sizeof(df_tables) / sizeof(msi_table));
7528 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7530 /* fails if the destination folder is not a valid property */
7532 r = MsiInstallProductA(msifile, NULL);
7533 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7535 skip("Not enough rights to perform tests\n");
7536 goto error;
7538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7539 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
7540 ok(delete_pf("msitest\\augustus", TRUE), "File not duplicated\n");
7541 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE), "File not duplicated\n");
7542 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE), "File not duplicated\n");
7543 ok(delete_pf("msitest\\this\\doesnot", FALSE), "File not duplicated\n");
7544 ok(delete_pf("msitest\\this", FALSE), "File not duplicated\n");
7545 ok(delete_pf("msitest", FALSE), "File not installed\n");
7547 error:
7548 DeleteFile("msitest\\maximus");
7549 RemoveDirectory("msitest");
7550 DeleteFile(msifile);
7553 static void test_writeregistryvalues(void)
7555 UINT r;
7556 LONG res;
7557 HKEY hkey;
7558 DWORD type, size;
7559 CHAR path[MAX_PATH];
7561 if (is_process_limited())
7563 skip("process is limited\n");
7564 return;
7567 CreateDirectoryA("msitest", NULL);
7568 create_file("msitest\\augustus", 500);
7570 create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table));
7572 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7574 r = MsiInstallProductA(msifile, NULL);
7575 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7577 skip("Not enough rights to perform tests\n");
7578 goto error;
7580 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7581 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
7582 ok(delete_pf("msitest", FALSE), "File installed\n");
7584 if (is_64bit && !is_wow64)
7585 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
7586 else
7587 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
7588 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7590 size = MAX_PATH;
7591 type = REG_MULTI_SZ;
7592 memset(path, 'a', MAX_PATH);
7593 res = RegQueryValueExA(hkey, "Value", NULL, &type, (LPBYTE)path, &size);
7594 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7595 ok(!memcmp(path, "one\0two\0three\0\0", size), "Wrong multi-sz data\n");
7596 ok(size == 15, "Expected 15, got %d\n", size);
7597 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
7599 RegDeleteValueA(hkey, "Value");
7600 RegCloseKey(hkey);
7601 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
7603 error:
7604 DeleteFile(msifile);
7605 DeleteFile("msitest\\augustus");
7606 RemoveDirectory("msitest");
7609 static void test_sourcefolder(void)
7611 UINT r;
7613 if (is_process_limited())
7615 skip("process is limited\n");
7616 return;
7619 CreateDirectoryA("msitest", NULL);
7620 create_file("augustus", 500);
7622 create_database(msifile, sf_tables, sizeof(sf_tables) / sizeof(msi_table));
7624 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7626 r = MsiInstallProductA(msifile, NULL);
7627 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7629 skip("Not enough rights to perform tests\n");
7630 goto error;
7632 ok(r == ERROR_INSTALL_FAILURE,
7633 "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
7634 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7635 todo_wine
7637 ok(!delete_pf("msitest", FALSE), "File installed\n");
7640 RemoveDirectoryA("msitest");
7642 r = MsiInstallProductA(msifile, NULL);
7643 ok(r == ERROR_INSTALL_FAILURE,
7644 "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
7645 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7646 todo_wine
7648 ok(!delete_pf("msitest", FALSE), "File installed\n");
7651 error:
7652 DeleteFile(msifile);
7653 DeleteFile("augustus");
7656 static void test_customaction51(void)
7658 UINT r;
7660 if (is_process_limited())
7662 skip("process is limited\n");
7663 return;
7666 CreateDirectoryA("msitest", NULL);
7667 create_file("msitest\\augustus", 500);
7669 create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
7671 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7673 r = MsiInstallProductA(msifile, NULL);
7674 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7676 skip("Not enough rights to perform tests\n");
7677 goto error;
7679 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7680 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
7681 ok(delete_pf("msitest", FALSE), "File installed\n");
7683 error:
7684 DeleteFile(msifile);
7685 DeleteFile("msitest\\augustus");
7686 RemoveDirectory("msitest");
7689 static void test_installstate(void)
7691 UINT r;
7693 if (is_process_limited())
7695 skip("process is limited\n");
7696 return;
7699 CreateDirectoryA("msitest", NULL);
7700 create_file("msitest\\alpha", 500);
7701 create_file("msitest\\beta", 500);
7702 create_file("msitest\\gamma", 500);
7703 create_file("msitest\\theta", 500);
7704 create_file("msitest\\delta", 500);
7705 create_file("msitest\\epsilon", 500);
7706 create_file("msitest\\zeta", 500);
7707 create_file("msitest\\iota", 500);
7708 create_file("msitest\\eta", 500);
7709 create_file("msitest\\kappa", 500);
7710 create_file("msitest\\lambda", 500);
7711 create_file("msitest\\mu", 500);
7713 create_database(msifile, is_tables, sizeof(is_tables) / sizeof(msi_table));
7715 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7717 r = MsiInstallProductA(msifile, NULL);
7718 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7720 skip("Not enough rights to perform tests\n");
7721 goto error;
7723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7724 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
7725 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7726 ok(delete_pf("msitest\\gamma", TRUE), "File not installed\n");
7727 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
7728 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7729 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
7730 ok(!delete_pf("msitest\\zeta", TRUE), "File installed\n");
7731 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7732 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
7733 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7734 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7735 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7736 ok(delete_pf("msitest", FALSE), "File not installed\n");
7738 r = MsiInstallProductA(msifile, "ADDLOCAL=\"one,two,three,four\"");
7739 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7740 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
7741 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7742 ok(delete_pf("msitest\\gamma", TRUE), "File not installed\n");
7743 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
7744 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7745 ok(delete_pf("msitest\\epsilon", TRUE), "File not installed\n");
7746 ok(delete_pf("msitest\\zeta", TRUE), "File not installed\n");
7747 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7748 ok(delete_pf("msitest\\eta", TRUE), "File not installed\n");
7749 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7750 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7751 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7752 ok(delete_pf("msitest", FALSE), "File not installed\n");
7754 r = MsiInstallProductA(msifile, "ADDSOURCE=\"one,two,three,four\"");
7755 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7756 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
7757 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7758 ok(!delete_pf("msitest\\gamma", TRUE), "File installed\n");
7759 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
7760 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7761 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
7762 ok(delete_pf("msitest\\zeta", TRUE), "File not installed\n");
7763 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7764 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
7765 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7766 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7767 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7768 ok(delete_pf("msitest", FALSE), "File not installed\n");
7770 r = MsiInstallProductA(msifile, "REMOVE=\"one,two,three,four\"");
7771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7772 ok(!delete_pf("msitest\\alpha", TRUE), "File installed\n");
7773 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7774 ok(!delete_pf("msitest\\gamma", TRUE), "File installed\n");
7775 ok(!delete_pf("msitest\\theta", TRUE), "File installed\n");
7776 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7777 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
7778 ok(!delete_pf("msitest\\zeta", TRUE), "File installed\n");
7779 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7780 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
7781 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7782 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7783 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7784 ok(!delete_pf("msitest", FALSE), "File installed\n");
7786 error:
7787 DeleteFile(msifile);
7788 DeleteFile("msitest\\alpha");
7789 DeleteFile("msitest\\beta");
7790 DeleteFile("msitest\\gamma");
7791 DeleteFile("msitest\\theta");
7792 DeleteFile("msitest\\delta");
7793 DeleteFile("msitest\\epsilon");
7794 DeleteFile("msitest\\zeta");
7795 DeleteFile("msitest\\iota");
7796 DeleteFile("msitest\\eta");
7797 DeleteFile("msitest\\kappa");
7798 DeleteFile("msitest\\lambda");
7799 DeleteFile("msitest\\mu");
7800 RemoveDirectory("msitest");
7803 static const struct sourcepathmap
7805 BOOL sost; /* shortone\shorttwo */
7806 BOOL solt; /* shortone\longtwo */
7807 BOOL lost; /* longone\shorttwo */
7808 BOOL lolt; /* longone\longtwo */
7809 BOOL soste; /* shortone\shorttwo source exists */
7810 BOOL solte; /* shortone\longtwo source exists */
7811 BOOL loste; /* longone\shorttwo source exists */
7812 BOOL lolte; /* longone\longtwo source exists */
7813 UINT err;
7814 DWORD size;
7815 } spmap[256] =
7817 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7818 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7819 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7820 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7821 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7822 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7823 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7824 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7825 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7826 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7827 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7828 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7829 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7830 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7831 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7832 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7833 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7834 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7835 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7836 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7837 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7838 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7839 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7840 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7841 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7842 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7843 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7844 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7845 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7846 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7847 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7848 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7849 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7850 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7851 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7852 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7853 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7854 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7855 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7856 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7857 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7858 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7859 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7860 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7861 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7862 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7863 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7864 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7865 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7866 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7867 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7868 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7869 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7870 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7871 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7872 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7873 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7874 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7875 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7876 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7877 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7878 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7879 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7880 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7881 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7882 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7883 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7884 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7885 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7886 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7887 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7888 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7889 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7890 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7891 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7892 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7893 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7894 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7895 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7896 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7897 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7898 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7899 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7900 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7901 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7902 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7903 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7904 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7905 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7906 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7907 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7908 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7909 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7910 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7911 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7912 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7913 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7914 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7915 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7916 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7917 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7918 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7919 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7920 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7921 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7922 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7923 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7924 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7925 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7926 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7927 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7928 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7929 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7930 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7931 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7932 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7933 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7934 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7935 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7936 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7937 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7938 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7939 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7940 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7941 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7942 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7943 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7944 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7945 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7946 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7947 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7948 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7949 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7950 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7951 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7952 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7953 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7954 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7955 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7956 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7957 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7958 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7959 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7960 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7961 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7962 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7963 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7964 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7965 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7966 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7967 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7968 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7969 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7970 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7971 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7972 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7973 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7974 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7975 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7976 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7977 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7978 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7979 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7980 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7981 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7982 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7983 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7984 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7985 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7986 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7987 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7988 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7989 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7990 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7991 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7992 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7993 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7994 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7995 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7996 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7997 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7998 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7999 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8000 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8001 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8002 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8003 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8004 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8005 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8006 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8007 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8008 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8009 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8010 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8011 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8012 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8013 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8014 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8015 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8016 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8017 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8018 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8019 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8020 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8021 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8022 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8023 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8024 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8025 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8026 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8027 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8028 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8029 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8030 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8031 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8032 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8033 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8034 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8035 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8036 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8037 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8038 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8039 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8040 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8041 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8042 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8043 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8044 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8045 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8046 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8047 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8048 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8049 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8050 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8051 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8052 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8053 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8054 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8055 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8056 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8057 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8058 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8059 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8060 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8061 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8062 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8063 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8064 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8065 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8066 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8067 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8068 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8069 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8070 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8071 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8072 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8075 static DWORD get_pf_file_size(LPCSTR file)
8077 CHAR path[MAX_PATH];
8078 HANDLE hfile;
8079 DWORD size;
8081 lstrcpyA(path, PROG_FILES_DIR);
8082 lstrcatA(path, "\\");
8083 lstrcatA(path, file);
8085 hfile = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
8086 if (hfile == INVALID_HANDLE_VALUE)
8087 return INVALID_FILE_SIZE;
8089 size = GetFileSize(hfile, NULL);
8090 CloseHandle(hfile);
8091 return size;
8094 static void test_sourcepath(void)
8096 UINT r, i;
8098 if (!winetest_interactive)
8100 skip("Run in interactive mode to run source path tests.\n");
8101 return;
8104 create_database(msifile, sp_tables, sizeof(sp_tables) / sizeof(msi_table));
8106 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8108 for (i = 0; i < sizeof(spmap) / sizeof(spmap[0]); i++)
8110 if (spmap[i].sost)
8112 CreateDirectoryA("shortone", NULL);
8113 CreateDirectoryA("shortone\\shorttwo", NULL);
8116 if (spmap[i].solt)
8118 CreateDirectoryA("shortone", NULL);
8119 CreateDirectoryA("shortone\\longtwo", NULL);
8122 if (spmap[i].lost)
8124 CreateDirectoryA("longone", NULL);
8125 CreateDirectoryA("longone\\shorttwo", NULL);
8128 if (spmap[i].lolt)
8130 CreateDirectoryA("longone", NULL);
8131 CreateDirectoryA("longone\\longtwo", NULL);
8134 if (spmap[i].soste)
8135 create_file("shortone\\shorttwo\\augustus", 50);
8136 if (spmap[i].solte)
8137 create_file("shortone\\longtwo\\augustus", 100);
8138 if (spmap[i].loste)
8139 create_file("longone\\shorttwo\\augustus", 150);
8140 if (spmap[i].lolte)
8141 create_file("longone\\longtwo\\augustus", 200);
8143 r = MsiInstallProductA(msifile, NULL);
8144 ok(r == spmap[i].err, "%d: Expected %d, got %d\n", i, spmap[i].err, r);
8145 ok(get_pf_file_size("msitest\\augustus") == spmap[i].size,
8146 "%d: Expected %d, got %d\n", i, spmap[i].size,
8147 get_pf_file_size("msitest\\augustus"));
8149 if (r == ERROR_SUCCESS)
8151 ok(delete_pf("msitest\\augustus", TRUE), "%d: File not installed\n", i);
8152 ok(delete_pf("msitest", FALSE), "%d: File not installed\n", i);
8154 else
8156 ok(!delete_pf("msitest\\augustus", TRUE), "%d: File installed\n", i);
8157 todo_wine ok(!delete_pf("msitest", FALSE), "%d: File installed\n", i);
8160 DeleteFileA("shortone\\shorttwo\\augustus");
8161 DeleteFileA("shortone\\longtwo\\augustus");
8162 DeleteFileA("longone\\shorttwo\\augustus");
8163 DeleteFileA("longone\\longtwo\\augustus");
8164 RemoveDirectoryA("shortone\\shorttwo");
8165 RemoveDirectoryA("shortone\\longtwo");
8166 RemoveDirectoryA("longone\\shorttwo");
8167 RemoveDirectoryA("longone\\longtwo");
8168 RemoveDirectoryA("shortone");
8169 RemoveDirectoryA("longone");
8172 DeleteFileA(msifile);
8175 static void test_MsiConfigureProductEx(void)
8177 UINT r;
8178 LONG res;
8179 DWORD type, size;
8180 HKEY props, source;
8181 CHAR keypath[MAX_PATH * 2], localpack[MAX_PATH];
8182 REGSAM access = KEY_ALL_ACCESS;
8184 if (on_win9x)
8186 win_skip("Different registry keys on Win9x and WinMe\n");
8187 return;
8189 if (is_process_limited())
8191 skip("process is limited\n");
8192 return;
8195 CreateDirectoryA("msitest", NULL);
8196 create_file("msitest\\hydrogen", 500);
8197 create_file("msitest\\helium", 500);
8198 create_file("msitest\\lithium", 500);
8200 create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
8202 if (is_wow64)
8203 access |= KEY_WOW64_64KEY;
8205 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8207 /* NULL szProduct */
8208 r = MsiConfigureProductExA(NULL, INSTALLLEVEL_DEFAULT,
8209 INSTALLSTATE_DEFAULT, "PROPVAR=42");
8210 ok(r == ERROR_INVALID_PARAMETER,
8211 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8213 /* empty szProduct */
8214 r = MsiConfigureProductExA("", INSTALLLEVEL_DEFAULT,
8215 INSTALLSTATE_DEFAULT, "PROPVAR=42");
8216 ok(r == ERROR_INVALID_PARAMETER,
8217 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8219 /* garbage szProduct */
8220 r = MsiConfigureProductExA("garbage", INSTALLLEVEL_DEFAULT,
8221 INSTALLSTATE_DEFAULT, "PROPVAR=42");
8222 ok(r == ERROR_INVALID_PARAMETER,
8223 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8225 /* guid without brackets */
8226 r = MsiConfigureProductExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D",
8227 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8228 "PROPVAR=42");
8229 ok(r == ERROR_INVALID_PARAMETER,
8230 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8232 /* guid with brackets */
8233 r = MsiConfigureProductExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}",
8234 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8235 "PROPVAR=42");
8236 ok(r == ERROR_UNKNOWN_PRODUCT,
8237 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
8239 /* same length as guid, but random */
8240 r = MsiConfigureProductExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93",
8241 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8242 "PROPVAR=42");
8243 ok(r == ERROR_UNKNOWN_PRODUCT,
8244 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
8246 /* product not installed yet */
8247 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8248 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8249 "PROPVAR=42");
8250 ok(r == ERROR_UNKNOWN_PRODUCT,
8251 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
8253 /* install the product, per-user unmanaged */
8254 r = MsiInstallProductA(msifile, "INSTALLLEVEL=10 PROPVAR=42");
8255 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8257 skip("Not enough rights to perform tests\n");
8258 goto error;
8260 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8261 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8262 ok(pf_exists("msitest\\helium"), "File not installed\n");
8263 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8264 ok(pf_exists("msitest"), "File not installed\n");
8266 /* product is installed per-user managed, remove it */
8267 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8268 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8269 "PROPVAR=42");
8270 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8271 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8272 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8273 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8274 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8276 /* product has been removed */
8277 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8278 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8279 "PROPVAR=42");
8280 ok(r == ERROR_UNKNOWN_PRODUCT,
8281 "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
8283 /* install the product, machine */
8284 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8285 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8286 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8287 ok(pf_exists("msitest\\helium"), "File not installed\n");
8288 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8289 ok(pf_exists("msitest"), "File not installed\n");
8291 /* product is installed machine, remove it */
8292 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8293 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8294 "PROPVAR=42");
8295 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8296 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8297 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8298 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8299 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8301 /* product has been removed */
8302 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8303 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8304 "PROPVAR=42");
8305 ok(r == ERROR_UNKNOWN_PRODUCT,
8306 "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
8308 /* install the product, machine */
8309 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8311 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8312 ok(pf_exists("msitest\\helium"), "File not installed\n");
8313 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8314 ok(pf_exists("msitest"), "File not installed\n");
8316 DeleteFileA(msifile);
8318 /* local msifile is removed */
8319 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8320 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8321 "PROPVAR=42");
8322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8323 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8324 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8325 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8326 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8328 create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
8330 /* install the product, machine */
8331 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8332 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8333 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8334 ok(pf_exists("msitest\\helium"), "File not installed\n");
8335 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8336 ok(pf_exists("msitest"), "File not installed\n");
8338 DeleteFileA(msifile);
8340 lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\");
8341 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
8342 lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties");
8344 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
8345 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8347 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
8348 (const BYTE *)"C:\\idontexist.msi", 18);
8349 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8351 /* LocalPackage is used to find the cached msi package */
8352 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8353 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8354 "PROPVAR=42");
8355 ok(r == ERROR_INSTALL_SOURCE_ABSENT,
8356 "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
8357 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8358 ok(pf_exists("msitest\\helium"), "File not installed\n");
8359 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8360 ok(pf_exists("msitest"), "File not installed\n");
8362 RegCloseKey(props);
8363 create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
8365 /* LastUsedSource (local msi package) can be used as a last resort */
8366 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8367 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8368 "PROPVAR=42");
8369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8370 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8371 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8372 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8373 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8375 /* install the product, machine */
8376 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8378 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8379 ok(pf_exists("msitest\\helium"), "File not installed\n");
8380 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8381 ok(pf_exists("msitest"), "File not installed\n");
8383 lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\");
8384 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
8385 lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties");
8387 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
8388 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8390 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
8391 (const BYTE *)"C:\\idontexist.msi", 18);
8392 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8394 lstrcpyA(keypath, "SOFTWARE\\Classes\\Installer\\Products\\");
8395 lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\SourceList");
8397 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &source);
8398 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8400 type = REG_SZ;
8401 size = MAX_PATH;
8402 res = RegQueryValueExA(source, "PackageName", NULL, &type,
8403 (LPBYTE)localpack, &size);
8404 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8406 res = RegSetValueExA(source, "PackageName", 0, REG_SZ,
8407 (const BYTE *)"idontexist.msi", 15);
8408 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8410 /* SourceList is altered */
8411 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8412 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8413 "PROPVAR=42");
8414 ok(r == ERROR_INSTALL_SOURCE_ABSENT,
8415 "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
8416 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8417 ok(pf_exists("msitest\\helium"), "File not installed\n");
8418 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8419 ok(pf_exists("msitest"), "File not installed\n");
8421 /* restore the SourceList */
8422 res = RegSetValueExA(source, "PackageName", 0, REG_SZ,
8423 (const BYTE *)localpack, lstrlenA(localpack) + 1);
8424 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8426 /* finally remove the product */
8427 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8428 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8429 "PROPVAR=42");
8430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8431 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8432 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8433 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8434 ok(!delete_pf("msitest", FALSE), "File not removed\n");
8436 RegCloseKey(source);
8437 RegCloseKey(props);
8439 error:
8440 DeleteFileA("msitest\\hydrogen");
8441 DeleteFileA("msitest\\helium");
8442 DeleteFileA("msitest\\lithium");
8443 RemoveDirectoryA("msitest");
8444 DeleteFileA(msifile);
8447 static void test_missingcomponent(void)
8449 UINT r;
8451 if (is_process_limited())
8453 skip("process is limited\n");
8454 return;
8457 CreateDirectoryA("msitest", NULL);
8458 create_file("msitest\\hydrogen", 500);
8459 create_file("msitest\\helium", 500);
8460 create_file("msitest\\lithium", 500);
8461 create_file("beryllium", 500);
8463 create_database(msifile, mcomp_tables, sizeof(mcomp_tables) / sizeof(msi_table));
8465 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8467 r = MsiInstallProductA(msifile, "INSTALLLEVEL=10 PROPVAR=42");
8468 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8470 skip("Not enough rights to perform tests\n");
8471 goto error;
8473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8474 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8475 ok(pf_exists("msitest\\helium"), "File not installed\n");
8476 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8477 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
8478 ok(pf_exists("msitest"), "File not installed\n");
8480 r = MsiInstallProductA(msifile, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
8481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8482 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8483 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8484 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8485 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
8486 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8488 error:
8489 DeleteFileA(msifile);
8490 DeleteFileA("msitest\\hydrogen");
8491 DeleteFileA("msitest\\helium");
8492 DeleteFileA("msitest\\lithium");
8493 DeleteFileA("beryllium");
8494 RemoveDirectoryA("msitest");
8497 static void test_sourcedirprop(void)
8499 UINT r;
8500 CHAR props[MAX_PATH];
8502 if (is_process_limited())
8504 skip("process is limited\n");
8505 return;
8508 CreateDirectoryA("msitest", NULL);
8509 create_file("msitest\\augustus", 500);
8511 create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
8513 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8515 r = MsiInstallProductA(msifile, NULL);
8516 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8518 skip("Not enough rights to perform tests\n");
8519 goto error;
8521 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8522 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
8523 ok(delete_pf("msitest", FALSE), "File installed\n");
8525 DeleteFile("msitest\\augustus");
8526 RemoveDirectory("msitest");
8528 CreateDirectoryA("altsource", NULL);
8529 CreateDirectoryA("altsource\\msitest", NULL);
8530 create_file("altsource\\msitest\\augustus", 500);
8532 sprintf(props, "SRCDIR=%s\\altsource\\", CURR_DIR);
8534 r = MsiInstallProductA(msifile, props);
8535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8536 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
8537 ok(delete_pf("msitest", FALSE), "File installed\n");
8539 DeleteFile("altsource\\msitest\\augustus");
8540 RemoveDirectory("altsource\\msitest");
8541 RemoveDirectory("altsource");
8543 error:
8544 DeleteFile("msitest\\augustus");
8545 RemoveDirectory("msitest");
8546 DeleteFile(msifile);
8549 static void test_adminimage(void)
8551 UINT r;
8553 if (is_process_limited())
8555 skip("process is limited\n");
8556 return;
8559 CreateDirectoryA("msitest", NULL);
8560 CreateDirectoryA("msitest\\first", NULL);
8561 CreateDirectoryA("msitest\\second", NULL);
8562 CreateDirectoryA("msitest\\cabout", NULL);
8563 CreateDirectoryA("msitest\\cabout\\new", NULL);
8564 create_file("msitest\\one.txt", 100);
8565 create_file("msitest\\first\\two.txt", 100);
8566 create_file("msitest\\second\\three.txt", 100);
8567 create_file("msitest\\cabout\\four.txt", 100);
8568 create_file("msitest\\cabout\\new\\five.txt", 100);
8569 create_file("msitest\\filename", 100);
8570 create_file("msitest\\service.exe", 100);
8572 create_database_wordcount(msifile, ai_tables,
8573 sizeof(ai_tables) / sizeof(msi_table),
8574 100, msidbSumInfoSourceTypeAdminImage, ";1033");
8576 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8578 r = MsiInstallProductA(msifile, NULL);
8579 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8581 skip("Not enough rights to perform tests\n");
8582 goto error;
8584 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8586 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
8587 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
8588 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
8589 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
8590 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
8591 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
8592 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
8593 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
8594 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
8595 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
8596 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
8597 ok(delete_pf("msitest", FALSE), "File not installed\n");
8599 error:
8600 DeleteFileA("msifile");
8601 DeleteFileA("msitest\\cabout\\new\\five.txt");
8602 DeleteFileA("msitest\\cabout\\four.txt");
8603 DeleteFileA("msitest\\second\\three.txt");
8604 DeleteFileA("msitest\\first\\two.txt");
8605 DeleteFileA("msitest\\one.txt");
8606 DeleteFileA("msitest\\service.exe");
8607 DeleteFileA("msitest\\filename");
8608 RemoveDirectoryA("msitest\\cabout\\new");
8609 RemoveDirectoryA("msitest\\cabout");
8610 RemoveDirectoryA("msitest\\second");
8611 RemoveDirectoryA("msitest\\first");
8612 RemoveDirectoryA("msitest");
8615 static void test_propcase(void)
8617 UINT r;
8619 if (is_process_limited())
8621 skip("process is limited\n");
8622 return;
8625 CreateDirectoryA("msitest", NULL);
8626 create_file("msitest\\augustus", 500);
8628 create_database(msifile, pc_tables, sizeof(pc_tables) / sizeof(msi_table));
8630 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8632 r = MsiInstallProductA(msifile, "MyProp=42");
8633 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8635 skip("Not enough rights to perform tests\n");
8636 goto error;
8638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8639 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
8640 ok(delete_pf("msitest", FALSE), "File not installed\n");
8642 error:
8643 DeleteFile(msifile);
8644 DeleteFile("msitest\\augustus");
8645 RemoveDirectory("msitest");
8648 static void test_int_widths( void )
8650 static const char int0[] = "int0\ni0\nint0\tint0\n1";
8651 static const char int1[] = "int1\ni1\nint1\tint1\n1";
8652 static const char int2[] = "int2\ni2\nint2\tint2\n1";
8653 static const char int3[] = "int3\ni3\nint3\tint3\n1";
8654 static const char int4[] = "int4\ni4\nint4\tint4\n1";
8655 static const char int5[] = "int5\ni5\nint5\tint5\n1";
8656 static const char int8[] = "int8\ni8\nint8\tint8\n1";
8658 static const struct
8660 const char *data;
8661 unsigned int size;
8662 UINT ret;
8664 tests[] =
8666 { int0, sizeof(int0) - 1, ERROR_SUCCESS },
8667 { int1, sizeof(int1) - 1, ERROR_SUCCESS },
8668 { int2, sizeof(int2) - 1, ERROR_SUCCESS },
8669 { int3, sizeof(int3) - 1, ERROR_FUNCTION_FAILED },
8670 { int4, sizeof(int4) - 1, ERROR_SUCCESS },
8671 { int5, sizeof(int5) - 1, ERROR_FUNCTION_FAILED },
8672 { int8, sizeof(int8) - 1, ERROR_FUNCTION_FAILED }
8675 char tmpdir[MAX_PATH], msitable[MAX_PATH], msidb[MAX_PATH];
8676 MSIHANDLE db;
8677 UINT r, i;
8679 GetTempPathA(MAX_PATH, tmpdir);
8680 CreateDirectoryA(tmpdir, NULL);
8682 strcpy(msitable, tmpdir);
8683 strcat(msitable, "\\msitable.idt");
8685 strcpy(msidb, tmpdir);
8686 strcat(msidb, "\\msitest.msi");
8688 r = MsiOpenDatabaseA(msidb, MSIDBOPEN_CREATE, &db);
8689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8691 for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++)
8693 write_file(msitable, tests[i].data, tests[i].size);
8695 r = MsiDatabaseImportA(db, tmpdir, "msitable.idt");
8696 ok(r == tests[i].ret, " %u expected %u, got %u\n", i, tests[i].ret, r);
8698 r = MsiDatabaseCommit(db);
8699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8700 DeleteFileA(msitable);
8703 MsiCloseHandle(db);
8704 DeleteFileA(msidb);
8705 RemoveDirectoryA(tmpdir);
8708 static void test_shortcut(void)
8710 UINT r;
8711 HRESULT hr;
8713 if (is_process_limited())
8715 skip("process is limited\n");
8716 return;
8719 create_test_files();
8720 create_database(msifile, sc_tables, sizeof(sc_tables) / sizeof(msi_table));
8722 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8724 r = MsiInstallProductA(msifile, NULL);
8725 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8727 skip("Not enough rights to perform tests\n");
8728 goto error;
8730 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8732 hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
8733 ok(SUCCEEDED(hr), "CoInitialize failed 0x%08x\n", hr);
8735 r = MsiInstallProductA(msifile, NULL);
8736 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8738 CoUninitialize();
8740 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
8741 ok(SUCCEEDED(hr), "CoInitialize failed 0x%08x\n", hr);
8743 r = MsiInstallProductA(msifile, NULL);
8744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8746 CoUninitialize();
8748 delete_pf("msitest\\cabout\\new\\five.txt", TRUE);
8749 delete_pf("msitest\\cabout\\new", FALSE);
8750 delete_pf("msitest\\cabout\\four.txt", TRUE);
8751 delete_pf("msitest\\cabout", FALSE);
8752 delete_pf("msitest\\changed\\three.txt", TRUE);
8753 delete_pf("msitest\\changed", FALSE);
8754 delete_pf("msitest\\first\\two.txt", TRUE);
8755 delete_pf("msitest\\first", FALSE);
8756 delete_pf("msitest\\filename", TRUE);
8757 delete_pf("msitest\\one.txt", TRUE);
8758 delete_pf("msitest\\service.exe", TRUE);
8759 delete_pf("msitest\\Shortcut.lnk", TRUE);
8760 delete_pf("msitest", FALSE);
8762 error:
8763 delete_test_files();
8764 DeleteFile(msifile);
8767 static void test_envvar(void)
8769 UINT r;
8770 HKEY env;
8771 LONG res;
8772 DWORD type, size;
8773 char buffer[16];
8774 UINT i;
8776 if (on_win9x)
8778 win_skip("Environment variables are handled differently on Win9x and WinMe\n");
8779 return;
8781 if (is_process_limited())
8783 skip("process is limited\n");
8784 return;
8787 create_test_files();
8788 create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table));
8790 res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
8791 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8793 res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2);
8794 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8796 res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2);
8797 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8799 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8801 r = MsiInstallProductA(msifile, NULL);
8802 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8804 skip("Not enough rights to perform tests\n");
8805 goto error;
8807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8809 type = REG_NONE;
8810 size = sizeof(buffer);
8811 buffer[0] = 0;
8812 res = RegQueryValueExA(env, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
8813 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8814 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
8815 ok(!lstrcmp(buffer, "1"), "Expected \"1\", got %s\n", buffer);
8817 res = RegDeleteValueA(env, "MSITESTVAR1");
8818 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8820 type = REG_NONE;
8821 size = sizeof(buffer);
8822 buffer[0] = 0;
8823 res = RegQueryValueExA(env, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
8824 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8825 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
8826 ok(!lstrcmp(buffer, "1"), "Expected \"1\", got %s\n", buffer);
8828 res = RegDeleteValueA(env, "MSITESTVAR2");
8829 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8831 res = RegDeleteValueA(env, "MSITESTVAR3");
8832 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8834 res = RegDeleteValueA(env, "MSITESTVAR4");
8835 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8837 res = RegDeleteValueA(env, "MSITESTVAR5");
8838 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8840 res = RegDeleteValueA(env, "MSITESTVAR6");
8841 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8843 res = RegDeleteValueA(env, "MSITESTVAR7");
8844 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8846 res = RegDeleteValueA(env, "MSITESTVAR8");
8847 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8849 res = RegDeleteValueA(env, "MSITESTVAR9");
8850 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8852 res = RegDeleteValueA(env, "MSITESTVAR10");
8853 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8855 i = 11;
8856 while (environment_dat_results[(i-11)]) {
8857 char name[20];
8858 sprintf(name, "MSITESTVAR%d", i);
8860 type = REG_NONE;
8861 size = sizeof(buffer);
8862 buffer[0] = 0;
8863 res = RegQueryValueExA(env, name, NULL, &type, (LPBYTE)buffer, &size);
8864 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
8865 ok(type == REG_SZ, "%d: Expected REG_SZ, got %u\n", i, type);
8866 ok(!lstrcmp(buffer, environment_dat_results[(i-11)]), "%d: Expected %s, got %s\n",
8867 i, environment_dat_results[(i-11)], buffer);
8869 res = RegDeleteValueA(env, name);
8870 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
8871 i++;
8874 delete_pf("msitest\\cabout\\new\\five.txt", TRUE);
8875 delete_pf("msitest\\cabout\\new", FALSE);
8876 delete_pf("msitest\\cabout\\four.txt", TRUE);
8877 delete_pf("msitest\\cabout", FALSE);
8878 delete_pf("msitest\\changed\\three.txt", TRUE);
8879 delete_pf("msitest\\changed", FALSE);
8880 delete_pf("msitest\\first\\two.txt", TRUE);
8881 delete_pf("msitest\\first", FALSE);
8882 delete_pf("msitest\\filename", TRUE);
8883 delete_pf("msitest\\one.txt", TRUE);
8884 delete_pf("msitest\\service.exe", TRUE);
8885 delete_pf("msitest", FALSE);
8887 error:
8888 RegDeleteValueA(env, "MSITESTVAR1");
8889 RegDeleteValueA(env, "MSITESTVAR2");
8890 RegCloseKey(env);
8892 delete_test_files();
8893 DeleteFile(msifile);
8896 static void test_preselected(void)
8898 UINT r;
8900 if (is_process_limited())
8902 skip("process is limited\n");
8903 return;
8906 create_test_files();
8907 create_database(msifile, ps_tables, sizeof(ps_tables) / sizeof(msi_table));
8909 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8911 r = MsiInstallProductA(msifile, "ADDLOCAL=One");
8912 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8914 skip("Not enough rights to perform tests\n");
8915 goto error;
8917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8919 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
8920 ok(!delete_pf("msitest\\cabout\\new", FALSE), "File installed\n");
8921 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
8922 ok(!delete_pf("msitest\\cabout", FALSE), "File installed\n");
8923 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
8924 ok(!delete_pf("msitest\\changed", FALSE), "File installed\n");
8925 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
8926 ok(!delete_pf("msitest\\first", FALSE), "File installed\n");
8927 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
8928 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
8929 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
8930 ok(delete_pf("msitest", FALSE), "File not installed\n");
8932 r = MsiInstallProductA(msifile, NULL);
8933 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8935 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
8936 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
8937 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
8938 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
8939 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
8940 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
8941 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
8942 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
8943 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
8944 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
8945 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
8946 ok(delete_pf("msitest", FALSE), "File not installed\n");
8948 error:
8949 delete_test_files();
8950 DeleteFile(msifile);
8953 static void test_installed_prop(void)
8955 static char prodcode[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
8956 UINT r;
8958 if (is_process_limited())
8960 skip("process is limited\n");
8961 return;
8964 create_test_files();
8965 create_database(msifile, ip_tables, sizeof(ip_tables) / sizeof(msi_table));
8967 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8969 r = MsiInstallProductA(msifile, "FULL=1");
8970 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8972 skip("Not enough rights to perform tests\n");
8973 goto error;
8975 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8977 r = MsiInstallProductA(msifile, "FULL=1");
8978 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
8980 r = MsiConfigureProductExA(prodcode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, "FULL=1");
8981 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
8983 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
8984 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
8985 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
8986 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
8987 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
8988 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
8989 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
8990 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
8991 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
8992 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
8993 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
8994 ok(delete_pf("msitest", FALSE), "File not installed\n");
8996 r = MsiInstallProductA(msifile, "REMOVE=ALL");
8997 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8999 error:
9000 delete_test_files();
9001 DeleteFile(msifile);
9004 static void test_allusers_prop(void)
9006 UINT r;
9008 if (is_process_limited())
9010 skip("process is limited\n");
9011 return;
9014 create_test_files();
9015 create_database(msifile, aup_tables, sizeof(aup_tables) / sizeof(msi_table));
9017 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9019 /* ALLUSERS property unset */
9020 r = MsiInstallProductA(msifile, "FULL=1");
9021 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9023 skip("Not enough rights to perform tests\n");
9024 goto error;
9026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9028 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9029 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9030 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9031 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9032 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9033 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9034 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9035 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9036 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9037 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9038 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9039 ok(delete_pf("msitest", FALSE), "File not installed\n");
9041 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9042 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9044 delete_test_files();
9046 create_test_files();
9047 create_database(msifile, aup2_tables, sizeof(aup2_tables) / sizeof(msi_table));
9049 /* ALLUSERS property set to 1 */
9050 r = MsiInstallProductA(msifile, "FULL=1");
9051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9053 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9054 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9055 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9056 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9057 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9058 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9059 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9060 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9061 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9062 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9063 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9064 ok(delete_pf("msitest", FALSE), "File not installed\n");
9066 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9069 delete_test_files();
9071 create_test_files();
9072 create_database(msifile, aup3_tables, sizeof(aup3_tables) / sizeof(msi_table));
9074 /* ALLUSERS property set to 2 */
9075 r = MsiInstallProductA(msifile, "FULL=1");
9076 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9078 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9079 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9080 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9081 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9082 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9083 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9084 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9085 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9086 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9087 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9088 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9089 ok(delete_pf("msitest", FALSE), "File not installed\n");
9091 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9094 delete_test_files();
9096 create_test_files();
9097 create_database(msifile, aup4_tables, sizeof(aup4_tables) / sizeof(msi_table));
9099 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
9100 r = MsiInstallProductA(msifile, "FULL=1");
9101 if (r == ERROR_SUCCESS)
9103 /* Win9x/WinMe */
9104 win_skip("Win9x and WinMe act differently with respect to ALLUSERS\n");
9106 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9107 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9108 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9109 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9110 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9111 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9112 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9113 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9114 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9115 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9116 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9117 ok(delete_pf("msitest", FALSE), "File not installed\n");
9119 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9122 delete_test_files();
9124 else
9125 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9127 error:
9128 delete_test_files();
9129 DeleteFile(msifile);
9132 static char session_manager[] = "System\\CurrentControlSet\\Control\\Session Manager";
9133 static char rename_ops[] = "PendingFileRenameOperations";
9135 static void process_pending_renames(HKEY hkey)
9137 char *buf, *src, *dst, *buf2, *buf2ptr;
9138 DWORD size;
9139 LONG ret;
9140 BOOL found = FALSE;
9142 ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, NULL, &size);
9143 buf = HeapAlloc(GetProcessHeap(), 0, size + 1);
9144 buf2ptr = buf2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 1);
9146 ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, (LPBYTE)buf, &size);
9147 buf[size] = 0;
9148 ok(!ret, "RegQueryValueExA failed %d\n", ret);
9149 if (ret) return;
9151 for (src = buf; *src; src = dst + strlen(dst) + 1)
9153 DWORD flags = MOVEFILE_COPY_ALLOWED;
9155 dst = src + strlen(src) + 1;
9157 if (!strstr(src, "msitest"))
9159 lstrcpyA(buf2ptr, src);
9160 buf2ptr += strlen(src) + 1;
9161 if (*dst)
9163 lstrcpyA(buf2ptr, dst);
9164 buf2ptr += strlen(dst) + 1;
9166 buf2ptr++;
9167 continue;
9170 found = TRUE;
9172 if (*dst == '!')
9174 flags |= MOVEFILE_REPLACE_EXISTING;
9175 dst++;
9177 if (src[0] == '\\' && src[1] == '?' && src[2] == '?' && src[3] == '\\') src += 4;
9178 if (*dst)
9180 if (dst[0] == '\\' && dst[1] == '?' && dst[2] == '?' && dst[3] == '\\') dst += 4;
9181 ok(MoveFileExA(src, dst, flags), "Failed to move file %s -> %s (%u)\n", src, dst, GetLastError());
9183 else
9184 ok(DeleteFileA(src), "Failed to delete file %s (%u)\n", src, GetLastError());
9187 ok(found, "Expected a 'msitest' entry\n");
9189 if (*buf2)
9190 RegSetValueExA(hkey, rename_ops, 0, REG_MULTI_SZ, (LPBYTE)buf2, buf2ptr + 1 - buf2);
9191 else
9192 RegDeleteValueA(hkey, rename_ops);
9194 HeapFree(GetProcessHeap(), 0, buf);
9195 HeapFree(GetProcessHeap(), 0, buf2);
9198 static BOOL file_matches_data(LPCSTR file, LPCSTR data)
9200 DWORD len, data_len = strlen(data);
9201 HANDLE handle;
9202 char buf[128];
9204 handle = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
9205 ok(handle != INVALID_HANDLE_VALUE, "failed to open %s (%u)\n", file, GetLastError());
9207 if (ReadFile(handle, buf, sizeof(buf), &len, NULL) && len >= data_len)
9209 CloseHandle(handle);
9210 return !memcmp(buf, data, data_len);
9212 CloseHandle(handle);
9213 return FALSE;
9216 static void test_file_in_use(void)
9218 UINT r;
9219 HANDLE file;
9220 HKEY hkey;
9221 char path[MAX_PATH];
9223 if (on_win9x)
9225 win_skip("Pending file renaming is implemented differently on Win9x and WinMe\n");
9226 return;
9228 if (is_process_limited())
9230 skip("process is limited\n");
9231 return;
9234 RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey);
9236 CreateDirectoryA("msitest", NULL);
9237 create_file("msitest\\maximus", 500);
9238 create_database(msifile, fiu_tables, sizeof(fiu_tables) / sizeof(msi_table));
9240 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9242 lstrcpy(path, PROG_FILES_DIR);
9243 lstrcat(path, "\\msitest");
9244 CreateDirectoryA(path, NULL);
9246 lstrcat(path, "\\maximus");
9247 file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
9249 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
9250 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9252 skip("Not enough rights to perform tests\n");
9253 goto error;
9255 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
9256 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
9257 CloseHandle(file);
9258 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
9260 process_pending_renames(hkey);
9261 RegCloseKey(hkey);
9263 ok(file_matches_data(path, "msitest\\maximus"), "Expected file to match\n");
9264 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
9265 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
9267 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9268 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9270 error:
9271 RegCloseKey(hkey);
9273 delete_pf("msitest\\maximus", TRUE);
9274 delete_pf("msitest", FALSE);
9275 DeleteFileA("msitest\\maximus");
9276 delete_test_files();
9277 DeleteFile(msifile);
9280 static void test_file_in_use_cab(void)
9282 UINT r;
9283 HANDLE file;
9284 HKEY hkey;
9285 char path[MAX_PATH];
9287 if (on_win9x)
9289 win_skip("Pending file renaming is implemented differently on Win9x and WinMe\n");
9290 return;
9292 if (is_process_limited())
9294 skip("process is limited\n");
9295 return;
9298 RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey);
9300 CreateDirectoryA("msitest", NULL);
9301 create_file("maximus", 500);
9302 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
9303 DeleteFile("maximus");
9305 create_database(msifile, fiuc_tables, sizeof(fiuc_tables) / sizeof(msi_table));
9307 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9309 lstrcpy(path, PROG_FILES_DIR);
9310 lstrcat(path, "\\msitest");
9311 CreateDirectoryA(path, NULL);
9313 lstrcat(path, "\\maximus");
9314 file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
9316 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
9317 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9319 skip("Not enough rights to perform tests\n");
9320 goto error;
9322 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
9323 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
9324 CloseHandle(file);
9325 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
9327 process_pending_renames(hkey);
9328 RegCloseKey(hkey);
9330 ok(file_matches_data(path, "maximus"), "Expected file to match\n");
9331 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
9332 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
9334 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9335 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9337 error:
9338 RegCloseKey(hkey);
9340 delete_pf("msitest\\maximus", TRUE);
9341 delete_pf("msitest", FALSE);
9342 DeleteFileA("msitest\\maximus");
9343 delete_cab_files();
9344 delete_test_files();
9345 DeleteFile(msifile);
9348 static INT CALLBACK handler_a(LPVOID context, UINT type, LPCSTR msg)
9350 return IDOK;
9353 static INT CALLBACK handler_w(LPVOID context, UINT type, LPCWSTR msg)
9355 return IDOK;
9358 static INT CALLBACK handler_record(LPVOID context, UINT type, MSIHANDLE record)
9360 return IDOK;
9363 static void test_MsiSetExternalUI(void)
9365 INSTALLUI_HANDLERA ret_a;
9366 INSTALLUI_HANDLERW ret_w;
9367 INSTALLUI_HANDLER_RECORD prev;
9368 UINT error;
9370 ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL);
9371 ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
9373 ret_a = MsiSetExternalUIA(NULL, 0, NULL);
9374 ok(ret_a == handler_a, "expected %p, got %p\n", handler_a, ret_a);
9376 /* Not present before Installer 3.1 */
9377 if (!pMsiSetExternalUIRecord) {
9378 win_skip("MsiSetExternalUIRecord is not available\n");
9379 return;
9382 error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
9383 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9384 ok(prev == NULL, "expected NULL, got %p\n", prev);
9386 prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
9387 error = pMsiSetExternalUIRecord(NULL, INSTALLLOGMODE_ERROR, NULL, &prev);
9388 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9389 ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev);
9391 ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL);
9392 ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
9394 ret_w = MsiSetExternalUIW(NULL, 0, NULL);
9395 ok(ret_w == handler_w, "expected %p, got %p\n", handler_w, ret_w);
9397 ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL);
9398 ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
9400 ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL);
9401 ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
9403 prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
9404 error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
9405 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9406 ok(prev == NULL, "expected NULL, got %p\n", prev);
9408 ret_a = MsiSetExternalUIA(NULL, 0, NULL);
9409 ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
9411 ret_w = MsiSetExternalUIW(NULL, 0, NULL);
9412 ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
9414 prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
9415 error = pMsiSetExternalUIRecord(NULL, 0, NULL, &prev);
9416 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9417 ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev);
9419 error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, NULL);
9420 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9422 error = pMsiSetExternalUIRecord(NULL, 0, NULL, NULL);
9423 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9426 static void test_feature_override(void)
9428 UINT r;
9429 REGSAM access = KEY_ALL_ACCESS;
9431 if (is_process_limited())
9433 skip("process is limited\n");
9434 return;
9437 create_test_files();
9438 create_file("msitest\\override.txt", 1000);
9439 create_file("msitest\\preselected.txt", 1000);
9440 create_file("msitest\\notpreselected.txt", 1000);
9441 create_database(msifile, fo_tables, sizeof(fo_tables) / sizeof(msi_table));
9443 if (is_wow64)
9444 access |= KEY_WOW64_64KEY;
9446 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9448 r = MsiInstallProductA(msifile, "ADDLOCAL=override");
9449 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9451 skip("Not enough rights to perform tests\n");
9452 goto error;
9454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9456 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
9457 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
9458 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
9460 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9463 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
9465 r = MsiInstallProductA(msifile, "preselect=1");
9466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9468 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
9469 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
9470 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
9472 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9475 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
9476 todo_wine {
9477 ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
9478 ok(delete_pf("msitest", FALSE), "directory removed\n");
9481 r = MsiInstallProductA(msifile, NULL);
9482 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9484 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
9485 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
9486 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
9488 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9489 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9491 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
9492 todo_wine {
9493 ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
9494 ok(delete_pf("msitest", FALSE), "directory removed\n");
9497 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access);
9499 error:
9500 DeleteFileA("msitest\\override.txt");
9501 DeleteFileA("msitest\\preselected.txt");
9502 DeleteFileA("msitest\\notpreselected.txt");
9503 delete_test_files();
9504 DeleteFile(msifile);
9507 static void test_create_folder(void)
9509 UINT r;
9511 create_test_files();
9512 create_database(msifile, cf_tables, sizeof(cf_tables) / sizeof(msi_table));
9514 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9516 r = MsiInstallProductA(msifile, NULL);
9517 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9519 skip("Not enough rights to perform tests\n");
9520 goto error;
9522 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9524 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9525 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9526 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9527 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9528 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9529 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9530 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9531 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9532 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9533 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9534 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9535 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9537 r = MsiInstallProductA(msifile, "LOCAL=Two");
9538 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9540 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9541 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9542 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9543 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9544 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9545 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9546 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9547 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9548 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9549 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9550 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9551 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9553 error:
9554 delete_test_files();
9555 DeleteFile(msifile);
9558 static void test_remove_folder(void)
9560 UINT r;
9562 create_test_files();
9563 create_database(msifile, rf_tables, sizeof(rf_tables) / sizeof(msi_table));
9565 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9567 r = MsiInstallProductA(msifile, NULL);
9568 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9570 skip("Not enough rights to perform tests\n");
9571 goto error;
9573 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9575 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9576 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9577 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9578 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9579 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9580 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9581 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9582 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9583 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9584 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9585 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9586 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9588 r = MsiInstallProductA(msifile, "LOCAL=Two");
9589 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9591 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9592 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9593 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9594 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9595 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9596 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9597 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9598 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9599 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9600 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9601 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9602 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9604 error:
9605 delete_test_files();
9606 DeleteFile(msifile);
9609 static void test_start_services(void)
9611 UINT r;
9612 SC_HANDLE scm, service;
9613 BOOL ret;
9614 DWORD error = ERROR_SUCCESS;
9616 if (on_win9x)
9618 win_skip("Services are not implemented on Win9x and WinMe\n");
9619 return;
9621 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
9622 if (!scm && GetLastError() == ERROR_ACCESS_DENIED)
9624 skip("Not enough rights to perform tests\n");
9625 return;
9627 ok(scm != NULL, "Failed to open the SC Manager\n");
9628 if (!scm) return;
9630 service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
9631 if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST)
9633 win_skip("The 'Spooler' service does not exist\n");
9634 CloseServiceHandle(scm);
9635 return;
9637 ok(service != NULL, "Failed to open Spooler, error %d\n", GetLastError());
9638 if (!service) {
9639 CloseServiceHandle(scm);
9640 return;
9643 ret = StartService(service, 0, NULL);
9644 if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING)
9646 skip("Terminal service not available, skipping test\n");
9647 CloseServiceHandle(service);
9648 CloseServiceHandle(scm);
9649 return;
9652 CloseServiceHandle(service);
9653 CloseServiceHandle(scm);
9655 create_test_files();
9656 create_database(msifile, sss_tables, sizeof(sss_tables) / sizeof(msi_table));
9658 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9660 r = MsiInstallProductA(msifile, NULL);
9661 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9663 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9664 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9665 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9666 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9667 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9668 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9669 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9670 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9671 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9672 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9673 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9674 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9676 delete_test_files();
9677 DeleteFile(msifile);
9679 if (error == ERROR_SUCCESS)
9681 SERVICE_STATUS status;
9683 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
9684 service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
9686 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
9687 ok(ret, "ControlService failed %u\n", GetLastError());
9689 CloseServiceHandle(service);
9690 CloseServiceHandle(scm);
9694 static void test_delete_services(void)
9696 UINT r;
9698 if (on_win9x)
9700 win_skip("Services are not implemented on Win9x and WinMe\n");
9701 return;
9703 if (is_process_limited())
9705 skip("process is limited\n");
9706 return;
9709 create_test_files();
9710 create_database(msifile, sds_tables, sizeof(sds_tables) / sizeof(msi_table));
9712 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9714 r = MsiInstallProductA(msifile, NULL);
9715 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9717 skip("Not enough rights to perform tests\n");
9718 goto error;
9720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9722 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9723 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9725 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9726 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9727 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9728 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9729 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9730 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9731 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9732 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9733 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9734 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9735 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9736 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9738 error:
9739 delete_test_files();
9740 DeleteFile(msifile);
9743 static void test_self_registration(void)
9745 UINT r;
9747 if (is_process_limited())
9749 skip("process is limited\n");
9750 return;
9753 create_test_files();
9754 create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table));
9756 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9758 r = MsiInstallProductA(msifile, NULL);
9759 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9761 skip("Not enough rights to perform tests\n");
9762 goto error;
9764 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9766 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9767 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9768 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9769 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9770 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9771 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9772 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9773 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9774 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9775 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9776 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9777 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9779 error:
9780 delete_test_files();
9781 DeleteFile(msifile);
9784 static void test_register_font(void)
9786 static const char regfont1[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
9787 static const char regfont2[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
9788 LONG ret;
9789 HKEY key;
9790 UINT r;
9791 REGSAM access = KEY_ALL_ACCESS;
9793 if (is_process_limited())
9795 skip("process is limited\n");
9796 return;
9799 create_test_files();
9800 create_file("msitest\\font.ttf", 1000);
9801 create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table));
9803 if (is_wow64)
9804 access |= KEY_WOW64_64KEY;
9806 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9808 r = MsiInstallProductA(msifile, NULL);
9809 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9811 skip("Not enough rights to perform tests\n");
9812 goto error;
9814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9816 ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont1, 0, access, &key);
9817 if (ret)
9818 RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont2, 0, access, &key);
9820 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
9821 ok(ret != ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
9823 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9826 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
9828 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
9829 ok(ret == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
9831 RegDeleteValueA(key, "msi test font");
9832 RegCloseKey(key);
9834 error:
9835 DeleteFileA("msitest\\font.ttf");
9836 delete_test_files();
9837 DeleteFile(msifile);
9840 static void test_validate_product_id(void)
9842 UINT r;
9844 if (is_process_limited())
9846 skip("process is limited\n");
9847 return;
9850 create_test_files();
9851 create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table));
9853 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9855 r = MsiInstallProductA(msifile, NULL);
9856 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9858 skip("Not enough rights to perform tests\n");
9859 goto error;
9861 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9863 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=1");
9864 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9866 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=2");
9867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9869 r = MsiInstallProductA(msifile, "PIDKEY=123-1234567");
9870 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9872 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9873 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9874 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9875 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9876 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9877 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9878 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9879 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9880 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9881 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9882 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9883 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9885 error:
9886 delete_test_files();
9887 DeleteFile(msifile);
9890 static void test_install_remove_odbc(void)
9892 UINT r;
9894 if (is_process_limited())
9896 skip("process is limited\n");
9897 return;
9900 create_test_files();
9901 create_file("msitest\\ODBCdriver.dll", 1000);
9902 create_file("msitest\\ODBCdriver2.dll", 1000);
9903 create_file("msitest\\ODBCtranslator.dll", 1000);
9904 create_file("msitest\\ODBCtranslator2.dll", 1000);
9905 create_file("msitest\\ODBCsetup.dll", 1000);
9906 create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table));
9908 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9910 r = MsiInstallProductA(msifile, NULL);
9911 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9913 skip("Not enough rights to perform tests\n");
9914 goto error;
9916 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9918 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
9919 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
9920 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
9921 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
9922 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
9924 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9925 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9927 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not removed\n");
9928 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not removed\n");
9929 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not removed\n");
9930 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not removed\n");
9931 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
9932 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
9934 error:
9935 DeleteFileA("msitest\\ODBCdriver.dll");
9936 DeleteFileA("msitest\\ODBCdriver2.dll");
9937 DeleteFileA("msitest\\ODBCtranslator.dll");
9938 DeleteFileA("msitest\\ODBCtranslator2.dll");
9939 DeleteFileA("msitest\\ODBCsetup.dll");
9940 delete_test_files();
9941 DeleteFile(msifile);
9944 static void test_register_typelib(void)
9946 UINT r;
9948 if (is_process_limited())
9950 skip("process is limited\n");
9951 return;
9954 create_test_files();
9955 create_file("msitest\\typelib.dll", 1000);
9956 create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table));
9958 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9960 r = MsiInstallProductA(msifile, "REGISTER_TYPELIB=1");
9961 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9963 skip("Not enough rights to perform tests\n");
9964 goto error;
9966 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9968 r = MsiInstallProductA(msifile, NULL);
9969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9971 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9974 ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n");
9975 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
9977 error:
9978 DeleteFileA("msitest\\typelib.dll");
9979 delete_test_files();
9980 DeleteFile(msifile);
9983 static void test_create_remove_shortcut(void)
9985 UINT r;
9987 if (is_process_limited())
9989 skip("process is limited\n");
9990 return;
9993 create_test_files();
9994 create_file("msitest\\target.txt", 1000);
9995 create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table));
9997 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9999 r = MsiInstallProductA(msifile, NULL);
10000 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10002 skip("Not enough rights to perform tests\n");
10003 goto error;
10005 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10007 ok(pf_exists("msitest\\target.txt"), "file not created\n");
10008 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
10010 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10011 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10013 ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n");
10014 ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n");
10015 todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10017 error:
10018 DeleteFileA("msitest\\target.txt");
10019 delete_test_files();
10020 DeleteFile(msifile);
10023 static void test_publish_components(void)
10025 static char keypath[] =
10026 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
10028 UINT r;
10029 LONG res;
10030 HKEY key;
10032 if (is_process_limited())
10034 skip("process is limited\n");
10035 return;
10038 create_test_files();
10039 create_file("msitest\\english.txt", 1000);
10040 create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table));
10042 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10044 r = MsiInstallProductA(msifile, NULL);
10045 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10047 skip("Not enough rights to perform tests\n");
10048 goto error;
10050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10052 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
10053 ok(res == ERROR_SUCCESS, "components key not created %d\n", res);
10055 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL);
10056 ok(res == ERROR_SUCCESS, "value not found %d\n", res);
10057 RegCloseKey(key);
10059 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10062 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
10063 ok(res == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", res);
10065 ok(!delete_pf("msitest\\english.txt", TRUE), "file not removed\n");
10066 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10068 error:
10069 DeleteFileA("msitest\\english.txt");
10070 delete_test_files();
10071 DeleteFile(msifile);
10074 static void test_remove_duplicate_files(void)
10076 UINT r;
10078 if (is_process_limited())
10080 skip("process is limited\n");
10081 return;
10084 create_test_files();
10085 create_file("msitest\\original.txt", 1000);
10086 create_file("msitest\\original2.txt", 1000);
10087 create_file("msitest\\original3.txt", 1000);
10088 create_database(msifile, rd_tables, sizeof(rd_tables) / sizeof(msi_table));
10090 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10092 r = MsiInstallProductA(msifile, NULL);
10093 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10095 skip("Not enough rights to perform tests\n");
10096 goto error;
10098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10100 ok(pf_exists("msitest\\original.txt"), "file not created\n");
10101 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
10102 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
10103 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
10104 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
10106 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10109 ok(delete_pf("msitest\\original.txt", TRUE), "file removed\n");
10110 ok(!delete_pf("msitest\\original2.txt", TRUE), "file not removed\n");
10111 ok(!delete_pf("msitest\\original3.txt", TRUE), "file not removed\n");
10112 ok(!delete_pf("msitest\\duplicate.txt", TRUE), "file not removed\n");
10113 ok(!delete_pf("msitest\\duplicate2.txt", TRUE), "file not removed\n");
10114 ok(delete_pf("msitest", FALSE), "directory removed\n");
10116 error:
10117 DeleteFileA("msitest\\original.txt");
10118 DeleteFileA("msitest\\original2.txt");
10119 DeleteFileA("msitest\\original3.txt");
10120 delete_test_files();
10121 DeleteFile(msifile);
10124 static void test_remove_registry_values(void)
10126 UINT r;
10127 LONG res;
10128 HKEY key;
10129 REGSAM access = KEY_ALL_ACCESS;
10131 if (is_process_limited())
10133 skip("process is limited\n");
10134 return;
10137 create_test_files();
10138 create_file("msitest\\registry.txt", 1000);
10139 create_database(msifile, rrv_tables, sizeof(rrv_tables) / sizeof(msi_table));
10141 if (is_wow64)
10142 access |= KEY_WOW64_64KEY;
10144 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10146 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, NULL, 0, access, NULL, &key, NULL);
10147 RegSetValueExA(key, "value1", 0, REG_SZ, (const BYTE *)"1", 2);
10148 RegCloseKey(key);
10150 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
10151 RegSetValueExA(key, "value2", 0, REG_SZ, (const BYTE *)"2", 2);
10152 RegCloseKey(key);
10154 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, NULL, 0, access, NULL, &key, NULL);
10155 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
10156 RegSetValueExA(key, "valueA", 0, REG_SZ, (const BYTE *)"A", 2);
10157 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
10158 RegCloseKey(key);
10160 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, NULL, 0, access, NULL, &key, NULL);
10161 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
10162 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
10163 RegCloseKey(key);
10165 r = MsiInstallProductA(msifile, NULL);
10166 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10168 skip("Not enough rights to perform tests\n");
10169 goto error;
10171 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10173 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, access, &key);
10174 ok(res == ERROR_SUCCESS, "key removed\n");
10175 RegCloseKey(key);
10177 if (is_64bit && !is_wow64)
10179 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
10180 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10182 else
10184 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
10185 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10188 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
10189 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10190 RegCloseKey(key);
10192 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10193 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10195 if (is_64bit && !is_wow64)
10197 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
10198 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10200 else
10202 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
10203 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10206 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, access, &key);
10207 ok(res == ERROR_SUCCESS, "key removed\n");
10208 RegCloseKey(key);
10210 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, access, &key);
10211 ok(res == ERROR_SUCCESS, "key removed\n");
10212 RegCloseKey(key);
10214 if (is_64bit && !is_wow64)
10216 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
10217 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10219 else
10221 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
10222 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10225 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
10226 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
10227 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine", access);
10229 ok(!delete_pf("msitest\\registry.txt", TRUE), "file not removed\n");
10230 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10232 error:
10233 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", access);
10234 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
10235 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
10236 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", access);
10238 DeleteFileA("msitest\\registry.txt");
10239 delete_test_files();
10240 DeleteFile(msifile);
10243 static void test_find_related_products(void)
10245 UINT r;
10247 if (is_process_limited())
10249 skip("process is limited\n");
10250 return;
10253 create_test_files();
10254 create_file("msitest\\product.txt", 1000);
10255 create_database(msifile, frp_tables, sizeof(frp_tables) / sizeof(msi_table));
10257 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10259 r = MsiInstallProductA(msifile, NULL);
10260 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10262 skip("Not enough rights to perform tests\n");
10263 goto error;
10265 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10267 /* install again, so it finds the upgrade code */
10268 r = MsiInstallProductA(msifile, NULL);
10269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10271 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10272 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10274 ok(!delete_pf("msitest\\product.txt", TRUE), "file not removed\n");
10275 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10277 error:
10278 DeleteFileA("msitest\\product.txt");
10279 delete_test_files();
10280 DeleteFile(msifile);
10283 static void test_remove_ini_values(void)
10285 UINT r;
10286 DWORD len;
10287 char inifile[MAX_PATH], buf[0x10];
10288 HANDLE file;
10289 BOOL ret;
10291 if (is_process_limited())
10293 skip("process is limited\n");
10294 return;
10297 create_test_files();
10298 create_file("msitest\\inifile.txt", 1000);
10299 create_database(msifile, riv_tables, sizeof(riv_tables) / sizeof(msi_table));
10301 lstrcpyA(inifile, PROG_FILES_DIR);
10302 lstrcatA(inifile, "\\msitest");
10303 ret = CreateDirectoryA(inifile, NULL);
10304 if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
10306 skip("Not enough rights to perform tests\n");
10307 goto error;
10309 lstrcatA(inifile, "\\test.ini");
10310 file = CreateFileA(inifile, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0, NULL);
10311 CloseHandle(file);
10313 ret = WritePrivateProfileStringA("section1", "key1", "value1", inifile);
10314 ok(ret, "failed to write profile string %u\n", GetLastError());
10316 ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile);
10317 ok(ret, "failed to write profile string %u\n", GetLastError());
10319 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10321 r = MsiInstallProductA(msifile, NULL);
10322 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10324 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
10325 ok(len == 6, "got %u expected 6\n", len);
10327 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
10328 ok(!len, "got %u expected 0\n", len);
10330 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10331 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10333 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
10334 ok(!len, "got %u expected 0\n", len);
10336 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
10337 ok(!len, "got %u expected 0\n", len);
10339 todo_wine ok(!delete_pf("msitest\\test.ini", TRUE), "file removed\n");
10340 ok(!delete_pf("msitest\\inifile.txt", TRUE), "file not removed\n");
10341 ok(delete_pf("msitest", FALSE), "directory removed\n");
10343 error:
10344 DeleteFileA("msitest\\inifile.txt");
10345 delete_test_files();
10346 DeleteFile(msifile);
10349 static void test_remove_env_strings(void)
10351 UINT r;
10352 LONG res;
10353 HKEY key;
10354 DWORD type, size;
10355 char buffer[0x10];
10357 if (on_win9x)
10359 win_skip("Environment variables are handled differently on win9x and winme\n");
10360 return;
10362 if (is_process_limited())
10364 skip("process is limited\n");
10365 return;
10368 create_test_files();
10369 create_file("msitest\\envvar.txt", 1000);
10370 create_database(msifile, res_tables, sizeof(res_tables) / sizeof(msi_table));
10372 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10374 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
10375 ok(!res, "failed to open environment key %d\n", res);
10377 RegSetValueExA(key, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"1", 2);
10378 RegSetValueExA(key, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"1", 2);
10379 RegSetValueExA(key, "MSITESTVAR3", 0, REG_SZ, (const BYTE *)"1", 2);
10380 RegSetValueExA(key, "MSITESTVAR4", 0, REG_SZ, (const BYTE *)"1", 2);
10381 RegSetValueExA(key, "MSITESTVAR5", 0, REG_SZ, (const BYTE *)"1", 2);
10383 RegCloseKey(key);
10385 r = MsiInstallProductA(msifile, NULL);
10386 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10388 skip("Not enough rights to perform tests\n");
10389 goto error;
10391 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10393 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
10394 ok(!res, "failed to open environment key %d\n", res);
10396 type = REG_NONE;
10397 buffer[0] = 0;
10398 size = sizeof(buffer);
10399 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
10400 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10401 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10402 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10404 type = REG_NONE;
10405 buffer[0] = 0;
10406 size = sizeof(buffer);
10407 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
10408 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10409 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10410 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10412 type = REG_NONE;
10413 buffer[0] = 0;
10414 size = sizeof(buffer);
10415 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
10416 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10417 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10418 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10420 type = REG_NONE;
10421 buffer[0] = 0;
10422 size = sizeof(buffer);
10423 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, &type, (LPBYTE)buffer, &size);
10424 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10425 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10426 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10428 type = REG_NONE;
10429 buffer[0] = 0;
10430 size = sizeof(buffer);
10431 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
10432 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10433 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10434 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10436 RegCloseKey(key);
10438 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10441 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
10442 ok(!res, "failed to open environment key %d\n", res);
10444 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, NULL, NULL, NULL);
10445 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
10447 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, NULL, NULL, NULL);
10448 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
10450 type = REG_NONE;
10451 buffer[0] = 0;
10452 size = sizeof(buffer);
10453 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
10454 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10455 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10456 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10457 RegDeleteValueA(key, "MSITESTVAR3");
10459 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, NULL, NULL, NULL);
10460 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
10462 type = REG_NONE;
10463 buffer[0] = 0;
10464 size = sizeof(buffer);
10465 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
10466 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10467 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10468 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10469 RegDeleteValueA(key, "MSITESTVAR5");
10471 ok(!delete_pf("msitest\\envvar.txt", TRUE), "file not removed\n");
10472 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10474 error:
10475 RegDeleteValueA(key, "MSITESTVAR1");
10476 RegDeleteValueA(key, "MSITESTVAR2");
10477 RegDeleteValueA(key, "MSITESTVAR3");
10478 RegDeleteValueA(key, "MSITESTVAR4");
10479 RegDeleteValueA(key, "MSITESTVAR5");
10480 RegCloseKey(key);
10482 DeleteFileA("msitest\\envvar.txt");
10483 delete_test_files();
10484 DeleteFile(msifile);
10487 static void test_register_class_info(void)
10489 UINT r;
10490 LONG res;
10491 HKEY hkey;
10493 if (is_process_limited())
10495 skip("process is limited\n");
10496 return;
10499 create_test_files();
10500 create_file("msitest\\class.txt", 1000);
10501 create_database(msifile, rci_tables, sizeof(rci_tables) / sizeof(msi_table));
10503 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10505 r = MsiInstallProductA(msifile, NULL);
10506 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10508 skip("Not enough rights to perform tests\n");
10509 goto error;
10511 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10513 if (is_64bit && !is_wow64)
10514 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10515 else
10516 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10517 ok(res == ERROR_SUCCESS, "key not created\n");
10518 RegCloseKey(hkey);
10520 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10521 ok(res == ERROR_SUCCESS, "key not created\n");
10522 RegCloseKey(hkey);
10524 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
10525 ok(res == ERROR_SUCCESS, "key not created\n");
10526 RegCloseKey(hkey);
10528 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10529 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10531 if (is_64bit && !is_wow64)
10532 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10533 else
10534 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10535 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10537 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10538 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10540 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
10541 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10543 ok(!delete_pf("msitest\\class.txt", TRUE), "file not removed\n");
10544 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10546 error:
10547 DeleteFileA("msitest\\class.txt");
10548 delete_test_files();
10549 DeleteFile(msifile);
10552 static void test_register_extension_info(void)
10554 UINT r;
10555 LONG res;
10556 HKEY hkey;
10558 if (is_process_limited())
10560 skip("process is limited\n");
10561 return;
10564 create_test_files();
10565 create_file("msitest\\extension.txt", 1000);
10566 create_database(msifile, rei_tables, sizeof(rei_tables) / sizeof(msi_table));
10568 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10570 r = MsiInstallProductA(msifile, NULL);
10571 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10573 skip("Not enough rights to perform tests\n");
10574 goto error;
10576 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10578 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
10579 ok(res == ERROR_SUCCESS, "key not created\n");
10580 RegCloseKey(hkey);
10582 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &hkey);
10583 ok(res == ERROR_SUCCESS, "key not created\n");
10584 RegCloseKey(hkey);
10586 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10587 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10589 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
10590 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10592 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1", &hkey);
10593 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10595 ok(!delete_pf("msitest\\extension.txt", TRUE), "file not removed\n");
10596 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10598 error:
10599 DeleteFileA("msitest\\extension.txt");
10600 delete_test_files();
10601 DeleteFile(msifile);
10604 static void test_register_mime_info(void)
10606 UINT r;
10607 LONG res;
10608 HKEY hkey;
10610 if (is_process_limited())
10612 skip("process is limited\n");
10613 return;
10616 create_test_files();
10617 create_file("msitest\\mime.txt", 1000);
10618 create_database(msifile, rmi_tables, sizeof(rmi_tables) / sizeof(msi_table));
10620 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10622 r = MsiInstallProductA(msifile, NULL);
10623 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10625 skip("Not enough rights to perform tests\n");
10626 goto error;
10628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10630 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
10631 ok(res == ERROR_SUCCESS, "key not created\n");
10632 RegCloseKey(hkey);
10634 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10637 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
10638 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10640 ok(!delete_pf("msitest\\mime.txt", TRUE), "file not removed\n");
10641 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10643 error:
10644 DeleteFileA("msitest\\mime.txt");
10645 delete_test_files();
10646 DeleteFile(msifile);
10649 static void test_icon_table(void)
10651 MSIHANDLE hdb = 0, record;
10652 LPCSTR query;
10653 UINT res;
10654 CHAR path[MAX_PATH], win9xpath[MAX_PATH];
10655 static const char prodcode[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
10657 if (is_process_limited())
10659 skip("process is limited\n");
10660 return;
10663 create_database(msifile, icon_base_tables, sizeof(icon_base_tables) / sizeof(msi_table));
10665 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10667 res = MsiOpenDatabase(msifile, MSIDBOPEN_TRANSACT, &hdb);
10668 ok(res == ERROR_SUCCESS, "failed to open db: %d\n", res);
10670 query = "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
10671 res = run_query( hdb, 0, query );
10672 ok(res == ERROR_SUCCESS, "Can't create Icon table: %d\n", res);
10674 create_file("icon.ico", 100);
10675 record = MsiCreateRecord(1);
10676 res = MsiRecordSetStream(record, 1, "icon.ico");
10677 ok(res == ERROR_SUCCESS, "Failed to add stream data to record: %d\n", res);
10678 DeleteFile("icon.ico");
10680 query = "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
10681 res = run_query(hdb, record, query);
10682 ok(res == ERROR_SUCCESS, "Insert into Icon table failed: %d\n", res);
10684 res = MsiCloseHandle(record);
10685 ok(res == ERROR_SUCCESS, "Failed to close record handle: %d\n", res);
10686 res = MsiDatabaseCommit(hdb);
10687 ok(res == ERROR_SUCCESS, "Failed to commit database: %d\n", res);
10688 res = MsiCloseHandle(hdb);
10689 ok(res == ERROR_SUCCESS, "Failed to close database: %d\n", res);
10691 /* per-user */
10692 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
10693 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
10695 skip("Not enough rights to perform tests\n");
10696 DeleteFile(msifile);
10697 return;
10699 ok(res == ERROR_SUCCESS, "Failed to do per-user install: %d\n", res);
10701 lstrcpyA(path, APP_DATA_DIR);
10702 lstrcatA(path, "\\");
10703 lstrcatA(path, "Microsoft\\Installer\\");
10704 lstrcatA(path, prodcode);
10705 lstrcatA(path, "\\testicon");
10706 ok(file_exists(path), "Per-user icon file isn't where it's expected (%s)\n", path);
10708 res = MsiInstallProductA(msifile, "REMOVE=ALL");
10709 ok(res == ERROR_SUCCESS, "Failed to uninstall per-user\n");
10711 /* system-wide */
10712 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
10713 ok(res == ERROR_SUCCESS, "Failed to system-wide install: %d\n", res);
10715 /* win9x with MSI 2.0 installs the icon to a different folder, same as above */
10716 lstrcpyA(win9xpath, APP_DATA_DIR);
10717 lstrcatA(win9xpath, "\\");
10718 lstrcatA(win9xpath, "Microsoft\\Installer\\");
10719 lstrcatA(win9xpath, prodcode);
10720 lstrcatA(win9xpath, "\\testicon");
10722 lstrcpyA(path, WINDOWS_DIR);
10723 lstrcatA(path, "\\");
10724 lstrcatA(path, "Installer\\");
10725 lstrcatA(path, prodcode);
10726 lstrcatA(path, "\\testicon");
10727 ok(file_exists(path) || file_exists(win9xpath),
10728 "System-wide icon file isn't where it's expected (%s)\n", path);
10730 res = MsiInstallProductA(msifile, "REMOVE=ALL");
10731 ok(res == ERROR_SUCCESS, "Failed to uninstall system-wide\n");
10733 delete_pfmsitest_files();
10734 DeleteFile(msifile);
10737 static void test_sourcedir_props(void)
10739 UINT r;
10741 if (on_win9x)
10743 win_skip("skipping sourcedir tests on win9x\n");
10744 return;
10746 if (is_process_limited())
10748 skip("process is limited\n");
10749 return;
10752 create_test_files();
10753 create_file("msitest\\sourcedir.txt", 1000);
10754 create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table));
10756 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
10758 /* full UI, no ResolveSource action */
10759 r = MsiInstallProductA(msifile, NULL);
10760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10762 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10763 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10765 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10766 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10768 /* full UI, ResolveSource action */
10769 r = MsiInstallProductA(msifile, "ResolveSource=1");
10770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10772 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10773 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10775 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10776 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10778 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10780 /* no UI, no ResolveSource action */
10781 r = MsiInstallProductA(msifile, NULL);
10782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10784 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10787 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10788 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10790 /* no UI, ResolveSource action */
10791 r = MsiInstallProductA(msifile, "ResolveSource=1");
10792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10794 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10795 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10797 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10798 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10800 DeleteFileA("msitest\\sourcedir.txt");
10801 DeleteFile(msifile);
10804 static void test_package_validation(void)
10806 UINT r;
10808 if (is_process_limited())
10810 skip("process is limited\n");
10811 return;
10814 CreateDirectoryA("msitest", NULL);
10815 create_file("msitest\\maximus", 500);
10816 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1033");
10818 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10820 r = MsiInstallProductA(msifile, NULL);
10821 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10823 skip("Not enough rights to perform tests\n");
10824 goto error;
10826 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10827 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10828 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10830 DeleteFile(msifile);
10831 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9999");
10833 r = MsiInstallProductA(msifile, NULL);
10834 ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
10835 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10836 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10838 DeleteFile(msifile);
10839 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel32;0");
10841 r = MsiInstallProductA(msifile, NULL);
10842 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
10843 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10844 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10846 if (is_64bit && !is_wow64)
10848 DeleteFile(msifile);
10849 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
10851 r = MsiInstallProductA(msifile, NULL);
10852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10853 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10854 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10856 DeleteFile(msifile);
10857 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
10859 r = MsiInstallProductA(msifile, NULL);
10860 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
10861 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10862 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10864 DeleteFile(msifile);
10865 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
10867 r = MsiInstallProductA(msifile, NULL);
10868 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10869 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10870 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10872 else if (is_wow64)
10874 DeleteFile(msifile);
10875 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
10877 r = MsiInstallProductA(msifile, NULL);
10878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10879 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10880 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10882 DeleteFile(msifile);
10883 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
10885 r = MsiInstallProductA(msifile, NULL);
10886 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
10887 ok(!delete_pf_native("msitest\\maximus", TRUE), "file exists\n");
10888 ok(!delete_pf_native("msitest", FALSE), "directory exists\n");
10890 DeleteFile(msifile);
10891 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
10893 r = MsiInstallProductA(msifile, NULL);
10894 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10895 ok(delete_pf_native("msitest\\maximus", TRUE), "file exists\n");
10896 ok(delete_pf_native("msitest", FALSE), "directory exists\n");
10898 else
10900 DeleteFile(msifile);
10901 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
10903 r = MsiInstallProductA(msifile, NULL);
10904 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10905 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10906 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10908 DeleteFile(msifile);
10909 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
10911 r = MsiInstallProductA(msifile, NULL);
10912 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
10913 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10914 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10916 DeleteFile(msifile);
10917 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
10919 r = MsiInstallProductA(msifile, NULL);
10920 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
10921 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10922 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10925 error:
10926 /* Delete the files in the temp (current) folder */
10927 DeleteFile(msifile);
10928 DeleteFile("msitest\\maximus");
10929 RemoveDirectory("msitest");
10932 START_TEST(install)
10934 DWORD len;
10935 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
10936 STATEMGRSTATUS status;
10937 BOOL ret = FALSE;
10939 init_functionpointers();
10941 on_win9x = check_win9x();
10943 if (pIsWow64Process)
10944 pIsWow64Process(GetCurrentProcess(), &is_wow64);
10946 GetCurrentDirectoryA(MAX_PATH, prev_path);
10947 GetTempPath(MAX_PATH, temp_path);
10948 SetCurrentDirectoryA(temp_path);
10950 lstrcpyA(CURR_DIR, temp_path);
10951 len = lstrlenA(CURR_DIR);
10953 if(len && (CURR_DIR[len - 1] == '\\'))
10954 CURR_DIR[len - 1] = 0;
10956 get_system_dirs();
10957 get_user_dirs();
10959 /* Create a restore point ourselves so we circumvent the multitude of restore points
10960 * that would have been created by all the installation and removal tests.
10962 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
10963 * creation of restore points.
10965 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
10967 memset(&status, 0, sizeof(status));
10968 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
10971 /* Create only one log file and don't append. We have to pass something
10972 * for the log mode for this to work. The logfile needs to have an absolute
10973 * path otherwise we still end up with some extra logfiles as some tests
10974 * change the current directory.
10976 lstrcpyA(log_file, temp_path);
10977 lstrcatA(log_file, "\\msitest.log");
10978 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
10980 test_MsiInstallProduct();
10981 test_MsiSetComponentState();
10982 test_packagecoltypes();
10983 test_continuouscabs();
10984 test_caborder();
10985 test_mixedmedia();
10986 test_samesequence();
10987 test_uiLevelFlags();
10988 test_readonlyfile();
10989 test_readonlyfile_cab();
10990 test_setdirproperty();
10991 test_cabisextracted();
10992 test_concurrentinstall();
10993 test_setpropertyfolder();
10994 test_publish_registerproduct();
10995 test_publish_publishproduct();
10996 test_publish_publishfeatures();
10997 test_publish_registeruser();
10998 test_publish_processcomponents();
10999 test_publish();
11000 test_publishsourcelist();
11001 test_transformprop();
11002 test_currentworkingdir();
11003 test_admin();
11004 test_adminprops();
11005 test_removefiles();
11006 test_movefiles();
11007 test_missingcab();
11008 test_duplicatefiles();
11009 test_writeregistryvalues();
11010 test_sourcefolder();
11011 test_customaction51();
11012 test_installstate();
11013 test_sourcepath();
11014 test_MsiConfigureProductEx();
11015 test_missingcomponent();
11016 test_sourcedirprop();
11017 test_adminimage();
11018 test_propcase();
11019 test_int_widths();
11020 test_shortcut();
11021 test_envvar();
11022 test_lastusedsource();
11023 test_preselected();
11024 test_installed_prop();
11025 test_file_in_use();
11026 test_file_in_use_cab();
11027 test_MsiSetExternalUI();
11028 test_allusers_prop();
11029 test_feature_override();
11030 test_create_folder();
11031 test_remove_folder();
11032 test_start_services();
11033 test_delete_services();
11034 test_self_registration();
11035 test_register_font();
11036 test_validate_product_id();
11037 test_install_remove_odbc();
11038 test_register_typelib();
11039 test_create_remove_shortcut();
11040 test_publish_components();
11041 test_remove_duplicate_files();
11042 test_remove_registry_values();
11043 test_find_related_products();
11044 test_remove_ini_values();
11045 test_remove_env_strings();
11046 test_register_class_info();
11047 test_register_extension_info();
11048 test_register_mime_info();
11049 test_icon_table();
11050 test_sourcedir_props();
11051 test_package_validation();
11053 DeleteFileA(log_file);
11055 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
11057 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
11058 if (ret)
11059 remove_restore_point(status.llSequenceNumber);
11061 FreeLibrary(hsrclient);
11063 SetCurrentDirectoryA(prev_path);