msi/tests: Reduce the UI level for a couple of tests.
[wine.git] / dlls / msi / tests / install.c
blob3572a937454af690ad8273d9c7d1f8f7c0b1e285
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);
46 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
47 static BOOL (WINAPI *pGetTokenInformation)( HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD );
48 static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
49 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
50 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
52 static HMODULE hsrclient = 0;
53 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
54 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
56 static BOOL on_win9x = FALSE;
57 static BOOL is_wow64;
58 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
60 static const char *msifile = "msitest.msi";
61 static const char *msifile2 = "winetest2.msi";
62 static const char *mstfile = "winetest.mst";
63 static CHAR CURR_DIR[MAX_PATH];
64 static CHAR PROG_FILES_DIR[MAX_PATH];
65 static CHAR PROG_FILES_DIR_NATIVE[MAX_PATH];
66 static CHAR COMMON_FILES_DIR[MAX_PATH];
67 static CHAR APP_DATA_DIR[MAX_PATH];
68 static CHAR WINDOWS_DIR[MAX_PATH];
70 /* msi database data */
72 static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
73 "s72\tS38\ts72\ti2\tS255\tS72\n"
74 "Component\tComponent\n"
75 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
76 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
77 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
78 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
79 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
80 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
81 "component\t\tMSITESTDIR\t0\t1\tfile\n"
82 "service_comp\t\tMSITESTDIR\t0\t1\tservice_file";
84 static const CHAR directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
85 "s72\tS72\tl255\n"
86 "Directory\tDirectory\n"
87 "CABOUTDIR\tMSITESTDIR\tcabout\n"
88 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
89 "FIRSTDIR\tMSITESTDIR\tfirst\n"
90 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
91 "NEWDIR\tCABOUTDIR\tnew\n"
92 "ProgramFilesFolder\tTARGETDIR\t.\n"
93 "TARGETDIR\t\tSourceDir";
95 static const CHAR feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
96 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
97 "Feature\tFeature\n"
98 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
99 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
100 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
101 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
102 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
103 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
104 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
106 static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n"
107 "s38\ts72\n"
108 "FeatureComponents\tFeature_\tComponent_\n"
109 "Five\tFive\n"
110 "Four\tFour\n"
111 "One\tOne\n"
112 "Three\tThree\n"
113 "Two\tTwo\n"
114 "feature\tcomponent\n"
115 "service_feature\tservice_comp\n";
117 static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
118 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
119 "File\tFile\n"
120 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
121 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
122 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
123 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
124 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
125 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
126 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
128 static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
129 "s72\tS255\tI2\n"
130 "InstallExecuteSequence\tAction\n"
131 "AllocateRegistrySpace\tNOT Installed\t1550\n"
132 "CostFinalize\t\t1000\n"
133 "CostInitialize\t\t800\n"
134 "FileCost\t\t900\n"
135 "ResolveSource\t\t950\n"
136 "MoveFiles\t\t1700\n"
137 "InstallFiles\t\t4000\n"
138 "DuplicateFiles\t\t4500\n"
139 "WriteEnvironmentStrings\t\t4550\n"
140 "CreateShortcuts\t\t4600\n"
141 "InstallServices\t\t5000\n"
142 "InstallFinalize\t\t6600\n"
143 "InstallInitialize\t\t1500\n"
144 "InstallValidate\t\t1400\n"
145 "LaunchConditions\t\t100\n"
146 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
148 static const CHAR media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
149 "i2\ti4\tL64\tS255\tS32\tS72\n"
150 "Media\tDiskId\n"
151 "1\t3\t\t\tDISK1\t\n"
152 "2\t5\t\tmsitest.cab\tDISK2\t\n";
154 static const CHAR property_dat[] = "Property\tValue\n"
155 "s72\tl0\n"
156 "Property\tProperty\n"
157 "DefaultUIFont\tDlgFont8\n"
158 "HASUIRUN\t0\n"
159 "INSTALLLEVEL\t3\n"
160 "InstallMode\tTypical\n"
161 "Manufacturer\tWine\n"
162 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
163 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
164 "ProductID\tnone\n"
165 "ProductLanguage\t1033\n"
166 "ProductName\tMSITEST\n"
167 "ProductVersion\t1.1.1\n"
168 "PROMPTROLLBACKCOST\tP\n"
169 "Setup\tSetup\n"
170 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
171 "AdminProperties\tPOSTADMIN\n"
172 "ROOTDRIVE\tC:\\\n"
173 "SERVNAME\tTestService\n"
174 "SERVDISP\tTestServiceDisp\n"
175 "MSIFASTINSTALL\t1\n";
177 static const CHAR aup_property_dat[] = "Property\tValue\n"
178 "s72\tl0\n"
179 "Property\tProperty\n"
180 "DefaultUIFont\tDlgFont8\n"
181 "HASUIRUN\t0\n"
182 "ALLUSERS\t1\n"
183 "INSTALLLEVEL\t3\n"
184 "InstallMode\tTypical\n"
185 "Manufacturer\tWine\n"
186 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
187 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
188 "ProductID\tnone\n"
189 "ProductLanguage\t1033\n"
190 "ProductName\tMSITEST\n"
191 "ProductVersion\t1.1.1\n"
192 "PROMPTROLLBACKCOST\tP\n"
193 "Setup\tSetup\n"
194 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
195 "AdminProperties\tPOSTADMIN\n"
196 "ROOTDRIVE\tC:\\\n"
197 "SERVNAME\tTestService\n"
198 "SERVDISP\tTestServiceDisp\n"
199 "MSIFASTINSTALL\t1\n";
201 static const CHAR aup2_property_dat[] = "Property\tValue\n"
202 "s72\tl0\n"
203 "Property\tProperty\n"
204 "DefaultUIFont\tDlgFont8\n"
205 "HASUIRUN\t0\n"
206 "ALLUSERS\t2\n"
207 "INSTALLLEVEL\t3\n"
208 "InstallMode\tTypical\n"
209 "Manufacturer\tWine\n"
210 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
211 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
212 "ProductID\tnone\n"
213 "ProductLanguage\t1033\n"
214 "ProductName\tMSITEST\n"
215 "ProductVersion\t1.1.1\n"
216 "PROMPTROLLBACKCOST\tP\n"
217 "Setup\tSetup\n"
218 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
219 "AdminProperties\tPOSTADMIN\n"
220 "ROOTDRIVE\tC:\\\n"
221 "SERVNAME\tTestService\n"
222 "SERVDISP\tTestServiceDisp\n"
223 "MSIFASTINSTALL\t1\n";
225 static const CHAR icon_property_dat[] = "Property\tValue\n"
226 "s72\tl0\n"
227 "Property\tProperty\n"
228 "DefaultUIFont\tDlgFont8\n"
229 "HASUIRUN\t0\n"
230 "INSTALLLEVEL\t3\n"
231 "InstallMode\tTypical\n"
232 "Manufacturer\tWine\n"
233 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
234 "ProductCode\t{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}\n"
235 "ProductID\tnone\n"
236 "ProductLanguage\t1033\n"
237 "ProductName\tMSITEST\n"
238 "ProductVersion\t1.1.1\n"
239 "PROMPTROLLBACKCOST\tP\n"
240 "Setup\tSetup\n"
241 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
242 "AdminProperties\tPOSTADMIN\n"
243 "ROOTDRIVE\tC:\\\n"
244 "SERVNAME\tTestService\n"
245 "SERVDISP\tTestServiceDisp\n"
246 "MSIFASTINSTALL\t1\n";
248 static const CHAR shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
249 "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"
250 "Shortcut\tShortcut\n"
251 "Shortcut\tMSITESTDIR\tShortcut\tcomponent\tShortcut\t\tShortcut\t\t\t\t\t\n";
253 static const CHAR environment_dat[] = "Environment\tName\tValue\tComponent_\n"
254 "s72\tl255\tL255\ts72\n"
255 "Environment\tEnvironment\n"
256 "Var1\t=-MSITESTVAR1\t1\tOne\n"
257 "Var2\tMSITESTVAR2\t1\tOne\n"
258 "Var3\t=-MSITESTVAR3\t1\tOne\n"
259 "Var4\tMSITESTVAR4\t1\tOne\n"
260 "Var5\t-MSITESTVAR5\t\tOne\n"
261 "Var6\tMSITESTVAR6\t\tOne\n"
262 "Var7\t!-MSITESTVAR7\t\tOne\n"
263 "Var8\t!-*MSITESTVAR8\t\tOne\n"
264 "Var9\t=-MSITESTVAR9\t\tOne\n"
265 "Var10\t=MSITESTVAR10\t\tOne\n"
266 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
267 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
268 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
269 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
270 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
271 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
272 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
273 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
274 "Var19\t+-MSITESTVAR17\t1\tOne\n"
275 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
276 "Var21\t+-MSITESTVAR18\t1\tOne\n"
277 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
278 "Var23\t+-MSITESTVAR19\t1\tOne\n"
279 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
280 "Var25\t+-MSITESTVAR20\t1\tOne\n"
281 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n";
283 /* Expected results, starting from MSITESTVAR11 onwards */
284 static const CHAR *environment_dat_results[] = {"1;2", /*MSITESTVAR11*/
285 "1", /*MSITESTVAR12*/
286 "1;2", /*MSITESTVAR13*/
287 ";1;", /*MSITESTVAR14*/
288 ";;1;;", /*MSITESTVAR15*/
289 " 1 ", /*MSITESTVAR16*/
290 ";;2;;1", /*MSITESTVAR17*/
291 "1;;2;;", /*MSITESTVAR18*/
292 "1", /*MSITESTVAR19*/
293 "1", /*MSITESTVAR20*/
294 NULL};
296 static const CHAR condition_dat[] = "Feature_\tLevel\tCondition\n"
297 "s38\ti2\tS255\n"
298 "Condition\tFeature_\tLevel\n"
299 "One\t4\t1\n";
301 static const CHAR up_property_dat[] = "Property\tValue\n"
302 "s72\tl0\n"
303 "Property\tProperty\n"
304 "DefaultUIFont\tDlgFont8\n"
305 "HASUIRUN\t0\n"
306 "INSTALLLEVEL\t3\n"
307 "InstallMode\tTypical\n"
308 "Manufacturer\tWine\n"
309 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
310 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
311 "ProductID\tnone\n"
312 "ProductLanguage\t1033\n"
313 "ProductName\tMSITEST\n"
314 "ProductVersion\t1.1.1\n"
315 "PROMPTROLLBACKCOST\tP\n"
316 "Setup\tSetup\n"
317 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
318 "AdminProperties\tPOSTADMIN\n"
319 "ROOTDRIVE\tC:\\\n"
320 "SERVNAME\tTestService\n"
321 "SERVDISP\tTestServiceDisp\n"
322 "RemovePreviousVersions\t1\n"
323 "MSIFASTINSTALL\t1\n";
325 static const CHAR up2_property_dat[] = "Property\tValue\n"
326 "s72\tl0\n"
327 "Property\tProperty\n"
328 "DefaultUIFont\tDlgFont8\n"
329 "HASUIRUN\t0\n"
330 "INSTALLLEVEL\t3\n"
331 "InstallMode\tTypical\n"
332 "Manufacturer\tWine\n"
333 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
334 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
335 "ProductID\tnone\n"
336 "ProductLanguage\t1033\n"
337 "ProductName\tMSITEST\n"
338 "ProductVersion\t1.1.2\n"
339 "PROMPTROLLBACKCOST\tP\n"
340 "Setup\tSetup\n"
341 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
342 "AdminProperties\tPOSTADMIN\n"
343 "ROOTDRIVE\tC:\\\n"
344 "SERVNAME\tTestService\n"
345 "SERVDISP\tTestServiceDisp\n"
346 "MSIFASTINSTALL\t1\n";
348 static const CHAR up3_property_dat[] = "Property\tValue\n"
349 "s72\tl0\n"
350 "Property\tProperty\n"
351 "DefaultUIFont\tDlgFont8\n"
352 "HASUIRUN\t0\n"
353 "INSTALLLEVEL\t3\n"
354 "InstallMode\tTypical\n"
355 "Manufacturer\tWine\n"
356 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
357 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
358 "ProductID\tnone\n"
359 "ProductLanguage\t1033\n"
360 "ProductName\tMSITEST\n"
361 "ProductVersion\t1.1.2\n"
362 "PROMPTROLLBACKCOST\tP\n"
363 "Setup\tSetup\n"
364 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
365 "AdminProperties\tPOSTADMIN\n"
366 "ROOTDRIVE\tC:\\\n"
367 "SERVNAME\tTestService\n"
368 "SERVDISP\tTestServiceDisp\n"
369 "RemovePreviousVersions\t1\n"
370 "MSIFASTINSTALL\t1\n";
372 static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
373 "s72\ti2\tl255\tL255\tL0\ts72\n"
374 "Registry\tRegistry\n"
375 "Apples\t1\tSOFTWARE\\Wine\\msitest\tName\timaname\tOne\n"
376 "Oranges\t1\tSOFTWARE\\Wine\\msitest\tnumber\t#314\tTwo\n"
377 "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
378 "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent";
380 static const CHAR service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
381 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
382 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
383 "ServiceInstall\tServiceInstall\n"
384 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t";
386 static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
387 "s72\tl255\ti2\tL255\tI2\ts72\n"
388 "ServiceControl\tServiceControl\n"
389 "ServiceControl\tTestService\t8\t\t0\tservice_comp";
391 static const CHAR sss_service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
392 "s72\tl255\ti2\tL255\tI2\ts72\n"
393 "ServiceControl\tServiceControl\n"
394 "ServiceControl\tSpooler\t1\t\t0\tservice_comp";
396 static const CHAR sss_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
397 "s72\tS255\tI2\n"
398 "InstallExecuteSequence\tAction\n"
399 "LaunchConditions\t\t100\n"
400 "CostInitialize\t\t800\n"
401 "FileCost\t\t900\n"
402 "ResolveSource\t\t950\n"
403 "CostFinalize\t\t1000\n"
404 "InstallValidate\t\t1400\n"
405 "InstallInitialize\t\t1500\n"
406 "DeleteServices\t\t5000\n"
407 "MoveFiles\t\t5100\n"
408 "InstallFiles\t\t5200\n"
409 "DuplicateFiles\t\t5300\n"
410 "StartServices\t\t5400\n"
411 "InstallFinalize\t\t6000\n";
413 static const CHAR sds_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
414 "s72\tS255\tI2\n"
415 "InstallExecuteSequence\tAction\n"
416 "LaunchConditions\t\t100\n"
417 "CostInitialize\t\t800\n"
418 "FileCost\t\t900\n"
419 "ResolveSource\t\t950\n"
420 "CostFinalize\t\t1000\n"
421 "InstallValidate\t\t1400\n"
422 "InstallInitialize\t\t1500\n"
423 "DeleteServices\tInstalled\t5000\n"
424 "MoveFiles\t\t5100\n"
425 "InstallFiles\t\t5200\n"
426 "DuplicateFiles\t\t5300\n"
427 "InstallServices\tNOT Installed\t5400\n"
428 "RegisterProduct\t\t5500\n"
429 "PublishFeatures\t\t5600\n"
430 "PublishProduct\t\t5700\n"
431 "InstallFinalize\t\t6000\n";
433 /* tables for test_continuouscabs */
434 static const CHAR cc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
435 "s72\tS38\ts72\ti2\tS255\tS72\n"
436 "Component\tComponent\n"
437 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
438 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
439 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
441 static const CHAR cc2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
442 "s72\tS38\ts72\ti2\tS255\tS72\n"
443 "Component\tComponent\n"
444 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
445 "augustus\t\tMSITESTDIR\t0\t0\taugustus\n"
446 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
448 static const CHAR cc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
449 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
450 "Feature\tFeature\n"
451 "feature\t\t\t\t2\t1\tTARGETDIR\t0";
453 static const CHAR cc_feature_comp_dat[] = "Feature_\tComponent_\n"
454 "s38\ts72\n"
455 "FeatureComponents\tFeature_\tComponent_\n"
456 "feature\tmaximus\n"
457 "feature\taugustus\n"
458 "feature\tcaesar";
460 static const CHAR cc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
461 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
462 "File\tFile\n"
463 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
464 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
465 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
467 static const CHAR cc2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
468 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
469 "File\tFile\n"
470 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
471 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
472 "tiberius\tmaximus\ttiberius\t500\t\t\t16384\t3\n"
473 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12";
475 static const CHAR cc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
476 "i2\ti4\tL64\tS255\tS32\tS72\n"
477 "Media\tDiskId\n"
478 "1\t10\t\ttest1.cab\tDISK1\t\n"
479 "2\t2\t\ttest2.cab\tDISK2\t\n"
480 "3\t12\t\ttest3.cab\tDISK3\t\n";
482 static const CHAR co_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
483 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
484 "File\tFile\n"
485 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
486 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
487 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
489 static const CHAR co_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
490 "i2\ti4\tL64\tS255\tS32\tS72\n"
491 "Media\tDiskId\n"
492 "1\t10\t\ttest1.cab\tDISK1\t\n"
493 "2\t2\t\ttest2.cab\tDISK2\t\n"
494 "3\t3\t\ttest3.cab\tDISK3\t\n";
496 static const CHAR co2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
497 "i2\ti4\tL64\tS255\tS32\tS72\n"
498 "Media\tDiskId\n"
499 "1\t10\t\ttest1.cab\tDISK1\t\n"
500 "2\t12\t\ttest3.cab\tDISK3\t\n"
501 "3\t2\t\ttest2.cab\tDISK2\t\n";
503 static const CHAR mm_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
504 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
505 "File\tFile\n"
506 "maximus\tmaximus\tmaximus\t500\t\t\t512\t1\n"
507 "augustus\taugustus\taugustus\t500\t\t\t512\t2\n"
508 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3";
510 static const CHAR mm_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
511 "i2\ti4\tL64\tS255\tS32\tS72\n"
512 "Media\tDiskId\n"
513 "1\t3\t\ttest1.cab\tDISK1\t\n";
515 static const CHAR ss_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
516 "i2\ti4\tL64\tS255\tS32\tS72\n"
517 "Media\tDiskId\n"
518 "1\t2\t\ttest1.cab\tDISK1\t\n"
519 "2\t2\t\ttest2.cab\tDISK2\t\n"
520 "3\t12\t\ttest3.cab\tDISK3\t\n";
522 /* tables for test_uiLevelFlags */
523 static const CHAR ui_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
524 "s72\tS38\ts72\ti2\tS255\tS72\n"
525 "Component\tComponent\n"
526 "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
527 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
528 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
530 static const CHAR ui_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
531 "s72\tS255\tI2\n"
532 "InstallUISequence\tAction\n"
533 "SetUIProperty\t\t5\n"
534 "ExecuteAction\t\t1100\n";
536 static const CHAR ui_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
537 "s72\ti2\tS64\tS0\tS255\n"
538 "CustomAction\tAction\n"
539 "SetUIProperty\t51\tHASUIRUN\t1\t\n";
541 static const CHAR rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
542 "s72\tS38\ts72\ti2\tS255\tS72\n"
543 "Component\tComponent\n"
544 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
546 static const CHAR rof_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
547 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
548 "Feature\tFeature\n"
549 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
550 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
552 static const CHAR rof_feature_comp_dat[] = "Feature_\tComponent_\n"
553 "s38\ts72\n"
554 "FeatureComponents\tFeature_\tComponent_\n"
555 "feature\tmaximus\n"
556 "montecristo\tmaximus";
558 static const CHAR rof_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
559 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
560 "File\tFile\n"
561 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
563 static const CHAR rof_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
564 "i2\ti4\tL64\tS255\tS32\tS72\n"
565 "Media\tDiskId\n"
566 "1\t1\t\t\tDISK1\t\n";
568 static const CHAR rofc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
569 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
570 "File\tFile\n"
571 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1";
573 static const CHAR rofc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
574 "i2\ti4\tL64\tS255\tS32\tS72\n"
575 "Media\tDiskId\n"
576 "1\t1\t\ttest1.cab\tDISK1\t\n";
578 static const CHAR lus2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
579 "i2\ti4\tL64\tS255\tS32\tS72\n"
580 "Media\tDiskId\n"
581 "1\t1\t\t#test1.cab\tDISK1\t\n";
583 static const CHAR sdp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
584 "s72\tS255\tI2\n"
585 "InstallExecuteSequence\tAction\n"
586 "AllocateRegistrySpace\tNOT Installed\t1550\n"
587 "CostFinalize\t\t1000\n"
588 "CostInitialize\t\t800\n"
589 "FileCost\t\t900\n"
590 "InstallFiles\t\t4000\n"
591 "InstallFinalize\t\t6600\n"
592 "InstallInitialize\t\t1500\n"
593 "InstallValidate\t\t1400\n"
594 "LaunchConditions\t\t100\n"
595 "SetDirProperty\t\t950";
597 static const CHAR sdp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
598 "s72\ti2\tS64\tS0\tS255\n"
599 "CustomAction\tAction\n"
600 "SetDirProperty\t51\tMSITESTDIR\t[CommonFilesFolder]msitest\\\t\n";
602 static const CHAR pv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
603 "s72\tS255\tI2\n"
604 "InstallExecuteSequence\tAction\n"
605 "LaunchConditions\t\t100\n"
606 "CostInitialize\t\t800\n"
607 "FileCost\t\t900\n"
608 "CostFinalize\t\t1000\n"
609 "InstallValidate\t\t1400\n"
610 "InstallInitialize\t\t1500\n"
611 "InstallFiles\t\t4000\n"
612 "InstallFinalize\t\t6600\n";
614 static const CHAR cie_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
615 "s72\tS38\ts72\ti2\tS255\tS72\n"
616 "Component\tComponent\n"
617 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
618 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
619 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
620 "gaius\t\tMSITESTDIR\t0\t1\tgaius\n";
622 static const CHAR cie_feature_comp_dat[] = "Feature_\tComponent_\n"
623 "s38\ts72\n"
624 "FeatureComponents\tFeature_\tComponent_\n"
625 "feature\tmaximus\n"
626 "feature\taugustus\n"
627 "feature\tcaesar\n"
628 "feature\tgaius";
630 static const CHAR cie_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
631 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
632 "File\tFile\n"
633 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
634 "augustus\taugustus\taugustus\t50000\t\t\t16384\t2\n"
635 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t12\n"
636 "gaius\tgaius\tgaius\t500\t\t\t8192\t11";
638 static const CHAR cie_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
639 "i2\ti4\tL64\tS255\tS32\tS72\n"
640 "Media\tDiskId\n"
641 "1\t1\t\ttest1.cab\tDISK1\t\n"
642 "2\t2\t\ttest2.cab\tDISK2\t\n"
643 "3\t12\t\ttest3.cab\tDISK3\t\n";
645 static const CHAR ci_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
646 "s72\tS255\tI2\n"
647 "InstallExecuteSequence\tAction\n"
648 "CostFinalize\t\t1000\n"
649 "CostInitialize\t\t800\n"
650 "FileCost\t\t900\n"
651 "InstallFiles\t\t4000\n"
652 "InstallServices\t\t5000\n"
653 "InstallFinalize\t\t6600\n"
654 "InstallInitialize\t\t1500\n"
655 "RunInstall\t\t1600\n"
656 "InstallValidate\t\t1400\n"
657 "LaunchConditions\t\t100";
659 static const CHAR ci_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
660 "s72\ti2\tS64\tS0\tS255\n"
661 "CustomAction\tAction\n"
662 "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n";
664 static const CHAR ci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
665 "s72\tS38\ts72\ti2\tS255\tS72\n"
666 "Component\tComponent\n"
667 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n";
669 static const CHAR ci2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
670 "s72\tS38\ts72\ti2\tS255\tS72\n"
671 "Component\tComponent\n"
672 "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n";
674 static const CHAR ci2_feature_comp_dat[] = "Feature_\tComponent_\n"
675 "s38\ts72\n"
676 "FeatureComponents\tFeature_\tComponent_\n"
677 "feature\taugustus";
679 static const CHAR ci2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
680 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
681 "File\tFile\n"
682 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
684 static const CHAR spf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
685 "s72\ti2\tS64\tS0\tS255\n"
686 "CustomAction\tAction\n"
687 "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n";
689 static const CHAR spf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
690 "s72\tS255\tI2\n"
691 "InstallExecuteSequence\tAction\n"
692 "CostFinalize\t\t1000\n"
693 "CostInitialize\t\t800\n"
694 "FileCost\t\t900\n"
695 "SetFolderProp\t\t950\n"
696 "InstallFiles\t\t4000\n"
697 "InstallServices\t\t5000\n"
698 "InstallFinalize\t\t6600\n"
699 "InstallInitialize\t\t1500\n"
700 "InstallValidate\t\t1400\n"
701 "LaunchConditions\t\t100";
703 static const CHAR spf_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
704 "s72\tS255\tI2\n"
705 "InstallUISequence\tAction\n"
706 "CostInitialize\t\t800\n"
707 "FileCost\t\t900\n"
708 "CostFinalize\t\t1000\n"
709 "ExecuteAction\t\t1100\n";
711 static const CHAR pp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
712 "s72\tS255\tI2\n"
713 "InstallExecuteSequence\tAction\n"
714 "ValidateProductID\t\t700\n"
715 "CostInitialize\t\t800\n"
716 "FileCost\t\t900\n"
717 "CostFinalize\t\t1000\n"
718 "InstallValidate\t\t1400\n"
719 "InstallInitialize\t\t1500\n"
720 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
721 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
722 "RemoveFiles\t\t3500\n"
723 "InstallFiles\t\t4000\n"
724 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
725 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
726 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
727 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
728 "InstallFinalize\t\t6600";
730 static const CHAR pp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
731 "s72\tS38\ts72\ti2\tS255\tS72\n"
732 "Component\tComponent\n"
733 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
735 static const CHAR ppc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
736 "s72\tS38\ts72\ti2\tS255\tS72\n"
737 "Component\tComponent\n"
738 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
739 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
741 static const CHAR ppc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
742 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
743 "File\tFile\n"
744 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
745 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
747 static const CHAR ppc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
748 "i2\ti4\tL64\tS255\tS32\tS72\n"
749 "Media\tDiskId\n"
750 "1\t2\t\t\tDISK1\t\n";
752 static const CHAR ppc_feature_comp_dat[] = "Feature_\tComponent_\n"
753 "s38\ts72\n"
754 "FeatureComponents\tFeature_\tComponent_\n"
755 "feature\tmaximus\n"
756 "feature\taugustus\n"
757 "montecristo\tmaximus";
759 static const CHAR tp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
760 "s72\tS38\ts72\ti2\tS255\tS72\n"
761 "Component\tComponent\n"
762 "augustus\t\tMSITESTDIR\t0\tprop=\"val\"\taugustus\n";
764 static const CHAR cwd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
765 "s72\tS38\ts72\ti2\tS255\tS72\n"
766 "Component\tComponent\n"
767 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
769 static const CHAR adm_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
770 "s72\tS38\ts72\ti2\tS255\tS72\n"
771 "Component\tComponent\n"
772 "augustus\t\tMSITESTDIR\t0\tPOSTADMIN=1\taugustus";
774 static const CHAR adm_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
775 "s72\ti2\tS64\tS0\tS255\n"
776 "CustomAction\tAction\n"
777 "SetPOSTADMIN\t51\tPOSTADMIN\t1\t\n";
779 static const CHAR adm_admin_exec_seq_dat[] = "Action\tCondition\tSequence\n"
780 "s72\tS255\tI2\n"
781 "AdminExecuteSequence\tAction\n"
782 "CostFinalize\t\t1000\n"
783 "CostInitialize\t\t800\n"
784 "FileCost\t\t900\n"
785 "SetPOSTADMIN\t\t950\n"
786 "InstallFiles\t\t4000\n"
787 "InstallFinalize\t\t6600\n"
788 "InstallInitialize\t\t1500\n"
789 "InstallValidate\t\t1400\n"
790 "LaunchConditions\t\t100";
792 static const CHAR amp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
793 "s72\tS38\ts72\ti2\tS255\tS72\n"
794 "Component\tComponent\n"
795 "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n";
797 static const CHAR rem_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
798 "s72\tS38\ts72\ti2\tS255\tS72\n"
799 "Component\tComponent\n"
800 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
801 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
802 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
804 static const CHAR rem_feature_comp_dat[] = "Feature_\tComponent_\n"
805 "s38\ts72\n"
806 "FeatureComponents\tFeature_\tComponent_\n"
807 "feature\thydrogen\n"
808 "feature\thelium\n"
809 "feature\tlithium";
811 static const CHAR rem_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
812 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
813 "File\tFile\n"
814 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
815 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
816 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
818 static const CHAR rem_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
819 "s72\tS255\tI2\n"
820 "InstallExecuteSequence\tAction\n"
821 "ValidateProductID\t\t700\n"
822 "CostInitialize\t\t800\n"
823 "FileCost\t\t900\n"
824 "CostFinalize\t\t1000\n"
825 "InstallValidate\t\t1400\n"
826 "InstallInitialize\t\t1500\n"
827 "ProcessComponents\t\t1600\n"
828 "UnpublishFeatures\t\t1800\n"
829 "RemoveFiles\t\t3500\n"
830 "InstallFiles\t\t4000\n"
831 "RegisterProduct\t\t6100\n"
832 "PublishFeatures\t\t6300\n"
833 "PublishProduct\t\t6400\n"
834 "InstallFinalize\t\t6600";
836 static const CHAR rem_remove_files_dat[] = "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
837 "s72\ts72\tS255\ts72\tI2\n"
838 "RemoveFile\tFileKey\n"
839 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
840 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
841 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
842 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
843 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
844 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
845 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
846 "block\thelium\tblock\tMSITESTDIR\t3\n"
847 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
848 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
850 static const CHAR mov_move_file_dat[] = "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
851 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
852 "MoveFile\tFileKey\n"
853 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
854 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
855 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
856 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
857 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
858 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
859 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
860 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
861 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
862 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
863 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
864 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
865 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
866 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
867 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
868 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
869 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
870 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
872 static const CHAR mc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
873 "s72\tS38\ts72\ti2\tS255\tS72\n"
874 "Component\tComponent\n"
875 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n"
876 "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
877 "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n"
878 "gaius\t\tMSITESTDIR\t0\tGAIUS=1\tgaius\n";
880 static const CHAR mc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
881 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
882 "File\tFile\n"
883 "maximus\tmaximus\tmaximus\t500\t\t\t16384\t1\n"
884 "augustus\taugustus\taugustus\t500\t\t\t0\t2\n"
885 "caesar\tcaesar\tcaesar\t500\t\t\t16384\t3\n"
886 "gaius\tgaius\tgaius\t500\t\t\t16384\t4";
888 static const CHAR mc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
889 "i2\ti4\tL64\tS255\tS32\tS72\n"
890 "Media\tDiskId\n"
891 "1\t1\t\ttest1.cab\tDISK1\t\n"
892 "2\t2\t\ttest2.cab\tDISK2\t\n"
893 "3\t3\t\ttest3.cab\tDISK3\t\n"
894 "4\t4\t\ttest3.cab\tDISK3\t\n";
896 static const CHAR mc_file_hash_dat[] = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"
897 "s72\ti2\ti4\ti4\ti4\ti4\n"
898 "MsiFileHash\tFile_\n"
899 "caesar\t0\t850433704\t-241429251\t675791761\t-1221108824";
901 static const CHAR df_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
902 "s72\tS72\tl255\n"
903 "Directory\tDirectory\n"
904 "THIS\tMSITESTDIR\tthis\n"
905 "DOESNOT\tTHIS\tdoesnot\n"
906 "NONEXISTENT\tDOESNOT\texist\n"
907 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
908 "ProgramFilesFolder\tTARGETDIR\t.\n"
909 "TARGETDIR\t\tSourceDir";
911 static const CHAR df_duplicate_file_dat[] = "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
912 "s72\ts72\ts72\tS255\tS72\n"
913 "DuplicateFile\tFileKey\n"
914 "maximus\tmaximus\tmaximus\taugustus\t\n"
915 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
916 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
918 static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
919 "s72\tS38\ts72\ti2\tS255\tS72\n"
920 "Component\tComponent\n"
921 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
923 static const CHAR wrv_registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
924 "s72\ti2\tl255\tL255\tL0\ts72\n"
925 "Registry\tRegistry\n"
926 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus";
928 static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
929 "s72\tS38\ts72\ti2\tS255\tS72\n"
930 "Component\tComponent\n"
931 "augustus\t\tMSITESTDIR\t0\tMYPROP=42\taugustus\n";
933 static const CHAR ca51_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
934 "s72\tS255\tI2\n"
935 "InstallExecuteSequence\tAction\n"
936 "ValidateProductID\t\t700\n"
937 "GoodSetProperty\t\t725\n"
938 "BadSetProperty\t\t750\n"
939 "CostInitialize\t\t800\n"
940 "ResolveSource\t\t810\n"
941 "FileCost\t\t900\n"
942 "SetSourceDir\tSRCDIR\t910\n"
943 "CostFinalize\t\t1000\n"
944 "InstallValidate\t\t1400\n"
945 "InstallInitialize\t\t1500\n"
946 "InstallFiles\t\t4000\n"
947 "InstallFinalize\t\t6600";
949 static const CHAR ca51_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
950 "s72\ti2\tS64\tS0\n"
951 "CustomAction\tAction\n"
952 "GoodSetProperty\t51\tMYPROP\t42\n"
953 "BadSetProperty\t51\t\tMYPROP\n"
954 "SetSourceDir\t51\tSourceDir\t[SRCDIR]\n";
956 static const CHAR is_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
957 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
958 "Feature\tFeature\n"
959 "one\t\t\t\t2\t1\t\t0\n" /* favorLocal */
960 "two\t\t\t\t2\t1\t\t1\n" /* favorSource */
961 "three\t\t\t\t2\t1\t\t4\n" /* favorAdvertise */
962 "four\t\t\t\t2\t0\t\t0"; /* disabled */
964 static const CHAR is_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
965 "s72\tS38\ts72\ti2\tS255\tS72\n"
966 "Component\tComponent\n"
967 "alpha\t\tMSITESTDIR\t0\t\talpha_file\n" /* favorLocal:Local */
968 "beta\t\tMSITESTDIR\t1\t\tbeta_file\n" /* favorLocal:Source */
969 "gamma\t\tMSITESTDIR\t2\t\tgamma_file\n" /* favorLocal:Optional */
970 "theta\t\tMSITESTDIR\t0\t\ttheta_file\n" /* favorSource:Local */
971 "delta\t\tMSITESTDIR\t1\t\tdelta_file\n" /* favorSource:Source */
972 "epsilon\t\tMSITESTDIR\t2\t\tepsilon_file\n" /* favorSource:Optional */
973 "zeta\t\tMSITESTDIR\t0\t\tzeta_file\n" /* favorAdvertise:Local */
974 "iota\t\tMSITESTDIR\t1\t\tiota_file\n" /* favorAdvertise:Source */
975 "eta\t\tMSITESTDIR\t2\t\teta_file\n" /* favorAdvertise:Optional */
976 "kappa\t\tMSITESTDIR\t0\t\tkappa_file\n" /* disabled:Local */
977 "lambda\t\tMSITESTDIR\t1\t\tlambda_file\n" /* disabled:Source */
978 "mu\t\tMSITESTDIR\t2\t\tmu_file\n"; /* disabled:Optional */
980 static const CHAR is_feature_comp_dat[] = "Feature_\tComponent_\n"
981 "s38\ts72\n"
982 "FeatureComponents\tFeature_\tComponent_\n"
983 "one\talpha\n"
984 "one\tbeta\n"
985 "one\tgamma\n"
986 "two\ttheta\n"
987 "two\tdelta\n"
988 "two\tepsilon\n"
989 "three\tzeta\n"
990 "three\tiota\n"
991 "three\teta\n"
992 "four\tkappa\n"
993 "four\tlambda\n"
994 "four\tmu";
996 static const CHAR is_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
997 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
998 "File\tFile\n"
999 "alpha_file\talpha\talpha\t500\t\t\t8192\t1\n"
1000 "beta_file\tbeta\tbeta\t500\t\t\t8291\t2\n"
1001 "gamma_file\tgamma\tgamma\t500\t\t\t8192\t3\n"
1002 "theta_file\ttheta\ttheta\t500\t\t\t8192\t4\n"
1003 "delta_file\tdelta\tdelta\t500\t\t\t8192\t5\n"
1004 "epsilon_file\tepsilon\tepsilon\t500\t\t\t8192\t6\n"
1005 "zeta_file\tzeta\tzeta\t500\t\t\t8192\t7\n"
1006 "iota_file\tiota\tiota\t500\t\t\t8192\t8\n"
1007 "eta_file\teta\teta\t500\t\t\t8192\t9\n"
1008 "kappa_file\tkappa\tkappa\t500\t\t\t8192\t10\n"
1009 "lambda_file\tlambda\tlambda\t500\t\t\t8192\t11\n"
1010 "mu_file\tmu\tmu\t500\t\t\t8192\t12";
1012 static const CHAR is_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1013 "i2\ti4\tL64\tS255\tS32\tS72\n"
1014 "Media\tDiskId\n"
1015 "1\t12\t\t\tDISK1\t\n";
1017 static const CHAR sp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1018 "s72\tS38\ts72\ti2\tS255\tS72\n"
1019 "Component\tComponent\n"
1020 "augustus\t\tTWODIR\t0\t\taugustus\n";
1022 static const CHAR sp_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n"
1023 "s72\tS72\tl255\n"
1024 "Directory\tDirectory\n"
1025 "TARGETDIR\t\tSourceDir\n"
1026 "ProgramFilesFolder\tTARGETDIR\t.\n"
1027 "MSITESTDIR\tProgramFilesFolder\tmsitest:.\n"
1028 "ONEDIR\tMSITESTDIR\t.:shortone|longone\n"
1029 "TWODIR\tONEDIR\t.:shorttwo|longtwo";
1031 static const CHAR mcp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1032 "s72\tS38\ts72\ti2\tS255\tS72\n"
1033 "Component\tComponent\n"
1034 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n"
1035 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n"
1036 "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n";
1038 static const CHAR mcp_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1039 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1040 "Feature\tFeature\n"
1041 "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n"
1042 "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n"
1043 "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0";
1045 static const CHAR mcp_feature_comp_dat[] = "Feature_\tComponent_\n"
1046 "s38\ts72\n"
1047 "FeatureComponents\tFeature_\tComponent_\n"
1048 "hydroxyl\thydrogen\n"
1049 "heliox\thelium\n"
1050 "lithia\tlithium";
1052 static const CHAR mcomp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1053 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1054 "File\tFile\n"
1055 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
1056 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
1057 "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n"
1058 "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1";
1060 static const CHAR ai_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1061 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1062 "File\tFile\n"
1063 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
1064 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
1065 "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n"
1066 "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n"
1067 "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n"
1068 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
1069 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1";
1071 static const CHAR ip_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1072 "s72\tS255\tI2\n"
1073 "InstallExecuteSequence\tAction\n"
1074 "CostFinalize\t\t1000\n"
1075 "ValidateProductID\t\t700\n"
1076 "CostInitialize\t\t800\n"
1077 "FileCost\t\t900\n"
1078 "RemoveFiles\t\t3500\n"
1079 "InstallFiles\t\t4000\n"
1080 "RegisterUser\t\t6000\n"
1081 "RegisterProduct\t\t6100\n"
1082 "PublishFeatures\t\t6300\n"
1083 "PublishProduct\t\t6400\n"
1084 "InstallFinalize\t\t6600\n"
1085 "InstallInitialize\t\t1500\n"
1086 "ProcessComponents\t\t1600\n"
1087 "UnpublishFeatures\t\t1800\n"
1088 "InstallValidate\t\t1400\n"
1089 "LaunchConditions\t\t100\n"
1090 "TestInstalledProp\tInstalled AND NOT REMOVE\t950\n";
1092 static const CHAR ip_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1093 "s72\ti2\tS64\tS0\tS255\n"
1094 "CustomAction\tAction\n"
1095 "TestInstalledProp\t19\t\tTest failed\t\n";
1097 static const CHAR aup_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1098 "s72\tS255\tI2\n"
1099 "InstallExecuteSequence\tAction\n"
1100 "CostFinalize\t\t1000\n"
1101 "ValidateProductID\t\t700\n"
1102 "CostInitialize\t\t800\n"
1103 "FileCost\t\t900\n"
1104 "RemoveFiles\t\t3500\n"
1105 "InstallFiles\t\t4000\n"
1106 "RegisterUser\t\t6000\n"
1107 "RegisterProduct\t\t6100\n"
1108 "PublishFeatures\t\t6300\n"
1109 "PublishProduct\t\t6400\n"
1110 "InstallFinalize\t\t6600\n"
1111 "InstallInitialize\t\t1500\n"
1112 "ProcessComponents\t\t1600\n"
1113 "UnpublishFeatures\t\t1800\n"
1114 "InstallValidate\t\t1400\n"
1115 "LaunchConditions\t\t100\n"
1116 "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
1118 static const CHAR aup2_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1119 "s72\tS255\tI2\n"
1120 "InstallExecuteSequence\tAction\n"
1121 "CostFinalize\t\t1000\n"
1122 "ValidateProductID\t\t700\n"
1123 "CostInitialize\t\t800\n"
1124 "FileCost\t\t900\n"
1125 "RemoveFiles\t\t3500\n"
1126 "InstallFiles\t\t4000\n"
1127 "RegisterUser\t\t6000\n"
1128 "RegisterProduct\t\t6100\n"
1129 "PublishFeatures\t\t6300\n"
1130 "PublishProduct\t\t6400\n"
1131 "InstallFinalize\t\t6600\n"
1132 "InstallInitialize\t\t1500\n"
1133 "ProcessComponents\t\t1600\n"
1134 "UnpublishFeatures\t\t1800\n"
1135 "InstallValidate\t\t1400\n"
1136 "LaunchConditions\t\t100\n"
1137 "TestAllUsersProp\tALLUSERS=2 AND NOT REMOVE\t50\n";
1139 static const CHAR aup3_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1140 "s72\tS255\tI2\n"
1141 "InstallExecuteSequence\tAction\n"
1142 "CostFinalize\t\t1000\n"
1143 "ValidateProductID\t\t700\n"
1144 "CostInitialize\t\t800\n"
1145 "FileCost\t\t900\n"
1146 "RemoveFiles\t\t3500\n"
1147 "InstallFiles\t\t4000\n"
1148 "RegisterUser\t\t6000\n"
1149 "RegisterProduct\t\t6100\n"
1150 "PublishFeatures\t\t6300\n"
1151 "PublishProduct\t\t6400\n"
1152 "InstallFinalize\t\t6600\n"
1153 "InstallInitialize\t\t1500\n"
1154 "ProcessComponents\t\t1600\n"
1155 "UnpublishFeatures\t\t1800\n"
1156 "InstallValidate\t\t1400\n"
1157 "LaunchConditions\t\t100\n"
1158 "TestAllUsersProp\tALLUSERS=1 AND NOT REMOVE\t50\n";
1160 static const CHAR aup_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1161 "s72\ti2\tS64\tS0\tS255\n"
1162 "CustomAction\tAction\n"
1163 "TestAllUsersProp\t19\t\tTest failed\t\n";
1165 static const CHAR cf_create_folders_dat[] = "Directory_\tComponent_\n"
1166 "s72\ts72\n"
1167 "CreateFolder\tDirectory_\tComponent_\n"
1168 "FIRSTDIR\tOne\n";
1170 static const CHAR cf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1171 "s72\tS255\tI2\n"
1172 "InstallExecuteSequence\tAction\n"
1173 "CostFinalize\t\t1000\n"
1174 "ValidateProductID\t\t700\n"
1175 "CostInitialize\t\t800\n"
1176 "FileCost\t\t900\n"
1177 "RemoveFiles\t\t3500\n"
1178 "CreateFolders\t\t3700\n"
1179 "InstallExecute\t\t3800\n"
1180 "TestCreateFolders\t\t3900\n"
1181 "InstallFiles\t\t4000\n"
1182 "RegisterUser\t\t6000\n"
1183 "RegisterProduct\t\t6100\n"
1184 "PublishFeatures\t\t6300\n"
1185 "PublishProduct\t\t6400\n"
1186 "InstallFinalize\t\t6600\n"
1187 "InstallInitialize\t\t1500\n"
1188 "ProcessComponents\t\t1600\n"
1189 "UnpublishFeatures\t\t1800\n"
1190 "InstallValidate\t\t1400\n"
1191 "LaunchConditions\t\t100\n";
1193 static const CHAR cf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1194 "s72\ti2\tS64\tS0\tS255\n"
1195 "CustomAction\tAction\n"
1196 "TestCreateFolders\t19\t\tHalts installation\t\n";
1198 static const CHAR rf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1199 "s72\tS255\tI2\n"
1200 "InstallExecuteSequence\tAction\n"
1201 "CostFinalize\t\t1000\n"
1202 "ValidateProductID\t\t700\n"
1203 "CostInitialize\t\t800\n"
1204 "FileCost\t\t900\n"
1205 "RemoveFiles\t\t3500\n"
1206 "CreateFolders\t\t3600\n"
1207 "RemoveFolders\t\t3700\n"
1208 "InstallExecute\t\t3800\n"
1209 "TestCreateFolders\t\t3900\n"
1210 "InstallFiles\t\t4000\n"
1211 "RegisterUser\t\t6000\n"
1212 "RegisterProduct\t\t6100\n"
1213 "PublishFeatures\t\t6300\n"
1214 "PublishProduct\t\t6400\n"
1215 "InstallFinalize\t\t6600\n"
1216 "InstallInitialize\t\t1500\n"
1217 "ProcessComponents\t\t1600\n"
1218 "UnpublishFeatures\t\t1800\n"
1219 "InstallValidate\t\t1400\n"
1220 "LaunchConditions\t\t100\n";
1223 static const CHAR sr_selfreg_dat[] = "File_\tCost\n"
1224 "s72\tI2\n"
1225 "SelfReg\tFile_\n"
1226 "one.txt\t1\n";
1228 static const CHAR sr_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1229 "s72\tS255\tI2\n"
1230 "InstallExecuteSequence\tAction\n"
1231 "CostFinalize\t\t1000\n"
1232 "CostInitialize\t\t800\n"
1233 "FileCost\t\t900\n"
1234 "ResolveSource\t\t950\n"
1235 "MoveFiles\t\t1700\n"
1236 "SelfUnregModules\t\t3900\n"
1237 "InstallFiles\t\t4000\n"
1238 "DuplicateFiles\t\t4500\n"
1239 "WriteEnvironmentStrings\t\t4550\n"
1240 "CreateShortcuts\t\t4600\n"
1241 "InstallFinalize\t\t6600\n"
1242 "InstallInitialize\t\t1500\n"
1243 "InstallValidate\t\t1400\n"
1244 "LaunchConditions\t\t100\n";
1246 static const CHAR font_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1247 "i2\ti4\tL64\tS255\tS32\tS72\n"
1248 "Media\tDiskId\n"
1249 "1\t3\t\t\tDISK1\t\n";
1251 static const CHAR font_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1252 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1253 "File\tFile\n"
1254 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
1256 static const CHAR font_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1257 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1258 "Feature\tFeature\n"
1259 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
1261 static const CHAR font_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1262 "s72\tS38\ts72\ti2\tS255\tS72\n"
1263 "Component\tComponent\n"
1264 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
1266 static const CHAR font_feature_comp_dat[] = "Feature_\tComponent_\n"
1267 "s38\ts72\n"
1268 "FeatureComponents\tFeature_\tComponent_\n"
1269 "fonts\tfonts\n";
1271 static const CHAR font_dat[] = "File_\tFontTitle\n"
1272 "s72\tS128\n"
1273 "Font\tFile_\n"
1274 "font.ttf\tmsi test font\n";
1276 static const CHAR font_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1277 "s72\tS255\tI2\n"
1278 "InstallExecuteSequence\tAction\n"
1279 "ValidateProductID\t\t700\n"
1280 "CostInitialize\t\t800\n"
1281 "FileCost\t\t900\n"
1282 "CostFinalize\t\t1000\n"
1283 "InstallValidate\t\t1400\n"
1284 "InstallInitialize\t\t1500\n"
1285 "ProcessComponents\t\t1600\n"
1286 "UnpublishFeatures\t\t1800\n"
1287 "RemoveFiles\t\t3500\n"
1288 "InstallFiles\t\t4000\n"
1289 "RegisterFonts\t\t4100\n"
1290 "UnregisterFonts\t\t4200\n"
1291 "RegisterUser\t\t6000\n"
1292 "RegisterProduct\t\t6100\n"
1293 "PublishFeatures\t\t6300\n"
1294 "PublishProduct\t\t6400\n"
1295 "InstallFinalize\t\t6600";
1297 static const CHAR vp_property_dat[] = "Property\tValue\n"
1298 "s72\tl0\n"
1299 "Property\tProperty\n"
1300 "HASUIRUN\t0\n"
1301 "INSTALLLEVEL\t3\n"
1302 "InstallMode\tTypical\n"
1303 "Manufacturer\tWine\n"
1304 "PIDTemplate\t###-#######\n"
1305 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
1306 "ProductLanguage\t1033\n"
1307 "ProductName\tMSITEST\n"
1308 "ProductVersion\t1.1.1\n"
1309 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
1310 "MSIFASTINSTALL\t1\n";
1312 static const CHAR vp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1313 "s72\ti2\tS64\tS0\tS255\n"
1314 "CustomAction\tAction\n"
1315 "SetProductID1\t51\tProductID\t1\t\n"
1316 "SetProductID2\t51\tProductID\t2\t\n"
1317 "TestProductID1\t19\t\t\tHalts installation\n"
1318 "TestProductID2\t19\t\t\tHalts installation\n";
1320 static const CHAR vp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1321 "s72\tS255\tI2\n"
1322 "InstallExecuteSequence\tAction\n"
1323 "LaunchConditions\t\t100\n"
1324 "CostInitialize\t\t800\n"
1325 "FileCost\t\t900\n"
1326 "CostFinalize\t\t1000\n"
1327 "InstallValidate\t\t1400\n"
1328 "InstallInitialize\t\t1500\n"
1329 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
1330 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
1331 "ValidateProductID\t\t3200\n"
1332 "InstallExecute\t\t3300\n"
1333 "TestProductID1\tProductID=1\t3400\n"
1334 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
1335 "InstallFiles\t\t4000\n"
1336 "InstallFinalize\t\t6000\n";
1338 static const CHAR odbc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1339 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1340 "File\tFile\n"
1341 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
1342 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
1343 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
1344 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
1345 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
1347 static const CHAR odbc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1348 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1349 "Feature\tFeature\n"
1350 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
1352 static const CHAR odbc_feature_comp_dat[] = "Feature_\tComponent_\n"
1353 "s38\ts72\n"
1354 "FeatureComponents\tFeature_\tComponent_\n"
1355 "odbc\todbc\n";
1357 static const CHAR odbc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1358 "s72\tS38\ts72\ti2\tS255\tS72\n"
1359 "Component\tComponent\n"
1360 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
1362 static const CHAR odbc_driver_dat[] = "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
1363 "s72\ts72\ts255\ts72\tS72\n"
1364 "ODBCDriver\tDriver\n"
1365 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
1366 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
1368 static const CHAR odbc_translator_dat[] = "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
1369 "s72\ts72\ts255\ts72\tS72\n"
1370 "ODBCTranslator\tTranslator\n"
1371 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
1372 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
1374 static const CHAR odbc_datasource_dat[] = "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
1375 "s72\ts72\ts255\ts255\ti2\n"
1376 "ODBCDataSource\tDataSource\n"
1377 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
1379 static const CHAR odbc_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1380 "s72\tS255\tI2\n"
1381 "InstallExecuteSequence\tAction\n"
1382 "LaunchConditions\t\t100\n"
1383 "CostInitialize\t\t800\n"
1384 "FileCost\t\t900\n"
1385 "CostFinalize\t\t1000\n"
1386 "InstallValidate\t\t1400\n"
1387 "InstallInitialize\t\t1500\n"
1388 "ProcessComponents\t\t1600\n"
1389 "InstallODBC\t\t3000\n"
1390 "RemoveODBC\t\t3100\n"
1391 "RemoveFiles\t\t3900\n"
1392 "InstallFiles\t\t4000\n"
1393 "RegisterProduct\t\t5000\n"
1394 "PublishFeatures\t\t5100\n"
1395 "PublishProduct\t\t5200\n"
1396 "InstallFinalize\t\t6000\n";
1398 static const CHAR odbc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1399 "i2\ti4\tL64\tS255\tS32\tS72\n"
1400 "Media\tDiskId\n"
1401 "1\t5\t\t\tDISK1\t\n";
1403 static const CHAR tl_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1404 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1405 "File\tFile\n"
1406 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
1408 static const CHAR tl_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1409 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1410 "Feature\tFeature\n"
1411 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
1413 static const CHAR tl_feature_comp_dat[] = "Feature_\tComponent_\n"
1414 "s38\ts72\n"
1415 "FeatureComponents\tFeature_\tComponent_\n"
1416 "typelib\ttypelib\n";
1418 static const CHAR tl_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1419 "s72\tS38\ts72\ti2\tS255\tS72\n"
1420 "Component\tComponent\n"
1421 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
1423 static const CHAR tl_typelib_dat[] = "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
1424 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
1425 "TypeLib\tLibID\tLanguage\tComponent_\n"
1426 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
1428 static const CHAR tl_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1429 "s72\tS255\tI2\n"
1430 "InstallExecuteSequence\tAction\n"
1431 "LaunchConditions\t\t100\n"
1432 "CostInitialize\t\t800\n"
1433 "FileCost\t\t900\n"
1434 "CostFinalize\t\t1000\n"
1435 "InstallValidate\t\t1400\n"
1436 "InstallInitialize\t\t1500\n"
1437 "ProcessComponents\t\t1600\n"
1438 "RemoveFiles\t\t1700\n"
1439 "InstallFiles\t\t2000\n"
1440 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
1441 "UnregisterTypeLibraries\t\t3100\n"
1442 "RegisterProduct\t\t5100\n"
1443 "PublishFeatures\t\t5200\n"
1444 "PublishProduct\t\t5300\n"
1445 "InstallFinalize\t\t6000\n";
1447 static const CHAR crs_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1448 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1449 "File\tFile\n"
1450 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
1452 static const CHAR crs_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1453 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1454 "Feature\tFeature\n"
1455 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
1457 static const CHAR crs_feature_comp_dat[] = "Feature_\tComponent_\n"
1458 "s38\ts72\n"
1459 "FeatureComponents\tFeature_\tComponent_\n"
1460 "shortcut\tshortcut\n";
1462 static const CHAR crs_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1463 "s72\tS38\ts72\ti2\tS255\tS72\n"
1464 "Component\tComponent\n"
1465 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
1467 static const CHAR crs_shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
1468 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
1469 "Shortcut\tShortcut\n"
1470 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
1472 static const CHAR crs_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1473 "s72\tS255\tI2\n"
1474 "InstallExecuteSequence\tAction\n"
1475 "LaunchConditions\t\t100\n"
1476 "CostInitialize\t\t800\n"
1477 "FileCost\t\t900\n"
1478 "CostFinalize\t\t1000\n"
1479 "InstallValidate\t\t1400\n"
1480 "InstallInitialize\t\t1500\n"
1481 "ProcessComponents\t\t1600\n"
1482 "RemoveFiles\t\t1700\n"
1483 "InstallFiles\t\t2000\n"
1484 "RemoveShortcuts\t\t3000\n"
1485 "CreateShortcuts\t\t3100\n"
1486 "RegisterProduct\t\t5000\n"
1487 "PublishFeatures\t\t5100\n"
1488 "PublishProduct\t\t5200\n"
1489 "InstallFinalize\t\t6000\n";
1491 static const CHAR fo_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1492 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1493 "File\tFile\n"
1494 "override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
1495 "preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
1496 "notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
1498 static const CHAR fo_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1499 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1500 "Feature\tFeature\n"
1501 "override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
1502 "preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
1503 "notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
1505 static const CHAR fo_condition_dat[] = "Feature_\tLevel\tCondition\n"
1506 "s38\ti2\tS255\n"
1507 "Condition\tFeature_\tLevel\n"
1508 "preselected\t0\tPreselected\n"
1509 "notpreselected\t0\tNOT Preselected\n";
1511 static const CHAR fo_feature_comp_dat[] = "Feature_\tComponent_\n"
1512 "s38\ts72\n"
1513 "FeatureComponents\tFeature_\tComponent_\n"
1514 "override\toverride\n"
1515 "preselected\tpreselected\n"
1516 "notpreselected\tnotpreselected\n";
1518 static const CHAR fo_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1519 "s72\tS38\ts72\ti2\tS255\tS72\n"
1520 "Component\tComponent\n"
1521 "override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
1522 "preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
1523 "notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
1525 static const CHAR fo_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1526 "s72\ti2\tS64\tS0\tS255\n"
1527 "CustomAction\tAction\n"
1528 "SetPreselected\t51\tPreselected\t1\t\n";
1530 static const CHAR fo_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1531 "s72\tS255\tI2\n"
1532 "InstallExecuteSequence\tAction\n"
1533 "LaunchConditions\t\t100\n"
1534 "SetPreselected\tpreselect=1\t200\n"
1535 "CostInitialize\t\t800\n"
1536 "FileCost\t\t900\n"
1537 "CostFinalize\t\t1000\n"
1538 "InstallValidate\t\t1400\n"
1539 "InstallInitialize\t\t1500\n"
1540 "ProcessComponents\t\t1600\n"
1541 "RemoveFiles\t\t1700\n"
1542 "InstallFiles\t\t2000\n"
1543 "RegisterProduct\t\t5000\n"
1544 "PublishFeatures\t\t5100\n"
1545 "PublishProduct\t\t5200\n"
1546 "InstallFinalize\t\t6000\n";
1548 static const CHAR pub_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1549 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1550 "File\tFile\n"
1551 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
1553 static const CHAR pub_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1554 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1555 "Feature\tFeature\n"
1556 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
1558 static const CHAR pub_feature_comp_dat[] = "Feature_\tComponent_\n"
1559 "s38\ts72\n"
1560 "FeatureComponents\tFeature_\tComponent_\n"
1561 "publish\tpublish\n";
1563 static const CHAR pub_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1564 "s72\tS38\ts72\ti2\tS255\tS72\n"
1565 "Component\tComponent\n"
1566 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
1568 static const CHAR pub_publish_component_dat[] = "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
1569 "s38\ts255\ts72\tL255\ts38\n"
1570 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
1571 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
1573 static const CHAR pub_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1574 "s72\tS255\tI2\n"
1575 "InstallExecuteSequence\tAction\n"
1576 "LaunchConditions\t\t100\n"
1577 "CostInitialize\t\t800\n"
1578 "FileCost\t\t900\n"
1579 "CostFinalize\t\t1000\n"
1580 "InstallValidate\t\t1400\n"
1581 "InstallInitialize\t\t1500\n"
1582 "ProcessComponents\t\t1600\n"
1583 "RemoveFiles\t\t1700\n"
1584 "InstallFiles\t\t2000\n"
1585 "PublishComponents\t\t3000\n"
1586 "UnpublishComponents\t\t3100\n"
1587 "RegisterProduct\t\t5000\n"
1588 "PublishFeatures\t\t5100\n"
1589 "PublishProduct\t\t5200\n"
1590 "InstallFinalize\t\t6000\n";
1592 static const CHAR rd_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1593 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1594 "File\tFile\n"
1595 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
1596 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
1597 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
1599 static const CHAR rd_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1600 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1601 "Feature\tFeature\n"
1602 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
1604 static const CHAR rd_feature_comp_dat[] = "Feature_\tComponent_\n"
1605 "s38\ts72\n"
1606 "FeatureComponents\tFeature_\tComponent_\n"
1607 "duplicate\tduplicate\n";
1609 static const CHAR rd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1610 "s72\tS38\ts72\ti2\tS255\tS72\n"
1611 "Component\tComponent\n"
1612 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
1613 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
1615 static const CHAR rd_duplicate_file_dat[] = "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
1616 "s72\ts72\ts72\tS255\tS72\n"
1617 "DuplicateFile\tFileKey\n"
1618 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
1619 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
1620 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
1622 static const CHAR rd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1623 "s72\tS255\tI2\n"
1624 "InstallExecuteSequence\tAction\n"
1625 "LaunchConditions\t\t100\n"
1626 "CostInitialize\t\t800\n"
1627 "FileCost\t\t900\n"
1628 "CostFinalize\t\t1000\n"
1629 "InstallValidate\t\t1400\n"
1630 "InstallInitialize\t\t1500\n"
1631 "ProcessComponents\t\t1600\n"
1632 "RemoveDuplicateFiles\t\t1900\n"
1633 "InstallFiles\t\t2000\n"
1634 "DuplicateFiles\t\t2100\n"
1635 "RegisterProduct\t\t5000\n"
1636 "PublishFeatures\t\t5100\n"
1637 "PublishProduct\t\t5200\n"
1638 "InstallFinalize\t\t6000\n";
1640 static const CHAR rrv_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1641 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1642 "File\tFile\n"
1643 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1645 static const CHAR rrv_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1646 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1647 "Feature\tFeature\n"
1648 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1650 static const CHAR rrv_feature_comp_dat[] = "Feature_\tComponent_\n"
1651 "s38\ts72\n"
1652 "FeatureComponents\tFeature_\tComponent_\n"
1653 "registry\tregistry\n";
1655 static const CHAR rrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1656 "s72\tS38\ts72\ti2\tS255\tS72\n"
1657 "Component\tComponent\n"
1658 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1660 static const CHAR rrv_registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1661 "s72\ti2\tl255\tL255\tL0\ts72\n"
1662 "Registry\tRegistry\n"
1663 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1664 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1665 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1667 static const CHAR rrv_remove_registry_dat[] = "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1668 "s72\ti2\tl255\tL255\ts72\n"
1669 "RemoveRegistry\tRemoveRegistry\n"
1670 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1671 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1672 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1674 static const CHAR rrv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1675 "s72\tS255\tI2\n"
1676 "InstallExecuteSequence\tAction\n"
1677 "LaunchConditions\t\t100\n"
1678 "CostInitialize\t\t800\n"
1679 "FileCost\t\t900\n"
1680 "CostFinalize\t\t1000\n"
1681 "InstallValidate\t\t1400\n"
1682 "InstallInitialize\t\t1500\n"
1683 "ProcessComponents\t\t1600\n"
1684 "RemoveFiles\t\t1700\n"
1685 "InstallFiles\t\t2000\n"
1686 "RemoveRegistryValues\t\t3000\n"
1687 "RegisterProduct\t\t5000\n"
1688 "PublishFeatures\t\t5100\n"
1689 "PublishProduct\t\t5200\n"
1690 "InstallFinalize\t\t6000\n";
1692 static const CHAR frp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1693 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1694 "File\tFile\n"
1695 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1697 static const CHAR frp_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1698 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1699 "Feature\tFeature\n"
1700 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1702 static const CHAR frp_feature_comp_dat[] = "Feature_\tComponent_\n"
1703 "s38\ts72\n"
1704 "FeatureComponents\tFeature_\tComponent_\n"
1705 "product\tproduct\n";
1707 static const CHAR frp_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1708 "s72\tS38\ts72\ti2\tS255\tS72\n"
1709 "Component\tComponent\n"
1710 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1712 static const CHAR frp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
1713 "s72\ti2\tS64\tS0\tS255\n"
1714 "CustomAction\tAction\n"
1715 "TestProp\t19\t\t\tPROP set\n";
1717 static const CHAR frp_upgrade_dat[] = "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1718 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1719 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1720 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1722 static const CHAR frp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1723 "s72\tS255\tI2\n"
1724 "InstallExecuteSequence\tAction\n"
1725 "FindRelatedProducts\t\t50\n"
1726 "TestProp\tPROP AND NOT REMOVE\t51\n"
1727 "LaunchConditions\t\t100\n"
1728 "CostInitialize\t\t800\n"
1729 "FileCost\t\t900\n"
1730 "CostFinalize\t\t1000\n"
1731 "InstallValidate\t\t1400\n"
1732 "InstallInitialize\t\t1500\n"
1733 "ProcessComponents\t\t1600\n"
1734 "RemoveFiles\t\t1700\n"
1735 "InstallFiles\t\t2000\n"
1736 "RegisterProduct\t\t5000\n"
1737 "PublishFeatures\t\t5100\n"
1738 "PublishProduct\t\t5200\n"
1739 "InstallFinalize\t\t6000\n";
1741 static const CHAR riv_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1742 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1743 "File\tFile\n"
1744 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1746 static const CHAR riv_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1747 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1748 "Feature\tFeature\n"
1749 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1751 static const CHAR riv_feature_comp_dat[] = "Feature_\tComponent_\n"
1752 "s38\ts72\n"
1753 "FeatureComponents\tFeature_\tComponent_\n"
1754 "inifile\tinifile\n";
1756 static const CHAR riv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1757 "s72\tS38\ts72\ti2\tS255\tS72\n"
1758 "Component\tComponent\n"
1759 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1761 static const CHAR riv_ini_file_dat[] = "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1762 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1763 "IniFile\tIniFile\n"
1764 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1766 static const CHAR riv_remove_ini_file_dat[] = "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1767 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1768 "RemoveIniFile\tRemoveIniFile\n"
1769 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1771 static const CHAR riv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1772 "s72\tS255\tI2\n"
1773 "InstallExecuteSequence\tAction\n"
1774 "LaunchConditions\t\t100\n"
1775 "CostInitialize\t\t800\n"
1776 "FileCost\t\t900\n"
1777 "CostFinalize\t\t1000\n"
1778 "InstallValidate\t\t1400\n"
1779 "InstallInitialize\t\t1500\n"
1780 "ProcessComponents\t\t1600\n"
1781 "RemoveFiles\t\t1700\n"
1782 "InstallFiles\t\t2000\n"
1783 "RemoveIniValues\t\t3000\n"
1784 "RegisterProduct\t\t5000\n"
1785 "PublishFeatures\t\t5100\n"
1786 "PublishProduct\t\t5200\n"
1787 "InstallFinalize\t\t6000\n";
1789 static const CHAR res_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1790 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1791 "File\tFile\n"
1792 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1794 static const CHAR res_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1795 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1796 "Feature\tFeature\n"
1797 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1799 static const CHAR res_feature_comp_dat[] = "Feature_\tComponent_\n"
1800 "s38\ts72\n"
1801 "FeatureComponents\tFeature_\tComponent_\n"
1802 "envvar\tenvvar\n";
1804 static const CHAR res_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1805 "s72\tS38\ts72\ti2\tS255\tS72\n"
1806 "Component\tComponent\n"
1807 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1809 static const CHAR res_environment_dat[] = "Environment\tName\tValue\tComponent_\n"
1810 "s72\tl255\tL255\ts72\n"
1811 "Environment\tEnvironment\n"
1812 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1813 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1814 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1815 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1816 "var5\t=MSITESTVAR5\t\tenvvar\n";
1818 static const CHAR res_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1819 "s72\tS255\tI2\n"
1820 "InstallExecuteSequence\tAction\n"
1821 "LaunchConditions\t\t100\n"
1822 "CostInitialize\t\t800\n"
1823 "FileCost\t\t900\n"
1824 "CostFinalize\t\t1000\n"
1825 "InstallValidate\t\t1400\n"
1826 "InstallInitialize\t\t1500\n"
1827 "ProcessComponents\t\t1600\n"
1828 "RemoveFiles\t\t1700\n"
1829 "InstallFiles\t\t2000\n"
1830 "RemoveEnvironmentStrings\t\t3000\n"
1831 "RegisterProduct\t\t5000\n"
1832 "PublishFeatures\t\t5100\n"
1833 "PublishProduct\t\t5200\n"
1834 "InstallFinalize\t\t6000\n";
1836 static const CHAR rci_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1837 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1838 "File\tFile\n"
1839 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1841 static const CHAR rci_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1842 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1843 "Feature\tFeature\n"
1844 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1846 static const CHAR rci_feature_comp_dat[] = "Feature_\tComponent_\n"
1847 "s38\ts72\n"
1848 "FeatureComponents\tFeature_\tComponent_\n"
1849 "class\tclass\n";
1851 static const CHAR rci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1852 "s72\tS38\ts72\ti2\tS255\tS72\n"
1853 "Component\tComponent\n"
1854 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1856 static const CHAR rci_appid_dat[] = "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1857 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1858 "AppId\tAppId\n"
1859 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1861 static const CHAR rci_class_dat[] = "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1862 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1863 "Class\tCLSID\tContext\tComponent_\n"
1864 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1866 static const CHAR rci_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1867 "s72\tS255\tI2\n"
1868 "InstallExecuteSequence\tAction\n"
1869 "LaunchConditions\t\t100\n"
1870 "CostInitialize\t\t800\n"
1871 "FileCost\t\t900\n"
1872 "CostFinalize\t\t1000\n"
1873 "InstallValidate\t\t1400\n"
1874 "InstallInitialize\t\t1500\n"
1875 "ProcessComponents\t\t1600\n"
1876 "RemoveFiles\t\t1700\n"
1877 "InstallFiles\t\t2000\n"
1878 "UnregisterClassInfo\t\t3000\n"
1879 "RegisterClassInfo\t\t4000\n"
1880 "RegisterProduct\t\t5000\n"
1881 "PublishFeatures\t\t5100\n"
1882 "PublishProduct\t\t5200\n"
1883 "InstallFinalize\t\t6000\n";
1885 static const CHAR rei_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1886 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1887 "File\tFile\n"
1888 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1890 static const CHAR rei_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1891 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1892 "Feature\tFeature\n"
1893 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1895 static const CHAR rei_feature_comp_dat[] = "Feature_\tComponent_\n"
1896 "s38\ts72\n"
1897 "FeatureComponents\tFeature_\tComponent_\n"
1898 "extension\textension\n";
1900 static const CHAR rei_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1901 "s72\tS38\ts72\ti2\tS255\tS72\n"
1902 "Component\tComponent\n"
1903 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1905 static const CHAR rei_extension_dat[] = "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1906 "s255\ts72\tS255\tS64\ts38\n"
1907 "Extension\tExtension\tComponent_\n"
1908 "extension\textension\tProg.Id.1\t\textension\n";
1910 static const CHAR rei_verb_dat[] = "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1911 "s255\ts32\tI2\tL255\tL255\n"
1912 "Verb\tExtension_\tVerb\n"
1913 "extension\tOpen\t1\t&Open\t/argument\n";
1915 static const CHAR rei_progid_dat[] = "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1916 "s255\tS255\tS38\tL255\tS72\tI2\n"
1917 "ProgId\tProgId\n"
1918 "Prog.Id.1\t\t\tdescription\t\t\n";
1920 static const CHAR rei_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1921 "s72\tS255\tI2\n"
1922 "InstallExecuteSequence\tAction\n"
1923 "LaunchConditions\t\t100\n"
1924 "CostInitialize\t\t800\n"
1925 "FileCost\t\t900\n"
1926 "CostFinalize\t\t1000\n"
1927 "InstallValidate\t\t1400\n"
1928 "InstallInitialize\t\t1500\n"
1929 "ProcessComponents\t\t1600\n"
1930 "RemoveFiles\t\t1700\n"
1931 "InstallFiles\t\t2000\n"
1932 "UnregisterExtensionInfo\t\t3000\n"
1933 "RegisterExtensionInfo\t\t4000\n"
1934 "RegisterProduct\t\t5000\n"
1935 "PublishFeatures\t\t5100\n"
1936 "PublishProduct\t\t5200\n"
1937 "InstallFinalize\t\t6000\n";
1939 static const CHAR rmi_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1940 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1941 "File\tFile\n"
1942 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1944 static const CHAR rmi_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1945 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1946 "Feature\tFeature\n"
1947 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1949 static const CHAR rmi_feature_comp_dat[] = "Feature_\tComponent_\n"
1950 "s38\ts72\n"
1951 "FeatureComponents\tFeature_\tComponent_\n"
1952 "mime\tmime\n";
1954 static const CHAR rmi_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1955 "s72\tS38\ts72\ti2\tS255\tS72\n"
1956 "Component\tComponent\n"
1957 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1959 static const CHAR rmi_extension_dat[] = "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1960 "s255\ts72\tS255\tS64\ts38\n"
1961 "Extension\tExtension\tComponent_\n"
1962 "mime\tmime\t\tmime/type\tmime\n";
1964 static const CHAR rmi_verb_dat[] = "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1965 "s255\ts32\tI2\tL255\tL255\n"
1966 "Verb\tExtension_\tVerb\n"
1967 "mime\tOpen\t1\t&Open\t/argument\n";
1969 static const CHAR rmi_mime_dat[] = "ContentType\tExtension_\tCLSID\n"
1970 "s64\ts255\tS38\n"
1971 "MIME\tContentType\n"
1972 "mime/type\tmime\t\n";
1974 static const CHAR rmi_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
1975 "s72\tS255\tI2\n"
1976 "InstallExecuteSequence\tAction\n"
1977 "LaunchConditions\t\t100\n"
1978 "CostInitialize\t\t800\n"
1979 "FileCost\t\t900\n"
1980 "CostFinalize\t\t1000\n"
1981 "InstallValidate\t\t1400\n"
1982 "InstallInitialize\t\t1500\n"
1983 "ProcessComponents\t\t1600\n"
1984 "RemoveFiles\t\t1700\n"
1985 "InstallFiles\t\t2000\n"
1986 "UnregisterExtensionInfo\t\t3000\n"
1987 "UnregisterMIMEInfo\t\t3500\n"
1988 "RegisterExtensionInfo\t\t4000\n"
1989 "RegisterMIMEInfo\t\t4500\n"
1990 "RegisterProduct\t\t5000\n"
1991 "PublishFeatures\t\t5100\n"
1992 "PublishProduct\t\t5200\n"
1993 "InstallFinalize\t\t6000\n";
1995 static const CHAR sd_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1996 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1997 "File\tFile\n"
1998 "sourcedir.txt\tsourcedir\tsourcedir.txt\t1000\t\t\t8192\t1\n";
2000 static const CHAR sd_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
2001 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
2002 "Feature\tFeature\n"
2003 "sourcedir\t\t\tsourcedir feature\t1\t2\tMSITESTDIR\t0\n";
2005 static const CHAR sd_feature_comp_dat[] = "Feature_\tComponent_\n"
2006 "s38\ts72\n"
2007 "FeatureComponents\tFeature_\tComponent_\n"
2008 "sourcedir\tsourcedir\n";
2010 static const CHAR sd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
2011 "s72\tS38\ts72\ti2\tS255\tS72\n"
2012 "Component\tComponent\n"
2013 "sourcedir\t{DD422F92-3ED8-49B5-A0B7-F266F98357DF}\tMSITESTDIR\t0\t\tsourcedir.txt\n";
2015 static const CHAR sd_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
2016 "s72\tS255\tI2\n"
2017 "InstallUISequence\tAction\n"
2018 "TestSourceDirProp1\tnot SourceDir and not SOURCEDIR and not Installed\t99\n"
2019 "AppSearch\t\t100\n"
2020 "TestSourceDirProp2\tnot SourceDir and not SOURCEDIR and not Installed\t101\n"
2021 "LaunchConditions\tnot Installed \t110\n"
2022 "TestSourceDirProp3\tnot SourceDir and not SOURCEDIR and not Installed\t111\n"
2023 "FindRelatedProducts\t\t120\n"
2024 "TestSourceDirProp4\tnot SourceDir and not SOURCEDIR and not Installed\t121\n"
2025 "CCPSearch\t\t130\n"
2026 "TestSourceDirProp5\tnot SourceDir and not SOURCEDIR and not Installed\t131\n"
2027 "RMCCPSearch\t\t140\n"
2028 "TestSourceDirProp6\tnot SourceDir and not SOURCEDIR and not Installed\t141\n"
2029 "ValidateProductID\t\t150\n"
2030 "TestSourceDirProp7\tnot SourceDir and not SOURCEDIR and not Installed\t151\n"
2031 "CostInitialize\t\t800\n"
2032 "TestSourceDirProp8\tnot SourceDir and not SOURCEDIR and not Installed\t801\n"
2033 "FileCost\t\t900\n"
2034 "TestSourceDirProp9\tnot SourceDir and not SOURCEDIR and not Installed\t901\n"
2035 "IsolateComponents\t\t1000\n"
2036 "TestSourceDirProp10\tnot SourceDir and not SOURCEDIR and not Installed\t1001\n"
2037 "CostFinalize\t\t1100\n"
2038 "TestSourceDirProp11\tnot SourceDir and not SOURCEDIR and not Installed\t1101\n"
2039 "MigrateFeatureStates\t\t1200\n"
2040 "TestSourceDirProp12\tnot SourceDir and not SOURCEDIR and not Installed\t1201\n"
2041 "ExecuteAction\t\t1300\n"
2042 "TestSourceDirProp13\tnot SourceDir and not SOURCEDIR and not Installed\t1301\n";
2044 static const CHAR sd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
2045 "s72\tS255\tI2\n"
2046 "InstallExecuteSequence\tAction\n"
2047 "TestSourceDirProp14\tSourceDir and SOURCEDIR and not Installed\t99\n"
2048 "LaunchConditions\t\t100\n"
2049 "TestSourceDirProp15\tSourceDir and SOURCEDIR and not Installed\t101\n"
2050 "ValidateProductID\t\t700\n"
2051 "TestSourceDirProp16\tSourceDir and SOURCEDIR and not Installed\t701\n"
2052 "CostInitialize\t\t800\n"
2053 "TestSourceDirProp17\tSourceDir and SOURCEDIR and not Installed\t801\n"
2054 "ResolveSource\tResolveSource and not Installed\t850\n"
2055 "TestSourceDirProp18\tResolveSource and not SourceDir and not SOURCEDIR and not Installed\t851\n"
2056 "TestSourceDirProp19\tnot ResolveSource and SourceDir and SOURCEDIR and not Installed\t852\n"
2057 "FileCost\t\t900\n"
2058 "TestSourceDirProp20\tSourceDir and SOURCEDIR and not Installed\t901\n"
2059 "IsolateComponents\t\t1000\n"
2060 "TestSourceDirProp21\tSourceDir and SOURCEDIR and not Installed\t1001\n"
2061 "CostFinalize\t\t1100\n"
2062 "TestSourceDirProp22\tSourceDir and SOURCEDIR and not Installed\t1101\n"
2063 "MigrateFeatureStates\t\t1200\n"
2064 "TestSourceDirProp23\tSourceDir and SOURCEDIR and not Installed\t1201\n"
2065 "InstallValidate\t\t1400\n"
2066 "TestSourceDirProp24\tSourceDir and SOURCEDIR and not Installed\t1401\n"
2067 "InstallInitialize\t\t1500\n"
2068 "TestSourceDirProp25\tSourceDir and SOURCEDIR and not Installed\t1501\n"
2069 "ProcessComponents\t\t1600\n"
2070 "TestSourceDirProp26\tnot SourceDir and not SOURCEDIR and not Installed\t1601\n"
2071 "UnpublishFeatures\t\t1800\n"
2072 "TestSourceDirProp27\tnot SourceDir and not SOURCEDIR and not Installed\t1801\n"
2073 "RemoveFiles\t\t3500\n"
2074 "TestSourceDirProp28\tnot SourceDir and not SOURCEDIR and not Installed\t3501\n"
2075 "InstallFiles\t\t4000\n"
2076 "TestSourceDirProp29\tnot SourceDir and not SOURCEDIR and not Installed\t4001\n"
2077 "RegisterUser\t\t6000\n"
2078 "TestSourceDirProp30\tnot SourceDir and not SOURCEDIR and not Installed\t6001\n"
2079 "RegisterProduct\t\t6100\n"
2080 "TestSourceDirProp31\tnot SourceDir and not SOURCEDIR and not Installed\t6101\n"
2081 "PublishFeatures\t\t6300\n"
2082 "TestSourceDirProp32\tnot SourceDir and not SOURCEDIR and not Installed\t6301\n"
2083 "PublishProduct\t\t6400\n"
2084 "TestSourceDirProp33\tnot SourceDir and not SOURCEDIR and not Installed\t6401\n"
2085 "InstallExecute\t\t6500\n"
2086 "TestSourceDirProp34\tnot SourceDir and not SOURCEDIR and not Installed\t6501\n"
2087 "InstallFinalize\t\t6600\n"
2088 "TestSourceDirProp35\tnot SourceDir and not SOURCEDIR and not Installed\t6601\n";
2090 static const CHAR sd_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
2091 "s72\ti2\tS64\tS0\tS255\n"
2092 "CustomAction\tAction\n"
2093 "TestSourceDirProp1\t19\t\tTest 1 failed\t\n"
2094 "TestSourceDirProp2\t19\t\tTest 2 failed\t\n"
2095 "TestSourceDirProp3\t19\t\tTest 3 failed\t\n"
2096 "TestSourceDirProp4\t19\t\tTest 4 failed\t\n"
2097 "TestSourceDirProp5\t19\t\tTest 5 failed\t\n"
2098 "TestSourceDirProp6\t19\t\tTest 6 failed\t\n"
2099 "TestSourceDirProp7\t19\t\tTest 7 failed\t\n"
2100 "TestSourceDirProp8\t19\t\tTest 8 failed\t\n"
2101 "TestSourceDirProp9\t19\t\tTest 9 failed\t\n"
2102 "TestSourceDirProp10\t19\t\tTest 10 failed\t\n"
2103 "TestSourceDirProp11\t19\t\tTest 11 failed\t\n"
2104 "TestSourceDirProp12\t19\t\tTest 12 failed\t\n"
2105 "TestSourceDirProp13\t19\t\tTest 13 failed\t\n"
2106 "TestSourceDirProp14\t19\t\tTest 14 failed\t\n"
2107 "TestSourceDirProp15\t19\t\tTest 15 failed\t\n"
2108 "TestSourceDirProp16\t19\t\tTest 16 failed\t\n"
2109 "TestSourceDirProp17\t19\t\tTest 17 failed\t\n"
2110 "TestSourceDirProp18\t19\t\tTest 18 failed\t\n"
2111 "TestSourceDirProp19\t19\t\tTest 19 failed\t\n"
2112 "TestSourceDirProp20\t19\t\tTest 20 failed\t\n"
2113 "TestSourceDirProp21\t19\t\tTest 21 failed\t\n"
2114 "TestSourceDirProp22\t19\t\tTest 22 failed\t\n"
2115 "TestSourceDirProp23\t19\t\tTest 23 failed\t\n"
2116 "TestSourceDirProp24\t19\t\tTest 24 failed\t\n"
2117 "TestSourceDirProp25\t19\t\tTest 25 failed\t\n"
2118 "TestSourceDirProp26\t19\t\tTest 26 failed\t\n"
2119 "TestSourceDirProp27\t19\t\tTest 27 failed\t\n"
2120 "TestSourceDirProp28\t19\t\tTest 28 failed\t\n"
2121 "TestSourceDirProp29\t19\t\tTest 29 failed\t\n"
2122 "TestSourceDirProp30\t19\t\tTest 30 failed\t\n"
2123 "TestSourceDirProp31\t19\t\tTest 31 failed\t\n"
2124 "TestSourceDirProp32\t19\t\tTest 32 failed\t\n"
2125 "TestSourceDirProp33\t19\t\tTest 33 failed\t\n"
2126 "TestSourceDirProp34\t19\t\tTest 34 failed\t\n"
2127 "TestSourceDirProp35\t19\t\tTest 35 failed\t\n";
2129 typedef struct _msi_table
2131 const CHAR *filename;
2132 const CHAR *data;
2133 int size;
2134 } msi_table;
2136 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
2138 static const msi_table tables[] =
2140 ADD_TABLE(component),
2141 ADD_TABLE(directory),
2142 ADD_TABLE(feature),
2143 ADD_TABLE(feature_comp),
2144 ADD_TABLE(file),
2145 ADD_TABLE(install_exec_seq),
2146 ADD_TABLE(media),
2147 ADD_TABLE(property),
2148 ADD_TABLE(registry),
2149 ADD_TABLE(service_install),
2150 ADD_TABLE(service_control)
2153 static const msi_table sc_tables[] =
2155 ADD_TABLE(component),
2156 ADD_TABLE(directory),
2157 ADD_TABLE(feature),
2158 ADD_TABLE(feature_comp),
2159 ADD_TABLE(file),
2160 ADD_TABLE(install_exec_seq),
2161 ADD_TABLE(media),
2162 ADD_TABLE(property),
2163 ADD_TABLE(shortcut)
2166 static const msi_table ps_tables[] =
2168 ADD_TABLE(component),
2169 ADD_TABLE(directory),
2170 ADD_TABLE(feature),
2171 ADD_TABLE(feature_comp),
2172 ADD_TABLE(file),
2173 ADD_TABLE(install_exec_seq),
2174 ADD_TABLE(media),
2175 ADD_TABLE(property),
2176 ADD_TABLE(condition)
2179 static const msi_table env_tables[] =
2181 ADD_TABLE(component),
2182 ADD_TABLE(directory),
2183 ADD_TABLE(feature),
2184 ADD_TABLE(feature_comp),
2185 ADD_TABLE(file),
2186 ADD_TABLE(install_exec_seq),
2187 ADD_TABLE(media),
2188 ADD_TABLE(property),
2189 ADD_TABLE(environment)
2192 static const msi_table up_tables[] =
2194 ADD_TABLE(component),
2195 ADD_TABLE(directory),
2196 ADD_TABLE(feature),
2197 ADD_TABLE(feature_comp),
2198 ADD_TABLE(file),
2199 ADD_TABLE(install_exec_seq),
2200 ADD_TABLE(media),
2201 ADD_TABLE(up_property),
2202 ADD_TABLE(registry),
2203 ADD_TABLE(service_install),
2204 ADD_TABLE(service_control)
2207 static const msi_table up2_tables[] =
2209 ADD_TABLE(component),
2210 ADD_TABLE(directory),
2211 ADD_TABLE(feature),
2212 ADD_TABLE(feature_comp),
2213 ADD_TABLE(file),
2214 ADD_TABLE(install_exec_seq),
2215 ADD_TABLE(media),
2216 ADD_TABLE(up2_property),
2217 ADD_TABLE(registry),
2218 ADD_TABLE(service_install),
2219 ADD_TABLE(service_control)
2222 static const msi_table up3_tables[] =
2224 ADD_TABLE(component),
2225 ADD_TABLE(directory),
2226 ADD_TABLE(feature),
2227 ADD_TABLE(feature_comp),
2228 ADD_TABLE(file),
2229 ADD_TABLE(install_exec_seq),
2230 ADD_TABLE(media),
2231 ADD_TABLE(up3_property),
2232 ADD_TABLE(registry),
2233 ADD_TABLE(service_install),
2234 ADD_TABLE(service_control)
2237 static const msi_table up4_tables[] =
2239 ADD_TABLE(component),
2240 ADD_TABLE(directory),
2241 ADD_TABLE(feature),
2242 ADD_TABLE(feature_comp),
2243 ADD_TABLE(file),
2244 ADD_TABLE(pp_install_exec_seq),
2245 ADD_TABLE(media),
2246 ADD_TABLE(property),
2247 ADD_TABLE(registry),
2248 ADD_TABLE(service_install),
2249 ADD_TABLE(service_control)
2252 static const msi_table up5_tables[] =
2254 ADD_TABLE(component),
2255 ADD_TABLE(directory),
2256 ADD_TABLE(feature),
2257 ADD_TABLE(feature_comp),
2258 ADD_TABLE(file),
2259 ADD_TABLE(pp_install_exec_seq),
2260 ADD_TABLE(media),
2261 ADD_TABLE(up_property),
2262 ADD_TABLE(registry),
2263 ADD_TABLE(service_install),
2264 ADD_TABLE(service_control)
2267 static const msi_table up6_tables[] =
2269 ADD_TABLE(component),
2270 ADD_TABLE(directory),
2271 ADD_TABLE(feature),
2272 ADD_TABLE(feature_comp),
2273 ADD_TABLE(file),
2274 ADD_TABLE(pp_install_exec_seq),
2275 ADD_TABLE(media),
2276 ADD_TABLE(up2_property),
2277 ADD_TABLE(registry),
2278 ADD_TABLE(service_install),
2279 ADD_TABLE(service_control)
2282 static const msi_table up7_tables[] =
2284 ADD_TABLE(component),
2285 ADD_TABLE(directory),
2286 ADD_TABLE(feature),
2287 ADD_TABLE(feature_comp),
2288 ADD_TABLE(file),
2289 ADD_TABLE(pp_install_exec_seq),
2290 ADD_TABLE(media),
2291 ADD_TABLE(up3_property),
2292 ADD_TABLE(registry),
2293 ADD_TABLE(service_install),
2294 ADD_TABLE(service_control)
2297 static const msi_table cc_tables[] =
2299 ADD_TABLE(cc_component),
2300 ADD_TABLE(directory),
2301 ADD_TABLE(cc_feature),
2302 ADD_TABLE(cc_feature_comp),
2303 ADD_TABLE(cc_file),
2304 ADD_TABLE(install_exec_seq),
2305 ADD_TABLE(cc_media),
2306 ADD_TABLE(property),
2309 static const msi_table cc2_tables[] =
2311 ADD_TABLE(cc2_component),
2312 ADD_TABLE(directory),
2313 ADD_TABLE(cc_feature),
2314 ADD_TABLE(cc_feature_comp),
2315 ADD_TABLE(cc2_file),
2316 ADD_TABLE(install_exec_seq),
2317 ADD_TABLE(cc_media),
2318 ADD_TABLE(property),
2321 static const msi_table co_tables[] =
2323 ADD_TABLE(cc_component),
2324 ADD_TABLE(directory),
2325 ADD_TABLE(cc_feature),
2326 ADD_TABLE(cc_feature_comp),
2327 ADD_TABLE(co_file),
2328 ADD_TABLE(install_exec_seq),
2329 ADD_TABLE(co_media),
2330 ADD_TABLE(property),
2333 static const msi_table co2_tables[] =
2335 ADD_TABLE(cc_component),
2336 ADD_TABLE(directory),
2337 ADD_TABLE(cc_feature),
2338 ADD_TABLE(cc_feature_comp),
2339 ADD_TABLE(cc_file),
2340 ADD_TABLE(install_exec_seq),
2341 ADD_TABLE(co2_media),
2342 ADD_TABLE(property),
2345 static const msi_table mm_tables[] =
2347 ADD_TABLE(cc_component),
2348 ADD_TABLE(directory),
2349 ADD_TABLE(cc_feature),
2350 ADD_TABLE(cc_feature_comp),
2351 ADD_TABLE(mm_file),
2352 ADD_TABLE(install_exec_seq),
2353 ADD_TABLE(mm_media),
2354 ADD_TABLE(property),
2357 static const msi_table ss_tables[] =
2359 ADD_TABLE(cc_component),
2360 ADD_TABLE(directory),
2361 ADD_TABLE(cc_feature),
2362 ADD_TABLE(cc_feature_comp),
2363 ADD_TABLE(cc_file),
2364 ADD_TABLE(install_exec_seq),
2365 ADD_TABLE(ss_media),
2366 ADD_TABLE(property),
2369 static const msi_table ui_tables[] =
2371 ADD_TABLE(ui_component),
2372 ADD_TABLE(directory),
2373 ADD_TABLE(cc_feature),
2374 ADD_TABLE(cc_feature_comp),
2375 ADD_TABLE(cc_file),
2376 ADD_TABLE(install_exec_seq),
2377 ADD_TABLE(ui_install_ui_seq),
2378 ADD_TABLE(ui_custom_action),
2379 ADD_TABLE(cc_media),
2380 ADD_TABLE(property),
2383 static const msi_table rof_tables[] =
2385 ADD_TABLE(rof_component),
2386 ADD_TABLE(directory),
2387 ADD_TABLE(rof_feature),
2388 ADD_TABLE(rof_feature_comp),
2389 ADD_TABLE(rof_file),
2390 ADD_TABLE(install_exec_seq),
2391 ADD_TABLE(rof_media),
2392 ADD_TABLE(property),
2395 static const msi_table rofc_tables[] =
2397 ADD_TABLE(rof_component),
2398 ADD_TABLE(directory),
2399 ADD_TABLE(rof_feature),
2400 ADD_TABLE(rof_feature_comp),
2401 ADD_TABLE(rofc_file),
2402 ADD_TABLE(install_exec_seq),
2403 ADD_TABLE(rofc_media),
2404 ADD_TABLE(property),
2407 static const msi_table sdp_tables[] =
2409 ADD_TABLE(rof_component),
2410 ADD_TABLE(directory),
2411 ADD_TABLE(rof_feature),
2412 ADD_TABLE(rof_feature_comp),
2413 ADD_TABLE(rof_file),
2414 ADD_TABLE(sdp_install_exec_seq),
2415 ADD_TABLE(sdp_custom_action),
2416 ADD_TABLE(rof_media),
2417 ADD_TABLE(property),
2420 static const msi_table cie_tables[] =
2422 ADD_TABLE(cie_component),
2423 ADD_TABLE(directory),
2424 ADD_TABLE(cc_feature),
2425 ADD_TABLE(cie_feature_comp),
2426 ADD_TABLE(cie_file),
2427 ADD_TABLE(install_exec_seq),
2428 ADD_TABLE(cie_media),
2429 ADD_TABLE(property),
2432 static const msi_table ci_tables[] =
2434 ADD_TABLE(ci_component),
2435 ADD_TABLE(directory),
2436 ADD_TABLE(rof_feature),
2437 ADD_TABLE(rof_feature_comp),
2438 ADD_TABLE(rof_file),
2439 ADD_TABLE(ci_install_exec_seq),
2440 ADD_TABLE(rof_media),
2441 ADD_TABLE(property),
2442 ADD_TABLE(ci_custom_action),
2445 static const msi_table ci2_tables[] =
2447 ADD_TABLE(ci2_component),
2448 ADD_TABLE(directory),
2449 ADD_TABLE(rof_feature),
2450 ADD_TABLE(ci2_feature_comp),
2451 ADD_TABLE(ci2_file),
2452 ADD_TABLE(install_exec_seq),
2453 ADD_TABLE(rof_media),
2454 ADD_TABLE(property),
2457 static const msi_table spf_tables[] =
2459 ADD_TABLE(ci_component),
2460 ADD_TABLE(directory),
2461 ADD_TABLE(rof_feature),
2462 ADD_TABLE(rof_feature_comp),
2463 ADD_TABLE(rof_file),
2464 ADD_TABLE(spf_install_exec_seq),
2465 ADD_TABLE(rof_media),
2466 ADD_TABLE(property),
2467 ADD_TABLE(spf_custom_action),
2468 ADD_TABLE(spf_install_ui_seq),
2471 static const msi_table pp_tables[] =
2473 ADD_TABLE(pp_component),
2474 ADD_TABLE(directory),
2475 ADD_TABLE(rof_feature),
2476 ADD_TABLE(rof_feature_comp),
2477 ADD_TABLE(rof_file),
2478 ADD_TABLE(pp_install_exec_seq),
2479 ADD_TABLE(rof_media),
2480 ADD_TABLE(property),
2483 static const msi_table ppc_tables[] =
2485 ADD_TABLE(ppc_component),
2486 ADD_TABLE(directory),
2487 ADD_TABLE(rof_feature),
2488 ADD_TABLE(ppc_feature_comp),
2489 ADD_TABLE(ppc_file),
2490 ADD_TABLE(pp_install_exec_seq),
2491 ADD_TABLE(ppc_media),
2492 ADD_TABLE(property),
2495 static const msi_table lus0_tables[] =
2497 ADD_TABLE(ci_component),
2498 ADD_TABLE(directory),
2499 ADD_TABLE(rof_feature),
2500 ADD_TABLE(rof_feature_comp),
2501 ADD_TABLE(rof_file),
2502 ADD_TABLE(pp_install_exec_seq),
2503 ADD_TABLE(rof_media),
2504 ADD_TABLE(property),
2507 static const msi_table lus1_tables[] =
2509 ADD_TABLE(ci_component),
2510 ADD_TABLE(directory),
2511 ADD_TABLE(rof_feature),
2512 ADD_TABLE(rof_feature_comp),
2513 ADD_TABLE(rof_file),
2514 ADD_TABLE(pp_install_exec_seq),
2515 ADD_TABLE(rofc_media),
2516 ADD_TABLE(property),
2519 static const msi_table lus2_tables[] =
2521 ADD_TABLE(ci_component),
2522 ADD_TABLE(directory),
2523 ADD_TABLE(rof_feature),
2524 ADD_TABLE(rof_feature_comp),
2525 ADD_TABLE(rof_file),
2526 ADD_TABLE(pp_install_exec_seq),
2527 ADD_TABLE(lus2_media),
2528 ADD_TABLE(property),
2531 static const msi_table tp_tables[] =
2533 ADD_TABLE(tp_component),
2534 ADD_TABLE(directory),
2535 ADD_TABLE(rof_feature),
2536 ADD_TABLE(ci2_feature_comp),
2537 ADD_TABLE(ci2_file),
2538 ADD_TABLE(install_exec_seq),
2539 ADD_TABLE(rof_media),
2540 ADD_TABLE(property),
2543 static const msi_table cwd_tables[] =
2545 ADD_TABLE(cwd_component),
2546 ADD_TABLE(directory),
2547 ADD_TABLE(rof_feature),
2548 ADD_TABLE(ci2_feature_comp),
2549 ADD_TABLE(ci2_file),
2550 ADD_TABLE(install_exec_seq),
2551 ADD_TABLE(rof_media),
2552 ADD_TABLE(property),
2555 static const msi_table adm_tables[] =
2557 ADD_TABLE(adm_component),
2558 ADD_TABLE(directory),
2559 ADD_TABLE(rof_feature),
2560 ADD_TABLE(ci2_feature_comp),
2561 ADD_TABLE(ci2_file),
2562 ADD_TABLE(install_exec_seq),
2563 ADD_TABLE(rof_media),
2564 ADD_TABLE(property),
2565 ADD_TABLE(adm_custom_action),
2566 ADD_TABLE(adm_admin_exec_seq),
2569 static const msi_table amp_tables[] =
2571 ADD_TABLE(amp_component),
2572 ADD_TABLE(directory),
2573 ADD_TABLE(rof_feature),
2574 ADD_TABLE(ci2_feature_comp),
2575 ADD_TABLE(ci2_file),
2576 ADD_TABLE(install_exec_seq),
2577 ADD_TABLE(rof_media),
2578 ADD_TABLE(property),
2581 static const msi_table rem_tables[] =
2583 ADD_TABLE(rem_component),
2584 ADD_TABLE(directory),
2585 ADD_TABLE(rof_feature),
2586 ADD_TABLE(rem_feature_comp),
2587 ADD_TABLE(rem_file),
2588 ADD_TABLE(rem_install_exec_seq),
2589 ADD_TABLE(rof_media),
2590 ADD_TABLE(property),
2591 ADD_TABLE(rem_remove_files),
2594 static const msi_table mov_tables[] =
2596 ADD_TABLE(cwd_component),
2597 ADD_TABLE(directory),
2598 ADD_TABLE(rof_feature),
2599 ADD_TABLE(ci2_feature_comp),
2600 ADD_TABLE(ci2_file),
2601 ADD_TABLE(install_exec_seq),
2602 ADD_TABLE(rof_media),
2603 ADD_TABLE(property),
2604 ADD_TABLE(mov_move_file),
2607 static const msi_table mc_tables[] =
2609 ADD_TABLE(mc_component),
2610 ADD_TABLE(directory),
2611 ADD_TABLE(cc_feature),
2612 ADD_TABLE(cie_feature_comp),
2613 ADD_TABLE(mc_file),
2614 ADD_TABLE(install_exec_seq),
2615 ADD_TABLE(mc_media),
2616 ADD_TABLE(property),
2617 ADD_TABLE(mc_file_hash),
2620 static const msi_table df_tables[] =
2622 ADD_TABLE(rof_component),
2623 ADD_TABLE(df_directory),
2624 ADD_TABLE(rof_feature),
2625 ADD_TABLE(rof_feature_comp),
2626 ADD_TABLE(rof_file),
2627 ADD_TABLE(install_exec_seq),
2628 ADD_TABLE(rof_media),
2629 ADD_TABLE(property),
2630 ADD_TABLE(df_duplicate_file),
2633 static const msi_table wrv_tables[] =
2635 ADD_TABLE(wrv_component),
2636 ADD_TABLE(directory),
2637 ADD_TABLE(rof_feature),
2638 ADD_TABLE(ci2_feature_comp),
2639 ADD_TABLE(ci2_file),
2640 ADD_TABLE(install_exec_seq),
2641 ADD_TABLE(rof_media),
2642 ADD_TABLE(property),
2643 ADD_TABLE(wrv_registry),
2646 static const msi_table sf_tables[] =
2648 ADD_TABLE(wrv_component),
2649 ADD_TABLE(directory),
2650 ADD_TABLE(rof_feature),
2651 ADD_TABLE(ci2_feature_comp),
2652 ADD_TABLE(ci2_file),
2653 ADD_TABLE(install_exec_seq),
2654 ADD_TABLE(rof_media),
2655 ADD_TABLE(property),
2658 static const msi_table ca51_tables[] =
2660 ADD_TABLE(ca51_component),
2661 ADD_TABLE(directory),
2662 ADD_TABLE(rof_feature),
2663 ADD_TABLE(ci2_feature_comp),
2664 ADD_TABLE(ci2_file),
2665 ADD_TABLE(ca51_install_exec_seq),
2666 ADD_TABLE(rof_media),
2667 ADD_TABLE(property),
2668 ADD_TABLE(ca51_custom_action),
2671 static const msi_table is_tables[] =
2673 ADD_TABLE(is_component),
2674 ADD_TABLE(directory),
2675 ADD_TABLE(is_feature),
2676 ADD_TABLE(is_feature_comp),
2677 ADD_TABLE(is_file),
2678 ADD_TABLE(install_exec_seq),
2679 ADD_TABLE(is_media),
2680 ADD_TABLE(property),
2683 static const msi_table sp_tables[] =
2685 ADD_TABLE(sp_component),
2686 ADD_TABLE(sp_directory),
2687 ADD_TABLE(rof_feature),
2688 ADD_TABLE(ci2_feature_comp),
2689 ADD_TABLE(ci2_file),
2690 ADD_TABLE(install_exec_seq),
2691 ADD_TABLE(rof_media),
2692 ADD_TABLE(property),
2695 static const msi_table mcp_tables[] =
2697 ADD_TABLE(mcp_component),
2698 ADD_TABLE(directory),
2699 ADD_TABLE(mcp_feature),
2700 ADD_TABLE(mcp_feature_comp),
2701 ADD_TABLE(rem_file),
2702 ADD_TABLE(rem_install_exec_seq),
2703 ADD_TABLE(rof_media),
2704 ADD_TABLE(property),
2707 static const msi_table mcomp_tables[] =
2709 ADD_TABLE(mcp_component),
2710 ADD_TABLE(directory),
2711 ADD_TABLE(mcp_feature),
2712 ADD_TABLE(mcp_feature_comp),
2713 ADD_TABLE(mcomp_file),
2714 ADD_TABLE(rem_install_exec_seq),
2715 ADD_TABLE(rof_media),
2716 ADD_TABLE(property),
2719 static const msi_table ai_tables[] =
2721 ADD_TABLE(component),
2722 ADD_TABLE(directory),
2723 ADD_TABLE(feature),
2724 ADD_TABLE(feature_comp),
2725 ADD_TABLE(ai_file),
2726 ADD_TABLE(install_exec_seq),
2727 ADD_TABLE(media),
2728 ADD_TABLE(property)
2731 static const msi_table pc_tables[] =
2733 ADD_TABLE(ca51_component),
2734 ADD_TABLE(directory),
2735 ADD_TABLE(rof_feature),
2736 ADD_TABLE(ci2_feature_comp),
2737 ADD_TABLE(ci2_file),
2738 ADD_TABLE(install_exec_seq),
2739 ADD_TABLE(rof_media),
2740 ADD_TABLE(property)
2743 static const msi_table ip_tables[] =
2745 ADD_TABLE(component),
2746 ADD_TABLE(directory),
2747 ADD_TABLE(feature),
2748 ADD_TABLE(feature_comp),
2749 ADD_TABLE(file),
2750 ADD_TABLE(ip_install_exec_seq),
2751 ADD_TABLE(ip_custom_action),
2752 ADD_TABLE(media),
2753 ADD_TABLE(property)
2756 static const msi_table aup_tables[] =
2758 ADD_TABLE(component),
2759 ADD_TABLE(directory),
2760 ADD_TABLE(feature),
2761 ADD_TABLE(feature_comp),
2762 ADD_TABLE(file),
2763 ADD_TABLE(aup_install_exec_seq),
2764 ADD_TABLE(aup_custom_action),
2765 ADD_TABLE(media),
2766 ADD_TABLE(property)
2769 static const msi_table aup2_tables[] =
2771 ADD_TABLE(component),
2772 ADD_TABLE(directory),
2773 ADD_TABLE(feature),
2774 ADD_TABLE(feature_comp),
2775 ADD_TABLE(file),
2776 ADD_TABLE(aup2_install_exec_seq),
2777 ADD_TABLE(aup_custom_action),
2778 ADD_TABLE(media),
2779 ADD_TABLE(aup_property)
2782 static const msi_table aup3_tables[] =
2784 ADD_TABLE(component),
2785 ADD_TABLE(directory),
2786 ADD_TABLE(feature),
2787 ADD_TABLE(feature_comp),
2788 ADD_TABLE(file),
2789 ADD_TABLE(aup2_install_exec_seq),
2790 ADD_TABLE(aup_custom_action),
2791 ADD_TABLE(media),
2792 ADD_TABLE(aup2_property)
2795 static const msi_table aup4_tables[] =
2797 ADD_TABLE(component),
2798 ADD_TABLE(directory),
2799 ADD_TABLE(feature),
2800 ADD_TABLE(feature_comp),
2801 ADD_TABLE(file),
2802 ADD_TABLE(aup3_install_exec_seq),
2803 ADD_TABLE(aup_custom_action),
2804 ADD_TABLE(media),
2805 ADD_TABLE(aup2_property)
2808 static const msi_table fiu_tables[] =
2810 ADD_TABLE(rof_component),
2811 ADD_TABLE(directory),
2812 ADD_TABLE(rof_feature),
2813 ADD_TABLE(rof_feature_comp),
2814 ADD_TABLE(rof_file),
2815 ADD_TABLE(pp_install_exec_seq),
2816 ADD_TABLE(rof_media),
2817 ADD_TABLE(property),
2820 static const msi_table fiuc_tables[] =
2822 ADD_TABLE(rof_component),
2823 ADD_TABLE(directory),
2824 ADD_TABLE(rof_feature),
2825 ADD_TABLE(rof_feature_comp),
2826 ADD_TABLE(rofc_file),
2827 ADD_TABLE(pp_install_exec_seq),
2828 ADD_TABLE(rofc_media),
2829 ADD_TABLE(property),
2832 static const msi_table cf_tables[] =
2834 ADD_TABLE(component),
2835 ADD_TABLE(directory),
2836 ADD_TABLE(feature),
2837 ADD_TABLE(feature_comp),
2838 ADD_TABLE(file),
2839 ADD_TABLE(cf_create_folders),
2840 ADD_TABLE(cf_install_exec_seq),
2841 ADD_TABLE(cf_custom_action),
2842 ADD_TABLE(media),
2843 ADD_TABLE(property)
2846 static const msi_table rf_tables[] =
2848 ADD_TABLE(component),
2849 ADD_TABLE(directory),
2850 ADD_TABLE(feature),
2851 ADD_TABLE(feature_comp),
2852 ADD_TABLE(file),
2853 ADD_TABLE(cf_create_folders),
2854 ADD_TABLE(rf_install_exec_seq),
2855 ADD_TABLE(cf_custom_action),
2856 ADD_TABLE(media),
2857 ADD_TABLE(property)
2860 static const msi_table sss_tables[] =
2862 ADD_TABLE(component),
2863 ADD_TABLE(directory),
2864 ADD_TABLE(feature),
2865 ADD_TABLE(feature_comp),
2866 ADD_TABLE(file),
2867 ADD_TABLE(sss_install_exec_seq),
2868 ADD_TABLE(sss_service_control),
2869 ADD_TABLE(media),
2870 ADD_TABLE(property)
2873 static const msi_table sds_tables[] =
2875 ADD_TABLE(component),
2876 ADD_TABLE(directory),
2877 ADD_TABLE(feature),
2878 ADD_TABLE(feature_comp),
2879 ADD_TABLE(file),
2880 ADD_TABLE(sds_install_exec_seq),
2881 ADD_TABLE(service_control),
2882 ADD_TABLE(service_install),
2883 ADD_TABLE(media),
2884 ADD_TABLE(property)
2887 static const msi_table sr_tables[] =
2889 ADD_TABLE(component),
2890 ADD_TABLE(directory),
2891 ADD_TABLE(feature),
2892 ADD_TABLE(feature_comp),
2893 ADD_TABLE(file),
2894 ADD_TABLE(sr_selfreg),
2895 ADD_TABLE(sr_install_exec_seq),
2896 ADD_TABLE(media),
2897 ADD_TABLE(property)
2900 static const msi_table font_tables[] =
2902 ADD_TABLE(font_component),
2903 ADD_TABLE(directory),
2904 ADD_TABLE(font_feature),
2905 ADD_TABLE(font_feature_comp),
2906 ADD_TABLE(font_file),
2907 ADD_TABLE(font),
2908 ADD_TABLE(font_install_exec_seq),
2909 ADD_TABLE(font_media),
2910 ADD_TABLE(property)
2913 static const msi_table vp_tables[] =
2915 ADD_TABLE(component),
2916 ADD_TABLE(directory),
2917 ADD_TABLE(feature),
2918 ADD_TABLE(feature_comp),
2919 ADD_TABLE(file),
2920 ADD_TABLE(vp_custom_action),
2921 ADD_TABLE(vp_install_exec_seq),
2922 ADD_TABLE(media),
2923 ADD_TABLE(vp_property)
2926 static const msi_table odbc_tables[] =
2928 ADD_TABLE(odbc_component),
2929 ADD_TABLE(directory),
2930 ADD_TABLE(odbc_feature),
2931 ADD_TABLE(odbc_feature_comp),
2932 ADD_TABLE(odbc_file),
2933 ADD_TABLE(odbc_driver),
2934 ADD_TABLE(odbc_translator),
2935 ADD_TABLE(odbc_datasource),
2936 ADD_TABLE(odbc_install_exec_seq),
2937 ADD_TABLE(odbc_media),
2938 ADD_TABLE(property)
2941 static const msi_table tl_tables[] =
2943 ADD_TABLE(tl_component),
2944 ADD_TABLE(directory),
2945 ADD_TABLE(tl_feature),
2946 ADD_TABLE(tl_feature_comp),
2947 ADD_TABLE(tl_file),
2948 ADD_TABLE(tl_typelib),
2949 ADD_TABLE(tl_install_exec_seq),
2950 ADD_TABLE(media),
2951 ADD_TABLE(property)
2954 static const msi_table crs_tables[] =
2956 ADD_TABLE(crs_component),
2957 ADD_TABLE(directory),
2958 ADD_TABLE(crs_feature),
2959 ADD_TABLE(crs_feature_comp),
2960 ADD_TABLE(crs_file),
2961 ADD_TABLE(crs_shortcut),
2962 ADD_TABLE(crs_install_exec_seq),
2963 ADD_TABLE(media),
2964 ADD_TABLE(property)
2967 static const msi_table pub_tables[] =
2969 ADD_TABLE(directory),
2970 ADD_TABLE(pub_component),
2971 ADD_TABLE(pub_feature),
2972 ADD_TABLE(pub_feature_comp),
2973 ADD_TABLE(pub_file),
2974 ADD_TABLE(pub_publish_component),
2975 ADD_TABLE(pub_install_exec_seq),
2976 ADD_TABLE(media),
2977 ADD_TABLE(property)
2980 static const msi_table rd_tables[] =
2982 ADD_TABLE(directory),
2983 ADD_TABLE(rd_component),
2984 ADD_TABLE(rd_feature),
2985 ADD_TABLE(rd_feature_comp),
2986 ADD_TABLE(rd_file),
2987 ADD_TABLE(rd_duplicate_file),
2988 ADD_TABLE(rd_install_exec_seq),
2989 ADD_TABLE(media),
2990 ADD_TABLE(property)
2993 static const msi_table rrv_tables[] =
2995 ADD_TABLE(directory),
2996 ADD_TABLE(rrv_component),
2997 ADD_TABLE(rrv_feature),
2998 ADD_TABLE(rrv_feature_comp),
2999 ADD_TABLE(rrv_file),
3000 ADD_TABLE(rrv_registry),
3001 ADD_TABLE(rrv_remove_registry),
3002 ADD_TABLE(rrv_install_exec_seq),
3003 ADD_TABLE(media),
3004 ADD_TABLE(property)
3007 static const msi_table frp_tables[] =
3009 ADD_TABLE(directory),
3010 ADD_TABLE(frp_component),
3011 ADD_TABLE(frp_feature),
3012 ADD_TABLE(frp_feature_comp),
3013 ADD_TABLE(frp_file),
3014 ADD_TABLE(frp_upgrade),
3015 ADD_TABLE(frp_custom_action),
3016 ADD_TABLE(frp_install_exec_seq),
3017 ADD_TABLE(media),
3018 ADD_TABLE(property)
3021 static const msi_table riv_tables[] =
3023 ADD_TABLE(directory),
3024 ADD_TABLE(riv_component),
3025 ADD_TABLE(riv_feature),
3026 ADD_TABLE(riv_feature_comp),
3027 ADD_TABLE(riv_file),
3028 ADD_TABLE(riv_ini_file),
3029 ADD_TABLE(riv_remove_ini_file),
3030 ADD_TABLE(riv_install_exec_seq),
3031 ADD_TABLE(media),
3032 ADD_TABLE(property)
3035 static const msi_table res_tables[] =
3037 ADD_TABLE(directory),
3038 ADD_TABLE(res_component),
3039 ADD_TABLE(res_feature),
3040 ADD_TABLE(res_feature_comp),
3041 ADD_TABLE(res_file),
3042 ADD_TABLE(res_environment),
3043 ADD_TABLE(res_install_exec_seq),
3044 ADD_TABLE(media),
3045 ADD_TABLE(property)
3048 static const msi_table rci_tables[] =
3050 ADD_TABLE(directory),
3051 ADD_TABLE(rci_component),
3052 ADD_TABLE(rci_feature),
3053 ADD_TABLE(rci_feature_comp),
3054 ADD_TABLE(rci_file),
3055 ADD_TABLE(rci_appid),
3056 ADD_TABLE(rci_class),
3057 ADD_TABLE(rci_install_exec_seq),
3058 ADD_TABLE(media),
3059 ADD_TABLE(property)
3062 static const msi_table rei_tables[] =
3064 ADD_TABLE(directory),
3065 ADD_TABLE(rei_component),
3066 ADD_TABLE(rei_feature),
3067 ADD_TABLE(rei_feature_comp),
3068 ADD_TABLE(rei_file),
3069 ADD_TABLE(rei_extension),
3070 ADD_TABLE(rei_verb),
3071 ADD_TABLE(rei_progid),
3072 ADD_TABLE(rei_install_exec_seq),
3073 ADD_TABLE(media),
3074 ADD_TABLE(property)
3077 static const msi_table rmi_tables[] =
3079 ADD_TABLE(directory),
3080 ADD_TABLE(rmi_component),
3081 ADD_TABLE(rmi_feature),
3082 ADD_TABLE(rmi_feature_comp),
3083 ADD_TABLE(rmi_file),
3084 ADD_TABLE(rmi_extension),
3085 ADD_TABLE(rmi_verb),
3086 ADD_TABLE(rmi_mime),
3087 ADD_TABLE(rmi_install_exec_seq),
3088 ADD_TABLE(media),
3089 ADD_TABLE(property)
3092 static const msi_table sd_tables[] =
3094 ADD_TABLE(directory),
3095 ADD_TABLE(sd_component),
3096 ADD_TABLE(sd_feature),
3097 ADD_TABLE(sd_feature_comp),
3098 ADD_TABLE(sd_file),
3099 ADD_TABLE(sd_install_exec_seq),
3100 ADD_TABLE(sd_install_ui_seq),
3101 ADD_TABLE(sd_custom_action),
3102 ADD_TABLE(media),
3103 ADD_TABLE(property)
3106 static const msi_table fo_tables[] =
3108 ADD_TABLE(directory),
3109 ADD_TABLE(fo_file),
3110 ADD_TABLE(fo_component),
3111 ADD_TABLE(fo_feature),
3112 ADD_TABLE(fo_condition),
3113 ADD_TABLE(fo_feature_comp),
3114 ADD_TABLE(fo_custom_action),
3115 ADD_TABLE(fo_install_exec_seq),
3116 ADD_TABLE(media),
3117 ADD_TABLE(property)
3120 static const msi_table icon_base_tables[] =
3122 ADD_TABLE(ci_component),
3123 ADD_TABLE(directory),
3124 ADD_TABLE(rof_feature),
3125 ADD_TABLE(rof_feature_comp),
3126 ADD_TABLE(rof_file),
3127 ADD_TABLE(pp_install_exec_seq),
3128 ADD_TABLE(rof_media),
3129 ADD_TABLE(icon_property),
3132 static const msi_table pv_tables[] =
3134 ADD_TABLE(rof_component),
3135 ADD_TABLE(directory),
3136 ADD_TABLE(rof_feature),
3137 ADD_TABLE(rof_feature_comp),
3138 ADD_TABLE(rof_file),
3139 ADD_TABLE(pv_install_exec_seq),
3140 ADD_TABLE(rof_media),
3141 ADD_TABLE(property)
3144 /* cabinet definitions */
3146 /* make the max size large so there is only one cab file */
3147 #define MEDIA_SIZE 0x7FFFFFFF
3148 #define FOLDER_THRESHOLD 900000
3150 /* the FCI callbacks */
3152 static void * CDECL mem_alloc(ULONG cb)
3154 return HeapAlloc(GetProcessHeap(), 0, cb);
3157 static void CDECL mem_free(void *memory)
3159 HeapFree(GetProcessHeap(), 0, memory);
3162 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
3164 sprintf(pccab->szCab, pv, pccab->iCab);
3165 return TRUE;
3168 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
3170 return 0;
3173 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
3174 BOOL fContinuation, void *pv)
3176 return 0;
3179 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
3181 HANDLE handle;
3182 DWORD dwAccess = 0;
3183 DWORD dwShareMode = 0;
3184 DWORD dwCreateDisposition = OPEN_EXISTING;
3186 dwAccess = GENERIC_READ | GENERIC_WRITE;
3187 /* FILE_SHARE_DELETE is not supported by Windows Me/98/95 */
3188 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
3190 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
3191 dwCreateDisposition = OPEN_EXISTING;
3192 else
3193 dwCreateDisposition = CREATE_NEW;
3195 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
3196 dwCreateDisposition, 0, NULL);
3198 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
3200 return (INT_PTR)handle;
3203 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
3205 HANDLE handle = (HANDLE)hf;
3206 DWORD dwRead;
3207 BOOL res;
3209 res = ReadFile(handle, memory, cb, &dwRead, NULL);
3210 ok(res, "Failed to ReadFile\n");
3212 return dwRead;
3215 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
3217 HANDLE handle = (HANDLE)hf;
3218 DWORD dwWritten;
3219 BOOL res;
3221 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
3222 ok(res, "Failed to WriteFile\n");
3224 return dwWritten;
3227 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
3229 HANDLE handle = (HANDLE)hf;
3230 ok(CloseHandle(handle), "Failed to CloseHandle\n");
3232 return 0;
3235 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
3237 HANDLE handle = (HANDLE)hf;
3238 DWORD ret;
3240 ret = SetFilePointer(handle, dist, NULL, seektype);
3241 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
3243 return ret;
3246 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
3248 BOOL ret = DeleteFileA(pszFile);
3249 ok(ret, "Failed to DeleteFile %s\n", pszFile);
3251 return 0;
3254 static void init_functionpointers(void)
3256 HMODULE hmsi = GetModuleHandleA("msi.dll");
3257 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
3258 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
3260 #define GET_PROC(mod, func) \
3261 p ## func = (void*)GetProcAddress(mod, #func); \
3262 if(!p ## func) \
3263 trace("GetProcAddress(%s) failed\n", #func);
3265 GET_PROC(hmsi, MsiQueryComponentStateA);
3266 GET_PROC(hmsi, MsiSetExternalUIRecord);
3267 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
3268 GET_PROC(hmsi, MsiSourceListGetInfoA);
3270 GET_PROC(hadvapi32, ConvertSidToStringSidA);
3271 GET_PROC(hadvapi32, GetTokenInformation);
3272 GET_PROC(hadvapi32, OpenProcessToken);
3273 GET_PROC(hadvapi32, RegDeleteKeyExA)
3274 GET_PROC(hkernel32, IsWow64Process)
3276 hsrclient = LoadLibraryA("srclient.dll");
3277 GET_PROC(hsrclient, SRRemoveRestorePoint);
3278 GET_PROC(hsrclient, SRSetRestorePointA);
3280 #undef GET_PROC
3283 static BOOL is_process_limited(void)
3285 HANDLE token;
3287 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
3289 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
3291 BOOL ret;
3292 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
3293 DWORD size;
3295 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
3296 CloseHandle(token);
3297 return (ret && type == TokenElevationTypeLimited);
3299 return FALSE;
3302 static BOOL check_win9x(void)
3304 SC_HANDLE scm;
3306 scm = OpenSCManager(NULL, NULL, GENERIC_ALL);
3307 if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
3308 return TRUE;
3310 CloseServiceHandle(scm);
3312 return FALSE;
3315 static LPSTR get_user_sid(LPSTR *usersid)
3317 HANDLE token;
3318 BYTE buf[1024];
3319 DWORD size;
3320 PTOKEN_USER user;
3322 if (!pConvertSidToStringSidA)
3324 win_skip("ConvertSidToStringSidA is not available\n");
3325 return NULL;
3328 *usersid = NULL;
3329 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
3330 size = sizeof(buf);
3331 GetTokenInformation(token, TokenUser, buf, size, &size);
3332 user = (PTOKEN_USER)buf;
3333 pConvertSidToStringSidA(user->User.Sid, usersid);
3334 ok(*usersid != NULL, "pConvertSidToStringSidA failed lre=%d\n", GetLastError());
3335 CloseHandle(token);
3336 return *usersid;
3339 static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val)
3341 CHAR buffer[0x20];
3342 UINT r;
3343 DWORD sz;
3345 sz = sizeof buffer;
3346 r = MsiRecordGetString(rec, field, buffer, &sz);
3347 return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
3350 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
3352 LPSTR tempname;
3354 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
3355 GetTempFileNameA(".", "xx", 0, tempname);
3357 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
3359 lstrcpyA(pszTempName, tempname);
3360 HeapFree(GetProcessHeap(), 0, tempname);
3361 return TRUE;
3364 HeapFree(GetProcessHeap(), 0, tempname);
3366 return FALSE;
3369 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
3370 USHORT *pattribs, int *err, void *pv)
3372 BY_HANDLE_FILE_INFORMATION finfo;
3373 FILETIME filetime;
3374 HANDLE handle;
3375 DWORD attrs;
3376 BOOL res;
3378 handle = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
3379 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
3381 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
3383 res = GetFileInformationByHandle(handle, &finfo);
3384 ok(res, "Expected GetFileInformationByHandle to succeed\n");
3386 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
3387 FileTimeToDosDateTime(&filetime, pdate, ptime);
3389 attrs = GetFileAttributes(pszName);
3390 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
3392 return (INT_PTR)handle;
3395 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
3397 char path[MAX_PATH];
3398 char filename[MAX_PATH];
3400 lstrcpyA(path, CURR_DIR);
3401 lstrcatA(path, "\\");
3402 lstrcatA(path, file);
3404 lstrcpyA(filename, file);
3406 return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
3407 progress, get_open_info, compress);
3410 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
3412 ZeroMemory(pCabParams, sizeof(CCAB));
3414 pCabParams->cb = max_size;
3415 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
3416 pCabParams->setID = 0xbeef;
3417 pCabParams->iCab = 1;
3418 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
3419 lstrcatA(pCabParams->szCabPath, "\\");
3420 lstrcpyA(pCabParams->szCab, name);
3423 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
3425 CCAB cabParams;
3426 LPCSTR ptr;
3427 HFCI hfci;
3428 ERF erf;
3429 BOOL res;
3431 set_cab_parameters(&cabParams, name, max_size);
3433 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
3434 fci_read, fci_write, fci_close, fci_seek, fci_delete,
3435 get_temp_file, &cabParams, NULL);
3437 ok(hfci != NULL, "Failed to create an FCI context\n");
3439 ptr = files;
3440 while (*ptr)
3442 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
3443 ok(res, "Failed to add file: %s\n", ptr);
3444 ptr += lstrlen(ptr) + 1;
3447 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
3448 ok(res, "Failed to flush the cabinet\n");
3450 res = FCIDestroy(hfci);
3451 ok(res, "Failed to destroy the cabinet\n");
3454 static BOOL get_user_dirs(void)
3456 HKEY hkey;
3457 DWORD type, size;
3459 if(RegOpenKey(HKEY_CURRENT_USER,
3460 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
3461 &hkey))
3462 return FALSE;
3464 size = MAX_PATH;
3465 if(RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size)){
3466 RegCloseKey(hkey);
3467 return FALSE;
3470 RegCloseKey(hkey);
3471 return TRUE;
3474 static BOOL get_system_dirs(void)
3476 HKEY hkey;
3477 DWORD type, size;
3479 if (RegOpenKey(HKEY_LOCAL_MACHINE,
3480 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
3481 return FALSE;
3483 size = MAX_PATH;
3484 if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
3485 RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size)) {
3486 RegCloseKey(hkey);
3487 return FALSE;
3490 size = MAX_PATH;
3491 if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
3492 RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size)) {
3493 RegCloseKey(hkey);
3494 return FALSE;
3497 size = MAX_PATH;
3498 if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR_NATIVE, &size)) {
3499 RegCloseKey(hkey);
3500 return FALSE;
3503 RegCloseKey(hkey);
3505 if(GetWindowsDirectoryA(WINDOWS_DIR, MAX_PATH) != ERROR_SUCCESS)
3506 return FALSE;
3508 return TRUE;
3511 static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
3513 HANDLE file;
3514 DWORD written;
3516 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
3517 if (file == INVALID_HANDLE_VALUE)
3518 return;
3520 WriteFile(file, data, strlen(data), &written, NULL);
3522 if (size)
3524 SetFilePointer(file, size, NULL, FILE_BEGIN);
3525 SetEndOfFile(file);
3528 CloseHandle(file);
3531 #define create_file(name, size) create_file_data(name, name, size)
3533 static void create_test_files(void)
3535 CreateDirectoryA("msitest", NULL);
3536 create_file("msitest\\one.txt", 100);
3537 CreateDirectoryA("msitest\\first", NULL);
3538 create_file("msitest\\first\\two.txt", 100);
3539 CreateDirectoryA("msitest\\second", NULL);
3540 create_file("msitest\\second\\three.txt", 100);
3542 create_file("four.txt", 100);
3543 create_file("five.txt", 100);
3544 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
3546 create_file("msitest\\filename", 100);
3547 create_file("msitest\\service.exe", 100);
3549 DeleteFileA("four.txt");
3550 DeleteFileA("five.txt");
3553 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
3555 CHAR path[MAX_PATH];
3557 lstrcpyA(path, PROG_FILES_DIR);
3558 lstrcatA(path, "\\");
3559 lstrcatA(path, rel_path);
3561 if (is_file)
3562 return DeleteFileA(path);
3563 else
3564 return RemoveDirectoryA(path);
3567 static BOOL delete_pf_native(const CHAR *rel_path, BOOL is_file)
3569 CHAR path[MAX_PATH];
3571 lstrcpyA(path, PROG_FILES_DIR_NATIVE);
3572 lstrcatA(path, "\\");
3573 lstrcatA(path, rel_path);
3575 if (is_file)
3576 return DeleteFileA(path);
3577 else
3578 return RemoveDirectoryA(path);
3581 static BOOL delete_cf(const CHAR *rel_path, BOOL is_file)
3583 CHAR path[MAX_PATH];
3585 lstrcpyA(path, COMMON_FILES_DIR);
3586 lstrcatA(path, "\\");
3587 lstrcatA(path, rel_path);
3589 if (is_file)
3590 return DeleteFileA(path);
3591 else
3592 return RemoveDirectoryA(path);
3595 static void delete_test_files(void)
3597 DeleteFileA("msitest.msi");
3598 DeleteFileA("msitest.cab");
3599 DeleteFileA("msitest\\second\\three.txt");
3600 DeleteFileA("msitest\\first\\two.txt");
3601 DeleteFileA("msitest\\one.txt");
3602 DeleteFileA("msitest\\service.exe");
3603 DeleteFileA("msitest\\filename");
3604 RemoveDirectoryA("msitest\\second");
3605 RemoveDirectoryA("msitest\\first");
3606 RemoveDirectoryA("msitest");
3609 static void write_file(const CHAR *filename, const char *data, int data_size)
3611 DWORD size;
3613 HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
3614 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
3616 WriteFile(hf, data, data_size, &size, NULL);
3617 CloseHandle(hf);
3620 static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template)
3622 MSIHANDLE summary;
3623 UINT r;
3625 r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
3626 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3628 r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template);
3629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3631 r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL,
3632 "{004757CA-5092-49c2-AD20-28E1CE0DF5F2}");
3633 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3635 r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, version, NULL, NULL);
3636 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3638 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
3639 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3641 r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
3642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3644 /* write the summary changes back to the stream */
3645 r = MsiSummaryInfoPersist(summary);
3646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3648 MsiCloseHandle(summary);
3651 #define create_database(name, tables, num_tables) \
3652 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
3654 #define create_database_template(name, tables, num_tables, version, template) \
3655 create_database_wordcount(name, tables, num_tables, version, 0, template);
3657 static void create_database_wordcount(const CHAR *name, const msi_table *tables,
3658 int num_tables, INT version, INT wordcount,
3659 const char *template)
3661 MSIHANDLE db;
3662 UINT r;
3663 int j;
3665 r = MsiOpenDatabaseA(name, MSIDBOPEN_CREATE, &db);
3666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3668 /* import the tables into the database */
3669 for (j = 0; j < num_tables; j++)
3671 const msi_table *table = &tables[j];
3673 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
3675 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
3676 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3678 DeleteFileA(table->filename);
3681 write_msi_summary_info(db, version, wordcount, template);
3683 r = MsiDatabaseCommit(db);
3684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3686 MsiCloseHandle(db);
3689 static void check_service_is_installed(void)
3691 SC_HANDLE scm, service;
3692 BOOL res;
3694 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
3695 ok(scm != NULL, "Failed to open the SC Manager\n");
3697 service = OpenService(scm, "TestService", SC_MANAGER_ALL_ACCESS);
3698 ok(service != NULL, "Failed to open TestService\n");
3700 res = DeleteService(service);
3701 ok(res, "Failed to delete TestService\n");
3703 CloseServiceHandle(service);
3704 CloseServiceHandle(scm);
3707 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
3709 RESTOREPOINTINFOA spec;
3711 spec.dwEventType = event_type;
3712 spec.dwRestorePtType = APPLICATION_INSTALL;
3713 spec.llSequenceNumber = status->llSequenceNumber;
3714 lstrcpyA(spec.szDescription, "msitest restore point");
3716 return pSRSetRestorePointA(&spec, status);
3719 static void remove_restore_point(DWORD seq_number)
3721 DWORD res;
3723 res = pSRRemoveRestorePoint(seq_number);
3724 if (res != ERROR_SUCCESS)
3725 trace("Failed to remove the restore point : %08x\n", res);
3728 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
3730 if (pRegDeleteKeyExA)
3731 return pRegDeleteKeyExA( key, subkey, access, 0 );
3732 return RegDeleteKeyA( key, subkey );
3735 static void test_MsiInstallProduct(void)
3737 UINT r;
3738 CHAR path[MAX_PATH];
3739 LONG res;
3740 HKEY hkey;
3741 DWORD num, size, type;
3742 REGSAM access = KEY_ALL_ACCESS;
3744 if (on_win9x)
3746 win_skip("Services are not implemented on Win9x and WinMe\n");
3747 return;
3749 if (is_process_limited())
3751 skip("process is limited\n");
3752 return;
3755 if (is_wow64)
3756 access |= KEY_WOW64_64KEY;
3758 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3760 /* szPackagePath is NULL */
3761 r = MsiInstallProductA(NULL, "INSTALL=ALL");
3762 ok(r == ERROR_INVALID_PARAMETER,
3763 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
3765 /* both szPackagePath and szCommandLine are NULL */
3766 r = MsiInstallProductA(NULL, NULL);
3767 ok(r == ERROR_INVALID_PARAMETER,
3768 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
3770 /* szPackagePath is empty */
3771 r = MsiInstallProductA("", "INSTALL=ALL");
3772 ok(r == ERROR_PATH_NOT_FOUND,
3773 "Expected ERROR_PATH_NOT_FOUND, got %d\n", r);
3775 create_test_files();
3776 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
3778 /* install, don't publish */
3779 r = MsiInstallProductA(msifile, NULL);
3780 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3782 skip("Not enough rights to perform tests\n");
3783 goto error;
3785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3787 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3788 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3789 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3790 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3791 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3792 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3793 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3794 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3795 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3796 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3797 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3798 ok(delete_pf("msitest", FALSE), "File not installed\n");
3800 res = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", 0, access, &hkey);
3801 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3803 size = MAX_PATH;
3804 type = REG_SZ;
3805 res = RegQueryValueExA(hkey, "Name", NULL, &type, (LPBYTE)path, &size);
3806 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3807 ok(!lstrcmpA(path, "imaname"), "Expected imaname, got %s\n", path);
3809 size = MAX_PATH;
3810 type = REG_SZ;
3811 res = RegQueryValueExA(hkey, "blah", NULL, &type, (LPBYTE)path, &size);
3812 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3814 size = sizeof(num);
3815 type = REG_DWORD;
3816 res = RegQueryValueExA(hkey, "number", NULL, &type, (LPBYTE)&num, &size);
3817 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3818 ok(num == 314, "Expected 314, got %d\n", num);
3820 size = MAX_PATH;
3821 type = REG_SZ;
3822 res = RegQueryValueExA(hkey, "OrderTestName", NULL, &type, (LPBYTE)path, &size);
3823 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3824 ok(!lstrcmpA(path, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path);
3826 check_service_is_installed();
3828 delete_key(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access);
3830 /* not published, reinstall */
3831 r = MsiInstallProductA(msifile, NULL);
3832 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3834 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3835 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3836 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3837 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3838 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3839 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3840 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3841 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3842 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3843 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3844 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3845 ok(delete_pf("msitest", FALSE), "File not installed\n");
3847 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3848 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3849 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3851 create_database(msifile, up_tables, sizeof(up_tables) / sizeof(msi_table));
3853 /* not published, RemovePreviousVersions set */
3854 r = MsiInstallProductA(msifile, NULL);
3855 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3857 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3858 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3859 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3860 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3861 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3862 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3863 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3864 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3865 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3866 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3867 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3868 ok(delete_pf("msitest", FALSE), "File not installed\n");
3870 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3871 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3872 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3874 create_database(msifile, up2_tables, sizeof(up2_tables) / sizeof(msi_table));
3876 /* not published, version number bumped */
3877 r = MsiInstallProductA(msifile, NULL);
3878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3880 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3881 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3882 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3883 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3884 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3885 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3886 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3887 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3888 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3889 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3890 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3891 ok(delete_pf("msitest", FALSE), "File not installed\n");
3893 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3894 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3895 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3897 create_database(msifile, up3_tables, sizeof(up3_tables) / sizeof(msi_table));
3899 /* not published, RemovePreviousVersions set and version number bumped */
3900 r = MsiInstallProductA(msifile, NULL);
3901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3903 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3904 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3905 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3906 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3907 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3908 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3909 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3910 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3911 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3912 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3913 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3914 ok(delete_pf("msitest", FALSE), "File not installed\n");
3916 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3917 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3918 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
3920 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
3922 /* install, publish product */
3923 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
3924 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3926 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3927 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3928 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3929 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3930 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3931 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3932 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3933 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3934 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3935 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3936 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3937 ok(delete_pf("msitest", FALSE), "File not installed\n");
3939 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3940 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3942 create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
3944 /* published, reinstall */
3945 r = MsiInstallProductA(msifile, NULL);
3946 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3948 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3949 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3950 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3951 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3952 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3953 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3954 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3955 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3956 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3957 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3958 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3959 ok(delete_pf("msitest", FALSE), "File not installed\n");
3961 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3962 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3964 create_database(msifile, up5_tables, sizeof(up5_tables) / sizeof(msi_table));
3966 /* published product, RemovePreviousVersions set */
3967 r = MsiInstallProductA(msifile, NULL);
3968 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3970 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3971 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3972 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3973 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3974 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3975 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3976 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3977 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
3978 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
3979 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
3980 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
3981 ok(delete_pf("msitest", FALSE), "File not installed\n");
3983 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
3984 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3986 create_database(msifile, up6_tables, sizeof(up6_tables) / sizeof(msi_table));
3988 /* published product, version number bumped */
3989 r = MsiInstallProductA(msifile, NULL);
3990 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3992 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
3993 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
3994 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
3995 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
3996 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
3997 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
3998 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
3999 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
4000 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4001 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4002 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4003 ok(delete_pf("msitest", FALSE), "File not installed\n");
4005 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
4006 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4008 create_database(msifile, up7_tables, sizeof(up7_tables) / sizeof(msi_table));
4010 /* published product, RemovePreviousVersions set and version number bumped */
4011 r = MsiInstallProductA(msifile, NULL);
4012 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4014 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4015 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
4016 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4017 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
4018 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
4019 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
4020 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
4021 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
4022 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4023 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4024 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4025 ok(delete_pf("msitest", FALSE), "File not installed\n");
4027 res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
4028 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4030 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4031 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4033 error:
4034 delete_test_files();
4035 DeleteFileA(msifile);
4038 static void test_MsiSetComponentState(void)
4040 INSTALLSTATE installed, action;
4041 MSIHANDLE package;
4042 char path[MAX_PATH];
4043 UINT r;
4045 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
4047 CoInitialize(NULL);
4049 lstrcpy(path, CURR_DIR);
4050 lstrcat(path, "\\");
4051 lstrcat(path, msifile);
4053 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4055 r = MsiOpenPackage(path, &package);
4056 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4058 skip("Not enough rights to perform tests\n");
4059 goto error;
4061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4063 r = MsiDoAction(package, "CostInitialize");
4064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4066 r = MsiDoAction(package, "FileCost");
4067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4069 r = MsiDoAction(package, "CostFinalize");
4070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4072 r = MsiGetComponentState(package, "dangler", &installed, &action);
4073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4074 ok(installed == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", installed);
4075 ok(action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
4077 r = MsiSetComponentState(package, "dangler", INSTALLSTATE_SOURCE);
4078 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4080 MsiCloseHandle(package);
4082 error:
4083 CoUninitialize();
4084 DeleteFileA(msifile);
4087 static void test_packagecoltypes(void)
4089 MSIHANDLE hdb, view, rec;
4090 char path[MAX_PATH];
4091 LPCSTR query;
4092 UINT r, count;
4094 create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
4096 CoInitialize(NULL);
4098 lstrcpy(path, CURR_DIR);
4099 lstrcat(path, "\\");
4100 lstrcat(path, msifile);
4102 r = MsiOpenDatabase(path, MSIDBOPEN_READONLY, &hdb);
4103 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4105 query = "SELECT * FROM `Media`";
4106 r = MsiDatabaseOpenView( hdb, query, &view );
4107 ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
4109 r = MsiViewGetColumnInfo( view, MSICOLINFO_NAMES, &rec );
4110 count = MsiRecordGetFieldCount( rec );
4111 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
4112 ok(count == 6, "Expected 6, got %d\n", count);
4113 ok(check_record(rec, 1, "DiskId"), "wrong column label\n");
4114 ok(check_record(rec, 2, "LastSequence"), "wrong column label\n");
4115 ok(check_record(rec, 3, "DiskPrompt"), "wrong column label\n");
4116 ok(check_record(rec, 4, "Cabinet"), "wrong column label\n");
4117 ok(check_record(rec, 5, "VolumeLabel"), "wrong column label\n");
4118 ok(check_record(rec, 6, "Source"), "wrong column label\n");
4119 MsiCloseHandle(rec);
4121 r = MsiViewGetColumnInfo( view, MSICOLINFO_TYPES, &rec );
4122 count = MsiRecordGetFieldCount( rec );
4123 ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
4124 ok(count == 6, "Expected 6, got %d\n", count);
4125 ok(check_record(rec, 1, "i2"), "wrong column label\n");
4126 ok(check_record(rec, 2, "i4"), "wrong column label\n");
4127 ok(check_record(rec, 3, "L64"), "wrong column label\n");
4128 ok(check_record(rec, 4, "S255"), "wrong column label\n");
4129 ok(check_record(rec, 5, "S32"), "wrong column label\n");
4130 ok(check_record(rec, 6, "S72"), "wrong column label\n");
4132 MsiCloseHandle(rec);
4133 MsiCloseHandle(view);
4134 MsiCloseHandle(hdb);
4135 CoUninitialize();
4137 DeleteFile(msifile);
4140 static void create_cc_test_files(void)
4142 CCAB cabParams;
4143 HFCI hfci;
4144 ERF erf;
4145 static CHAR cab_context[] = "test%d.cab";
4146 BOOL res;
4148 create_file("maximus", 500);
4149 create_file("augustus", 50000);
4150 create_file("tiberius", 500);
4151 create_file("caesar", 500);
4153 set_cab_parameters(&cabParams, "test1.cab", 40000);
4155 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
4156 fci_read, fci_write, fci_close, fci_seek, fci_delete,
4157 get_temp_file, &cabParams, cab_context);
4158 ok(hfci != NULL, "Failed to create an FCI context\n");
4160 res = add_file(hfci, "maximus", tcompTYPE_NONE);
4161 ok(res, "Failed to add file maximus\n");
4163 res = add_file(hfci, "augustus", tcompTYPE_NONE);
4164 ok(res, "Failed to add file augustus\n");
4166 res = add_file(hfci, "tiberius", tcompTYPE_NONE);
4167 ok(res, "Failed to add file tiberius\n");
4169 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
4170 ok(res, "Failed to flush the cabinet\n");
4172 res = FCIDestroy(hfci);
4173 ok(res, "Failed to destroy the cabinet\n");
4175 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4177 DeleteFile("maximus");
4178 DeleteFile("augustus");
4179 DeleteFile("tiberius");
4180 DeleteFile("caesar");
4183 static void delete_cab_files(void)
4185 SHFILEOPSTRUCT shfl;
4186 CHAR path[MAX_PATH+10];
4188 lstrcpyA(path, CURR_DIR);
4189 lstrcatA(path, "\\*.cab");
4190 path[strlen(path) + 1] = '\0';
4192 shfl.hwnd = NULL;
4193 shfl.wFunc = FO_DELETE;
4194 shfl.pFrom = path;
4195 shfl.pTo = NULL;
4196 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT;
4198 SHFileOperation(&shfl);
4201 static void test_continuouscabs(void)
4203 UINT r;
4205 if (is_process_limited())
4207 skip("process is limited\n");
4208 return;
4211 create_cc_test_files();
4212 create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
4214 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4216 r = MsiInstallProductA(msifile, NULL);
4217 if (r == ERROR_SUCCESS) /* win9x has a problem with this */
4219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4220 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4221 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4222 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4223 ok(delete_pf("msitest", FALSE), "File not installed\n");
4226 delete_cab_files();
4227 DeleteFile(msifile);
4229 create_cc_test_files();
4230 create_database(msifile, cc2_tables, sizeof(cc2_tables) / sizeof(msi_table));
4232 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4234 r = MsiInstallProductA(msifile, NULL);
4235 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4237 skip("Not enough rights to perform tests\n");
4238 goto error;
4240 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4241 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4242 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4243 ok(delete_pf("msitest\\tiberius", TRUE), "File not installed\n");
4244 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4245 ok(delete_pf("msitest", FALSE), "File not installed\n");
4247 error:
4248 delete_cab_files();
4249 DeleteFile(msifile);
4252 static void test_caborder(void)
4254 UINT r;
4256 create_file("imperator", 100);
4257 create_file("maximus", 500);
4258 create_file("augustus", 50000);
4259 create_file("caesar", 500);
4261 create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
4263 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4265 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4266 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
4267 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4269 r = MsiInstallProductA(msifile, NULL);
4270 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4272 skip("Not enough rights to perform tests\n");
4273 goto error;
4275 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4276 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4277 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4278 todo_wine
4280 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4281 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4284 delete_cab_files();
4286 create_cab_file("test1.cab", MEDIA_SIZE, "imperator\0");
4287 create_cab_file("test2.cab", MEDIA_SIZE, "maximus\0augustus\0");
4288 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4290 r = MsiInstallProductA(msifile, NULL);
4291 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4292 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4293 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4294 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4295 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4297 delete_cab_files();
4298 DeleteFile(msifile);
4300 create_cc_test_files();
4301 create_database(msifile, co_tables, sizeof(co_tables) / sizeof(msi_table));
4303 r = MsiInstallProductA(msifile, NULL);
4304 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4305 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4306 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4307 todo_wine
4309 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4310 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4313 delete_cab_files();
4314 DeleteFile(msifile);
4316 create_cc_test_files();
4317 create_database(msifile, co2_tables, sizeof(co2_tables) / sizeof(msi_table));
4319 r = MsiInstallProductA(msifile, NULL);
4320 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
4321 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4322 todo_wine
4324 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
4325 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
4326 ok(!delete_pf("msitest", FALSE), "File is installed\n");
4329 error:
4330 delete_cab_files();
4331 DeleteFile("imperator");
4332 DeleteFile("maximus");
4333 DeleteFile("augustus");
4334 DeleteFile("caesar");
4335 DeleteFile(msifile);
4338 static void test_mixedmedia(void)
4340 UINT r;
4342 if (is_process_limited())
4344 skip("process is limited\n");
4345 return;
4348 CreateDirectoryA("msitest", NULL);
4349 create_file("msitest\\maximus", 500);
4350 create_file("msitest\\augustus", 500);
4351 create_file("caesar", 500);
4353 create_database(msifile, mm_tables, sizeof(mm_tables) / sizeof(msi_table));
4355 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4357 create_cab_file("test1.cab", MEDIA_SIZE, "caesar\0");
4359 r = MsiInstallProductA(msifile, NULL);
4360 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4362 skip("Not enough rights to perform tests\n");
4363 goto error;
4365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4366 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4367 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4368 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4369 ok(delete_pf("msitest", FALSE), "File not installed\n");
4371 error:
4372 /* Delete the files in the temp (current) folder */
4373 DeleteFile("msitest\\maximus");
4374 DeleteFile("msitest\\augustus");
4375 RemoveDirectory("msitest");
4376 DeleteFile("caesar");
4377 DeleteFile("test1.cab");
4378 DeleteFile(msifile);
4381 static void test_samesequence(void)
4383 UINT r;
4385 create_cc_test_files();
4386 create_database(msifile, ss_tables, sizeof(ss_tables) / sizeof(msi_table));
4388 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4390 r = MsiInstallProductA(msifile, NULL);
4391 if (r == ERROR_SUCCESS) /* win9x has a problem with this */
4393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4394 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4395 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4396 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4397 ok(delete_pf("msitest", FALSE), "File not installed\n");
4400 delete_cab_files();
4401 DeleteFile(msifile);
4404 static void test_uiLevelFlags(void)
4406 UINT r;
4408 create_cc_test_files();
4409 create_database(msifile, ui_tables, sizeof(ui_tables) / sizeof(msi_table));
4411 MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL);
4413 r = MsiInstallProductA(msifile, NULL);
4414 if (r == ERROR_SUCCESS) /* win9x has a problem with this */
4416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4417 ok(!delete_pf("msitest\\maximus", TRUE), "UI install occurred, but execute-only was requested.\n");
4418 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4419 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4420 ok(delete_pf("msitest", FALSE), "File not installed\n");
4423 delete_cab_files();
4424 DeleteFile(msifile);
4427 static BOOL file_matches(LPSTR path)
4429 CHAR buf[MAX_PATH];
4430 HANDLE file;
4431 DWORD size;
4433 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4434 NULL, OPEN_EXISTING, 0, NULL);
4436 ZeroMemory(buf, MAX_PATH);
4437 ReadFile(file, buf, 15, &size, NULL);
4438 CloseHandle(file);
4440 return !lstrcmp(buf, "msitest\\maximus");
4443 static void test_readonlyfile(void)
4445 UINT r;
4446 DWORD size;
4447 HANDLE file;
4448 CHAR path[MAX_PATH];
4450 if (is_process_limited())
4452 skip("process is limited\n");
4453 return;
4456 CreateDirectoryA("msitest", NULL);
4457 create_file("msitest\\maximus", 500);
4458 create_database(msifile, rof_tables, sizeof(rof_tables) / sizeof(msi_table));
4460 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4462 lstrcpy(path, PROG_FILES_DIR);
4463 lstrcat(path, "\\msitest");
4464 CreateDirectory(path, NULL);
4466 lstrcat(path, "\\maximus");
4467 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4468 NULL, CREATE_NEW, FILE_ATTRIBUTE_READONLY, NULL);
4470 WriteFile(file, "readonlyfile", strlen("readonlyfile"), &size, NULL);
4471 CloseHandle(file);
4473 r = MsiInstallProductA(msifile, NULL);
4474 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4476 skip("Not enough rights to perform tests\n");
4477 goto error;
4479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4480 ok(file_matches(path), "Expected file to be overwritten\n");
4481 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4482 ok(delete_pf("msitest", FALSE), "File not installed\n");
4484 error:
4485 /* Delete the files in the temp (current) folder */
4486 DeleteFile("msitest\\maximus");
4487 RemoveDirectory("msitest");
4488 DeleteFile(msifile);
4491 static void test_readonlyfile_cab(void)
4493 UINT r;
4494 DWORD size;
4495 HANDLE file;
4496 CHAR path[MAX_PATH];
4497 CHAR buf[16];
4499 if (is_process_limited())
4501 skip("process is limited\n");
4502 return;
4505 CreateDirectoryA("msitest", NULL);
4506 create_file("maximus", 500);
4507 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4508 DeleteFile("maximus");
4510 create_database(msifile, rofc_tables, sizeof(rofc_tables) / sizeof(msi_table));
4512 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4514 lstrcpy(path, PROG_FILES_DIR);
4515 lstrcat(path, "\\msitest");
4516 CreateDirectory(path, NULL);
4518 lstrcat(path, "\\maximus");
4519 file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4520 NULL, CREATE_NEW, FILE_ATTRIBUTE_READONLY, NULL);
4522 WriteFile(file, "readonlyfile", strlen("readonlyfile"), &size, NULL);
4523 CloseHandle(file);
4525 r = MsiInstallProductA(msifile, NULL);
4526 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4528 skip("Not enough rights to perform tests\n");
4529 goto error;
4531 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4533 memset( buf, 0, sizeof(buf) );
4534 if ((file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
4535 NULL, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE)
4537 ReadFile(file, buf, sizeof(buf) - 1, &size, NULL);
4538 CloseHandle(file);
4540 ok(!memcmp( buf, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf);
4541 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4542 ok(delete_pf("msitest", FALSE), "File not installed\n");
4544 error:
4545 /* Delete the files in the temp (current) folder */
4546 delete_cab_files();
4547 DeleteFile("msitest\\maximus");
4548 RemoveDirectory("msitest");
4549 DeleteFile(msifile);
4552 static BOOL add_cabinet_storage(LPCSTR db, LPCSTR cabinet)
4554 WCHAR dbW[MAX_PATH], cabinetW[MAX_PATH];
4555 IStorage *stg;
4556 IStream *stm;
4557 HRESULT hr;
4558 HANDLE handle;
4560 MultiByteToWideChar(CP_ACP, 0, db, -1, dbW, MAX_PATH);
4561 hr = StgOpenStorage(dbW, NULL, STGM_DIRECT|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, NULL, 0, &stg);
4562 if (FAILED(hr))
4563 return FALSE;
4565 MultiByteToWideChar(CP_ACP, 0, cabinet, -1, cabinetW, MAX_PATH);
4566 hr = IStorage_CreateStream(stg, cabinetW, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
4567 if (FAILED(hr))
4569 IStorage_Release(stg);
4570 return FALSE;
4573 handle = CreateFileW(cabinetW, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
4574 if (handle != INVALID_HANDLE_VALUE)
4576 DWORD count;
4577 char buffer[1024];
4578 if (ReadFile(handle, buffer, sizeof(buffer), &count, NULL))
4579 IStream_Write(stm, buffer, count, &count);
4580 CloseHandle(handle);
4583 IStream_Release(stm);
4584 IStorage_Release(stg);
4586 return TRUE;
4589 static void test_lastusedsource(void)
4591 static char prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4593 UINT r;
4594 char value[MAX_PATH], path[MAX_PATH];
4595 DWORD size;
4597 if (!pMsiSourceListGetInfoA)
4599 win_skip("MsiSourceListGetInfoA is not available\n");
4600 return;
4603 CreateDirectoryA("msitest", NULL);
4604 create_file("maximus", 500);
4605 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4606 DeleteFile("maximus");
4608 create_database("msifile0.msi", lus0_tables, sizeof(lus0_tables) / sizeof(msi_table));
4609 create_database("msifile1.msi", lus1_tables, sizeof(lus1_tables) / sizeof(msi_table));
4610 create_database("msifile2.msi", lus2_tables, sizeof(lus2_tables) / sizeof(msi_table));
4612 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4614 /* no cabinet file */
4616 size = MAX_PATH;
4617 lstrcpyA(value, "aaa");
4618 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4619 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4620 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4621 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4623 r = MsiInstallProductA("msifile0.msi", "PUBLISH_PRODUCT=1");
4624 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4626 skip("Not enough rights to perform tests\n");
4627 goto error;
4629 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4631 lstrcpyA(path, CURR_DIR);
4632 lstrcatA(path, "\\");
4634 size = MAX_PATH;
4635 lstrcpyA(value, "aaa");
4636 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4637 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4639 todo_wine
4641 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4642 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4645 r = MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
4646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4648 /* separate cabinet file */
4650 size = MAX_PATH;
4651 lstrcpyA(value, "aaa");
4652 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4653 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4654 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4655 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4657 r = MsiInstallProductA("msifile1.msi", "PUBLISH_PRODUCT=1");
4658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4660 lstrcpyA(path, CURR_DIR);
4661 lstrcatA(path, "\\");
4663 size = MAX_PATH;
4664 lstrcpyA(value, "aaa");
4665 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4666 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4667 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4668 todo_wine
4670 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4671 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4674 r = MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
4675 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4677 size = MAX_PATH;
4678 lstrcpyA(value, "aaa");
4679 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4680 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4681 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4682 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4684 /* embedded cabinet stream */
4686 add_cabinet_storage("msifile2.msi", "test1.cab");
4688 r = MsiInstallProductA("msifile2.msi", "PUBLISH_PRODUCT=1");
4689 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4691 size = MAX_PATH;
4692 lstrcpyA(value, "aaa");
4693 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4694 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4695 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4696 todo_wine
4698 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4699 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4702 r = MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
4703 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4705 size = MAX_PATH;
4706 lstrcpyA(value, "aaa");
4707 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4708 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4709 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
4710 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4712 error:
4713 /* Delete the files in the temp (current) folder */
4714 delete_cab_files();
4715 DeleteFile("msitest\\maximus");
4716 RemoveDirectory("msitest");
4717 DeleteFile("msifile0.msi");
4718 DeleteFile("msifile1.msi");
4719 DeleteFile("msifile2.msi");
4722 static void test_setdirproperty(void)
4724 UINT r;
4726 if (is_process_limited())
4728 skip("process is limited\n");
4729 return;
4732 CreateDirectoryA("msitest", NULL);
4733 create_file("msitest\\maximus", 500);
4734 create_database(msifile, sdp_tables, sizeof(sdp_tables) / sizeof(msi_table));
4736 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4738 r = MsiInstallProductA(msifile, NULL);
4739 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4741 skip("Not enough rights to perform tests\n");
4742 goto error;
4744 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4745 ok(delete_cf("msitest\\maximus", TRUE), "File not installed\n");
4746 ok(delete_cf("msitest", FALSE), "File not installed\n");
4748 error:
4749 /* Delete the files in the temp (current) folder */
4750 DeleteFile(msifile);
4751 DeleteFile("msitest\\maximus");
4752 RemoveDirectory("msitest");
4755 static void test_cabisextracted(void)
4757 UINT r;
4759 if (is_process_limited())
4761 skip("process is limited\n");
4762 return;
4765 CreateDirectoryA("msitest", NULL);
4766 create_file("msitest\\gaius", 500);
4767 create_file("maximus", 500);
4768 create_file("augustus", 500);
4769 create_file("caesar", 500);
4771 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
4772 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
4773 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
4775 create_database(msifile, cie_tables, sizeof(cie_tables) / sizeof(msi_table));
4777 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4779 r = MsiInstallProductA(msifile, NULL);
4780 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4782 skip("Not enough rights to perform tests\n");
4783 goto error;
4785 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4786 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4787 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4788 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
4789 ok(delete_pf("msitest\\gaius", TRUE), "File not installed\n");
4790 ok(delete_pf("msitest", FALSE), "File not installed\n");
4792 error:
4793 /* Delete the files in the temp (current) folder */
4794 delete_cab_files();
4795 DeleteFile(msifile);
4796 DeleteFile("maximus");
4797 DeleteFile("augustus");
4798 DeleteFile("caesar");
4799 DeleteFile("msitest\\gaius");
4800 RemoveDirectory("msitest");
4803 static void test_concurrentinstall(void)
4805 UINT r;
4806 CHAR path[MAX_PATH];
4808 if (is_process_limited())
4810 skip("process is limited\n");
4811 return;
4814 CreateDirectoryA("msitest", NULL);
4815 CreateDirectoryA("msitest\\msitest", NULL);
4816 create_file("msitest\\maximus", 500);
4817 create_file("msitest\\msitest\\augustus", 500);
4819 create_database(msifile, ci_tables, sizeof(ci_tables) / sizeof(msi_table));
4821 lstrcpyA(path, CURR_DIR);
4822 lstrcatA(path, "\\msitest\\concurrent.msi");
4823 create_database(path, ci2_tables, sizeof(ci2_tables) / sizeof(msi_table));
4825 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
4827 r = MsiInstallProductA(msifile, NULL);
4828 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4830 skip("Not enough rights to perform tests\n");
4831 DeleteFile(path);
4832 goto error;
4834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4835 if (!delete_pf("msitest\\augustus", TRUE))
4836 trace("concurrent installs not supported\n");
4837 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4838 ok(delete_pf("msitest", FALSE), "File not installed\n");
4840 DeleteFile(path);
4842 r = MsiInstallProductA(msifile, NULL);
4843 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4844 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4845 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
4846 ok(delete_pf("msitest", FALSE), "File not installed\n");
4848 error:
4849 DeleteFile(msifile);
4850 DeleteFile("msitest\\msitest\\augustus");
4851 DeleteFile("msitest\\maximus");
4852 RemoveDirectory("msitest\\msitest");
4853 RemoveDirectory("msitest");
4856 static void test_setpropertyfolder(void)
4858 UINT r;
4859 CHAR path[MAX_PATH];
4860 DWORD attr;
4862 if (is_process_limited())
4864 skip("process is limited\n");
4865 return;
4868 lstrcpyA(path, PROG_FILES_DIR);
4869 lstrcatA(path, "\\msitest\\added");
4871 CreateDirectoryA("msitest", NULL);
4872 create_file("msitest\\maximus", 500);
4874 create_database(msifile, spf_tables, sizeof(spf_tables) / sizeof(msi_table));
4876 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
4878 r = MsiInstallProductA(msifile, NULL);
4879 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4881 skip("Not enough rights to perform tests\n");
4882 goto error;
4884 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4885 attr = GetFileAttributesA(path);
4886 if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
4888 ok(delete_pf("msitest\\added\\maximus", TRUE), "File not installed\n");
4889 ok(delete_pf("msitest\\added", FALSE), "File not installed\n");
4890 ok(delete_pf("msitest", FALSE), "File not installed\n");
4892 else
4894 trace("changing folder property not supported\n");
4895 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4896 ok(delete_pf("msitest", FALSE), "File not installed\n");
4899 error:
4900 /* Delete the files in the temp (current) folder */
4901 DeleteFile(msifile);
4902 DeleteFile("msitest\\maximus");
4903 RemoveDirectory("msitest");
4906 static BOOL file_exists(LPCSTR file)
4908 return GetFileAttributes(file) != INVALID_FILE_ATTRIBUTES;
4911 static BOOL pf_exists(LPCSTR file)
4913 CHAR path[MAX_PATH];
4915 lstrcpyA(path, PROG_FILES_DIR);
4916 lstrcatA(path, "\\");
4917 lstrcatA(path, file);
4919 return file_exists(path);
4922 static void delete_pfmsitest_files(void)
4924 SHFILEOPSTRUCT shfl;
4925 CHAR path[MAX_PATH+11];
4927 lstrcpyA(path, PROG_FILES_DIR);
4928 lstrcatA(path, "\\msitest\\*");
4929 path[strlen(path) + 1] = '\0';
4931 shfl.hwnd = NULL;
4932 shfl.wFunc = FO_DELETE;
4933 shfl.pFrom = path;
4934 shfl.pTo = NULL;
4935 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
4937 SHFileOperation(&shfl);
4939 lstrcpyA(path, PROG_FILES_DIR);
4940 lstrcatA(path, "\\msitest");
4941 RemoveDirectoryA(path);
4944 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, DWORD line)
4946 char val[MAX_PATH];
4947 DWORD size, type;
4948 LONG res;
4950 size = MAX_PATH;
4951 val[0] = '\0';
4952 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)val, &size);
4954 if (res != ERROR_SUCCESS ||
4955 (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_MULTI_SZ))
4957 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
4958 return;
4961 if (!expected)
4962 ok_(__FILE__, line)(lstrlenA(val) == 0, "Expected empty string, got %s\n", val);
4963 else
4965 if (bcase)
4966 ok_(__FILE__, line)(!lstrcmpA(val, expected), "Expected %s, got %s\n", expected, val);
4967 else
4968 ok_(__FILE__, line)(!lstrcmpiA(val, expected), "Expected %s, got %s\n", expected, val);
4972 static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line)
4974 DWORD val, size, type;
4975 LONG res;
4977 size = sizeof(DWORD);
4978 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
4980 if (res != ERROR_SUCCESS || type != REG_DWORD)
4982 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
4983 return;
4986 ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val);
4989 static void check_reg_dword2(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD line)
4991 DWORD val, size, type;
4992 LONG res;
4994 size = sizeof(DWORD);
4995 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
4997 if (res != ERROR_SUCCESS || type != REG_DWORD)
4999 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
5000 return;
5003 ok_(__FILE__, line)(val == expected1 || val == expected2, "Expected %d or %d, got %d\n", expected1, expected2, val);
5006 static void check_reg_dword3(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD expected3, DWORD line)
5008 DWORD val, size, type;
5009 LONG res;
5011 size = sizeof(DWORD);
5012 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
5014 if (res != ERROR_SUCCESS || type != REG_DWORD)
5016 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
5017 return;
5020 ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3,
5021 "Expected %d, %d or %d, got %d\n", expected1, expected2, expected3, val);
5024 #define CHECK_REG_STR(prodkey, name, expected) \
5025 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
5027 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
5028 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
5029 RegDeleteValueA(prodkey, name);
5031 #define CHECK_REG_ISTR(prodkey, name, expected) \
5032 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
5034 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
5035 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
5036 RegDeleteValueA(prodkey, name);
5038 #define CHECK_REG_DWORD(prodkey, name, expected) \
5039 check_reg_dword(prodkey, name, expected, __LINE__);
5041 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
5042 check_reg_dword(prodkey, name, expected, __LINE__); \
5043 RegDeleteValueA(prodkey, name);
5045 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
5046 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
5048 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
5049 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
5050 RegDeleteValueA(prodkey, name);
5052 #define CHECK_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \
5053 check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__);
5055 #define CHECK_DEL_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \
5056 check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__); \
5057 RegDeleteValueA(prodkey, name);
5059 static void get_date_str(LPSTR date)
5061 SYSTEMTIME systime;
5063 static const char date_fmt[] = "%d%02d%02d";
5064 GetLocalTime(&systime);
5065 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
5068 static void test_publish_registerproduct(void)
5070 UINT r;
5071 LONG res;
5072 HKEY hkey;
5073 HKEY props, usage;
5074 LPSTR usersid;
5075 char date[MAX_PATH];
5076 char temp[MAX_PATH];
5077 char keypath[MAX_PATH];
5078 REGSAM access = KEY_ALL_ACCESS;
5080 static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5081 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
5082 static const CHAR uninstall_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
5083 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
5084 static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
5085 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5086 static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
5087 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
5088 static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
5089 "\\51AAE0C44620A5E4788506E91F249BD2";
5091 if (is_process_limited())
5093 skip("process is limited\n");
5094 return;
5097 if (!get_user_sid(&usersid))
5098 return;
5100 get_date_str(date);
5101 GetTempPath(MAX_PATH, temp);
5103 CreateDirectoryA("msitest", NULL);
5104 create_file("msitest\\maximus", 500);
5106 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5108 if (is_wow64)
5109 access |= KEY_WOW64_64KEY;
5111 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
5113 /* RegisterProduct */
5114 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
5115 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5117 skip("Not enough rights to perform tests\n");
5118 goto error;
5120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5121 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5122 ok(delete_pf("msitest", FALSE), "File not installed\n");
5124 res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
5125 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5127 if (is_64bit && !is_wow64)
5129 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
5130 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5132 else
5134 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
5135 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5138 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
5139 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
5140 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
5141 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
5142 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5143 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
5144 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5145 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
5146 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
5147 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
5148 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
5149 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
5150 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
5151 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
5152 CHECK_DEL_REG_STR(hkey, "Size", NULL);
5153 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
5154 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
5155 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5156 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5157 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
5158 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
5159 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
5160 todo_wine
5162 CHECK_DEL_REG_DWORD3(hkey, "EstimatedSize", 12, -12, 4);
5165 delete_key(hkey, "", access);
5166 RegCloseKey(hkey);
5168 sprintf(keypath, userdata, usersid);
5169 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5170 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5172 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5173 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5175 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
5176 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
5177 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
5178 CHECK_DEL_REG_STR(props, "InstallDate", date);
5179 CHECK_DEL_REG_STR(props, "InstallSource", temp);
5180 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5181 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
5182 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5183 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
5184 CHECK_DEL_REG_STR(props, "Comments", NULL);
5185 CHECK_DEL_REG_STR(props, "Contact", NULL);
5186 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
5187 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
5188 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
5189 CHECK_DEL_REG_STR(props, "Readme", NULL);
5190 CHECK_DEL_REG_STR(props, "Size", NULL);
5191 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
5192 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
5193 CHECK_DEL_REG_DWORD(props, "Language", 1033);
5194 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
5195 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
5196 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
5197 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
5198 todo_wine
5200 CHECK_DEL_REG_DWORD3(props, "EstimatedSize", 12, -12, 4);
5203 delete_key(props, "", access);
5204 RegCloseKey(props);
5206 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
5207 todo_wine
5209 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5212 delete_key(usage, "", access);
5213 RegCloseKey(usage);
5214 delete_key(hkey, "", access);
5215 RegCloseKey(hkey);
5217 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
5218 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5220 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5222 delete_key(hkey, "", access);
5223 RegCloseKey(hkey);
5225 /* RegisterProduct, machine */
5226 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1");
5227 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5228 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5229 ok(delete_pf("msitest", FALSE), "File not installed\n");
5231 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, access, &hkey);
5232 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5234 if (is_64bit && !is_wow64)
5236 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
5237 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5239 else
5241 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
5242 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5245 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
5246 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
5247 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
5248 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
5249 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5250 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
5251 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5252 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
5253 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
5254 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
5255 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
5256 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
5257 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
5258 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
5259 CHECK_DEL_REG_STR(hkey, "Size", NULL);
5260 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
5261 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
5262 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5263 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5264 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
5265 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
5266 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
5267 todo_wine
5269 CHECK_DEL_REG_DWORD3(hkey, "EstimatedSize", 12, -12, 4);
5272 delete_key(hkey, "", access);
5273 RegCloseKey(hkey);
5275 sprintf(keypath, userdata, "S-1-5-18");
5276 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5277 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5279 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5280 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5282 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
5283 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
5284 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
5285 CHECK_DEL_REG_STR(props, "InstallDate", date);
5286 CHECK_DEL_REG_STR(props, "InstallSource", temp);
5287 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5288 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
5289 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
5290 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
5291 CHECK_DEL_REG_STR(props, "Comments", NULL);
5292 CHECK_DEL_REG_STR(props, "Contact", NULL);
5293 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
5294 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
5295 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
5296 CHECK_DEL_REG_STR(props, "Readme", NULL);
5297 CHECK_DEL_REG_STR(props, "Size", NULL);
5298 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
5299 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
5300 CHECK_DEL_REG_DWORD(props, "Language", 1033);
5301 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
5302 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
5303 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
5304 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
5305 todo_wine
5307 CHECK_DEL_REG_DWORD3(props, "EstimatedSize", 12, -12, 4);
5310 delete_key(props, "", access);
5311 RegCloseKey(props);
5313 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
5314 todo_wine
5316 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5319 delete_key(usage, "", access);
5320 RegCloseKey(usage);
5321 delete_key(hkey, "", access);
5322 RegCloseKey(hkey);
5324 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
5325 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5327 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5329 delete_key(hkey, "", access);
5330 RegCloseKey(hkey);
5332 error:
5333 DeleteFile(msifile);
5334 DeleteFile("msitest\\maximus");
5335 RemoveDirectory("msitest");
5336 HeapFree(GetProcessHeap(), 0, usersid);
5339 static void test_publish_publishproduct(void)
5341 UINT r;
5342 LONG res;
5343 LPSTR usersid;
5344 HKEY sourcelist, net, props;
5345 HKEY hkey, patches, media;
5346 CHAR keypath[MAX_PATH];
5347 CHAR temp[MAX_PATH];
5348 CHAR path[MAX_PATH];
5349 BOOL old_installer = FALSE;
5350 REGSAM access = KEY_ALL_ACCESS;
5352 static const CHAR prodpath[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5353 "\\Installer\\UserData\\%s\\Products"
5354 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5355 static const CHAR cuprodpath[] = "Software\\Microsoft\\Installer\\Products"
5356 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5357 static const CHAR cuupgrades[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
5358 "\\51AAE0C44620A5E4788506E91F249BD2";
5359 static const CHAR badprod[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5360 "\\Installer\\Products"
5361 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5362 static const CHAR machprod[] = "Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5363 static const CHAR machup[] = "Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
5365 if (is_process_limited())
5367 skip("process is limited\n");
5368 return;
5371 if (!get_user_sid(&usersid))
5372 return;
5374 GetTempPath(MAX_PATH, temp);
5376 CreateDirectoryA("msitest", NULL);
5377 create_file("msitest\\maximus", 500);
5379 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5381 if (is_wow64)
5382 access |= KEY_WOW64_64KEY;
5384 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
5386 /* PublishProduct, current user */
5387 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
5388 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5390 skip("Not enough rights to perform tests\n");
5391 goto error;
5393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5394 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5395 ok(delete_pf("msitest", FALSE), "File not installed\n");
5397 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
5398 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5400 sprintf(keypath, prodpath, usersid);
5401 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5402 if (res == ERROR_FILE_NOT_FOUND)
5404 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
5405 if (res == ERROR_SUCCESS)
5407 win_skip("Windows Installer < 3.0 detected\n");
5408 RegCloseKey(hkey);
5409 old_installer = TRUE;
5410 goto currentuser;
5412 else
5414 win_skip("Install failed, no need to continue\n");
5415 return;
5418 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5420 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5421 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5423 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
5424 todo_wine
5426 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5427 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
5430 delete_key(patches, "", access);
5431 RegCloseKey(patches);
5432 delete_key(hkey, "", access);
5433 RegCloseKey(hkey);
5435 currentuser:
5436 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
5437 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5439 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
5440 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
5441 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5442 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5443 if (!old_installer)
5444 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
5445 CHECK_DEL_REG_DWORD(hkey, "Assignment", 0);
5446 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
5447 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
5448 CHECK_DEL_REG_STR(hkey, "Clients", ":");
5450 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
5451 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5453 lstrcpyA(path, "n;1;");
5454 lstrcatA(path, temp);
5455 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
5456 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
5458 res = RegOpenKeyA(sourcelist, "Net", &net);
5459 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5461 CHECK_DEL_REG_STR(net, "1", temp);
5463 RegDeleteKeyA(net, "");
5464 RegCloseKey(net);
5466 res = RegOpenKeyA(sourcelist, "Media", &media);
5467 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5469 CHECK_DEL_REG_STR(media, "1", "DISK1;");
5471 RegDeleteKeyA(media, "");
5472 RegCloseKey(media);
5473 RegDeleteKeyA(sourcelist, "");
5474 RegCloseKey(sourcelist);
5475 RegDeleteKeyA(hkey, "");
5476 RegCloseKey(hkey);
5478 res = RegOpenKeyA(HKEY_CURRENT_USER, cuupgrades, &hkey);
5479 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5481 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5483 RegDeleteKeyA(hkey, "");
5484 RegCloseKey(hkey);
5486 /* PublishProduct, machine */
5487 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5488 if (old_installer)
5489 goto machprod;
5490 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5491 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5492 ok(delete_pf("msitest", FALSE), "File not installed\n");
5494 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
5495 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5497 sprintf(keypath, prodpath, "S-1-5-18");
5498 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5499 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5501 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
5502 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5504 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
5505 todo_wine
5507 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5508 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
5511 delete_key(patches, "", access);
5512 RegCloseKey(patches);
5513 delete_key(hkey, "", access);
5514 RegCloseKey(hkey);
5516 machprod:
5517 res = RegOpenKeyA(HKEY_CLASSES_ROOT, machprod, &hkey);
5518 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5520 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
5521 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
5522 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
5523 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
5524 if (!old_installer)
5525 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
5526 todo_wine CHECK_DEL_REG_DWORD(hkey, "Assignment", 1);
5527 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
5528 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
5529 CHECK_DEL_REG_STR(hkey, "Clients", ":");
5531 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
5532 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5534 lstrcpyA(path, "n;1;");
5535 lstrcatA(path, temp);
5536 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
5537 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
5539 res = RegOpenKeyA(sourcelist, "Net", &net);
5540 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5542 CHECK_DEL_REG_STR(net, "1", temp);
5544 RegDeleteKeyA(net, "");
5545 RegCloseKey(net);
5547 res = RegOpenKeyA(sourcelist, "Media", &media);
5548 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5550 CHECK_DEL_REG_STR(media, "1", "DISK1;");
5552 RegDeleteKeyA(media, "");
5553 RegCloseKey(media);
5554 RegDeleteKeyA(sourcelist, "");
5555 RegCloseKey(sourcelist);
5556 RegDeleteKeyA(hkey, "");
5557 RegCloseKey(hkey);
5559 res = RegOpenKeyA(HKEY_CLASSES_ROOT, machup, &hkey);
5560 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5562 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
5564 RegDeleteKeyA(hkey, "");
5565 RegCloseKey(hkey);
5567 error:
5568 DeleteFile(msifile);
5569 DeleteFile("msitest\\maximus");
5570 RemoveDirectory("msitest");
5571 HeapFree(GetProcessHeap(), 0, usersid);
5574 static void test_publish_publishfeatures(void)
5576 UINT r;
5577 LONG res;
5578 HKEY hkey;
5579 LPSTR usersid;
5580 CHAR keypath[MAX_PATH];
5581 REGSAM access = KEY_ALL_ACCESS;
5583 static const CHAR cupath[] = "Software\\Microsoft\\Installer\\Features"
5584 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5585 static const CHAR udpath[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5586 "\\Installer\\UserData\\%s\\Products"
5587 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
5588 static const CHAR featkey[] = "Software\\Microsoft\\Windows\\CurrentVersion"
5589 "\\Installer\\Features";
5590 static const CHAR classfeat[] = "Software\\Classes\\Installer\\Features"
5591 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
5593 if (is_process_limited())
5595 skip("process is limited\n");
5596 return;
5599 if (!get_user_sid(&usersid))
5600 return;
5602 CreateDirectoryA("msitest", NULL);
5603 create_file("msitest\\maximus", 500);
5605 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5607 if (is_wow64)
5608 access |= KEY_WOW64_64KEY;
5610 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
5612 /* PublishFeatures, current user */
5613 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
5614 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5616 skip("Not enough rights to perform tests\n");
5617 goto error;
5619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5620 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5621 ok(delete_pf("msitest", FALSE), "File not installed\n");
5623 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
5624 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5626 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
5627 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5629 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
5630 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5632 CHECK_REG_STR(hkey, "feature", "");
5633 CHECK_REG_STR(hkey, "montecristo", "");
5635 RegDeleteValueA(hkey, "feature");
5636 RegDeleteValueA(hkey, "montecristo");
5637 RegDeleteKeyA(hkey, "");
5638 RegCloseKey(hkey);
5640 sprintf(keypath, udpath, usersid);
5641 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5642 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5644 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
5645 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
5647 RegDeleteValueA(hkey, "feature");
5648 RegDeleteValueA(hkey, "montecristo");
5649 RegDeleteKeyA(hkey, "");
5650 RegCloseKey(hkey);
5652 /* PublishFeatures, machine */
5653 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
5654 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5655 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5656 ok(delete_pf("msitest", FALSE), "File not installed\n");
5658 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
5659 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5661 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
5662 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5664 res = RegOpenKeyA(HKEY_LOCAL_MACHINE, classfeat, &hkey);
5665 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5667 CHECK_REG_STR(hkey, "feature", "");
5668 CHECK_REG_STR(hkey, "montecristo", "");
5670 RegDeleteValueA(hkey, "feature");
5671 RegDeleteValueA(hkey, "montecristo");
5672 RegDeleteKeyA(hkey, "");
5673 RegCloseKey(hkey);
5675 sprintf(keypath, udpath, "S-1-5-18");
5676 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
5677 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5679 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
5680 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
5682 RegDeleteValueA(hkey, "feature");
5683 RegDeleteValueA(hkey, "montecristo");
5684 RegDeleteKeyA(hkey, "");
5685 RegCloseKey(hkey);
5687 error:
5688 DeleteFile(msifile);
5689 DeleteFile("msitest\\maximus");
5690 RemoveDirectory("msitest");
5691 HeapFree(GetProcessHeap(), 0, usersid);
5694 static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
5696 DWORD len = 0;
5697 LPSTR val;
5698 LONG r;
5700 r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
5701 if (r != ERROR_SUCCESS)
5702 return NULL;
5704 len += sizeof (WCHAR);
5705 val = HeapAlloc(GetProcessHeap(), 0, len);
5706 if (!val) return NULL;
5707 val[0] = 0;
5708 RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len);
5709 return val;
5712 static void get_owner_company(LPSTR *owner, LPSTR *company)
5714 LONG res;
5715 HKEY hkey;
5716 REGSAM access = KEY_ALL_ACCESS;
5718 *owner = *company = NULL;
5720 if (is_wow64)
5721 access |= KEY_WOW64_64KEY;
5723 res = RegOpenKeyA(HKEY_CURRENT_USER,
5724 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
5725 if (res == ERROR_SUCCESS)
5727 *owner = reg_get_val_str(hkey, "DefName");
5728 *company = reg_get_val_str(hkey, "DefCompany");
5729 RegCloseKey(hkey);
5732 if (!*owner || !*company)
5734 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
5735 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
5736 if (res == ERROR_SUCCESS)
5738 *owner = reg_get_val_str(hkey, "RegisteredOwner");
5739 *company = reg_get_val_str(hkey, "RegisteredOrganization");
5740 RegCloseKey(hkey);
5744 if (!*owner || !*company)
5746 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
5747 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
5748 if (res == ERROR_SUCCESS)
5750 *owner = reg_get_val_str(hkey, "RegisteredOwner");
5751 *company = reg_get_val_str(hkey, "RegisteredOrganization");
5752 RegCloseKey(hkey);
5757 static void test_publish_registeruser(void)
5759 UINT r;
5760 LONG res;
5761 HKEY props;
5762 LPSTR usersid;
5763 LPSTR owner, company;
5764 CHAR keypath[MAX_PATH];
5765 REGSAM access = KEY_ALL_ACCESS;
5767 static const CHAR keyfmt[] =
5768 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
5769 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
5771 if (is_process_limited())
5773 skip("process is limited\n");
5774 return;
5777 if (!get_user_sid(&usersid))
5778 return;
5780 get_owner_company(&owner, &company);
5782 CreateDirectoryA("msitest", NULL);
5783 create_file("msitest\\maximus", 500);
5785 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
5787 if (is_wow64)
5788 access |= KEY_WOW64_64KEY;
5790 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5792 /* RegisterUser, per-user */
5793 r = MsiInstallProductA(msifile, "REGISTER_USER=1");
5794 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5796 skip("Not enough rights to perform tests\n");
5797 goto error;
5799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5800 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5801 ok(delete_pf("msitest", FALSE), "File not installed\n");
5803 sprintf(keypath, keyfmt, usersid);
5804 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
5805 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5807 CHECK_REG_STR(props, "ProductID", "none");
5808 CHECK_REG_STR(props, "RegCompany", company);
5809 CHECK_REG_STR(props, "RegOwner", owner);
5811 RegDeleteValueA(props, "ProductID");
5812 RegDeleteValueA(props, "RegCompany");
5813 RegDeleteValueA(props, "RegOwner");
5814 delete_key(props, "", access);
5815 RegCloseKey(props);
5817 /* RegisterUser, machine */
5818 r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
5819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5820 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5821 ok(delete_pf("msitest", FALSE), "File not installed\n");
5823 sprintf(keypath, keyfmt, "S-1-5-18");
5824 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
5825 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5827 CHECK_REG_STR(props, "ProductID", "none");
5828 CHECK_REG_STR(props, "RegCompany", company);
5829 CHECK_REG_STR(props, "RegOwner", owner);
5831 RegDeleteValueA(props, "ProductID");
5832 RegDeleteValueA(props, "RegCompany");
5833 RegDeleteValueA(props, "RegOwner");
5834 delete_key(props, "", access);
5835 RegCloseKey(props);
5837 error:
5838 HeapFree(GetProcessHeap(), 0, company);
5839 HeapFree(GetProcessHeap(), 0, owner);
5841 DeleteFile(msifile);
5842 DeleteFile("msitest\\maximus");
5843 RemoveDirectory("msitest");
5844 LocalFree(usersid);
5847 static void test_publish_processcomponents(void)
5849 UINT r;
5850 LONG res;
5851 DWORD size;
5852 HKEY comp, hkey;
5853 LPSTR usersid;
5854 CHAR val[MAX_PATH];
5855 CHAR keypath[MAX_PATH];
5856 CHAR program_files_maximus[MAX_PATH];
5857 REGSAM access = KEY_ALL_ACCESS;
5859 static const CHAR keyfmt[] =
5860 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
5861 "UserData\\%s\\Components\\%s";
5862 static const CHAR compkey[] =
5863 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
5865 if (is_process_limited())
5867 skip("process is limited\n");
5868 return;
5871 if (!get_user_sid(&usersid))
5872 return;
5874 CreateDirectoryA("msitest", NULL);
5875 create_file("msitest\\maximus", 500);
5877 create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table));
5879 if (is_wow64)
5880 access |= KEY_WOW64_64KEY;
5882 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5884 /* ProcessComponents, per-user */
5885 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
5886 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5888 skip("Not enough rights to perform tests\n");
5889 goto error;
5891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5892 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5893 ok(delete_pf("msitest", FALSE), "File not installed\n");
5895 sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
5896 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5897 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5899 size = MAX_PATH;
5900 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5901 NULL, NULL, (LPBYTE)val, &size);
5902 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5904 lstrcpyA(program_files_maximus,PROG_FILES_DIR);
5905 lstrcatA(program_files_maximus,"\\msitest\\maximus");
5907 ok(!lstrcmpiA(val, program_files_maximus),
5908 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
5910 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5911 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5913 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5914 delete_key(comp, "", access);
5915 RegCloseKey(comp);
5917 sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
5918 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5919 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5921 size = MAX_PATH;
5922 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5923 NULL, NULL, (LPBYTE)val, &size);
5924 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5925 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
5926 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
5928 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5929 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5931 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5932 delete_key(comp, "", access);
5933 RegCloseKey(comp);
5935 /* ProcessComponents, machine */
5936 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
5937 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
5938 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
5939 ok(delete_pf("msitest", FALSE), "File not installed\n");
5941 sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
5942 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5943 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5945 size = MAX_PATH;
5946 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5947 NULL, NULL, (LPBYTE)val, &size);
5948 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5949 ok(!lstrcmpiA(val, program_files_maximus),
5950 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
5952 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5953 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5955 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5956 delete_key(comp, "", access);
5957 RegCloseKey(comp);
5959 sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
5960 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
5961 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5963 size = MAX_PATH;
5964 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
5965 NULL, NULL, (LPBYTE)val, &size);
5966 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5967 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
5968 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
5970 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
5971 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5973 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
5974 delete_key(comp, "", access);
5975 RegCloseKey(comp);
5977 error:
5978 DeleteFile(msifile);
5979 DeleteFile("msitest\\maximus");
5980 RemoveDirectory("msitest");
5981 LocalFree(usersid);
5984 static void test_publish(void)
5986 UINT r;
5987 LONG res;
5988 HKEY uninstall, prodkey, uninstall_32node = NULL;
5989 INSTALLSTATE state;
5990 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
5991 char date[MAX_PATH], temp[MAX_PATH];
5992 REGSAM access = KEY_ALL_ACCESS;
5994 static const CHAR subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
5995 static const CHAR subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
5997 if (!pMsiQueryComponentStateA)
5999 win_skip("MsiQueryComponentStateA is not available\n");
6000 return;
6002 if (is_process_limited())
6004 skip("process is limited\n");
6005 return;
6008 get_date_str(date);
6009 GetTempPath(MAX_PATH, temp);
6011 if (is_wow64)
6012 access |= KEY_WOW64_64KEY;
6014 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
6015 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6017 if (is_64bit)
6019 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
6020 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6023 CreateDirectoryA("msitest", NULL);
6024 create_file("msitest\\maximus", 500);
6026 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
6028 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6030 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6031 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6033 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6034 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6036 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6037 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6039 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6040 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6041 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6042 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6044 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6045 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6047 /* nothing published */
6048 r = MsiInstallProductA(msifile, NULL);
6049 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6051 skip("Not enough rights to perform tests\n");
6052 goto error;
6054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6055 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6056 ok(pf_exists("msitest"), "File not installed\n");
6058 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6059 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6061 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6062 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6064 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6065 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6067 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6068 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6069 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6070 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6072 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6073 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6075 /* PublishProduct and RegisterProduct */
6076 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
6077 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6078 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6079 ok(pf_exists("msitest"), "File not installed\n");
6081 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6082 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6084 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6085 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6087 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6088 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6090 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6091 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6092 ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
6093 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6095 if (is_64bit && !is_wow64)
6097 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6098 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6100 else
6102 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6103 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6106 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6107 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6108 CHECK_REG_STR(prodkey, "InstallDate", date);
6109 CHECK_REG_STR(prodkey, "InstallSource", temp);
6110 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6111 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6112 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6113 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6114 CHECK_REG_STR(prodkey, "Comments", NULL);
6115 CHECK_REG_STR(prodkey, "Contact", NULL);
6116 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6117 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6118 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6119 CHECK_REG_STR(prodkey, "Readme", NULL);
6120 CHECK_REG_STR(prodkey, "Size", NULL);
6121 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6122 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6123 CHECK_REG_DWORD(prodkey, "Language", 1033);
6124 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6125 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6126 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6127 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6128 todo_wine
6130 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6133 RegCloseKey(prodkey);
6135 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
6136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6137 ok(pf_exists("msitest\\maximus"), "File deleted\n");
6138 ok(pf_exists("msitest"), "File deleted\n");
6140 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6141 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6143 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6144 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6146 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6147 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6149 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6150 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6151 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6152 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6154 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6155 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6157 /* complete install */
6158 r = MsiInstallProductA(msifile, "FULL=1");
6159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6160 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6161 ok(pf_exists("msitest"), "File not installed\n");
6163 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6164 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6166 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6167 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6169 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6170 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6172 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6173 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6175 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6177 if (is_64bit && !is_wow64)
6179 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6180 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6182 else
6184 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6185 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6188 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6189 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6190 CHECK_REG_STR(prodkey, "InstallDate", date);
6191 CHECK_REG_STR(prodkey, "InstallSource", temp);
6192 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6193 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6194 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6195 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6196 CHECK_REG_STR(prodkey, "Comments", NULL);
6197 CHECK_REG_STR(prodkey, "Contact", NULL);
6198 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6199 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6200 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6201 CHECK_REG_STR(prodkey, "Readme", NULL);
6202 CHECK_REG_STR(prodkey, "Size", NULL);
6203 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6204 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6205 CHECK_REG_DWORD(prodkey, "Language", 1033);
6206 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6207 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6208 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6209 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6210 todo_wine
6212 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6215 RegCloseKey(prodkey);
6217 /* no UnpublishFeatures */
6218 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6219 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6220 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6221 ok(!pf_exists("msitest"), "Directory not deleted\n");
6223 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6224 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6226 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6227 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6229 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6230 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6232 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6233 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6234 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6235 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6237 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6238 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6240 /* complete install */
6241 r = MsiInstallProductA(msifile, "FULL=1");
6242 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6243 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6244 ok(pf_exists("msitest"), "File not installed\n");
6246 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6247 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6249 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6250 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6252 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6253 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6255 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6256 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6257 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6258 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6260 if (is_64bit && !is_wow64)
6262 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6263 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6265 else
6267 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6268 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6271 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6272 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6273 CHECK_REG_STR(prodkey, "InstallDate", date);
6274 CHECK_REG_STR(prodkey, "InstallSource", temp);
6275 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6276 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6277 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6278 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6279 CHECK_REG_STR(prodkey, "Comments", NULL);
6280 CHECK_REG_STR(prodkey, "Contact", NULL);
6281 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6282 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6283 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6284 CHECK_REG_STR(prodkey, "Readme", NULL);
6285 CHECK_REG_STR(prodkey, "Size", NULL);
6286 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6287 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6288 CHECK_REG_DWORD(prodkey, "Language", 1033);
6289 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6290 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6291 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6292 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6293 todo_wine
6295 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6298 RegCloseKey(prodkey);
6300 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
6301 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
6302 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6303 ok(pf_exists("msitest\\maximus"), "File deleted\n");
6304 ok(pf_exists("msitest"), "Directory deleted\n");
6306 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6307 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6309 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6310 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6312 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6313 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6315 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6316 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6317 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6318 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6320 if (is_64bit && !is_wow64)
6322 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6323 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6325 else
6327 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6328 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6331 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6332 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6333 CHECK_REG_STR(prodkey, "InstallDate", date);
6334 CHECK_REG_STR(prodkey, "InstallSource", temp);
6335 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6336 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6337 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6338 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6339 CHECK_REG_STR(prodkey, "Comments", NULL);
6340 CHECK_REG_STR(prodkey, "Contact", NULL);
6341 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6342 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6343 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6344 CHECK_REG_STR(prodkey, "Readme", NULL);
6345 CHECK_REG_STR(prodkey, "Size", NULL);
6346 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6347 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6348 CHECK_REG_DWORD(prodkey, "Language", 1033);
6349 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6350 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6351 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6352 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6353 todo_wine
6355 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6358 RegCloseKey(prodkey);
6360 /* complete install */
6361 r = MsiInstallProductA(msifile, "FULL=1");
6362 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6363 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6364 ok(pf_exists("msitest"), "File not installed\n");
6366 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6367 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6369 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6370 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6372 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6373 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6375 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6376 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6377 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6378 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6380 if (is_64bit && !is_wow64)
6382 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6383 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6385 else
6387 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6388 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6391 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6392 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6393 CHECK_REG_STR(prodkey, "InstallDate", date);
6394 CHECK_REG_STR(prodkey, "InstallSource", temp);
6395 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6396 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6397 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6398 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6399 CHECK_REG_STR(prodkey, "Comments", NULL);
6400 CHECK_REG_STR(prodkey, "Contact", NULL);
6401 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6402 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6403 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6404 CHECK_REG_STR(prodkey, "Readme", NULL);
6405 CHECK_REG_STR(prodkey, "Size", NULL);
6406 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6407 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6408 CHECK_REG_DWORD(prodkey, "Language", 1033);
6409 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6410 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6411 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6412 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6413 todo_wine
6415 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -20);
6418 RegCloseKey(prodkey);
6420 /* UnpublishFeatures, both features removed */
6421 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
6422 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6423 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6424 ok(!pf_exists("msitest"), "Directory not deleted\n");
6426 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6427 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6429 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6430 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6432 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6433 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6435 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6436 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6437 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6438 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6440 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6441 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6443 /* complete install */
6444 r = MsiInstallProductA(msifile, "FULL=1");
6445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6446 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6447 ok(pf_exists("msitest"), "File not installed\n");
6449 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6450 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
6452 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6453 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6455 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6456 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6458 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6459 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6460 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6461 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
6463 if (is_64bit && !is_wow64)
6465 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6466 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6468 else
6470 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
6471 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6474 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
6475 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
6476 CHECK_REG_STR(prodkey, "InstallDate", date);
6477 CHECK_REG_STR(prodkey, "InstallSource", temp);
6478 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6479 CHECK_REG_STR(prodkey, "Publisher", "Wine");
6480 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6481 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
6482 CHECK_REG_STR(prodkey, "Comments", NULL);
6483 CHECK_REG_STR(prodkey, "Contact", NULL);
6484 CHECK_REG_STR(prodkey, "HelpLink", NULL);
6485 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
6486 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
6487 CHECK_REG_STR(prodkey, "Readme", NULL);
6488 CHECK_REG_STR(prodkey, "Size", NULL);
6489 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
6490 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
6491 CHECK_REG_DWORD(prodkey, "Language", 1033);
6492 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
6493 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
6494 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
6495 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
6496 todo_wine
6498 CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12);
6501 RegCloseKey(prodkey);
6503 /* complete uninstall */
6504 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
6505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6506 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6507 ok(!pf_exists("msitest"), "Directory not deleted\n");
6509 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
6510 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6512 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
6513 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6515 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
6516 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6518 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6519 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
6520 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6521 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
6523 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
6524 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6526 /* make sure 'Program Files\msitest' is removed */
6527 delete_pfmsitest_files();
6529 error:
6530 RegCloseKey(uninstall);
6531 RegCloseKey(uninstall_32node);
6532 DeleteFile(msifile);
6533 DeleteFile("msitest\\maximus");
6534 RemoveDirectory("msitest");
6537 static void test_publishsourcelist(void)
6539 UINT r;
6540 DWORD size;
6541 CHAR value[MAX_PATH];
6542 CHAR path[MAX_PATH];
6543 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
6545 if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
6547 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
6548 return;
6550 if (is_process_limited())
6552 skip("process is limited\n");
6553 return;
6556 CreateDirectoryA("msitest", NULL);
6557 create_file("msitest\\maximus", 500);
6559 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
6561 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6563 r = MsiInstallProductA(msifile, NULL);
6564 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6566 skip("Not enough rights to perform tests\n");
6567 goto error;
6569 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6570 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6571 ok(pf_exists("msitest"), "File not installed\n");
6573 /* nothing published */
6574 size = MAX_PATH;
6575 lstrcpyA(value, "aaa");
6576 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6577 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6578 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6579 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6580 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6582 size = MAX_PATH;
6583 lstrcpyA(value, "aaa");
6584 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6585 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6586 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6587 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6588 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6590 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
6591 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6592 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6593 ok(pf_exists("msitest"), "File not installed\n");
6595 /* after RegisterProduct */
6596 size = MAX_PATH;
6597 lstrcpyA(value, "aaa");
6598 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6599 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6600 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6601 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6602 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6604 size = MAX_PATH;
6605 lstrcpyA(value, "aaa");
6606 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6607 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6608 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6609 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6610 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6612 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
6613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6614 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6615 ok(pf_exists("msitest"), "File not installed\n");
6617 /* after ProcessComponents */
6618 size = MAX_PATH;
6619 lstrcpyA(value, "aaa");
6620 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6621 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6622 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6623 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6624 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6626 size = MAX_PATH;
6627 lstrcpyA(value, "aaa");
6628 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6629 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6630 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6631 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6632 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6634 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
6635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6636 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6637 ok(pf_exists("msitest"), "File not installed\n");
6639 /* after PublishFeatures */
6640 size = MAX_PATH;
6641 lstrcpyA(value, "aaa");
6642 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6643 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6644 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6645 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6646 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6648 size = MAX_PATH;
6649 lstrcpyA(value, "aaa");
6650 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6651 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6652 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
6653 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
6654 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
6656 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
6657 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6658 ok(pf_exists("msitest\\maximus"), "File not installed\n");
6659 ok(pf_exists("msitest"), "File not installed\n");
6661 /* after PublishProduct */
6662 size = MAX_PATH;
6663 lstrcpyA(value, "aaa");
6664 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6665 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
6666 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6667 ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
6668 ok(size == 11, "Expected 11, got %d\n", size);
6670 size = MAX_PATH;
6671 lstrcpyA(value, "aaa");
6672 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6673 MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATH, value, &size);
6674 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6675 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
6676 ok(size == 0, "Expected 0, got %d\n", size);
6678 size = MAX_PATH;
6679 lstrcpyA(value, "aaa");
6680 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6681 MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPT, value, &size);
6682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6683 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
6684 ok(size == 0, "Expected 0, got %d\n", size);
6686 lstrcpyA(path, CURR_DIR);
6687 lstrcatA(path, "\\");
6689 size = MAX_PATH;
6690 lstrcpyA(value, "aaa");
6691 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6692 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
6693 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6694 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
6695 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
6697 size = MAX_PATH;
6698 lstrcpyA(value, "aaa");
6699 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6700 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPE, value, &size);
6701 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6702 ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
6703 ok(size == 1, "Expected 1, got %d\n", size);
6705 size = MAX_PATH;
6706 lstrcpyA(value, "aaa");
6707 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6708 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
6709 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
6710 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
6711 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
6713 size = MAX_PATH;
6714 lstrcpyA(value, "aaa");
6715 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6716 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
6717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6718 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
6719 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
6721 size = MAX_PATH;
6722 lstrcpyA(value, "aaa");
6723 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
6724 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
6725 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
6726 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
6727 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
6729 /* complete uninstall */
6730 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
6731 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6732 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
6733 ok(!pf_exists("msitest"), "Directory not deleted\n");
6735 /* make sure 'Program Files\msitest' is removed */
6736 delete_pfmsitest_files();
6738 error:
6739 DeleteFile(msifile);
6740 DeleteFile("msitest\\maximus");
6741 RemoveDirectory("msitest");
6744 static UINT run_query(MSIHANDLE hdb, MSIHANDLE hrec, const char *query)
6746 MSIHANDLE hview = 0;
6747 UINT r;
6749 r = MsiDatabaseOpenView(hdb, query, &hview);
6750 if(r != ERROR_SUCCESS)
6751 return r;
6753 r = MsiViewExecute(hview, hrec);
6754 if(r == ERROR_SUCCESS)
6755 r = MsiViewClose(hview);
6756 MsiCloseHandle(hview);
6757 return r;
6760 static void set_transform_summary_info(void)
6762 UINT r;
6763 MSIHANDLE suminfo = 0;
6765 /* build summary info */
6766 r = MsiGetSummaryInformation(0, mstfile, 3, &suminfo);
6767 ok(r == ERROR_SUCCESS , "Failed to open summaryinfo\n");
6769 r = MsiSummaryInfoSetProperty(suminfo, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
6770 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
6772 r = MsiSummaryInfoSetProperty(suminfo, PID_REVNUMBER, VT_LPSTR, 0, NULL,
6773 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
6774 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
6775 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
6776 ok(r == ERROR_SUCCESS , "Failed to set summary info\n");
6778 r = MsiSummaryInfoSetProperty(suminfo, PID_PAGECOUNT, VT_I4, 100, NULL, NULL);
6779 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
6781 r = MsiSummaryInfoPersist(suminfo);
6782 ok(r == ERROR_SUCCESS , "Failed to make summary info persist\n");
6784 r = MsiCloseHandle(suminfo);
6785 ok(r == ERROR_SUCCESS , "Failed to close suminfo\n");
6788 static void generate_transform(void)
6790 MSIHANDLE hdb1, hdb2;
6791 LPCSTR query;
6792 UINT r;
6794 /* start with two identical databases */
6795 CopyFile(msifile, msifile2, FALSE);
6797 r = MsiOpenDatabase(msifile2, MSIDBOPEN_TRANSACT, &hdb1);
6798 ok(r == ERROR_SUCCESS , "Failed to create database\n");
6800 r = MsiDatabaseCommit(hdb1);
6801 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
6803 r = MsiOpenDatabase(msifile, MSIDBOPEN_READONLY, &hdb2);
6804 ok(r == ERROR_SUCCESS , "Failed to create database\n");
6806 query = "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
6807 r = run_query(hdb1, 0, query);
6808 ok(r == ERROR_SUCCESS, "failed to add property\n");
6810 /* database needs to be committed */
6811 MsiDatabaseCommit(hdb1);
6813 r = MsiDatabaseGenerateTransform(hdb1, hdb2, mstfile, 0, 0);
6814 ok(r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r);
6816 #if 0 /* not implemented in wine yet */
6817 r = MsiCreateTransformSummaryInfo(hdb2, hdb2, mstfile, 0, 0);
6818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
6819 #endif
6821 MsiCloseHandle(hdb1);
6822 MsiCloseHandle(hdb2);
6825 /* data for generating a transform */
6827 /* tables transform names - encoded as they would be in an msi database file */
6828 static const WCHAR name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
6829 static const WCHAR name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
6830 static const WCHAR name3[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }; /* Property */
6832 /* data in each table */
6833 static const char data1[] = /* _StringData */
6834 "propval"; /* all the strings squashed together */
6836 static const WCHAR data2[] = { /* _StringPool */
6837 /* len, refs */
6838 0, 0, /* string 0 '' */
6839 4, 1, /* string 1 'prop' */
6840 3, 1, /* string 2 'val' */
6843 static const WCHAR data3[] = { /* Property */
6844 0x0201, 0x0001, 0x0002,
6847 static const struct {
6848 LPCWSTR name;
6849 const void *data;
6850 DWORD size;
6851 } table_transform_data[] =
6853 { name1, data1, sizeof data1 - 1 },
6854 { name2, data2, sizeof data2 },
6855 { name3, data3, sizeof data3 },
6858 #define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
6860 static void generate_transform_manual(void)
6862 IStorage *stg = NULL;
6863 IStream *stm;
6864 WCHAR name[0x20];
6865 HRESULT r;
6866 DWORD i, count;
6867 const DWORD mode = STGM_CREATE|STGM_READWRITE|STGM_DIRECT|STGM_SHARE_EXCLUSIVE;
6869 const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
6871 MultiByteToWideChar(CP_ACP, 0, mstfile, -1, name, 0x20);
6873 r = StgCreateDocfile(name, mode, 0, &stg);
6874 ok(r == S_OK, "failed to create storage\n");
6875 if (!stg)
6876 return;
6878 r = IStorage_SetClass(stg, &CLSID_MsiTransform);
6879 ok(r == S_OK, "failed to set storage type\n");
6881 for (i=0; i<NUM_TRANSFORM_TABLES; i++)
6883 r = IStorage_CreateStream(stg, table_transform_data[i].name,
6884 STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
6885 if (FAILED(r))
6887 ok(0, "failed to create stream %08x\n", r);
6888 continue;
6891 r = IStream_Write(stm, table_transform_data[i].data,
6892 table_transform_data[i].size, &count);
6893 if (FAILED(r) || count != table_transform_data[i].size)
6894 ok(0, "failed to write stream\n");
6895 IStream_Release(stm);
6898 IStorage_Release(stg);
6900 set_transform_summary_info();
6903 static void test_transformprop(void)
6905 UINT r;
6907 if (is_process_limited())
6909 skip("process is limited\n");
6910 return;
6913 CreateDirectoryA("msitest", NULL);
6914 create_file("msitest\\augustus", 500);
6916 create_database(msifile, tp_tables, sizeof(tp_tables) / sizeof(msi_table));
6918 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6920 r = MsiInstallProductA(msifile, NULL);
6921 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6923 skip("Not enough rights to perform tests\n");
6924 goto error;
6926 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6927 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
6928 ok(!delete_pf("msitest", FALSE), "File installed\n");
6930 if (0)
6931 generate_transform();
6932 else
6933 generate_transform_manual();
6935 r = MsiInstallProductA(msifile, "TRANSFORMS=winetest.mst");
6936 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6937 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
6938 ok(delete_pf("msitest", FALSE), "File not installed\n");
6940 error:
6941 /* Delete the files in the temp (current) folder */
6942 DeleteFile(msifile);
6943 DeleteFile(msifile2);
6944 DeleteFile(mstfile);
6945 DeleteFile("msitest\\augustus");
6946 RemoveDirectory("msitest");
6949 static void test_currentworkingdir(void)
6951 UINT r;
6952 CHAR drive[MAX_PATH], path[MAX_PATH];
6953 LPSTR ptr;
6955 if (is_process_limited())
6957 skip("process is limited\n");
6958 return;
6961 CreateDirectoryA("msitest", NULL);
6962 create_file("msitest\\augustus", 500);
6964 create_database(msifile, cwd_tables, sizeof(cwd_tables) / sizeof(msi_table));
6966 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6968 CreateDirectoryA("diffdir", NULL);
6969 SetCurrentDirectoryA("diffdir");
6971 sprintf(path, "..\\%s", msifile);
6972 r = MsiInstallProductA(path, NULL);
6973 todo_wine
6975 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
6976 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
6977 ok(!delete_pf("msitest", FALSE), "File installed\n");
6980 sprintf(path, "%s\\%s", CURR_DIR, msifile);
6981 r = MsiInstallProductA(path, NULL);
6982 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6984 skip("Not enough rights to perform tests\n");
6985 goto error;
6987 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6988 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
6989 ok(delete_pf("msitest", FALSE), "File not installed\n");
6991 lstrcpyA(drive, CURR_DIR);
6992 drive[2] = '\\';
6993 drive[3] = '\0';
6994 SetCurrentDirectoryA(drive);
6996 lstrcpy(path, CURR_DIR);
6997 if (path[lstrlenA(path) - 1] != '\\')
6998 lstrcatA(path, "\\");
6999 lstrcatA(path, msifile);
7000 ptr = strchr(path, ':');
7001 ptr +=2;
7003 r = MsiInstallProductA(ptr, NULL);
7004 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7005 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
7006 ok(delete_pf("msitest", FALSE), "File not installed\n");
7008 error:
7009 SetCurrentDirectoryA(CURR_DIR);
7010 DeleteFile(msifile);
7011 DeleteFile("msitest\\augustus");
7012 RemoveDirectory("msitest");
7013 RemoveDirectory("diffdir");
7016 static void set_admin_summary_info(const CHAR *name)
7018 MSIHANDLE db, summary;
7019 UINT r;
7021 r = MsiOpenDatabaseA(name, MSIDBOPEN_DIRECT, &db);
7022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7024 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
7025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7027 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, 5, NULL, NULL);
7028 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7030 /* write the summary changes back to the stream */
7031 r = MsiSummaryInfoPersist(summary);
7032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7034 MsiCloseHandle(summary);
7036 r = MsiDatabaseCommit(db);
7037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7039 MsiCloseHandle(db);
7042 static void test_admin(void)
7044 UINT r;
7046 CreateDirectoryA("msitest", NULL);
7047 create_file("msitest\\augustus", 500);
7049 create_database(msifile, adm_tables, sizeof(adm_tables) / sizeof(msi_table));
7050 set_admin_summary_info(msifile);
7052 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7054 r = MsiInstallProductA(msifile, NULL);
7055 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7057 skip("Not enough rights to perform tests\n");
7058 goto error;
7060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7061 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7062 ok(!delete_pf("msitest", FALSE), "File installed\n");
7063 ok(!DeleteFile("c:\\msitest\\augustus"), "File installed\n");
7064 ok(!RemoveDirectory("c:\\msitest"), "File installed\n");
7066 r = MsiInstallProductA(msifile, "ACTION=ADMIN");
7067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7068 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7069 ok(!delete_pf("msitest", FALSE), "File installed\n");
7070 todo_wine
7072 ok(DeleteFile("c:\\msitest\\augustus"), "File not installed\n");
7073 ok(RemoveDirectory("c:\\msitest"), "File not installed\n");
7076 error:
7077 DeleteFile(msifile);
7078 DeleteFile("msitest\\augustus");
7079 RemoveDirectory("msitest");
7082 static void set_admin_property_stream(LPCSTR file)
7084 IStorage *stg;
7085 IStream *stm;
7086 WCHAR fileW[MAX_PATH];
7087 HRESULT hr;
7088 DWORD count;
7089 const DWORD mode = STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
7091 /* AdminProperties */
7092 static const WCHAR stmname[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
7093 static const WCHAR data[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
7094 'M','y','P','r','o','p','=','4','2',0};
7096 MultiByteToWideChar(CP_ACP, 0, file, -1, fileW, MAX_PATH);
7098 hr = StgOpenStorage(fileW, NULL, mode, NULL, 0, &stg);
7099 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
7100 if (!stg)
7101 return;
7103 hr = IStorage_CreateStream(stg, stmname, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
7104 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
7106 hr = IStream_Write(stm, data, sizeof(data), &count);
7107 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
7109 IStream_Release(stm);
7110 IStorage_Release(stg);
7113 static void test_adminprops(void)
7115 UINT r;
7117 if (is_process_limited())
7119 skip("process is limited\n");
7120 return;
7123 CreateDirectoryA("msitest", NULL);
7124 create_file("msitest\\augustus", 500);
7126 create_database(msifile, amp_tables, sizeof(amp_tables) / sizeof(msi_table));
7127 set_admin_summary_info(msifile);
7128 set_admin_property_stream(msifile);
7130 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7132 r = MsiInstallProductA(msifile, NULL);
7133 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7135 skip("Not enough rights to perform tests\n");
7136 goto error;
7138 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7139 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
7140 ok(delete_pf("msitest", FALSE), "File installed\n");
7142 error:
7143 DeleteFile(msifile);
7144 DeleteFile("msitest\\augustus");
7145 RemoveDirectory("msitest");
7148 static void create_pf_data(LPCSTR file, LPCSTR data, BOOL is_file)
7150 CHAR path[MAX_PATH];
7152 lstrcpyA(path, PROG_FILES_DIR);
7153 lstrcatA(path, "\\");
7154 lstrcatA(path, file);
7156 if (is_file)
7157 create_file_data(path, data, 500);
7158 else
7159 CreateDirectoryA(path, NULL);
7162 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
7164 static void test_removefiles(void)
7166 UINT r;
7168 if (is_process_limited())
7170 skip("process is limited\n");
7171 return;
7174 CreateDirectoryA("msitest", NULL);
7175 create_file("msitest\\hydrogen", 500);
7176 create_file("msitest\\helium", 500);
7177 create_file("msitest\\lithium", 500);
7179 create_database(msifile, rem_tables, sizeof(rem_tables) / sizeof(msi_table));
7181 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7183 r = MsiInstallProductA(msifile, NULL);
7184 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7186 skip("Not enough rights to perform tests\n");
7187 goto error;
7189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7190 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
7191 ok(!pf_exists("msitest\\helium"), "File installed\n");
7192 ok(pf_exists("msitest\\lithium"), "File not installed\n");
7193 ok(pf_exists("msitest"), "File not installed\n");
7195 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7196 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7197 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
7198 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
7199 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
7200 ok(delete_pf("msitest", FALSE), "File deleted\n");
7202 create_pf("msitest", FALSE);
7203 create_pf("msitest\\hydrogen", TRUE);
7204 create_pf("msitest\\helium", TRUE);
7205 create_pf("msitest\\lithium", TRUE);
7207 r = MsiInstallProductA(msifile, NULL);
7208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7209 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
7210 ok(pf_exists("msitest\\helium"), "File not installed\n");
7211 ok(pf_exists("msitest\\lithium"), "File not installed\n");
7212 ok(pf_exists("msitest"), "File not installed\n");
7214 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7215 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7216 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
7217 ok(delete_pf("msitest\\helium", TRUE), "File deleted\n");
7218 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
7219 ok(delete_pf("msitest", FALSE), "File deleted\n");
7221 create_pf("msitest", FALSE);
7222 create_pf("msitest\\furlong", TRUE);
7223 create_pf("msitest\\firkin", TRUE);
7224 create_pf("msitest\\fortnight", TRUE);
7225 create_pf("msitest\\becquerel", TRUE);
7226 create_pf("msitest\\dioptre", TRUE);
7227 create_pf("msitest\\attoparsec", TRUE);
7228 create_pf("msitest\\storeys", TRUE);
7229 create_pf("msitest\\block", TRUE);
7230 create_pf("msitest\\siriometer", TRUE);
7231 create_pf("msitest\\cabout", FALSE);
7232 create_pf("msitest\\cabout\\blocker", TRUE);
7234 r = MsiInstallProductA(msifile, NULL);
7235 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7236 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
7237 ok(!pf_exists("msitest\\helium"), "File installed\n");
7238 ok(pf_exists("msitest\\lithium"), "File not installed\n");
7239 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
7240 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
7241 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
7242 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
7243 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
7244 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
7245 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
7246 ok(!pf_exists("msitest\\block"), "File not deleted\n");
7247 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
7248 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
7249 ok(pf_exists("msitest"), "File not installed\n");
7251 create_pf("msitest\\furlong", TRUE);
7252 create_pf("msitest\\firkin", TRUE);
7253 create_pf("msitest\\fortnight", TRUE);
7254 create_pf("msitest\\storeys", TRUE);
7255 create_pf("msitest\\block", TRUE);
7256 create_pf("msitest\\siriometer", TRUE);
7258 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7259 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7260 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
7261 ok(!delete_pf("msitest\\helium", TRUE), "File not deleted\n");
7262 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
7263 ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
7264 ok(delete_pf("msitest\\firkin", TRUE), "File deleted\n");
7265 ok(delete_pf("msitest\\fortnight", TRUE), "File deleted\n");
7266 ok(!delete_pf("msitest\\becquerel", TRUE), "File not deleted\n");
7267 ok(!delete_pf("msitest\\dioptre", TRUE), "File not deleted\n");
7268 ok(delete_pf("msitest\\attoparsec", TRUE), "File deleted\n");
7269 ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
7270 ok(!delete_pf("msitest\\block", TRUE), "File not deleted\n");
7271 ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
7272 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
7273 ok(pf_exists("msitest"), "Directory deleted\n");
7275 r = MsiInstallProductA(msifile, NULL);
7276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7277 ok(delete_pf("msitest\\hydrogen", TRUE), "File not installed\n");
7278 ok(!delete_pf("msitest\\helium", TRUE), "File installed\n");
7279 ok(delete_pf("msitest\\lithium", TRUE), "File not installed\n");
7280 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
7281 ok(pf_exists("msitest"), "Directory deleted\n");
7283 delete_pf("msitest\\cabout\\blocker", TRUE);
7285 r = MsiInstallProductA(msifile, "REMOVE=ALL");
7286 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7287 ok(!delete_pf("msitest\\cabout", FALSE), "Directory not deleted\n");
7288 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
7290 error:
7291 DeleteFile(msifile);
7292 DeleteFile("msitest\\hydrogen");
7293 DeleteFile("msitest\\helium");
7294 DeleteFile("msitest\\lithium");
7295 RemoveDirectory("msitest");
7298 static void test_movefiles(void)
7300 UINT r;
7301 char props[MAX_PATH];
7303 if (is_process_limited())
7305 skip("process is limited\n");
7306 return;
7309 CreateDirectoryA("msitest", NULL);
7310 create_file("msitest\\augustus", 100);
7311 create_file("cameroon", 100);
7312 create_file("djibouti", 100);
7313 create_file("egypt", 100);
7314 create_file("finland", 100);
7315 create_file("gambai", 100);
7316 create_file("honduras", 100);
7317 create_file("msitest\\india", 100);
7318 create_file("japan", 100);
7319 create_file("kenya", 100);
7320 CreateDirectoryA("latvia", NULL);
7321 create_file("nauru", 100);
7322 create_file("peru", 100);
7323 create_file("apple", 100);
7324 create_file("application", 100);
7325 create_file("ape", 100);
7326 create_file("foo", 100);
7327 create_file("fao", 100);
7328 create_file("fbod", 100);
7329 create_file("budding", 100);
7330 create_file("buddy", 100);
7331 create_file("bud", 100);
7332 create_file("bar", 100);
7333 create_file("bur", 100);
7334 create_file("bird", 100);
7336 create_database(msifile, mov_tables, sizeof(mov_tables) / sizeof(msi_table));
7338 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7340 /* if the source or dest property is not a full path,
7341 * windows tries to access it as a network resource
7344 sprintf(props, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
7345 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
7346 CURR_DIR, PROG_FILES_DIR, CURR_DIR, CURR_DIR);
7348 r = MsiInstallProductA(msifile, props);
7349 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7351 skip("Not enough rights to perform tests\n");
7352 goto error;
7354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7355 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
7356 ok(!delete_pf("msitest\\dest", TRUE), "File copied\n");
7357 ok(delete_pf("msitest\\canada", TRUE), "File not copied\n");
7358 ok(delete_pf("msitest\\dominica", TRUE), "File not moved\n");
7359 ok(!delete_pf("msitest\\elsalvador", TRUE), "File moved\n");
7360 ok(!delete_pf("msitest\\france", TRUE), "File moved\n");
7361 ok(!delete_pf("msitest\\georgia", TRUE), "File moved\n");
7362 ok(delete_pf("msitest\\hungary", TRUE), "File not moved\n");
7363 ok(!delete_pf("msitest\\indonesia", TRUE), "File moved\n");
7364 ok(!delete_pf("msitest\\jordan", TRUE), "File moved\n");
7365 ok(delete_pf("msitest\\kiribati", TRUE), "File not moved\n");
7366 ok(!delete_pf("msitest\\lebanon", TRUE), "File moved\n");
7367 ok(!delete_pf("msitest\\lebanon", FALSE), "Directory moved\n");
7368 ok(delete_pf("msitest\\poland", TRUE), "File not moved\n");
7369 /* either apple or application will be moved depending on directory order */
7370 if (!delete_pf("msitest\\apple", TRUE))
7371 ok(delete_pf("msitest\\application", TRUE), "File not moved\n");
7372 else
7373 ok(!delete_pf("msitest\\application", TRUE), "File should not exist\n");
7374 ok(delete_pf("msitest\\wildcard", TRUE), "File not moved\n");
7375 ok(!delete_pf("msitest\\ape", TRUE), "File moved\n");
7376 /* either fao or foo will be moved depending on directory order */
7377 if (delete_pf("msitest\\foo", TRUE))
7378 ok(!delete_pf("msitest\\fao", TRUE), "File should not exist\n");
7379 else
7380 ok(delete_pf("msitest\\fao", TRUE), "File not moved\n");
7381 ok(delete_pf("msitest\\single", TRUE), "File not moved\n");
7382 ok(!delete_pf("msitest\\fbod", TRUE), "File moved\n");
7383 ok(delete_pf("msitest\\budding", TRUE), "File not moved\n");
7384 ok(delete_pf("msitest\\buddy", TRUE), "File not moved\n");
7385 ok(!delete_pf("msitest\\bud", TRUE), "File moved\n");
7386 ok(delete_pf("msitest\\bar", TRUE), "File not moved\n");
7387 ok(delete_pf("msitest\\bur", TRUE), "File not moved\n");
7388 ok(!delete_pf("msitest\\bird", TRUE), "File moved\n");
7389 ok(delete_pf("msitest", FALSE), "File not installed\n");
7390 ok(DeleteFileA("cameroon"), "File moved\n");
7391 ok(!DeleteFileA("djibouti"), "File not moved\n");
7392 ok(DeleteFileA("egypt"), "File moved\n");
7393 ok(DeleteFileA("finland"), "File moved\n");
7394 ok(DeleteFileA("gambai"), "File moved\n");
7395 ok(!DeleteFileA("honduras"), "File not moved\n");
7396 ok(DeleteFileA("msitest\\india"), "File moved\n");
7397 ok(DeleteFileA("japan"), "File moved\n");
7398 ok(!DeleteFileA("kenya"), "File not moved\n");
7399 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
7400 ok(!DeleteFileA("nauru"), "File not moved\n");
7401 ok(!DeleteFileA("peru"), "File not moved\n");
7402 ok(!DeleteFileA("apple"), "File not moved\n");
7403 ok(!DeleteFileA("application"), "File not moved\n");
7404 ok(DeleteFileA("ape"), "File moved\n");
7405 ok(!DeleteFileA("foo"), "File not moved\n");
7406 ok(!DeleteFileA("fao"), "File not moved\n");
7407 ok(DeleteFileA("fbod"), "File moved\n");
7408 ok(!DeleteFileA("budding"), "File not moved\n");
7409 ok(!DeleteFileA("buddy"), "File not moved\n");
7410 ok(DeleteFileA("bud"), "File moved\n");
7411 ok(!DeleteFileA("bar"), "File not moved\n");
7412 ok(!DeleteFileA("bur"), "File not moved\n");
7413 ok(DeleteFileA("bird"), "File moved\n");
7415 error:
7416 DeleteFile("cameroon");
7417 DeleteFile("djibouti");
7418 DeleteFile("egypt");
7419 DeleteFile("finland");
7420 DeleteFile("gambai");
7421 DeleteFile("honduras");
7422 DeleteFile("japan");
7423 DeleteFile("kenya");
7424 DeleteFile("nauru");
7425 DeleteFile("peru");
7426 DeleteFile("apple");
7427 DeleteFile("application");
7428 DeleteFile("ape");
7429 DeleteFile("foo");
7430 DeleteFile("fao");
7431 DeleteFile("fbod");
7432 DeleteFile("budding");
7433 DeleteFile("buddy");
7434 DeleteFile("bud");
7435 DeleteFile("bar");
7436 DeleteFile("bur");
7437 DeleteFile("bird");
7438 DeleteFile("msitest\\india");
7439 DeleteFile("msitest\\augustus");
7440 RemoveDirectory("latvia");
7441 RemoveDirectory("msitest");
7442 DeleteFile(msifile);
7445 static void test_missingcab(void)
7447 UINT r;
7449 if (is_process_limited())
7451 skip("process is limited\n");
7452 return;
7455 CreateDirectoryA("msitest", NULL);
7456 create_file("msitest\\augustus", 500);
7457 create_file("maximus", 500);
7459 create_database(msifile, mc_tables, sizeof(mc_tables) / sizeof(msi_table));
7461 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7463 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
7465 create_pf("msitest", FALSE);
7466 create_pf_data("msitest\\caesar", "abcdefgh", TRUE);
7468 r = MsiInstallProductA(msifile, NULL);
7469 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7471 skip("Not enough rights to perform tests\n");
7472 goto error;
7474 ok(r == ERROR_SUCCESS ||
7475 broken(r == ERROR_INSTALL_FAILURE), /* win9x */
7476 "Expected ERROR_SUCCESS, got %u\n", r);
7477 if (r == ERROR_SUCCESS)
7479 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
7480 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
7482 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
7483 ok(!delete_pf("msitest\\gaius", TRUE), "File installed\n");
7484 ok(delete_pf("msitest", FALSE), "File not installed\n");
7486 create_pf("msitest", FALSE);
7487 create_pf_data("msitest\\caesar", "abcdefgh", TRUE);
7488 create_pf("msitest\\gaius", TRUE);
7490 r = MsiInstallProductA(msifile, "GAIUS=1");
7491 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
7492 todo_wine
7494 ok(!delete_pf("msitest\\maximus", TRUE), "File installed\n");
7495 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7497 ok(delete_pf("msitest\\caesar", TRUE), "File removed\n");
7498 ok(delete_pf("msitest\\gaius", TRUE), "File removed\n");
7499 ok(delete_pf("msitest", FALSE), "File not installed\n");
7501 error:
7502 delete_pf("msitest\\caesar", TRUE);
7503 delete_pf("msitest", FALSE);
7504 DeleteFile("msitest\\augustus");
7505 RemoveDirectory("msitest");
7506 DeleteFile("maximus");
7507 DeleteFile("test1.cab");
7508 DeleteFile(msifile);
7511 static void test_duplicatefiles(void)
7513 UINT r;
7515 if (is_process_limited())
7517 skip("process is limited\n");
7518 return;
7521 CreateDirectoryA("msitest", NULL);
7522 create_file("msitest\\maximus", 500);
7523 create_database(msifile, df_tables, sizeof(df_tables) / sizeof(msi_table));
7525 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7527 /* fails if the destination folder is not a valid property */
7529 r = MsiInstallProductA(msifile, NULL);
7530 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7532 skip("Not enough rights to perform tests\n");
7533 goto error;
7535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7536 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
7537 ok(delete_pf("msitest\\augustus", TRUE), "File not duplicated\n");
7538 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE), "File not duplicated\n");
7539 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE), "File not duplicated\n");
7540 ok(delete_pf("msitest\\this\\doesnot", FALSE), "File not duplicated\n");
7541 ok(delete_pf("msitest\\this", FALSE), "File not duplicated\n");
7542 ok(delete_pf("msitest", FALSE), "File not installed\n");
7544 error:
7545 DeleteFile("msitest\\maximus");
7546 RemoveDirectory("msitest");
7547 DeleteFile(msifile);
7550 static void test_writeregistryvalues(void)
7552 UINT r;
7553 LONG res;
7554 HKEY hkey;
7555 DWORD type, size;
7556 CHAR path[MAX_PATH];
7558 if (is_process_limited())
7560 skip("process is limited\n");
7561 return;
7564 CreateDirectoryA("msitest", NULL);
7565 create_file("msitest\\augustus", 500);
7567 create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table));
7569 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7571 r = MsiInstallProductA(msifile, NULL);
7572 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7574 skip("Not enough rights to perform tests\n");
7575 goto error;
7577 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7578 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
7579 ok(delete_pf("msitest", FALSE), "File installed\n");
7581 if (is_64bit && !is_wow64)
7582 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
7583 else
7584 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
7585 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7587 size = MAX_PATH;
7588 type = REG_MULTI_SZ;
7589 memset(path, 'a', MAX_PATH);
7590 res = RegQueryValueExA(hkey, "Value", NULL, &type, (LPBYTE)path, &size);
7591 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
7592 ok(!memcmp(path, "one\0two\0three\0\0", size), "Wrong multi-sz data\n");
7593 ok(size == 15, "Expected 15, got %d\n", size);
7594 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
7596 RegDeleteValueA(hkey, "Value");
7597 RegCloseKey(hkey);
7598 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
7600 error:
7601 DeleteFile(msifile);
7602 DeleteFile("msitest\\augustus");
7603 RemoveDirectory("msitest");
7606 static void test_sourcefolder(void)
7608 UINT r;
7610 if (is_process_limited())
7612 skip("process is limited\n");
7613 return;
7616 CreateDirectoryA("msitest", NULL);
7617 create_file("augustus", 500);
7619 create_database(msifile, sf_tables, sizeof(sf_tables) / sizeof(msi_table));
7621 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7623 r = MsiInstallProductA(msifile, NULL);
7624 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7626 skip("Not enough rights to perform tests\n");
7627 goto error;
7629 ok(r == ERROR_INSTALL_FAILURE,
7630 "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
7631 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7632 todo_wine
7634 ok(!delete_pf("msitest", FALSE), "File installed\n");
7637 RemoveDirectoryA("msitest");
7639 r = MsiInstallProductA(msifile, NULL);
7640 ok(r == ERROR_INSTALL_FAILURE,
7641 "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
7642 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
7643 todo_wine
7645 ok(!delete_pf("msitest", FALSE), "File installed\n");
7648 error:
7649 DeleteFile(msifile);
7650 DeleteFile("augustus");
7653 static void test_customaction51(void)
7655 UINT r;
7657 if (is_process_limited())
7659 skip("process is limited\n");
7660 return;
7663 CreateDirectoryA("msitest", NULL);
7664 create_file("msitest\\augustus", 500);
7666 create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
7668 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7670 r = MsiInstallProductA(msifile, NULL);
7671 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7673 skip("Not enough rights to perform tests\n");
7674 goto error;
7676 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7677 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
7678 ok(delete_pf("msitest", FALSE), "File installed\n");
7680 error:
7681 DeleteFile(msifile);
7682 DeleteFile("msitest\\augustus");
7683 RemoveDirectory("msitest");
7686 static void test_installstate(void)
7688 UINT r;
7690 if (is_process_limited())
7692 skip("process is limited\n");
7693 return;
7696 CreateDirectoryA("msitest", NULL);
7697 create_file("msitest\\alpha", 500);
7698 create_file("msitest\\beta", 500);
7699 create_file("msitest\\gamma", 500);
7700 create_file("msitest\\theta", 500);
7701 create_file("msitest\\delta", 500);
7702 create_file("msitest\\epsilon", 500);
7703 create_file("msitest\\zeta", 500);
7704 create_file("msitest\\iota", 500);
7705 create_file("msitest\\eta", 500);
7706 create_file("msitest\\kappa", 500);
7707 create_file("msitest\\lambda", 500);
7708 create_file("msitest\\mu", 500);
7710 create_database(msifile, is_tables, sizeof(is_tables) / sizeof(msi_table));
7712 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
7714 r = MsiInstallProductA(msifile, NULL);
7715 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
7717 skip("Not enough rights to perform tests\n");
7718 goto error;
7720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7721 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
7722 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7723 ok(delete_pf("msitest\\gamma", TRUE), "File not installed\n");
7724 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
7725 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7726 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
7727 ok(!delete_pf("msitest\\zeta", TRUE), "File installed\n");
7728 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7729 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
7730 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7731 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7732 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7733 ok(delete_pf("msitest", FALSE), "File not installed\n");
7735 r = MsiInstallProductA(msifile, "ADDLOCAL=\"one,two,three,four\"");
7736 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7737 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
7738 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7739 ok(delete_pf("msitest\\gamma", TRUE), "File not installed\n");
7740 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
7741 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7742 ok(delete_pf("msitest\\epsilon", TRUE), "File not installed\n");
7743 ok(delete_pf("msitest\\zeta", TRUE), "File not installed\n");
7744 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7745 ok(delete_pf("msitest\\eta", TRUE), "File not installed\n");
7746 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7747 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7748 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7749 ok(delete_pf("msitest", FALSE), "File not installed\n");
7751 r = MsiInstallProductA(msifile, "ADDSOURCE=\"one,two,three,four\"");
7752 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7753 ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
7754 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7755 ok(!delete_pf("msitest\\gamma", TRUE), "File installed\n");
7756 ok(delete_pf("msitest\\theta", TRUE), "File not installed\n");
7757 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7758 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
7759 ok(delete_pf("msitest\\zeta", TRUE), "File not installed\n");
7760 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7761 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
7762 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7763 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7764 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7765 ok(delete_pf("msitest", FALSE), "File not installed\n");
7767 r = MsiInstallProductA(msifile, "REMOVE=\"one,two,three,four\"");
7768 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
7769 ok(!delete_pf("msitest\\alpha", TRUE), "File installed\n");
7770 ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
7771 ok(!delete_pf("msitest\\gamma", TRUE), "File installed\n");
7772 ok(!delete_pf("msitest\\theta", TRUE), "File installed\n");
7773 ok(!delete_pf("msitest\\delta", TRUE), "File installed\n");
7774 ok(!delete_pf("msitest\\epsilon", TRUE), "File installed\n");
7775 ok(!delete_pf("msitest\\zeta", TRUE), "File installed\n");
7776 ok(!delete_pf("msitest\\iota", TRUE), "File installed\n");
7777 ok(!delete_pf("msitest\\eta", TRUE), "File installed\n");
7778 ok(!delete_pf("msitest\\kappa", TRUE), "File installed\n");
7779 ok(!delete_pf("msitest\\lambda", TRUE), "File installed\n");
7780 ok(!delete_pf("msitest\\mu", TRUE), "File installed\n");
7781 ok(!delete_pf("msitest", FALSE), "File installed\n");
7783 error:
7784 DeleteFile(msifile);
7785 DeleteFile("msitest\\alpha");
7786 DeleteFile("msitest\\beta");
7787 DeleteFile("msitest\\gamma");
7788 DeleteFile("msitest\\theta");
7789 DeleteFile("msitest\\delta");
7790 DeleteFile("msitest\\epsilon");
7791 DeleteFile("msitest\\zeta");
7792 DeleteFile("msitest\\iota");
7793 DeleteFile("msitest\\eta");
7794 DeleteFile("msitest\\kappa");
7795 DeleteFile("msitest\\lambda");
7796 DeleteFile("msitest\\mu");
7797 RemoveDirectory("msitest");
7800 static const struct sourcepathmap
7802 BOOL sost; /* shortone\shorttwo */
7803 BOOL solt; /* shortone\longtwo */
7804 BOOL lost; /* longone\shorttwo */
7805 BOOL lolt; /* longone\longtwo */
7806 BOOL soste; /* shortone\shorttwo source exists */
7807 BOOL solte; /* shortone\longtwo source exists */
7808 BOOL loste; /* longone\shorttwo source exists */
7809 BOOL lolte; /* longone\longtwo source exists */
7810 UINT err;
7811 DWORD size;
7812 } spmap[256] =
7814 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7815 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7816 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7817 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7818 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7819 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7820 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7821 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7822 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7823 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7824 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7825 {TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7826 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7827 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7828 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7829 {TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7830 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7831 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7832 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7833 {TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7834 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7835 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7836 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7837 {TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7838 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7839 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7840 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7841 {TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7842 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7843 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7844 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7845 {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7846 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7847 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7848 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7849 {TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7850 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7851 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7852 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7853 {TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7854 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7855 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7856 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7857 {TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7858 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7859 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7860 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7861 {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7862 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7863 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7864 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7865 {TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7866 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7867 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7868 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7869 {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7870 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7871 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7872 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7873 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7874 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7875 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7876 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7877 {TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7878 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7879 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7880 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7881 {TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7882 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7883 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7884 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7885 {TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7886 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7887 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7888 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7889 {TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7890 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7891 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7892 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7893 {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7894 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7895 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7896 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7897 {TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7898 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7899 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7900 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7901 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7902 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7903 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7904 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7905 {TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7906 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7907 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7908 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7909 {TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7910 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7911 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7912 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7913 {TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7914 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7915 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7916 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7917 {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7918 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7919 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7920 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7921 {TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7922 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7923 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7924 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7925 {TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7926 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7927 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7928 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7929 {TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7930 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7931 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7932 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7933 {TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7934 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7935 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7936 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7937 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7938 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7939 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7940 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7941 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7942 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7943 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7944 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7945 {FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7946 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7947 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7948 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7949 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7950 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7951 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7952 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7953 {FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7954 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7955 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7956 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7957 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7958 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7959 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7960 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7961 {FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7962 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7963 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7964 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7965 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7966 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7967 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7968 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7969 {FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7970 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7971 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7972 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7973 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7974 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7975 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7976 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7977 {FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7978 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7979 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7980 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7981 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7982 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
7983 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7984 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
7985 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7986 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
7987 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7988 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
7989 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7990 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7991 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7992 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7993 {FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7994 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7995 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
7996 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
7997 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
7998 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
7999 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8000 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8001 {FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8002 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8003 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8004 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8005 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8006 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8007 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8008 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8009 {FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8010 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8011 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8012 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8013 {FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8014 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8015 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8016 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8017 {FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8018 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8019 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8020 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8021 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8022 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8023 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8024 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8025 {FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8026 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8027 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8028 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8029 {FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8030 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8031 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8032 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8033 {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8034 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8035 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8036 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8037 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8038 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8039 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8040 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8041 {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8042 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8043 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8044 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8045 {FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8046 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, ERROR_SUCCESS, 200},
8047 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8048 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, ERROR_SUCCESS, 200},
8049 {FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8050 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, ERROR_SUCCESS, 200},
8051 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8052 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, ERROR_SUCCESS, 200},
8053 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8054 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8055 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8056 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8057 {FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8058 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8059 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8060 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8061 {FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8062 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8063 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8064 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8065 {FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8066 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, ERROR_INSTALL_FAILURE, 0},
8067 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, ERROR_INSTALL_FAILURE, 0},
8068 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, ERROR_INSTALL_FAILURE, 0},
8069 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ERROR_INSTALL_FAILURE, 0},
8072 static DWORD get_pf_file_size(LPCSTR file)
8074 CHAR path[MAX_PATH];
8075 HANDLE hfile;
8076 DWORD size;
8078 lstrcpyA(path, PROG_FILES_DIR);
8079 lstrcatA(path, "\\");
8080 lstrcatA(path, file);
8082 hfile = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
8083 if (hfile == INVALID_HANDLE_VALUE)
8084 return INVALID_FILE_SIZE;
8086 size = GetFileSize(hfile, NULL);
8087 CloseHandle(hfile);
8088 return size;
8091 static void test_sourcepath(void)
8093 UINT r, i;
8095 if (!winetest_interactive)
8097 skip("Run in interactive mode to run source path tests.\n");
8098 return;
8101 create_database(msifile, sp_tables, sizeof(sp_tables) / sizeof(msi_table));
8103 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8105 for (i = 0; i < sizeof(spmap) / sizeof(spmap[0]); i++)
8107 if (spmap[i].sost)
8109 CreateDirectoryA("shortone", NULL);
8110 CreateDirectoryA("shortone\\shorttwo", NULL);
8113 if (spmap[i].solt)
8115 CreateDirectoryA("shortone", NULL);
8116 CreateDirectoryA("shortone\\longtwo", NULL);
8119 if (spmap[i].lost)
8121 CreateDirectoryA("longone", NULL);
8122 CreateDirectoryA("longone\\shorttwo", NULL);
8125 if (spmap[i].lolt)
8127 CreateDirectoryA("longone", NULL);
8128 CreateDirectoryA("longone\\longtwo", NULL);
8131 if (spmap[i].soste)
8132 create_file("shortone\\shorttwo\\augustus", 50);
8133 if (spmap[i].solte)
8134 create_file("shortone\\longtwo\\augustus", 100);
8135 if (spmap[i].loste)
8136 create_file("longone\\shorttwo\\augustus", 150);
8137 if (spmap[i].lolte)
8138 create_file("longone\\longtwo\\augustus", 200);
8140 r = MsiInstallProductA(msifile, NULL);
8141 ok(r == spmap[i].err, "%d: Expected %d, got %d\n", i, spmap[i].err, r);
8142 ok(get_pf_file_size("msitest\\augustus") == spmap[i].size,
8143 "%d: Expected %d, got %d\n", i, spmap[i].size,
8144 get_pf_file_size("msitest\\augustus"));
8146 if (r == ERROR_SUCCESS)
8148 ok(delete_pf("msitest\\augustus", TRUE), "%d: File not installed\n", i);
8149 ok(delete_pf("msitest", FALSE), "%d: File not installed\n", i);
8151 else
8153 ok(!delete_pf("msitest\\augustus", TRUE), "%d: File installed\n", i);
8154 todo_wine ok(!delete_pf("msitest", FALSE), "%d: File installed\n", i);
8157 DeleteFileA("shortone\\shorttwo\\augustus");
8158 DeleteFileA("shortone\\longtwo\\augustus");
8159 DeleteFileA("longone\\shorttwo\\augustus");
8160 DeleteFileA("longone\\longtwo\\augustus");
8161 RemoveDirectoryA("shortone\\shorttwo");
8162 RemoveDirectoryA("shortone\\longtwo");
8163 RemoveDirectoryA("longone\\shorttwo");
8164 RemoveDirectoryA("longone\\longtwo");
8165 RemoveDirectoryA("shortone");
8166 RemoveDirectoryA("longone");
8169 DeleteFileA(msifile);
8172 static void test_MsiConfigureProductEx(void)
8174 UINT r;
8175 LONG res;
8176 DWORD type, size;
8177 HKEY props, source;
8178 CHAR keypath[MAX_PATH * 2], localpack[MAX_PATH];
8179 REGSAM access = KEY_ALL_ACCESS;
8181 if (on_win9x)
8183 win_skip("Different registry keys on Win9x and WinMe\n");
8184 return;
8186 if (is_process_limited())
8188 skip("process is limited\n");
8189 return;
8192 CreateDirectoryA("msitest", NULL);
8193 create_file("msitest\\hydrogen", 500);
8194 create_file("msitest\\helium", 500);
8195 create_file("msitest\\lithium", 500);
8197 create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
8199 if (is_wow64)
8200 access |= KEY_WOW64_64KEY;
8202 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8204 /* NULL szProduct */
8205 r = MsiConfigureProductExA(NULL, INSTALLLEVEL_DEFAULT,
8206 INSTALLSTATE_DEFAULT, "PROPVAR=42");
8207 ok(r == ERROR_INVALID_PARAMETER,
8208 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8210 /* empty szProduct */
8211 r = MsiConfigureProductExA("", INSTALLLEVEL_DEFAULT,
8212 INSTALLSTATE_DEFAULT, "PROPVAR=42");
8213 ok(r == ERROR_INVALID_PARAMETER,
8214 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8216 /* garbage szProduct */
8217 r = MsiConfigureProductExA("garbage", INSTALLLEVEL_DEFAULT,
8218 INSTALLSTATE_DEFAULT, "PROPVAR=42");
8219 ok(r == ERROR_INVALID_PARAMETER,
8220 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8222 /* guid without brackets */
8223 r = MsiConfigureProductExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D",
8224 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8225 "PROPVAR=42");
8226 ok(r == ERROR_INVALID_PARAMETER,
8227 "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
8229 /* guid with brackets */
8230 r = MsiConfigureProductExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}",
8231 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8232 "PROPVAR=42");
8233 ok(r == ERROR_UNKNOWN_PRODUCT,
8234 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
8236 /* same length as guid, but random */
8237 r = MsiConfigureProductExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93",
8238 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8239 "PROPVAR=42");
8240 ok(r == ERROR_UNKNOWN_PRODUCT,
8241 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
8243 /* product not installed yet */
8244 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8245 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8246 "PROPVAR=42");
8247 ok(r == ERROR_UNKNOWN_PRODUCT,
8248 "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
8250 /* install the product, per-user unmanaged */
8251 r = MsiInstallProductA(msifile, "INSTALLLEVEL=10 PROPVAR=42");
8252 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8254 skip("Not enough rights to perform tests\n");
8255 goto error;
8257 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8258 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8259 ok(pf_exists("msitest\\helium"), "File not installed\n");
8260 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8261 ok(pf_exists("msitest"), "File not installed\n");
8263 /* product is installed per-user managed, remove it */
8264 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8265 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8266 "PROPVAR=42");
8267 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8268 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8269 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8270 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8271 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8273 /* product has been removed */
8274 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8275 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8276 "PROPVAR=42");
8277 ok(r == ERROR_UNKNOWN_PRODUCT,
8278 "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
8280 /* install the product, machine */
8281 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8282 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8283 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8284 ok(pf_exists("msitest\\helium"), "File not installed\n");
8285 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8286 ok(pf_exists("msitest"), "File not installed\n");
8288 /* product is installed machine, remove it */
8289 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8290 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8291 "PROPVAR=42");
8292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8293 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8294 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8295 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8296 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8298 /* product has been removed */
8299 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8300 INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT,
8301 "PROPVAR=42");
8302 ok(r == ERROR_UNKNOWN_PRODUCT,
8303 "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
8305 /* install the product, machine */
8306 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8307 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8308 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8309 ok(pf_exists("msitest\\helium"), "File not installed\n");
8310 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8311 ok(pf_exists("msitest"), "File not installed\n");
8313 DeleteFileA(msifile);
8315 /* local msifile is removed */
8316 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8317 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8318 "PROPVAR=42");
8319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8320 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8321 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8322 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8323 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8325 create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
8327 /* install the product, machine */
8328 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8330 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8331 ok(pf_exists("msitest\\helium"), "File not installed\n");
8332 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8333 ok(pf_exists("msitest"), "File not installed\n");
8335 DeleteFileA(msifile);
8337 lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\");
8338 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
8339 lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties");
8341 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
8342 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8344 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
8345 (const BYTE *)"C:\\idontexist.msi", 18);
8346 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8348 /* LocalPackage is used to find the cached msi package */
8349 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8350 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8351 "PROPVAR=42");
8352 ok(r == ERROR_INSTALL_SOURCE_ABSENT,
8353 "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
8354 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8355 ok(pf_exists("msitest\\helium"), "File not installed\n");
8356 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8357 ok(pf_exists("msitest"), "File not installed\n");
8359 RegCloseKey(props);
8360 create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
8362 /* LastUsedSource (local msi package) can be used as a last resort */
8363 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8364 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8365 "PROPVAR=42");
8366 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8367 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8368 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8369 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8370 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8372 /* install the product, machine */
8373 r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
8374 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8375 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8376 ok(pf_exists("msitest\\helium"), "File not installed\n");
8377 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8378 ok(pf_exists("msitest"), "File not installed\n");
8380 lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\");
8381 lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\");
8382 lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties");
8384 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
8385 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8387 res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
8388 (const BYTE *)"C:\\idontexist.msi", 18);
8389 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8391 lstrcpyA(keypath, "SOFTWARE\\Classes\\Installer\\Products\\");
8392 lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\SourceList");
8394 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &source);
8395 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8397 type = REG_SZ;
8398 size = MAX_PATH;
8399 res = RegQueryValueExA(source, "PackageName", NULL, &type,
8400 (LPBYTE)localpack, &size);
8401 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8403 res = RegSetValueExA(source, "PackageName", 0, REG_SZ,
8404 (const BYTE *)"idontexist.msi", 15);
8405 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8407 /* SourceList is altered */
8408 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8409 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8410 "PROPVAR=42");
8411 ok(r == ERROR_INSTALL_SOURCE_ABSENT,
8412 "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
8413 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8414 ok(pf_exists("msitest\\helium"), "File not installed\n");
8415 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8416 ok(pf_exists("msitest"), "File not installed\n");
8418 /* restore the SourceList */
8419 res = RegSetValueExA(source, "PackageName", 0, REG_SZ,
8420 (const BYTE *)localpack, lstrlenA(localpack) + 1);
8421 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8423 /* finally remove the product */
8424 r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
8425 INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
8426 "PROPVAR=42");
8427 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
8428 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8429 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8430 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8431 ok(!delete_pf("msitest", FALSE), "File not removed\n");
8433 RegCloseKey(source);
8434 RegCloseKey(props);
8436 error:
8437 DeleteFileA("msitest\\hydrogen");
8438 DeleteFileA("msitest\\helium");
8439 DeleteFileA("msitest\\lithium");
8440 RemoveDirectoryA("msitest");
8441 DeleteFileA(msifile);
8444 static void test_missingcomponent(void)
8446 UINT r;
8448 if (is_process_limited())
8450 skip("process is limited\n");
8451 return;
8454 CreateDirectoryA("msitest", NULL);
8455 create_file("msitest\\hydrogen", 500);
8456 create_file("msitest\\helium", 500);
8457 create_file("msitest\\lithium", 500);
8458 create_file("beryllium", 500);
8460 create_database(msifile, mcomp_tables, sizeof(mcomp_tables) / sizeof(msi_table));
8462 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8464 r = MsiInstallProductA(msifile, "INSTALLLEVEL=10 PROPVAR=42");
8465 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8467 skip("Not enough rights to perform tests\n");
8468 goto error;
8470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8471 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
8472 ok(pf_exists("msitest\\helium"), "File not installed\n");
8473 ok(pf_exists("msitest\\lithium"), "File not installed\n");
8474 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
8475 ok(pf_exists("msitest"), "File not installed\n");
8477 r = MsiInstallProductA(msifile, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
8478 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8479 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
8480 ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
8481 ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
8482 ok(!pf_exists("msitest\\beryllium"), "File installed\n");
8483 ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
8485 error:
8486 DeleteFileA(msifile);
8487 DeleteFileA("msitest\\hydrogen");
8488 DeleteFileA("msitest\\helium");
8489 DeleteFileA("msitest\\lithium");
8490 DeleteFileA("beryllium");
8491 RemoveDirectoryA("msitest");
8494 static void test_sourcedirprop(void)
8496 UINT r;
8497 CHAR props[MAX_PATH];
8499 if (is_process_limited())
8501 skip("process is limited\n");
8502 return;
8505 CreateDirectoryA("msitest", NULL);
8506 create_file("msitest\\augustus", 500);
8508 create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
8510 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8512 r = MsiInstallProductA(msifile, NULL);
8513 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8515 skip("Not enough rights to perform tests\n");
8516 goto error;
8518 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8519 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
8520 ok(delete_pf("msitest", FALSE), "File installed\n");
8522 DeleteFile("msitest\\augustus");
8523 RemoveDirectory("msitest");
8525 CreateDirectoryA("altsource", NULL);
8526 CreateDirectoryA("altsource\\msitest", NULL);
8527 create_file("altsource\\msitest\\augustus", 500);
8529 sprintf(props, "SRCDIR=%s\\altsource\\", CURR_DIR);
8531 r = MsiInstallProductA(msifile, props);
8532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8533 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
8534 ok(delete_pf("msitest", FALSE), "File installed\n");
8536 DeleteFile("altsource\\msitest\\augustus");
8537 RemoveDirectory("altsource\\msitest");
8538 RemoveDirectory("altsource");
8540 error:
8541 DeleteFile("msitest\\augustus");
8542 RemoveDirectory("msitest");
8543 DeleteFile(msifile);
8546 static void test_adminimage(void)
8548 UINT r;
8550 if (is_process_limited())
8552 skip("process is limited\n");
8553 return;
8556 CreateDirectoryA("msitest", NULL);
8557 CreateDirectoryA("msitest\\first", NULL);
8558 CreateDirectoryA("msitest\\second", NULL);
8559 CreateDirectoryA("msitest\\cabout", NULL);
8560 CreateDirectoryA("msitest\\cabout\\new", NULL);
8561 create_file("msitest\\one.txt", 100);
8562 create_file("msitest\\first\\two.txt", 100);
8563 create_file("msitest\\second\\three.txt", 100);
8564 create_file("msitest\\cabout\\four.txt", 100);
8565 create_file("msitest\\cabout\\new\\five.txt", 100);
8566 create_file("msitest\\filename", 100);
8567 create_file("msitest\\service.exe", 100);
8569 create_database_wordcount(msifile, ai_tables,
8570 sizeof(ai_tables) / sizeof(msi_table),
8571 100, msidbSumInfoSourceTypeAdminImage, ";1033");
8573 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8575 r = MsiInstallProductA(msifile, NULL);
8576 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8578 skip("Not enough rights to perform tests\n");
8579 goto error;
8581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8583 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
8584 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
8585 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
8586 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
8587 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
8588 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
8589 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
8590 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
8591 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
8592 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
8593 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
8594 ok(delete_pf("msitest", FALSE), "File not installed\n");
8596 error:
8597 DeleteFileA("msifile");
8598 DeleteFileA("msitest\\cabout\\new\\five.txt");
8599 DeleteFileA("msitest\\cabout\\four.txt");
8600 DeleteFileA("msitest\\second\\three.txt");
8601 DeleteFileA("msitest\\first\\two.txt");
8602 DeleteFileA("msitest\\one.txt");
8603 DeleteFileA("msitest\\service.exe");
8604 DeleteFileA("msitest\\filename");
8605 RemoveDirectoryA("msitest\\cabout\\new");
8606 RemoveDirectoryA("msitest\\cabout");
8607 RemoveDirectoryA("msitest\\second");
8608 RemoveDirectoryA("msitest\\first");
8609 RemoveDirectoryA("msitest");
8612 static void test_propcase(void)
8614 UINT r;
8616 if (is_process_limited())
8618 skip("process is limited\n");
8619 return;
8622 CreateDirectoryA("msitest", NULL);
8623 create_file("msitest\\augustus", 500);
8625 create_database(msifile, pc_tables, sizeof(pc_tables) / sizeof(msi_table));
8627 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8629 r = MsiInstallProductA(msifile, "MyProp=42");
8630 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8632 skip("Not enough rights to perform tests\n");
8633 goto error;
8635 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8636 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
8637 ok(delete_pf("msitest", FALSE), "File not installed\n");
8639 error:
8640 DeleteFile(msifile);
8641 DeleteFile("msitest\\augustus");
8642 RemoveDirectory("msitest");
8645 static void test_int_widths( void )
8647 static const char int0[] = "int0\ni0\nint0\tint0\n1";
8648 static const char int1[] = "int1\ni1\nint1\tint1\n1";
8649 static const char int2[] = "int2\ni2\nint2\tint2\n1";
8650 static const char int3[] = "int3\ni3\nint3\tint3\n1";
8651 static const char int4[] = "int4\ni4\nint4\tint4\n1";
8652 static const char int5[] = "int5\ni5\nint5\tint5\n1";
8653 static const char int8[] = "int8\ni8\nint8\tint8\n1";
8655 static const struct
8657 const char *data;
8658 unsigned int size;
8659 UINT ret;
8661 tests[] =
8663 { int0, sizeof(int0) - 1, ERROR_SUCCESS },
8664 { int1, sizeof(int1) - 1, ERROR_SUCCESS },
8665 { int2, sizeof(int2) - 1, ERROR_SUCCESS },
8666 { int3, sizeof(int3) - 1, ERROR_FUNCTION_FAILED },
8667 { int4, sizeof(int4) - 1, ERROR_SUCCESS },
8668 { int5, sizeof(int5) - 1, ERROR_FUNCTION_FAILED },
8669 { int8, sizeof(int8) - 1, ERROR_FUNCTION_FAILED }
8672 char tmpdir[MAX_PATH], msitable[MAX_PATH], msidb[MAX_PATH];
8673 MSIHANDLE db;
8674 UINT r, i;
8676 GetTempPathA(MAX_PATH, tmpdir);
8677 CreateDirectoryA(tmpdir, NULL);
8679 strcpy(msitable, tmpdir);
8680 strcat(msitable, "\\msitable.idt");
8682 strcpy(msidb, tmpdir);
8683 strcat(msidb, "\\msitest.msi");
8685 r = MsiOpenDatabaseA(msidb, MSIDBOPEN_CREATE, &db);
8686 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8688 for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++)
8690 write_file(msitable, tests[i].data, tests[i].size);
8692 r = MsiDatabaseImportA(db, tmpdir, "msitable.idt");
8693 ok(r == tests[i].ret, " %u expected %u, got %u\n", i, tests[i].ret, r);
8695 r = MsiDatabaseCommit(db);
8696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8697 DeleteFileA(msitable);
8700 MsiCloseHandle(db);
8701 DeleteFileA(msidb);
8702 RemoveDirectoryA(tmpdir);
8705 static void test_shortcut(void)
8707 UINT r;
8708 HRESULT hr;
8710 if (is_process_limited())
8712 skip("process is limited\n");
8713 return;
8716 create_test_files();
8717 create_database(msifile, sc_tables, sizeof(sc_tables) / sizeof(msi_table));
8719 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8721 r = MsiInstallProductA(msifile, NULL);
8722 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8724 skip("Not enough rights to perform tests\n");
8725 goto error;
8727 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8729 hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
8730 ok(SUCCEEDED(hr), "CoInitialize failed 0x%08x\n", hr);
8732 r = MsiInstallProductA(msifile, NULL);
8733 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8735 CoUninitialize();
8737 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
8738 ok(SUCCEEDED(hr), "CoInitialize failed 0x%08x\n", hr);
8740 r = MsiInstallProductA(msifile, NULL);
8741 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8743 CoUninitialize();
8745 delete_pf("msitest\\cabout\\new\\five.txt", TRUE);
8746 delete_pf("msitest\\cabout\\new", FALSE);
8747 delete_pf("msitest\\cabout\\four.txt", TRUE);
8748 delete_pf("msitest\\cabout", FALSE);
8749 delete_pf("msitest\\changed\\three.txt", TRUE);
8750 delete_pf("msitest\\changed", FALSE);
8751 delete_pf("msitest\\first\\two.txt", TRUE);
8752 delete_pf("msitest\\first", FALSE);
8753 delete_pf("msitest\\filename", TRUE);
8754 delete_pf("msitest\\one.txt", TRUE);
8755 delete_pf("msitest\\service.exe", TRUE);
8756 delete_pf("msitest\\Shortcut.lnk", TRUE);
8757 delete_pf("msitest", FALSE);
8759 error:
8760 delete_test_files();
8761 DeleteFile(msifile);
8764 static void test_envvar(void)
8766 UINT r;
8767 HKEY env;
8768 LONG res;
8769 DWORD type, size;
8770 char buffer[16];
8771 UINT i;
8773 if (on_win9x)
8775 win_skip("Environment variables are handled differently on Win9x and WinMe\n");
8776 return;
8778 if (is_process_limited())
8780 skip("process is limited\n");
8781 return;
8784 create_test_files();
8785 create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table));
8787 res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
8788 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8790 res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2);
8791 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8793 res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2);
8794 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8796 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8798 r = MsiInstallProductA(msifile, NULL);
8799 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8801 skip("Not enough rights to perform tests\n");
8802 goto error;
8804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8806 type = REG_NONE;
8807 size = sizeof(buffer);
8808 buffer[0] = 0;
8809 res = RegQueryValueExA(env, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
8810 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8811 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
8812 ok(!lstrcmp(buffer, "1"), "Expected \"1\", got %s\n", buffer);
8814 res = RegDeleteValueA(env, "MSITESTVAR1");
8815 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8817 type = REG_NONE;
8818 size = sizeof(buffer);
8819 buffer[0] = 0;
8820 res = RegQueryValueExA(env, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
8821 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8822 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
8823 ok(!lstrcmp(buffer, "1"), "Expected \"1\", got %s\n", buffer);
8825 res = RegDeleteValueA(env, "MSITESTVAR2");
8826 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8828 res = RegDeleteValueA(env, "MSITESTVAR3");
8829 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8831 res = RegDeleteValueA(env, "MSITESTVAR4");
8832 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
8834 res = RegDeleteValueA(env, "MSITESTVAR5");
8835 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8837 res = RegDeleteValueA(env, "MSITESTVAR6");
8838 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8840 res = RegDeleteValueA(env, "MSITESTVAR7");
8841 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8843 res = RegDeleteValueA(env, "MSITESTVAR8");
8844 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8846 res = RegDeleteValueA(env, "MSITESTVAR9");
8847 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8849 res = RegDeleteValueA(env, "MSITESTVAR10");
8850 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
8852 i = 11;
8853 while (environment_dat_results[(i-11)]) {
8854 char name[20];
8855 sprintf(name, "MSITESTVAR%d", i);
8857 type = REG_NONE;
8858 size = sizeof(buffer);
8859 buffer[0] = 0;
8860 res = RegQueryValueExA(env, name, NULL, &type, (LPBYTE)buffer, &size);
8861 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
8862 ok(type == REG_SZ, "%d: Expected REG_SZ, got %u\n", i, type);
8863 ok(!lstrcmp(buffer, environment_dat_results[(i-11)]), "%d: Expected %s, got %s\n",
8864 i, environment_dat_results[(i-11)], buffer);
8866 res = RegDeleteValueA(env, name);
8867 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
8868 i++;
8871 delete_pf("msitest\\cabout\\new\\five.txt", TRUE);
8872 delete_pf("msitest\\cabout\\new", FALSE);
8873 delete_pf("msitest\\cabout\\four.txt", TRUE);
8874 delete_pf("msitest\\cabout", FALSE);
8875 delete_pf("msitest\\changed\\three.txt", TRUE);
8876 delete_pf("msitest\\changed", FALSE);
8877 delete_pf("msitest\\first\\two.txt", TRUE);
8878 delete_pf("msitest\\first", FALSE);
8879 delete_pf("msitest\\filename", TRUE);
8880 delete_pf("msitest\\one.txt", TRUE);
8881 delete_pf("msitest\\service.exe", TRUE);
8882 delete_pf("msitest", FALSE);
8884 error:
8885 RegDeleteValueA(env, "MSITESTVAR1");
8886 RegDeleteValueA(env, "MSITESTVAR2");
8887 RegCloseKey(env);
8889 delete_test_files();
8890 DeleteFile(msifile);
8893 static void test_preselected(void)
8895 UINT r;
8897 if (is_process_limited())
8899 skip("process is limited\n");
8900 return;
8903 create_test_files();
8904 create_database(msifile, ps_tables, sizeof(ps_tables) / sizeof(msi_table));
8906 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8908 r = MsiInstallProductA(msifile, "ADDLOCAL=One");
8909 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8911 skip("Not enough rights to perform tests\n");
8912 goto error;
8914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8916 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
8917 ok(!delete_pf("msitest\\cabout\\new", FALSE), "File installed\n");
8918 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
8919 ok(!delete_pf("msitest\\cabout", FALSE), "File installed\n");
8920 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
8921 ok(!delete_pf("msitest\\changed", FALSE), "File installed\n");
8922 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
8923 ok(!delete_pf("msitest\\first", FALSE), "File installed\n");
8924 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
8925 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
8926 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
8927 ok(delete_pf("msitest", FALSE), "File not installed\n");
8929 r = MsiInstallProductA(msifile, NULL);
8930 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8932 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
8933 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
8934 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
8935 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
8936 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
8937 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
8938 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
8939 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
8940 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
8941 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
8942 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
8943 ok(delete_pf("msitest", FALSE), "File not installed\n");
8945 error:
8946 delete_test_files();
8947 DeleteFile(msifile);
8950 static void test_installed_prop(void)
8952 static char prodcode[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
8953 UINT r;
8955 if (is_process_limited())
8957 skip("process is limited\n");
8958 return;
8961 create_test_files();
8962 create_database(msifile, ip_tables, sizeof(ip_tables) / sizeof(msi_table));
8964 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
8966 r = MsiInstallProductA(msifile, "FULL=1");
8967 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
8969 skip("Not enough rights to perform tests\n");
8970 goto error;
8972 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8974 r = MsiInstallProductA(msifile, "FULL=1");
8975 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
8977 r = MsiConfigureProductExA(prodcode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, "FULL=1");
8978 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
8980 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
8981 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
8982 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
8983 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
8984 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
8985 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
8986 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
8987 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
8988 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
8989 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
8990 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
8991 ok(delete_pf("msitest", FALSE), "File not installed\n");
8993 r = MsiInstallProductA(msifile, "REMOVE=ALL");
8994 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
8996 error:
8997 delete_test_files();
8998 DeleteFile(msifile);
9001 static void test_allusers_prop(void)
9003 UINT r;
9005 if (is_process_limited())
9007 skip("process is limited\n");
9008 return;
9011 create_test_files();
9012 create_database(msifile, aup_tables, sizeof(aup_tables) / sizeof(msi_table));
9014 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9016 /* ALLUSERS property unset */
9017 r = MsiInstallProductA(msifile, "FULL=1");
9018 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9020 skip("Not enough rights to perform tests\n");
9021 goto error;
9023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9025 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9026 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9027 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9028 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9029 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9030 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9031 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9032 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9033 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9034 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9035 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9036 ok(delete_pf("msitest", FALSE), "File not installed\n");
9038 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9041 delete_test_files();
9043 create_test_files();
9044 create_database(msifile, aup2_tables, sizeof(aup2_tables) / sizeof(msi_table));
9046 /* ALLUSERS property set to 1 */
9047 r = MsiInstallProductA(msifile, "FULL=1");
9048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9050 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9051 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9052 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9053 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9054 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9055 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9056 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9057 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9058 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9059 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9060 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9061 ok(delete_pf("msitest", FALSE), "File not installed\n");
9063 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9066 delete_test_files();
9068 create_test_files();
9069 create_database(msifile, aup3_tables, sizeof(aup3_tables) / sizeof(msi_table));
9071 /* ALLUSERS property set to 2 */
9072 r = MsiInstallProductA(msifile, "FULL=1");
9073 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9075 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9076 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9077 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9078 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9079 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9080 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9081 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9082 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9083 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9084 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9085 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9086 ok(delete_pf("msitest", FALSE), "File not installed\n");
9088 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9091 delete_test_files();
9093 create_test_files();
9094 create_database(msifile, aup4_tables, sizeof(aup4_tables) / sizeof(msi_table));
9096 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
9097 r = MsiInstallProductA(msifile, "FULL=1");
9098 if (r == ERROR_SUCCESS)
9100 /* Win9x/WinMe */
9101 win_skip("Win9x and WinMe act differently with respect to ALLUSERS\n");
9103 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9104 ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
9105 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9106 ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
9107 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9108 ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
9109 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9110 ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
9111 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9112 ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9113 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9114 ok(delete_pf("msitest", FALSE), "File not installed\n");
9116 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9117 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9119 delete_test_files();
9121 else
9122 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9124 error:
9125 delete_test_files();
9126 DeleteFile(msifile);
9129 static char session_manager[] = "System\\CurrentControlSet\\Control\\Session Manager";
9130 static char rename_ops[] = "PendingFileRenameOperations";
9132 static void process_pending_renames(HKEY hkey)
9134 char *buf, *src, *dst, *buf2, *buf2ptr;
9135 DWORD size;
9136 LONG ret;
9137 BOOL found = FALSE;
9139 ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, NULL, &size);
9140 buf = HeapAlloc(GetProcessHeap(), 0, size + 1);
9141 buf2ptr = buf2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 1);
9143 ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, (LPBYTE)buf, &size);
9144 buf[size] = 0;
9145 ok(!ret, "RegQueryValueExA failed %d\n", ret);
9146 if (ret) return;
9148 for (src = buf; *src; src = dst + strlen(dst) + 1)
9150 DWORD flags = MOVEFILE_COPY_ALLOWED;
9152 dst = src + strlen(src) + 1;
9154 if (!strstr(src, "msitest"))
9156 lstrcpyA(buf2ptr, src);
9157 buf2ptr += strlen(src) + 1;
9158 if (*dst)
9160 lstrcpyA(buf2ptr, dst);
9161 buf2ptr += strlen(dst) + 1;
9163 buf2ptr++;
9164 continue;
9167 found = TRUE;
9169 if (*dst == '!')
9171 flags |= MOVEFILE_REPLACE_EXISTING;
9172 dst++;
9174 if (src[0] == '\\' && src[1] == '?' && src[2] == '?' && src[3] == '\\') src += 4;
9175 if (*dst)
9177 if (dst[0] == '\\' && dst[1] == '?' && dst[2] == '?' && dst[3] == '\\') dst += 4;
9178 ok(MoveFileExA(src, dst, flags), "Failed to move file %s -> %s (%u)\n", src, dst, GetLastError());
9180 else
9181 ok(DeleteFileA(src), "Failed to delete file %s (%u)\n", src, GetLastError());
9184 ok(found, "Expected a 'msitest' entry\n");
9186 if (*buf2)
9187 RegSetValueExA(hkey, rename_ops, 0, REG_MULTI_SZ, (LPBYTE)buf2, buf2ptr + 1 - buf2);
9188 else
9189 RegDeleteValueA(hkey, rename_ops);
9191 HeapFree(GetProcessHeap(), 0, buf);
9192 HeapFree(GetProcessHeap(), 0, buf2);
9195 static BOOL file_matches_data(LPCSTR file, LPCSTR data)
9197 DWORD len, data_len = strlen(data);
9198 HANDLE handle;
9199 char buf[128];
9201 handle = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
9202 ok(handle != INVALID_HANDLE_VALUE, "failed to open %s (%u)\n", file, GetLastError());
9204 if (ReadFile(handle, buf, sizeof(buf), &len, NULL) && len >= data_len)
9206 CloseHandle(handle);
9207 return !memcmp(buf, data, data_len);
9209 CloseHandle(handle);
9210 return FALSE;
9213 static void test_file_in_use(void)
9215 UINT r;
9216 HANDLE file;
9217 HKEY hkey;
9218 char path[MAX_PATH];
9220 if (on_win9x)
9222 win_skip("Pending file renaming is implemented differently on Win9x and WinMe\n");
9223 return;
9225 if (is_process_limited())
9227 skip("process is limited\n");
9228 return;
9231 RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey);
9233 CreateDirectoryA("msitest", NULL);
9234 create_file("msitest\\maximus", 500);
9235 create_database(msifile, fiu_tables, sizeof(fiu_tables) / sizeof(msi_table));
9237 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9239 lstrcpy(path, PROG_FILES_DIR);
9240 lstrcat(path, "\\msitest");
9241 CreateDirectoryA(path, NULL);
9243 lstrcat(path, "\\maximus");
9244 file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
9246 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
9247 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9249 skip("Not enough rights to perform tests\n");
9250 goto error;
9252 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
9253 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
9254 CloseHandle(file);
9255 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
9257 process_pending_renames(hkey);
9258 RegCloseKey(hkey);
9260 ok(file_matches_data(path, "msitest\\maximus"), "Expected file to match\n");
9261 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
9262 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
9264 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9265 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9267 error:
9268 RegCloseKey(hkey);
9270 delete_pf("msitest\\maximus", TRUE);
9271 delete_pf("msitest", FALSE);
9272 DeleteFileA("msitest\\maximus");
9273 delete_test_files();
9274 DeleteFile(msifile);
9277 static void test_file_in_use_cab(void)
9279 UINT r;
9280 HANDLE file;
9281 HKEY hkey;
9282 char path[MAX_PATH];
9284 if (on_win9x)
9286 win_skip("Pending file renaming is implemented differently on Win9x and WinMe\n");
9287 return;
9289 if (is_process_limited())
9291 skip("process is limited\n");
9292 return;
9295 RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey);
9297 CreateDirectoryA("msitest", NULL);
9298 create_file("maximus", 500);
9299 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
9300 DeleteFile("maximus");
9302 create_database(msifile, fiuc_tables, sizeof(fiuc_tables) / sizeof(msi_table));
9304 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9306 lstrcpy(path, PROG_FILES_DIR);
9307 lstrcat(path, "\\msitest");
9308 CreateDirectoryA(path, NULL);
9310 lstrcat(path, "\\maximus");
9311 file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
9313 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
9314 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9316 skip("Not enough rights to perform tests\n");
9317 goto error;
9319 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
9320 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
9321 CloseHandle(file);
9322 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
9324 process_pending_renames(hkey);
9325 RegCloseKey(hkey);
9327 ok(file_matches_data(path, "maximus"), "Expected file to match\n");
9328 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
9329 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
9331 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9332 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9334 error:
9335 RegCloseKey(hkey);
9337 delete_pf("msitest\\maximus", TRUE);
9338 delete_pf("msitest", FALSE);
9339 DeleteFileA("msitest\\maximus");
9340 delete_cab_files();
9341 delete_test_files();
9342 DeleteFile(msifile);
9345 static INT CALLBACK handler_a(LPVOID context, UINT type, LPCSTR msg)
9347 return IDOK;
9350 static INT CALLBACK handler_w(LPVOID context, UINT type, LPCWSTR msg)
9352 return IDOK;
9355 static INT CALLBACK handler_record(LPVOID context, UINT type, MSIHANDLE record)
9357 return IDOK;
9360 static void test_MsiSetExternalUI(void)
9362 INSTALLUI_HANDLERA ret_a;
9363 INSTALLUI_HANDLERW ret_w;
9364 INSTALLUI_HANDLER_RECORD prev;
9365 UINT error;
9367 ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL);
9368 ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
9370 ret_a = MsiSetExternalUIA(NULL, 0, NULL);
9371 ok(ret_a == handler_a, "expected %p, got %p\n", handler_a, ret_a);
9373 /* Not present before Installer 3.1 */
9374 if (!pMsiSetExternalUIRecord) {
9375 win_skip("MsiSetExternalUIRecord is not available\n");
9376 return;
9379 error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
9380 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9381 ok(prev == NULL, "expected NULL, got %p\n", prev);
9383 prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
9384 error = pMsiSetExternalUIRecord(NULL, INSTALLLOGMODE_ERROR, NULL, &prev);
9385 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9386 ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev);
9388 ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL);
9389 ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
9391 ret_w = MsiSetExternalUIW(NULL, 0, NULL);
9392 ok(ret_w == handler_w, "expected %p, got %p\n", handler_w, ret_w);
9394 ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL);
9395 ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
9397 ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL);
9398 ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
9400 prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
9401 error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
9402 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9403 ok(prev == NULL, "expected NULL, got %p\n", prev);
9405 ret_a = MsiSetExternalUIA(NULL, 0, NULL);
9406 ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
9408 ret_w = MsiSetExternalUIW(NULL, 0, NULL);
9409 ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
9411 prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
9412 error = pMsiSetExternalUIRecord(NULL, 0, NULL, &prev);
9413 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9414 ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev);
9416 error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, NULL);
9417 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9419 error = pMsiSetExternalUIRecord(NULL, 0, NULL, NULL);
9420 ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
9423 static void test_feature_override(void)
9425 UINT r;
9426 REGSAM access = KEY_ALL_ACCESS;
9428 if (is_process_limited())
9430 skip("process is limited\n");
9431 return;
9434 create_test_files();
9435 create_file("msitest\\override.txt", 1000);
9436 create_file("msitest\\preselected.txt", 1000);
9437 create_file("msitest\\notpreselected.txt", 1000);
9438 create_database(msifile, fo_tables, sizeof(fo_tables) / sizeof(msi_table));
9440 if (is_wow64)
9441 access |= KEY_WOW64_64KEY;
9443 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9445 r = MsiInstallProductA(msifile, "ADDLOCAL=override");
9446 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9448 skip("Not enough rights to perform tests\n");
9449 goto error;
9451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9453 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
9454 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
9455 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
9457 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9460 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
9462 r = MsiInstallProductA(msifile, "preselect=1");
9463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9465 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
9466 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
9467 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
9469 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9470 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9472 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
9473 todo_wine {
9474 ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
9475 ok(delete_pf("msitest", FALSE), "directory removed\n");
9478 r = MsiInstallProductA(msifile, NULL);
9479 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9481 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
9482 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
9483 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
9485 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9486 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9488 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
9489 todo_wine {
9490 ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
9491 ok(delete_pf("msitest", FALSE), "directory removed\n");
9494 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access);
9496 error:
9497 DeleteFileA("msitest\\override.txt");
9498 DeleteFileA("msitest\\preselected.txt");
9499 DeleteFileA("msitest\\notpreselected.txt");
9500 delete_test_files();
9501 DeleteFile(msifile);
9504 static void test_create_folder(void)
9506 UINT r;
9508 create_test_files();
9509 create_database(msifile, cf_tables, sizeof(cf_tables) / sizeof(msi_table));
9511 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9513 r = MsiInstallProductA(msifile, NULL);
9514 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9516 skip("Not enough rights to perform tests\n");
9517 goto error;
9519 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9521 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9522 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9523 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9524 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9525 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9526 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9527 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9528 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9529 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9530 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9531 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9532 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9534 r = MsiInstallProductA(msifile, "LOCAL=Two");
9535 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9537 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9538 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9539 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9540 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9541 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9542 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9543 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9544 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9545 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9546 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9547 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9548 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9550 error:
9551 delete_test_files();
9552 DeleteFile(msifile);
9555 static void test_remove_folder(void)
9557 UINT r;
9559 create_test_files();
9560 create_database(msifile, rf_tables, sizeof(rf_tables) / sizeof(msi_table));
9562 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9564 r = MsiInstallProductA(msifile, NULL);
9565 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9567 skip("Not enough rights to perform tests\n");
9568 goto error;
9570 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9572 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9573 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9574 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9575 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9576 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9577 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9578 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9579 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9580 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9581 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9582 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9583 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9585 r = MsiInstallProductA(msifile, "LOCAL=Two");
9586 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9588 ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
9589 ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
9590 ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
9591 ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n");
9592 ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
9593 ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n");
9594 ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
9595 ok(!delete_pf("msitest\\first", FALSE), "Directory created\n");
9596 ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
9597 ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n");
9598 ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
9599 ok(!delete_pf("msitest", FALSE), "Directory created\n");
9601 error:
9602 delete_test_files();
9603 DeleteFile(msifile);
9606 static void test_start_services(void)
9608 UINT r;
9609 SC_HANDLE scm, service;
9610 BOOL ret;
9611 DWORD error = ERROR_SUCCESS;
9613 if (on_win9x)
9615 win_skip("Services are not implemented on Win9x and WinMe\n");
9616 return;
9618 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
9619 if (!scm && GetLastError() == ERROR_ACCESS_DENIED)
9621 skip("Not enough rights to perform tests\n");
9622 return;
9624 ok(scm != NULL, "Failed to open the SC Manager\n");
9625 if (!scm) return;
9627 service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
9628 if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST)
9630 win_skip("The 'Spooler' service does not exist\n");
9631 CloseServiceHandle(scm);
9632 return;
9634 ok(service != NULL, "Failed to open Spooler, error %d\n", GetLastError());
9635 if (!service) {
9636 CloseServiceHandle(scm);
9637 return;
9640 ret = StartService(service, 0, NULL);
9641 if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING)
9643 skip("Terminal service not available, skipping test\n");
9644 CloseServiceHandle(service);
9645 CloseServiceHandle(scm);
9646 return;
9649 CloseServiceHandle(service);
9650 CloseServiceHandle(scm);
9652 create_test_files();
9653 create_database(msifile, sss_tables, sizeof(sss_tables) / sizeof(msi_table));
9655 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9657 r = MsiInstallProductA(msifile, NULL);
9658 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9660 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9661 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9662 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9663 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9664 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9665 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9666 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9667 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9668 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9669 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9670 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9671 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9673 delete_test_files();
9674 DeleteFile(msifile);
9676 if (error == ERROR_SUCCESS)
9678 SERVICE_STATUS status;
9680 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
9681 service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
9683 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
9684 ok(ret, "ControlService failed %u\n", GetLastError());
9686 CloseServiceHandle(service);
9687 CloseServiceHandle(scm);
9691 static void test_delete_services(void)
9693 UINT r;
9695 if (on_win9x)
9697 win_skip("Services are not implemented on Win9x and WinMe\n");
9698 return;
9700 if (is_process_limited())
9702 skip("process is limited\n");
9703 return;
9706 create_test_files();
9707 create_database(msifile, sds_tables, sizeof(sds_tables) / sizeof(msi_table));
9709 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9711 r = MsiInstallProductA(msifile, NULL);
9712 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9714 skip("Not enough rights to perform tests\n");
9715 goto error;
9717 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9719 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9720 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9722 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9723 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9724 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9725 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9726 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9727 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9728 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9729 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9730 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9731 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9732 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9733 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9735 error:
9736 delete_test_files();
9737 DeleteFile(msifile);
9740 static void test_self_registration(void)
9742 UINT r;
9744 if (is_process_limited())
9746 skip("process is limited\n");
9747 return;
9750 create_test_files();
9751 create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table));
9753 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9755 r = MsiInstallProductA(msifile, NULL);
9756 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9758 skip("Not enough rights to perform tests\n");
9759 goto error;
9761 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9763 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9764 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9765 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9766 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9767 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9768 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9769 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9770 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9771 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9772 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9773 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9774 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9776 error:
9777 delete_test_files();
9778 DeleteFile(msifile);
9781 static void test_register_font(void)
9783 static const char regfont1[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
9784 static const char regfont2[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
9785 LONG ret;
9786 HKEY key;
9787 UINT r;
9788 REGSAM access = KEY_ALL_ACCESS;
9790 if (is_process_limited())
9792 skip("process is limited\n");
9793 return;
9796 create_test_files();
9797 create_file("msitest\\font.ttf", 1000);
9798 create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table));
9800 if (is_wow64)
9801 access |= KEY_WOW64_64KEY;
9803 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9805 r = MsiInstallProductA(msifile, NULL);
9806 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9808 skip("Not enough rights to perform tests\n");
9809 goto error;
9811 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9813 ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont1, 0, access, &key);
9814 if (ret)
9815 RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont2, 0, access, &key);
9817 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
9818 ok(ret != ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
9820 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9821 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9823 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
9825 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
9826 ok(ret == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
9828 RegDeleteValueA(key, "msi test font");
9829 RegCloseKey(key);
9831 error:
9832 DeleteFileA("msitest\\font.ttf");
9833 delete_test_files();
9834 DeleteFile(msifile);
9837 static void test_validate_product_id(void)
9839 UINT r;
9841 if (is_process_limited())
9843 skip("process is limited\n");
9844 return;
9847 create_test_files();
9848 create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table));
9850 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9852 r = MsiInstallProductA(msifile, NULL);
9853 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9855 skip("Not enough rights to perform tests\n");
9856 goto error;
9858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9860 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=1");
9861 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9863 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=2");
9864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9866 r = MsiInstallProductA(msifile, "PIDKEY=123-1234567");
9867 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9869 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
9870 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
9871 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
9872 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
9873 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
9874 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
9875 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
9876 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
9877 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
9878 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
9879 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
9880 ok(delete_pf("msitest", FALSE), "Directory not created\n");
9882 error:
9883 delete_test_files();
9884 DeleteFile(msifile);
9887 static void test_install_remove_odbc(void)
9889 UINT r;
9891 if (is_process_limited())
9893 skip("process is limited\n");
9894 return;
9897 create_test_files();
9898 create_file("msitest\\ODBCdriver.dll", 1000);
9899 create_file("msitest\\ODBCdriver2.dll", 1000);
9900 create_file("msitest\\ODBCtranslator.dll", 1000);
9901 create_file("msitest\\ODBCtranslator2.dll", 1000);
9902 create_file("msitest\\ODBCsetup.dll", 1000);
9903 create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table));
9905 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9907 r = MsiInstallProductA(msifile, NULL);
9908 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9910 skip("Not enough rights to perform tests\n");
9911 goto error;
9913 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9915 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
9916 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
9917 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
9918 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
9919 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
9921 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9922 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9924 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not removed\n");
9925 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not removed\n");
9926 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not removed\n");
9927 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not removed\n");
9928 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
9929 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
9931 error:
9932 DeleteFileA("msitest\\ODBCdriver.dll");
9933 DeleteFileA("msitest\\ODBCdriver2.dll");
9934 DeleteFileA("msitest\\ODBCtranslator.dll");
9935 DeleteFileA("msitest\\ODBCtranslator2.dll");
9936 DeleteFileA("msitest\\ODBCsetup.dll");
9937 delete_test_files();
9938 DeleteFile(msifile);
9941 static void test_register_typelib(void)
9943 UINT r;
9945 if (is_process_limited())
9947 skip("process is limited\n");
9948 return;
9951 create_test_files();
9952 create_file("msitest\\typelib.dll", 1000);
9953 create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table));
9955 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9957 r = MsiInstallProductA(msifile, "REGISTER_TYPELIB=1");
9958 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9960 skip("Not enough rights to perform tests\n");
9961 goto error;
9963 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
9965 r = MsiInstallProductA(msifile, NULL);
9966 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9968 r = MsiInstallProductA(msifile, "REMOVE=ALL");
9969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
9971 ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n");
9972 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
9974 error:
9975 DeleteFileA("msitest\\typelib.dll");
9976 delete_test_files();
9977 DeleteFile(msifile);
9980 static void test_create_remove_shortcut(void)
9982 UINT r;
9984 if (is_process_limited())
9986 skip("process is limited\n");
9987 return;
9990 create_test_files();
9991 create_file("msitest\\target.txt", 1000);
9992 create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table));
9994 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
9996 r = MsiInstallProductA(msifile, NULL);
9997 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
9999 skip("Not enough rights to perform tests\n");
10000 goto error;
10002 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10004 ok(pf_exists("msitest\\target.txt"), "file not created\n");
10005 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
10007 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10008 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10010 ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n");
10011 ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n");
10012 todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10014 error:
10015 DeleteFileA("msitest\\target.txt");
10016 delete_test_files();
10017 DeleteFile(msifile);
10020 static void test_publish_components(void)
10022 static char keypath[] =
10023 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
10025 UINT r;
10026 LONG res;
10027 HKEY key;
10029 if (is_process_limited())
10031 skip("process is limited\n");
10032 return;
10035 create_test_files();
10036 create_file("msitest\\english.txt", 1000);
10037 create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table));
10039 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10041 r = MsiInstallProductA(msifile, NULL);
10042 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10044 skip("Not enough rights to perform tests\n");
10045 goto error;
10047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10049 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
10050 ok(res == ERROR_SUCCESS, "components key not created %d\n", res);
10052 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL);
10053 ok(res == ERROR_SUCCESS, "value not found %d\n", res);
10054 RegCloseKey(key);
10056 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10057 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10059 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
10060 ok(res == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", res);
10062 ok(!delete_pf("msitest\\english.txt", TRUE), "file not removed\n");
10063 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10065 error:
10066 DeleteFileA("msitest\\english.txt");
10067 delete_test_files();
10068 DeleteFile(msifile);
10071 static void test_remove_duplicate_files(void)
10073 UINT r;
10075 if (is_process_limited())
10077 skip("process is limited\n");
10078 return;
10081 create_test_files();
10082 create_file("msitest\\original.txt", 1000);
10083 create_file("msitest\\original2.txt", 1000);
10084 create_file("msitest\\original3.txt", 1000);
10085 create_database(msifile, rd_tables, sizeof(rd_tables) / sizeof(msi_table));
10087 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10089 r = MsiInstallProductA(msifile, NULL);
10090 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10092 skip("Not enough rights to perform tests\n");
10093 goto error;
10095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10097 ok(pf_exists("msitest\\original.txt"), "file not created\n");
10098 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
10099 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
10100 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
10101 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
10103 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10104 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10106 ok(delete_pf("msitest\\original.txt", TRUE), "file removed\n");
10107 ok(!delete_pf("msitest\\original2.txt", TRUE), "file not removed\n");
10108 ok(!delete_pf("msitest\\original3.txt", TRUE), "file not removed\n");
10109 ok(!delete_pf("msitest\\duplicate.txt", TRUE), "file not removed\n");
10110 ok(!delete_pf("msitest\\duplicate2.txt", TRUE), "file not removed\n");
10111 ok(delete_pf("msitest", FALSE), "directory removed\n");
10113 error:
10114 DeleteFileA("msitest\\original.txt");
10115 DeleteFileA("msitest\\original2.txt");
10116 DeleteFileA("msitest\\original3.txt");
10117 delete_test_files();
10118 DeleteFile(msifile);
10121 static void test_remove_registry_values(void)
10123 UINT r;
10124 LONG res;
10125 HKEY key;
10126 REGSAM access = KEY_ALL_ACCESS;
10128 if (is_process_limited())
10130 skip("process is limited\n");
10131 return;
10134 create_test_files();
10135 create_file("msitest\\registry.txt", 1000);
10136 create_database(msifile, rrv_tables, sizeof(rrv_tables) / sizeof(msi_table));
10138 if (is_wow64)
10139 access |= KEY_WOW64_64KEY;
10141 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10143 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, NULL, 0, access, NULL, &key, NULL);
10144 RegSetValueExA(key, "value1", 0, REG_SZ, (const BYTE *)"1", 2);
10145 RegCloseKey(key);
10147 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
10148 RegSetValueExA(key, "value2", 0, REG_SZ, (const BYTE *)"2", 2);
10149 RegCloseKey(key);
10151 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, NULL, 0, access, NULL, &key, NULL);
10152 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
10153 RegSetValueExA(key, "valueA", 0, REG_SZ, (const BYTE *)"A", 2);
10154 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
10155 RegCloseKey(key);
10157 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, NULL, 0, access, NULL, &key, NULL);
10158 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
10159 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
10160 RegCloseKey(key);
10162 r = MsiInstallProductA(msifile, NULL);
10163 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10165 skip("Not enough rights to perform tests\n");
10166 goto error;
10168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10170 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, access, &key);
10171 ok(res == ERROR_SUCCESS, "key removed\n");
10172 RegCloseKey(key);
10174 if (is_64bit && !is_wow64)
10176 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
10177 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10179 else
10181 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
10182 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10185 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
10186 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10187 RegCloseKey(key);
10189 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10192 if (is_64bit && !is_wow64)
10194 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
10195 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10197 else
10199 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
10200 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10203 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, access, &key);
10204 ok(res == ERROR_SUCCESS, "key removed\n");
10205 RegCloseKey(key);
10207 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, access, &key);
10208 ok(res == ERROR_SUCCESS, "key removed\n");
10209 RegCloseKey(key);
10211 if (is_64bit && !is_wow64)
10213 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
10214 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10216 else
10218 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
10219 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10222 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
10223 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
10224 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine", access);
10226 ok(!delete_pf("msitest\\registry.txt", TRUE), "file not removed\n");
10227 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10229 error:
10230 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", access);
10231 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
10232 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
10233 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", access);
10235 DeleteFileA("msitest\\registry.txt");
10236 delete_test_files();
10237 DeleteFile(msifile);
10240 static void test_find_related_products(void)
10242 UINT r;
10244 if (is_process_limited())
10246 skip("process is limited\n");
10247 return;
10250 create_test_files();
10251 create_file("msitest\\product.txt", 1000);
10252 create_database(msifile, frp_tables, sizeof(frp_tables) / sizeof(msi_table));
10254 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10256 r = MsiInstallProductA(msifile, NULL);
10257 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10259 skip("Not enough rights to perform tests\n");
10260 goto error;
10262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10264 /* install again, so it finds the upgrade code */
10265 r = MsiInstallProductA(msifile, NULL);
10266 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10268 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10271 ok(!delete_pf("msitest\\product.txt", TRUE), "file not removed\n");
10272 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10274 error:
10275 DeleteFileA("msitest\\product.txt");
10276 delete_test_files();
10277 DeleteFile(msifile);
10280 static void test_remove_ini_values(void)
10282 UINT r;
10283 DWORD len;
10284 char inifile[MAX_PATH], buf[0x10];
10285 HANDLE file;
10286 BOOL ret;
10288 if (is_process_limited())
10290 skip("process is limited\n");
10291 return;
10294 create_test_files();
10295 create_file("msitest\\inifile.txt", 1000);
10296 create_database(msifile, riv_tables, sizeof(riv_tables) / sizeof(msi_table));
10298 lstrcpyA(inifile, PROG_FILES_DIR);
10299 lstrcatA(inifile, "\\msitest");
10300 ret = CreateDirectoryA(inifile, NULL);
10301 if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
10303 skip("Not enough rights to perform tests\n");
10304 goto error;
10306 lstrcatA(inifile, "\\test.ini");
10307 file = CreateFileA(inifile, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0, NULL);
10308 CloseHandle(file);
10310 ret = WritePrivateProfileStringA("section1", "key1", "value1", inifile);
10311 ok(ret, "failed to write profile string %u\n", GetLastError());
10313 ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile);
10314 ok(ret, "failed to write profile string %u\n", GetLastError());
10316 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10318 r = MsiInstallProductA(msifile, NULL);
10319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10321 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
10322 ok(len == 6, "got %u expected 6\n", len);
10324 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
10325 ok(!len, "got %u expected 0\n", len);
10327 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10328 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10330 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
10331 ok(!len, "got %u expected 0\n", len);
10333 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
10334 ok(!len, "got %u expected 0\n", len);
10336 todo_wine ok(!delete_pf("msitest\\test.ini", TRUE), "file removed\n");
10337 ok(!delete_pf("msitest\\inifile.txt", TRUE), "file not removed\n");
10338 ok(delete_pf("msitest", FALSE), "directory removed\n");
10340 error:
10341 DeleteFileA("msitest\\inifile.txt");
10342 delete_test_files();
10343 DeleteFile(msifile);
10346 static void test_remove_env_strings(void)
10348 UINT r;
10349 LONG res;
10350 HKEY key;
10351 DWORD type, size;
10352 char buffer[0x10];
10354 if (on_win9x)
10356 win_skip("Environment variables are handled differently on win9x and winme\n");
10357 return;
10359 if (is_process_limited())
10361 skip("process is limited\n");
10362 return;
10365 create_test_files();
10366 create_file("msitest\\envvar.txt", 1000);
10367 create_database(msifile, res_tables, sizeof(res_tables) / sizeof(msi_table));
10369 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10371 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
10372 ok(!res, "failed to open environment key %d\n", res);
10374 RegSetValueExA(key, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"1", 2);
10375 RegSetValueExA(key, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"1", 2);
10376 RegSetValueExA(key, "MSITESTVAR3", 0, REG_SZ, (const BYTE *)"1", 2);
10377 RegSetValueExA(key, "MSITESTVAR4", 0, REG_SZ, (const BYTE *)"1", 2);
10378 RegSetValueExA(key, "MSITESTVAR5", 0, REG_SZ, (const BYTE *)"1", 2);
10380 RegCloseKey(key);
10382 r = MsiInstallProductA(msifile, NULL);
10383 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10385 skip("Not enough rights to perform tests\n");
10386 goto error;
10388 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10390 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
10391 ok(!res, "failed to open environment key %d\n", res);
10393 type = REG_NONE;
10394 buffer[0] = 0;
10395 size = sizeof(buffer);
10396 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
10397 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10398 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10399 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10401 type = REG_NONE;
10402 buffer[0] = 0;
10403 size = sizeof(buffer);
10404 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
10405 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10406 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10407 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10409 type = REG_NONE;
10410 buffer[0] = 0;
10411 size = sizeof(buffer);
10412 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
10413 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10414 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10415 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10417 type = REG_NONE;
10418 buffer[0] = 0;
10419 size = sizeof(buffer);
10420 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, &type, (LPBYTE)buffer, &size);
10421 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10422 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10423 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10425 type = REG_NONE;
10426 buffer[0] = 0;
10427 size = sizeof(buffer);
10428 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
10429 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10430 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10431 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10433 RegCloseKey(key);
10435 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10436 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10438 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
10439 ok(!res, "failed to open environment key %d\n", res);
10441 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, NULL, NULL, NULL);
10442 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
10444 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, NULL, NULL, NULL);
10445 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
10447 type = REG_NONE;
10448 buffer[0] = 0;
10449 size = sizeof(buffer);
10450 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
10451 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10452 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10453 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10454 RegDeleteValueA(key, "MSITESTVAR3");
10456 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, NULL, NULL, NULL);
10457 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
10459 type = REG_NONE;
10460 buffer[0] = 0;
10461 size = sizeof(buffer);
10462 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
10463 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
10464 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
10465 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
10466 RegDeleteValueA(key, "MSITESTVAR5");
10468 ok(!delete_pf("msitest\\envvar.txt", TRUE), "file not removed\n");
10469 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10471 error:
10472 RegDeleteValueA(key, "MSITESTVAR1");
10473 RegDeleteValueA(key, "MSITESTVAR2");
10474 RegDeleteValueA(key, "MSITESTVAR3");
10475 RegDeleteValueA(key, "MSITESTVAR4");
10476 RegDeleteValueA(key, "MSITESTVAR5");
10477 RegCloseKey(key);
10479 DeleteFileA("msitest\\envvar.txt");
10480 delete_test_files();
10481 DeleteFile(msifile);
10484 static void test_register_class_info(void)
10486 UINT r;
10487 LONG res;
10488 HKEY hkey;
10490 if (is_process_limited())
10492 skip("process is limited\n");
10493 return;
10496 create_test_files();
10497 create_file("msitest\\class.txt", 1000);
10498 create_database(msifile, rci_tables, sizeof(rci_tables) / sizeof(msi_table));
10500 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10502 r = MsiInstallProductA(msifile, NULL);
10503 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10505 skip("Not enough rights to perform tests\n");
10506 goto error;
10508 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10510 if (is_64bit && !is_wow64)
10511 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10512 else
10513 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10514 ok(res == ERROR_SUCCESS, "key not created\n");
10515 RegCloseKey(hkey);
10517 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10518 ok(res == ERROR_SUCCESS, "key not created\n");
10519 RegCloseKey(hkey);
10521 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
10522 ok(res == ERROR_SUCCESS, "key not created\n");
10523 RegCloseKey(hkey);
10525 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10528 if (is_64bit && !is_wow64)
10529 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10530 else
10531 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10532 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10534 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
10535 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10537 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
10538 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10540 ok(!delete_pf("msitest\\class.txt", TRUE), "file not removed\n");
10541 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10543 error:
10544 DeleteFileA("msitest\\class.txt");
10545 delete_test_files();
10546 DeleteFile(msifile);
10549 static void test_register_extension_info(void)
10551 UINT r;
10552 LONG res;
10553 HKEY hkey;
10555 if (is_process_limited())
10557 skip("process is limited\n");
10558 return;
10561 create_test_files();
10562 create_file("msitest\\extension.txt", 1000);
10563 create_database(msifile, rei_tables, sizeof(rei_tables) / sizeof(msi_table));
10565 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10567 r = MsiInstallProductA(msifile, NULL);
10568 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10570 skip("Not enough rights to perform tests\n");
10571 goto error;
10573 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10575 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
10576 ok(res == ERROR_SUCCESS, "key not created\n");
10577 RegCloseKey(hkey);
10579 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &hkey);
10580 ok(res == ERROR_SUCCESS, "key not created\n");
10581 RegCloseKey(hkey);
10583 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10584 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10586 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
10587 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10589 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1", &hkey);
10590 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10592 ok(!delete_pf("msitest\\extension.txt", TRUE), "file not removed\n");
10593 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10595 error:
10596 DeleteFileA("msitest\\extension.txt");
10597 delete_test_files();
10598 DeleteFile(msifile);
10601 static void test_register_mime_info(void)
10603 UINT r;
10604 LONG res;
10605 HKEY hkey;
10607 if (is_process_limited())
10609 skip("process is limited\n");
10610 return;
10613 create_test_files();
10614 create_file("msitest\\mime.txt", 1000);
10615 create_database(msifile, rmi_tables, sizeof(rmi_tables) / sizeof(msi_table));
10617 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10619 r = MsiInstallProductA(msifile, NULL);
10620 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10622 skip("Not enough rights to perform tests\n");
10623 goto error;
10625 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10627 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
10628 ok(res == ERROR_SUCCESS, "key not created\n");
10629 RegCloseKey(hkey);
10631 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10632 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10634 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
10635 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
10637 ok(!delete_pf("msitest\\mime.txt", TRUE), "file not removed\n");
10638 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10640 error:
10641 DeleteFileA("msitest\\mime.txt");
10642 delete_test_files();
10643 DeleteFile(msifile);
10646 static void test_icon_table(void)
10648 MSIHANDLE hdb = 0, record;
10649 LPCSTR query;
10650 UINT res;
10651 CHAR path[MAX_PATH], win9xpath[MAX_PATH];
10652 static const char prodcode[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
10654 if (is_process_limited())
10656 skip("process is limited\n");
10657 return;
10660 create_database(msifile, icon_base_tables, sizeof(icon_base_tables) / sizeof(msi_table));
10662 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10664 res = MsiOpenDatabase(msifile, MSIDBOPEN_TRANSACT, &hdb);
10665 ok(res == ERROR_SUCCESS, "failed to open db: %d\n", res);
10667 query = "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
10668 res = run_query( hdb, 0, query );
10669 ok(res == ERROR_SUCCESS, "Can't create Icon table: %d\n", res);
10671 create_file("icon.ico", 100);
10672 record = MsiCreateRecord(1);
10673 res = MsiRecordSetStream(record, 1, "icon.ico");
10674 ok(res == ERROR_SUCCESS, "Failed to add stream data to record: %d\n", res);
10675 DeleteFile("icon.ico");
10677 query = "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
10678 res = run_query(hdb, record, query);
10679 ok(res == ERROR_SUCCESS, "Insert into Icon table failed: %d\n", res);
10681 res = MsiCloseHandle(record);
10682 ok(res == ERROR_SUCCESS, "Failed to close record handle: %d\n", res);
10683 res = MsiDatabaseCommit(hdb);
10684 ok(res == ERROR_SUCCESS, "Failed to commit database: %d\n", res);
10685 res = MsiCloseHandle(hdb);
10686 ok(res == ERROR_SUCCESS, "Failed to close database: %d\n", res);
10688 /* per-user */
10689 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
10690 if (res == ERROR_INSTALL_PACKAGE_REJECTED)
10692 skip("Not enough rights to perform tests\n");
10693 DeleteFile(msifile);
10694 return;
10696 ok(res == ERROR_SUCCESS, "Failed to do per-user install: %d\n", res);
10698 lstrcpyA(path, APP_DATA_DIR);
10699 lstrcatA(path, "\\");
10700 lstrcatA(path, "Microsoft\\Installer\\");
10701 lstrcatA(path, prodcode);
10702 lstrcatA(path, "\\testicon");
10703 ok(file_exists(path), "Per-user icon file isn't where it's expected (%s)\n", path);
10705 res = MsiInstallProductA(msifile, "REMOVE=ALL");
10706 ok(res == ERROR_SUCCESS, "Failed to uninstall per-user\n");
10708 /* system-wide */
10709 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
10710 ok(res == ERROR_SUCCESS, "Failed to system-wide install: %d\n", res);
10712 /* win9x with MSI 2.0 installs the icon to a different folder, same as above */
10713 lstrcpyA(win9xpath, APP_DATA_DIR);
10714 lstrcatA(win9xpath, "\\");
10715 lstrcatA(win9xpath, "Microsoft\\Installer\\");
10716 lstrcatA(win9xpath, prodcode);
10717 lstrcatA(win9xpath, "\\testicon");
10719 lstrcpyA(path, WINDOWS_DIR);
10720 lstrcatA(path, "\\");
10721 lstrcatA(path, "Installer\\");
10722 lstrcatA(path, prodcode);
10723 lstrcatA(path, "\\testicon");
10724 ok(file_exists(path) || file_exists(win9xpath),
10725 "System-wide icon file isn't where it's expected (%s)\n", path);
10727 res = MsiInstallProductA(msifile, "REMOVE=ALL");
10728 ok(res == ERROR_SUCCESS, "Failed to uninstall system-wide\n");
10730 delete_pfmsitest_files();
10731 DeleteFile(msifile);
10734 static void test_sourcedir_props(void)
10736 UINT r;
10738 if (on_win9x)
10740 win_skip("skipping sourcedir tests on win9x\n");
10741 return;
10743 if (is_process_limited())
10745 skip("process is limited\n");
10746 return;
10749 create_test_files();
10750 create_file("msitest\\sourcedir.txt", 1000);
10751 create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table));
10753 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
10755 /* full UI, no ResolveSource action */
10756 r = MsiInstallProductA(msifile, NULL);
10757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10759 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10760 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10762 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10763 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10765 /* full UI, ResolveSource action */
10766 r = MsiInstallProductA(msifile, "ResolveSource=1");
10767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10769 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10770 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10772 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10773 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10775 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10777 /* no UI, no ResolveSource action */
10778 r = MsiInstallProductA(msifile, NULL);
10779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10781 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10784 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10785 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10787 /* no UI, ResolveSource action */
10788 r = MsiInstallProductA(msifile, "ResolveSource=1");
10789 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10791 r = MsiInstallProductA(msifile, "REMOVE=ALL");
10792 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10794 ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
10795 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
10797 DeleteFileA("msitest\\sourcedir.txt");
10798 DeleteFile(msifile);
10801 static void test_package_validation(void)
10803 UINT r;
10805 if (is_process_limited())
10807 skip("process is limited\n");
10808 return;
10811 CreateDirectoryA("msitest", NULL);
10812 create_file("msitest\\maximus", 500);
10813 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1033");
10815 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
10817 r = MsiInstallProductA(msifile, NULL);
10818 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
10820 skip("Not enough rights to perform tests\n");
10821 goto error;
10823 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10824 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10825 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10827 DeleteFile(msifile);
10828 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9999");
10830 r = MsiInstallProductA(msifile, NULL);
10831 ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
10832 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10833 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10835 DeleteFile(msifile);
10836 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel32;0");
10838 r = MsiInstallProductA(msifile, NULL);
10839 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
10840 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10841 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10843 if (is_64bit && !is_wow64)
10845 DeleteFile(msifile);
10846 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
10848 r = MsiInstallProductA(msifile, NULL);
10849 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10850 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10851 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10853 DeleteFile(msifile);
10854 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
10856 r = MsiInstallProductA(msifile, NULL);
10857 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
10858 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10859 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10861 DeleteFile(msifile);
10862 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
10864 r = MsiInstallProductA(msifile, NULL);
10865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10866 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10867 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10869 else if (is_wow64)
10871 DeleteFile(msifile);
10872 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
10874 r = MsiInstallProductA(msifile, NULL);
10875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10876 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10877 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10879 DeleteFile(msifile);
10880 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
10882 r = MsiInstallProductA(msifile, NULL);
10883 ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
10884 ok(!delete_pf_native("msitest\\maximus", TRUE), "file exists\n");
10885 ok(!delete_pf_native("msitest", FALSE), "directory exists\n");
10887 DeleteFile(msifile);
10888 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
10890 r = MsiInstallProductA(msifile, NULL);
10891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10892 ok(delete_pf_native("msitest\\maximus", TRUE), "file exists\n");
10893 ok(delete_pf_native("msitest", FALSE), "directory exists\n");
10895 else
10897 DeleteFile(msifile);
10898 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
10900 r = MsiInstallProductA(msifile, NULL);
10901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
10902 ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
10903 ok(delete_pf("msitest", FALSE), "directory does not exist\n");
10905 DeleteFile(msifile);
10906 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
10908 r = MsiInstallProductA(msifile, NULL);
10909 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
10910 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10911 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10913 DeleteFile(msifile);
10914 create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
10916 r = MsiInstallProductA(msifile, NULL);
10917 ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
10918 ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
10919 ok(!delete_pf("msitest", FALSE), "directory exists\n");
10922 error:
10923 /* Delete the files in the temp (current) folder */
10924 DeleteFile(msifile);
10925 DeleteFile("msitest\\maximus");
10926 RemoveDirectory("msitest");
10929 START_TEST(install)
10931 DWORD len;
10932 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
10933 STATEMGRSTATUS status;
10934 BOOL ret = FALSE;
10936 init_functionpointers();
10938 on_win9x = check_win9x();
10940 if (pIsWow64Process)
10941 pIsWow64Process(GetCurrentProcess(), &is_wow64);
10943 GetCurrentDirectoryA(MAX_PATH, prev_path);
10944 GetTempPath(MAX_PATH, temp_path);
10945 SetCurrentDirectoryA(temp_path);
10947 lstrcpyA(CURR_DIR, temp_path);
10948 len = lstrlenA(CURR_DIR);
10950 if(len && (CURR_DIR[len - 1] == '\\'))
10951 CURR_DIR[len - 1] = 0;
10953 get_system_dirs();
10954 get_user_dirs();
10956 /* Create a restore point ourselves so we circumvent the multitude of restore points
10957 * that would have been created by all the installation and removal tests.
10959 if (pSRSetRestorePointA)
10961 memset(&status, 0, sizeof(status));
10962 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
10965 /* Create only one log file and don't append. We have to pass something
10966 * for the log mode for this to work. The logfile needs to have an absolute
10967 * path otherwise we still end up with some extra logfiles as some tests
10968 * change the current directory.
10970 lstrcpyA(log_file, temp_path);
10971 lstrcatA(log_file, "\\msitest.log");
10972 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
10974 test_MsiInstallProduct();
10975 test_MsiSetComponentState();
10976 test_packagecoltypes();
10977 test_continuouscabs();
10978 test_caborder();
10979 test_mixedmedia();
10980 test_samesequence();
10981 test_uiLevelFlags();
10982 test_readonlyfile();
10983 test_readonlyfile_cab();
10984 test_setdirproperty();
10985 test_cabisextracted();
10986 test_concurrentinstall();
10987 test_setpropertyfolder();
10988 test_publish_registerproduct();
10989 test_publish_publishproduct();
10990 test_publish_publishfeatures();
10991 test_publish_registeruser();
10992 test_publish_processcomponents();
10993 test_publish();
10994 test_publishsourcelist();
10995 test_transformprop();
10996 test_currentworkingdir();
10997 test_admin();
10998 test_adminprops();
10999 test_removefiles();
11000 test_movefiles();
11001 test_missingcab();
11002 test_duplicatefiles();
11003 test_writeregistryvalues();
11004 test_sourcefolder();
11005 test_customaction51();
11006 test_installstate();
11007 test_sourcepath();
11008 test_MsiConfigureProductEx();
11009 test_missingcomponent();
11010 test_sourcedirprop();
11011 test_adminimage();
11012 test_propcase();
11013 test_int_widths();
11014 test_shortcut();
11015 test_envvar();
11016 test_lastusedsource();
11017 test_preselected();
11018 test_installed_prop();
11019 test_file_in_use();
11020 test_file_in_use_cab();
11021 test_MsiSetExternalUI();
11022 test_allusers_prop();
11023 test_feature_override();
11024 test_create_folder();
11025 test_remove_folder();
11026 test_start_services();
11027 test_delete_services();
11028 test_self_registration();
11029 test_register_font();
11030 test_validate_product_id();
11031 test_install_remove_odbc();
11032 test_register_typelib();
11033 test_create_remove_shortcut();
11034 test_publish_components();
11035 test_remove_duplicate_files();
11036 test_remove_registry_values();
11037 test_find_related_products();
11038 test_remove_ini_values();
11039 test_remove_env_strings();
11040 test_register_class_info();
11041 test_register_extension_info();
11042 test_register_mime_info();
11043 test_icon_table();
11044 test_sourcedir_props();
11045 test_package_validation();
11047 DeleteFileA(log_file);
11049 if (pSRSetRestorePointA && ret)
11051 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
11052 if (ret)
11053 remove_restore_point(status.llSequenceNumber);
11055 FreeLibrary(hsrclient);
11057 SetCurrentDirectoryA(prev_path);