2 * Copyright (C) 2006 James Hawkins
3 * Copyright 2010 Hans Leidekker for CodeWeavers
5 * Tests concentrating on standard actions
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define _WIN32_MSI 300
30 #include <srrestoreptapi.h>
32 #include "wine/test.h"
34 static UINT (WINAPI *pMsiQueryComponentStateA)
35 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
36 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
37 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
38 static UINT (WINAPI *pMsiSourceListGetInfoA)
39 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
40 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
41 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
43 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
44 static BOOL (WINAPI *pGetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, LPVOID, DWORD, PDWORD);
45 static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE);
46 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
47 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
49 static HMODULE hsrclient;
50 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
51 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
54 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
56 static const char *msifile = "msitest.msi";
57 static CHAR CURR_DIR[MAX_PATH];
58 static CHAR PROG_FILES_DIR[MAX_PATH];
59 static CHAR COMMON_FILES_DIR[MAX_PATH];
60 static CHAR APP_DATA_DIR[MAX_PATH];
61 static CHAR WINDOWS_DIR[MAX_PATH];
63 /* msi database data */
65 static const char component_dat[] =
66 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
67 "s72\tS38\ts72\ti2\tS255\tS72\n"
68 "Component\tComponent\n"
69 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
70 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
71 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
72 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
73 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
74 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
75 "component\t\tMSITESTDIR\t0\t1\tfile\n"
76 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
77 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2";
79 static const char directory_dat[] =
80 "Directory\tDirectory_Parent\tDefaultDir\n"
82 "Directory\tDirectory\n"
83 "CABOUTDIR\tMSITESTDIR\tcabout\n"
84 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
85 "FIRSTDIR\tMSITESTDIR\tfirst\n"
86 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
87 "NEWDIR\tCABOUTDIR\tnew\n"
88 "ProgramFilesFolder\tTARGETDIR\t.\n"
89 "TARGETDIR\t\tSourceDir";
91 static const char feature_dat[] =
92 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
93 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
95 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
96 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
97 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
98 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
99 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
100 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
101 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
103 static const char feature_comp_dat[] =
104 "Feature_\tComponent_\n"
106 "FeatureComponents\tFeature_\tComponent_\n"
112 "feature\tcomponent\n"
113 "service_feature\tservice_comp\n"
114 "service_feature\tservice_comp2";
116 static const char file_dat[] =
117 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
118 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\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\t6\n"
127 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
129 static const char install_exec_seq_dat[] =
130 "Action\tCondition\tSequence\n"
132 "InstallExecuteSequence\tAction\n"
133 "AllocateRegistrySpace\tNOT Installed\t1550\n"
134 "CostFinalize\t\t1000\n"
135 "CostInitialize\t\t800\n"
137 "ResolveSource\t\t950\n"
138 "MoveFiles\t\t1700\n"
139 "InstallFiles\t\t4000\n"
140 "DuplicateFiles\t\t4500\n"
141 "WriteEnvironmentStrings\t\t4550\n"
142 "CreateShortcuts\t\t4600\n"
143 "InstallServices\t\t5000\n"
144 "InstallFinalize\t\t6600\n"
145 "InstallInitialize\t\t1500\n"
146 "InstallValidate\t\t1400\n"
147 "LaunchConditions\t\t100\n"
148 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
150 static const char media_dat[] =
151 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
152 "i2\ti4\tL64\tS255\tS32\tS72\n"
154 "1\t3\t\t\tDISK1\t\n"
155 "2\t7\t\tmsitest.cab\tDISK2\t\n";
157 static const char property_dat[] =
160 "Property\tProperty\n"
161 "DefaultUIFont\tDlgFont8\n"
164 "InstallMode\tTypical\n"
165 "Manufacturer\tWine\n"
166 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
167 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
169 "ProductLanguage\t1033\n"
170 "ProductName\tMSITEST\n"
171 "ProductVersion\t1.1.1\n"
172 "PROMPTROLLBACKCOST\tP\n"
174 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
175 "AdminProperties\tPOSTADMIN\n"
177 "SERVNAME\tTestService\n"
178 "SERVNAME2\tTestService2\n"
179 "SERVDISP\tTestServiceDisp\n"
180 "SERVDISP2\tTestServiceDisp2\n"
181 "MSIFASTINSTALL\t1\n";
183 static const char environment_dat[] =
184 "Environment\tName\tValue\tComponent_\n"
185 "s72\tl255\tL255\ts72\n"
186 "Environment\tEnvironment\n"
187 "Var1\t=-MSITESTVAR1\t1\tOne\n"
188 "Var2\tMSITESTVAR2\t1\tOne\n"
189 "Var3\t=-MSITESTVAR3\t1\tOne\n"
190 "Var4\tMSITESTVAR4\t1\tOne\n"
191 "Var5\t-MSITESTVAR5\t\tOne\n"
192 "Var6\tMSITESTVAR6\t\tOne\n"
193 "Var7\t!-MSITESTVAR7\t\tOne\n"
194 "Var8\t!-*MSITESTVAR8\t\tOne\n"
195 "Var9\t=-MSITESTVAR9\t\tOne\n"
196 "Var10\t=MSITESTVAR10\t\tOne\n"
197 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
198 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
199 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
200 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
201 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
202 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
203 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
204 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
205 "Var19\t+-MSITESTVAR17\t1\tOne\n"
206 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
207 "Var21\t+-MSITESTVAR18\t1\tOne\n"
208 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
209 "Var23\t+-MSITESTVAR19\t1\tOne\n"
210 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
211 "Var25\t+-MSITESTVAR20\t1\tOne\n"
212 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n";
214 static const char service_install_dat[] =
215 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
216 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
217 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
218 "ServiceInstall\tServiceInstall\n"
219 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
220 "TestService2\tSERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription";
222 static const char service_control_dat[] =
223 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
224 "s72\tl255\ti2\tL255\tI2\ts72\n"
225 "ServiceControl\tServiceControl\n"
226 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
227 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
229 static const char sss_service_control_dat[] =
230 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
231 "s72\tl255\ti2\tL255\tI2\ts72\n"
232 "ServiceControl\tServiceControl\n"
233 "ServiceControl\tSpooler\t1\t\t0\tservice_comp";
235 static const char sss_install_exec_seq_dat[] =
236 "Action\tCondition\tSequence\n"
238 "InstallExecuteSequence\tAction\n"
239 "LaunchConditions\t\t100\n"
240 "CostInitialize\t\t800\n"
242 "ResolveSource\t\t950\n"
243 "CostFinalize\t\t1000\n"
244 "InstallValidate\t\t1400\n"
245 "InstallInitialize\t\t1500\n"
246 "DeleteServices\t\t5000\n"
247 "MoveFiles\t\t5100\n"
248 "InstallFiles\t\t5200\n"
249 "DuplicateFiles\t\t5300\n"
250 "StartServices\t\t5400\n"
251 "InstallFinalize\t\t6000\n";
253 static const char sds_install_exec_seq_dat[] =
254 "Action\tCondition\tSequence\n"
256 "InstallExecuteSequence\tAction\n"
257 "LaunchConditions\t\t100\n"
258 "CostInitialize\t\t800\n"
260 "ResolveSource\t\t950\n"
261 "CostFinalize\t\t1000\n"
262 "InstallValidate\t\t1400\n"
263 "InstallInitialize\t\t1500\n"
264 "StopServices\t\t5000\n"
265 "DeleteServices\t\t5050\n"
266 "MoveFiles\t\t5100\n"
267 "InstallFiles\t\t5200\n"
268 "DuplicateFiles\t\t5300\n"
269 "InstallServices\t\t5400\n"
270 "StartServices\t\t5450\n"
271 "RegisterProduct\t\t5500\n"
272 "PublishFeatures\t\t5600\n"
273 "PublishProduct\t\t5700\n"
274 "InstallFinalize\t\t6000\n";
276 static const char rof_component_dat[] =
277 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
278 "s72\tS38\ts72\ti2\tS255\tS72\n"
279 "Component\tComponent\n"
280 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
282 static const char rof_feature_dat[] =
283 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
284 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
286 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
287 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
289 static const char rof_feature_comp_dat[] =
290 "Feature_\tComponent_\n"
292 "FeatureComponents\tFeature_\tComponent_\n"
294 "montecristo\tmaximus";
296 static const char rof_file_dat[] =
297 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
298 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
300 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
302 static const char rof_media_dat[] =
303 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
304 "i2\ti4\tL64\tS255\tS32\tS72\n"
306 "1\t1\t\t\tDISK1\t\n";
308 static const char ci2_feature_comp_dat[] =
309 "Feature_\tComponent_\n"
311 "FeatureComponents\tFeature_\tComponent_\n"
314 static const char ci2_file_dat[] =
315 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
316 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
318 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
320 static const char pp_install_exec_seq_dat[] =
321 "Action\tCondition\tSequence\n"
323 "InstallExecuteSequence\tAction\n"
324 "ValidateProductID\t\t700\n"
325 "CostInitialize\t\t800\n"
327 "CostFinalize\t\t1000\n"
328 "InstallValidate\t\t1400\n"
329 "InstallInitialize\t\t1500\n"
330 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
331 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
332 "RemoveFiles\t\t3500\n"
333 "InstallFiles\t\t4000\n"
334 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
335 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
336 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
337 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
338 "InstallFinalize\t\t6600";
340 static const char pp_component_dat[] =
341 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
342 "s72\tS38\ts72\ti2\tS255\tS72\n"
343 "Component\tComponent\n"
344 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
346 static const char ppc_component_dat[] =
347 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
348 "s72\tS38\ts72\ti2\tS255\tS72\n"
349 "Component\tComponent\n"
350 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
351 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
353 static const char ppc_file_dat[] =
354 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
355 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
357 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
358 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
360 static const char ppc_media_dat[] =
361 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
362 "i2\ti4\tL64\tS255\tS32\tS72\n"
364 "1\t2\t\t\tDISK1\t\n";
366 static const char ppc_feature_comp_dat[] =
367 "Feature_\tComponent_\n"
369 "FeatureComponents\tFeature_\tComponent_\n"
371 "feature\taugustus\n"
372 "montecristo\tmaximus";
374 static const char cwd_component_dat[] =
375 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
376 "s72\tS38\ts72\ti2\tS255\tS72\n"
377 "Component\tComponent\n"
378 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
380 static const char rem_component_dat[] =
381 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
382 "s72\tS38\ts72\ti2\tS255\tS72\n"
383 "Component\tComponent\n"
384 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
385 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
386 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
388 static const char rem_feature_comp_dat[] =
389 "Feature_\tComponent_\n"
391 "FeatureComponents\tFeature_\tComponent_\n"
392 "feature\thydrogen\n"
396 static const char rem_file_dat[] =
397 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
398 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
400 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
401 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
402 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
404 static const char rem_install_exec_seq_dat[] =
405 "Action\tCondition\tSequence\n"
407 "InstallExecuteSequence\tAction\n"
408 "ValidateProductID\t\t700\n"
409 "CostInitialize\t\t800\n"
411 "CostFinalize\t\t1000\n"
412 "InstallValidate\t\t1400\n"
413 "InstallInitialize\t\t1500\n"
414 "ProcessComponents\t\t1600\n"
415 "UnpublishFeatures\t\t1800\n"
416 "RemoveFiles\t\t3500\n"
417 "InstallFiles\t\t4000\n"
418 "RegisterProduct\t\t6100\n"
419 "PublishFeatures\t\t6300\n"
420 "PublishProduct\t\t6400\n"
421 "InstallFinalize\t\t6600";
423 static const char rem_remove_files_dat[] =
424 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
425 "s72\ts72\tS255\ts72\tI2\n"
426 "RemoveFile\tFileKey\n"
427 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
428 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
429 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
430 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
431 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
432 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
433 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
434 "block\thelium\tblock\tMSITESTDIR\t3\n"
435 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
436 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
438 static const char mov_move_file_dat[] =
439 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
440 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
441 "MoveFile\tFileKey\n"
442 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
443 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
444 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
445 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
446 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
447 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
448 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
449 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
450 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
451 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
452 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
453 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
454 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
455 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
456 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
457 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
458 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
459 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
461 static const char df_directory_dat[] =
462 "Directory\tDirectory_Parent\tDefaultDir\n"
464 "Directory\tDirectory\n"
465 "THIS\tMSITESTDIR\tthis\n"
466 "DOESNOT\tTHIS\tdoesnot\n"
467 "NONEXISTENT\tDOESNOT\texist\n"
468 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
469 "ProgramFilesFolder\tTARGETDIR\t.\n"
470 "TARGETDIR\t\tSourceDir";
472 static const char df_duplicate_file_dat[] =
473 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
474 "s72\ts72\ts72\tS255\tS72\n"
475 "DuplicateFile\tFileKey\n"
476 "maximus\tmaximus\tmaximus\taugustus\t\n"
477 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
478 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
480 static const char wrv_component_dat[] =
481 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
482 "s72\tS38\ts72\ti2\tS255\tS72\n"
483 "Component\tComponent\n"
484 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
486 static const char wrv_registry_dat[] =
487 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
488 "s72\ti2\tl255\tL255\tL0\ts72\n"
489 "Registry\tRegistry\n"
490 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus";
492 static const char cf_directory_dat[] =
493 "Directory\tDirectory_Parent\tDefaultDir\n"
495 "Directory\tDirectory\n"
496 "FIRSTDIR\tMSITESTDIR\tfirst\n"
497 "SECONDDIR\tMSITESTDIR\tsecond\n"
498 "THIRDDIR\tMSITESTDIR\tthird\n"
499 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
500 "ProgramFilesFolder\tTARGETDIR\t.\n"
501 "TARGETDIR\t\tSourceDir";
503 static const char cf_component_dat[] =
504 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
505 "s72\tS38\ts72\ti2\tS255\tS72\n"
506 "Component\tComponent\n"
507 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
508 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
510 static const char cf_feature_dat[] =
511 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
512 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
514 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
515 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
517 static const char cf_feature_comp_dat[] =
518 "Feature_\tComponent_\n"
520 "FeatureComponents\tFeature_\tComponent_\n"
524 static const char cf_file_dat[] =
525 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
526 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
528 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
529 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
531 static const char cf_create_folders_dat[] =
532 "Directory_\tComponent_\n"
534 "CreateFolder\tDirectory_\tComponent_\n"
539 static const char cf_install_exec_seq_dat[] =
540 "Action\tCondition\tSequence\n"
542 "InstallExecuteSequence\tAction\n"
543 "CostFinalize\t\t1000\n"
544 "ValidateProductID\t\t700\n"
545 "CostInitialize\t\t800\n"
547 "RemoveFiles\t\t3500\n"
548 "CreateFolders\t\t3700\n"
549 "RemoveFolders\t\t3800\n"
550 "InstallFiles\t\t4000\n"
551 "RegisterUser\t\t6000\n"
552 "RegisterProduct\t\t6100\n"
553 "PublishFeatures\t\t6300\n"
554 "PublishProduct\t\t6400\n"
555 "InstallFinalize\t\t6600\n"
556 "InstallInitialize\t\t1500\n"
557 "ProcessComponents\t\t1600\n"
558 "UnpublishFeatures\t\t1800\n"
559 "InstallValidate\t\t1400\n"
560 "LaunchConditions\t\t100\n";
562 static const char sr_selfreg_dat[] =
568 static const char sr_install_exec_seq_dat[] =
569 "Action\tCondition\tSequence\n"
571 "InstallExecuteSequence\tAction\n"
572 "CostFinalize\t\t1000\n"
573 "CostInitialize\t\t800\n"
575 "ResolveSource\t\t950\n"
576 "MoveFiles\t\t1700\n"
577 "SelfUnregModules\t\t3900\n"
578 "InstallFiles\t\t4000\n"
579 "DuplicateFiles\t\t4500\n"
580 "WriteEnvironmentStrings\t\t4550\n"
581 "CreateShortcuts\t\t4600\n"
582 "InstallFinalize\t\t6600\n"
583 "InstallInitialize\t\t1500\n"
584 "InstallValidate\t\t1400\n"
585 "LaunchConditions\t\t100\n";
587 static const char font_media_dat[] =
588 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
589 "i2\ti4\tL64\tS255\tS32\tS72\n"
591 "1\t3\t\t\tDISK1\t\n";
593 static const char font_file_dat[] =
594 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
595 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
597 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
599 static const char font_feature_dat[] =
600 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
601 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
603 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
605 static const char font_component_dat[] =
606 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
607 "s72\tS38\ts72\ti2\tS255\tS72\n"
608 "Component\tComponent\n"
609 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
611 static const char font_feature_comp_dat[] =
612 "Feature_\tComponent_\n"
614 "FeatureComponents\tFeature_\tComponent_\n"
617 static const char font_dat[] =
621 "font.ttf\tmsi test font\n";
623 static const char font_install_exec_seq_dat[] =
624 "Action\tCondition\tSequence\n"
626 "InstallExecuteSequence\tAction\n"
627 "ValidateProductID\t\t700\n"
628 "CostInitialize\t\t800\n"
630 "CostFinalize\t\t1000\n"
631 "InstallValidate\t\t1400\n"
632 "InstallInitialize\t\t1500\n"
633 "ProcessComponents\t\t1600\n"
634 "UnpublishFeatures\t\t1800\n"
635 "RemoveFiles\t\t3500\n"
636 "InstallFiles\t\t4000\n"
637 "RegisterFonts\t\t4100\n"
638 "UnregisterFonts\t\t4200\n"
639 "RegisterUser\t\t6000\n"
640 "RegisterProduct\t\t6100\n"
641 "PublishFeatures\t\t6300\n"
642 "PublishProduct\t\t6400\n"
643 "InstallFinalize\t\t6600";
645 static const char vp_property_dat[] =
648 "Property\tProperty\n"
651 "InstallMode\tTypical\n"
652 "Manufacturer\tWine\n"
653 "PIDTemplate\t###-#######\n"
654 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
655 "ProductLanguage\t1033\n"
656 "ProductName\tMSITEST\n"
657 "ProductVersion\t1.1.1\n"
658 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
659 "MSIFASTINSTALL\t1\n";
661 static const char vp_custom_action_dat[] =
662 "Action\tType\tSource\tTarget\tISComments\n"
663 "s72\ti2\tS64\tS0\tS255\n"
664 "CustomAction\tAction\n"
665 "SetProductID1\t51\tProductID\t1\t\n"
666 "SetProductID2\t51\tProductID\t2\t\n"
667 "TestProductID1\t19\t\t\tHalts installation\n"
668 "TestProductID2\t19\t\t\tHalts installation\n";
670 static const char vp_install_exec_seq_dat[] =
671 "Action\tCondition\tSequence\n"
673 "InstallExecuteSequence\tAction\n"
674 "LaunchConditions\t\t100\n"
675 "CostInitialize\t\t800\n"
677 "CostFinalize\t\t1000\n"
678 "InstallValidate\t\t1400\n"
679 "InstallInitialize\t\t1500\n"
680 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
681 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
682 "ValidateProductID\t\t3200\n"
683 "InstallExecute\t\t3300\n"
684 "TestProductID1\tProductID=1\t3400\n"
685 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
686 "InstallFiles\t\t4000\n"
687 "InstallFinalize\t\t6000\n";
689 static const char odbc_file_dat[] =
690 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
691 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
693 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
694 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
695 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
696 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
697 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
699 static const char odbc_feature_dat[] =
700 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
701 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
703 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
705 static const char odbc_feature_comp_dat[] =
706 "Feature_\tComponent_\n"
708 "FeatureComponents\tFeature_\tComponent_\n"
711 static const char odbc_component_dat[] =
712 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
713 "s72\tS38\ts72\ti2\tS255\tS72\n"
714 "Component\tComponent\n"
715 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
717 static const char odbc_driver_dat[] =
718 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
719 "s72\ts72\ts255\ts72\tS72\n"
720 "ODBCDriver\tDriver\n"
721 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
722 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
724 static const char odbc_translator_dat[] =
725 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
726 "s72\ts72\ts255\ts72\tS72\n"
727 "ODBCTranslator\tTranslator\n"
728 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
729 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
731 static const char odbc_datasource_dat[] =
732 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
733 "s72\ts72\ts255\ts255\ti2\n"
734 "ODBCDataSource\tDataSource\n"
735 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
737 static const char odbc_install_exec_seq_dat[] =
738 "Action\tCondition\tSequence\n"
740 "InstallExecuteSequence\tAction\n"
741 "LaunchConditions\t\t100\n"
742 "CostInitialize\t\t800\n"
744 "CostFinalize\t\t1000\n"
745 "InstallValidate\t\t1400\n"
746 "InstallInitialize\t\t1500\n"
747 "ProcessComponents\t\t1600\n"
748 "InstallODBC\t\t3000\n"
749 "RemoveODBC\t\t3100\n"
750 "RemoveFiles\t\t3900\n"
751 "InstallFiles\t\t4000\n"
752 "RegisterProduct\t\t5000\n"
753 "PublishFeatures\t\t5100\n"
754 "PublishProduct\t\t5200\n"
755 "InstallFinalize\t\t6000\n";
757 static const char odbc_media_dat[] =
758 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
759 "i2\ti4\tL64\tS255\tS32\tS72\n"
761 "1\t5\t\t\tDISK1\t\n";
763 static const char tl_file_dat[] =
764 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
765 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
767 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
769 static const char tl_feature_dat[] =
770 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
771 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
773 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
775 static const char tl_feature_comp_dat[] =
776 "Feature_\tComponent_\n"
778 "FeatureComponents\tFeature_\tComponent_\n"
779 "typelib\ttypelib\n";
781 static const char tl_component_dat[] =
782 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
783 "s72\tS38\ts72\ti2\tS255\tS72\n"
784 "Component\tComponent\n"
785 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
787 static const char tl_typelib_dat[] =
788 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
789 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
790 "TypeLib\tLibID\tLanguage\tComponent_\n"
791 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
793 static const char tl_install_exec_seq_dat[] =
794 "Action\tCondition\tSequence\n"
796 "InstallExecuteSequence\tAction\n"
797 "LaunchConditions\t\t100\n"
798 "CostInitialize\t\t800\n"
800 "CostFinalize\t\t1000\n"
801 "InstallValidate\t\t1400\n"
802 "InstallInitialize\t\t1500\n"
803 "ProcessComponents\t\t1600\n"
804 "RemoveFiles\t\t1700\n"
805 "InstallFiles\t\t2000\n"
806 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
807 "UnregisterTypeLibraries\t\t3100\n"
808 "RegisterProduct\t\t5100\n"
809 "PublishFeatures\t\t5200\n"
810 "PublishProduct\t\t5300\n"
811 "InstallFinalize\t\t6000\n";
813 static const char crs_file_dat[] =
814 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
815 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
817 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
819 static const char crs_feature_dat[] =
820 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
821 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
823 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
825 static const char crs_feature_comp_dat[] =
826 "Feature_\tComponent_\n"
828 "FeatureComponents\tFeature_\tComponent_\n"
829 "shortcut\tshortcut\n";
831 static const char crs_component_dat[] =
832 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
833 "s72\tS38\ts72\ti2\tS255\tS72\n"
834 "Component\tComponent\n"
835 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
837 static const char crs_shortcut_dat[] =
838 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
839 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
840 "Shortcut\tShortcut\n"
841 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
843 static const char crs_install_exec_seq_dat[] =
844 "Action\tCondition\tSequence\n"
846 "InstallExecuteSequence\tAction\n"
847 "LaunchConditions\t\t100\n"
848 "CostInitialize\t\t800\n"
850 "CostFinalize\t\t1000\n"
851 "InstallValidate\t\t1400\n"
852 "InstallInitialize\t\t1500\n"
853 "ProcessComponents\t\t1600\n"
854 "RemoveFiles\t\t1700\n"
855 "InstallFiles\t\t2000\n"
856 "RemoveShortcuts\t\t3000\n"
857 "CreateShortcuts\t\t3100\n"
858 "RegisterProduct\t\t5000\n"
859 "PublishFeatures\t\t5100\n"
860 "PublishProduct\t\t5200\n"
861 "InstallFinalize\t\t6000\n";
863 static const char pub_file_dat[] =
864 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
865 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
867 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
869 static const char pub_feature_dat[] =
870 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
871 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
873 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
875 static const char pub_feature_comp_dat[] =
876 "Feature_\tComponent_\n"
878 "FeatureComponents\tFeature_\tComponent_\n"
879 "publish\tpublish\n";
881 static const char pub_component_dat[] =
882 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
883 "s72\tS38\ts72\ti2\tS255\tS72\n"
884 "Component\tComponent\n"
885 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
887 static const char pub_publish_component_dat[] =
888 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
889 "s38\ts255\ts72\tL255\ts38\n"
890 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
891 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
893 static const char pub_install_exec_seq_dat[] =
894 "Action\tCondition\tSequence\n"
896 "InstallExecuteSequence\tAction\n"
897 "LaunchConditions\t\t100\n"
898 "CostInitialize\t\t800\n"
900 "CostFinalize\t\t1000\n"
901 "InstallValidate\t\t1400\n"
902 "InstallInitialize\t\t1500\n"
903 "ProcessComponents\t\t1600\n"
904 "RemoveFiles\t\t1700\n"
905 "InstallFiles\t\t2000\n"
906 "PublishComponents\t\t3000\n"
907 "UnpublishComponents\t\t3100\n"
908 "RegisterProduct\t\t5000\n"
909 "PublishFeatures\t\t5100\n"
910 "PublishProduct\t\t5200\n"
911 "InstallFinalize\t\t6000\n";
913 static const char rd_file_dat[] =
914 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
915 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
917 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
918 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
919 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
921 static const char rd_feature_dat[] =
922 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
923 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
925 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
927 static const char rd_feature_comp_dat[] =
928 "Feature_\tComponent_\n"
930 "FeatureComponents\tFeature_\tComponent_\n"
931 "duplicate\tduplicate\n";
933 static const char rd_component_dat[] =
934 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
935 "s72\tS38\ts72\ti2\tS255\tS72\n"
936 "Component\tComponent\n"
937 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
938 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
940 static const char rd_duplicate_file_dat[] =
941 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
942 "s72\ts72\ts72\tS255\tS72\n"
943 "DuplicateFile\tFileKey\n"
944 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
945 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
946 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
948 static const char rd_install_exec_seq_dat[] =
949 "Action\tCondition\tSequence\n"
951 "InstallExecuteSequence\tAction\n"
952 "LaunchConditions\t\t100\n"
953 "CostInitialize\t\t800\n"
955 "CostFinalize\t\t1000\n"
956 "InstallValidate\t\t1400\n"
957 "InstallInitialize\t\t1500\n"
958 "ProcessComponents\t\t1600\n"
959 "RemoveDuplicateFiles\t\t1900\n"
960 "InstallFiles\t\t2000\n"
961 "DuplicateFiles\t\t2100\n"
962 "RegisterProduct\t\t5000\n"
963 "PublishFeatures\t\t5100\n"
964 "PublishProduct\t\t5200\n"
965 "InstallFinalize\t\t6000\n";
967 static const char rrv_file_dat[] =
968 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
969 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
971 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
973 static const char rrv_feature_dat[] =
974 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
975 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
977 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
979 static const char rrv_feature_comp_dat[] =
980 "Feature_\tComponent_\n"
982 "FeatureComponents\tFeature_\tComponent_\n"
983 "registry\tregistry\n";
985 static const char rrv_component_dat[] =
986 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
987 "s72\tS38\ts72\ti2\tS255\tS72\n"
988 "Component\tComponent\n"
989 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
991 static const char rrv_registry_dat[] =
992 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
993 "s72\ti2\tl255\tL255\tL0\ts72\n"
994 "Registry\tRegistry\n"
995 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
996 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
997 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
999 static const char rrv_remove_registry_dat[] =
1000 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1001 "s72\ti2\tl255\tL255\ts72\n"
1002 "RemoveRegistry\tRemoveRegistry\n"
1003 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1004 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1005 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1007 static const char rrv_install_exec_seq_dat[] =
1008 "Action\tCondition\tSequence\n"
1010 "InstallExecuteSequence\tAction\n"
1011 "LaunchConditions\t\t100\n"
1012 "CostInitialize\t\t800\n"
1014 "CostFinalize\t\t1000\n"
1015 "InstallValidate\t\t1400\n"
1016 "InstallInitialize\t\t1500\n"
1017 "ProcessComponents\t\t1600\n"
1018 "RemoveFiles\t\t1700\n"
1019 "InstallFiles\t\t2000\n"
1020 "RemoveRegistryValues\t\t3000\n"
1021 "RegisterProduct\t\t5000\n"
1022 "PublishFeatures\t\t5100\n"
1023 "PublishProduct\t\t5200\n"
1024 "InstallFinalize\t\t6000\n";
1026 static const char frp_file_dat[] =
1027 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1028 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1030 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1032 static const char frp_feature_dat[] =
1033 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1034 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1035 "Feature\tFeature\n"
1036 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1038 static const char frp_feature_comp_dat[] =
1039 "Feature_\tComponent_\n"
1041 "FeatureComponents\tFeature_\tComponent_\n"
1042 "product\tproduct\n";
1044 static const char frp_component_dat[] =
1045 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1046 "s72\tS38\ts72\ti2\tS255\tS72\n"
1047 "Component\tComponent\n"
1048 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1050 static const char frp_custom_action_dat[] =
1051 "Action\tType\tSource\tTarget\tISComments\n"
1052 "s72\ti2\tS64\tS0\tS255\n"
1053 "CustomAction\tAction\n"
1054 "TestProp\t19\t\t\tPROP set\n";
1056 static const char frp_upgrade_dat[] =
1057 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1058 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1059 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1060 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1062 static const char frp_install_exec_seq_dat[] =
1063 "Action\tCondition\tSequence\n"
1065 "InstallExecuteSequence\tAction\n"
1066 "FindRelatedProducts\t\t50\n"
1067 "TestProp\tPROP AND NOT REMOVE\t51\n"
1068 "LaunchConditions\t\t100\n"
1069 "CostInitialize\t\t800\n"
1071 "CostFinalize\t\t1000\n"
1072 "InstallValidate\t\t1400\n"
1073 "InstallInitialize\t\t1500\n"
1074 "ProcessComponents\t\t1600\n"
1075 "RemoveFiles\t\t1700\n"
1076 "InstallFiles\t\t2000\n"
1077 "RegisterProduct\t\t5000\n"
1078 "PublishFeatures\t\t5100\n"
1079 "PublishProduct\t\t5200\n"
1080 "InstallFinalize\t\t6000\n";
1082 static const char riv_file_dat[] =
1083 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1084 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1086 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1088 static const char riv_feature_dat[] =
1089 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1090 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1091 "Feature\tFeature\n"
1092 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1094 static const char riv_feature_comp_dat[] =
1095 "Feature_\tComponent_\n"
1097 "FeatureComponents\tFeature_\tComponent_\n"
1098 "inifile\tinifile\n";
1100 static const char riv_component_dat[] =
1101 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1102 "s72\tS38\ts72\ti2\tS255\tS72\n"
1103 "Component\tComponent\n"
1104 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1106 static const char riv_ini_file_dat[] =
1107 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1108 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1109 "IniFile\tIniFile\n"
1110 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1112 static const char riv_remove_ini_file_dat[] =
1113 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1114 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1115 "RemoveIniFile\tRemoveIniFile\n"
1116 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1118 static const char riv_install_exec_seq_dat[] =
1119 "Action\tCondition\tSequence\n"
1121 "InstallExecuteSequence\tAction\n"
1122 "LaunchConditions\t\t100\n"
1123 "CostInitialize\t\t800\n"
1125 "CostFinalize\t\t1000\n"
1126 "InstallValidate\t\t1400\n"
1127 "InstallInitialize\t\t1500\n"
1128 "ProcessComponents\t\t1600\n"
1129 "RemoveFiles\t\t1700\n"
1130 "InstallFiles\t\t2000\n"
1131 "RemoveIniValues\t\t3000\n"
1132 "RegisterProduct\t\t5000\n"
1133 "PublishFeatures\t\t5100\n"
1134 "PublishProduct\t\t5200\n"
1135 "InstallFinalize\t\t6000\n";
1137 static const char res_file_dat[] =
1138 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1139 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1141 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1143 static const char res_feature_dat[] =
1144 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1145 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1146 "Feature\tFeature\n"
1147 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1149 static const char res_feature_comp_dat[] =
1150 "Feature_\tComponent_\n"
1152 "FeatureComponents\tFeature_\tComponent_\n"
1155 static const char res_component_dat[] =
1156 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1157 "s72\tS38\ts72\ti2\tS255\tS72\n"
1158 "Component\tComponent\n"
1159 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1161 static const char res_environment_dat[] =
1162 "Environment\tName\tValue\tComponent_\n"
1163 "s72\tl255\tL255\ts72\n"
1164 "Environment\tEnvironment\n"
1165 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1166 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1167 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1168 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1169 "var5\t=MSITESTVAR5\t\tenvvar\n";
1171 static const char res_install_exec_seq_dat[] =
1172 "Action\tCondition\tSequence\n"
1174 "InstallExecuteSequence\tAction\n"
1175 "LaunchConditions\t\t100\n"
1176 "CostInitialize\t\t800\n"
1178 "CostFinalize\t\t1000\n"
1179 "InstallValidate\t\t1400\n"
1180 "InstallInitialize\t\t1500\n"
1181 "ProcessComponents\t\t1600\n"
1182 "RemoveFiles\t\t1700\n"
1183 "InstallFiles\t\t2000\n"
1184 "RemoveEnvironmentStrings\t\t3000\n"
1185 "RegisterProduct\t\t5000\n"
1186 "PublishFeatures\t\t5100\n"
1187 "PublishProduct\t\t5200\n"
1188 "InstallFinalize\t\t6000\n";
1190 static const char rci_file_dat[] =
1191 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1192 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1194 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1196 static const char rci_feature_dat[] =
1197 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1198 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1199 "Feature\tFeature\n"
1200 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1202 static const char rci_feature_comp_dat[] =
1203 "Feature_\tComponent_\n"
1205 "FeatureComponents\tFeature_\tComponent_\n"
1208 static const char rci_component_dat[] =
1209 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1210 "s72\tS38\ts72\ti2\tS255\tS72\n"
1211 "Component\tComponent\n"
1212 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1214 static const char rci_appid_dat[] =
1215 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1216 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1218 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1220 static const char rci_class_dat[] =
1221 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1222 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1223 "Class\tCLSID\tContext\tComponent_\n"
1224 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1226 static const char rci_install_exec_seq_dat[] =
1227 "Action\tCondition\tSequence\n"
1229 "InstallExecuteSequence\tAction\n"
1230 "LaunchConditions\t\t100\n"
1231 "CostInitialize\t\t800\n"
1233 "CostFinalize\t\t1000\n"
1234 "InstallValidate\t\t1400\n"
1235 "InstallInitialize\t\t1500\n"
1236 "ProcessComponents\t\t1600\n"
1237 "RemoveFiles\t\t1700\n"
1238 "InstallFiles\t\t2000\n"
1239 "UnregisterClassInfo\t\t3000\n"
1240 "RegisterClassInfo\t\t4000\n"
1241 "RegisterProduct\t\t5000\n"
1242 "PublishFeatures\t\t5100\n"
1243 "PublishProduct\t\t5200\n"
1244 "InstallFinalize\t\t6000\n";
1246 static const char rei_file_dat[] =
1247 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1248 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1250 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1252 static const char rei_feature_dat[] =
1253 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1254 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1255 "Feature\tFeature\n"
1256 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1258 static const char rei_feature_comp_dat[] =
1259 "Feature_\tComponent_\n"
1261 "FeatureComponents\tFeature_\tComponent_\n"
1262 "extension\textension\n";
1264 static const char rei_component_dat[] =
1265 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1266 "s72\tS38\ts72\ti2\tS255\tS72\n"
1267 "Component\tComponent\n"
1268 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1270 static const char rei_extension_dat[] =
1271 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1272 "s255\ts72\tS255\tS64\ts38\n"
1273 "Extension\tExtension\tComponent_\n"
1274 "extension\textension\tProg.Id.1\t\textension\n";
1276 static const char rei_verb_dat[] =
1277 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1278 "s255\ts32\tI2\tL255\tL255\n"
1279 "Verb\tExtension_\tVerb\n"
1280 "extension\tOpen\t1\t&Open\t/argument\n";
1282 static const char rei_progid_dat[] =
1283 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1284 "s255\tS255\tS38\tL255\tS72\tI2\n"
1286 "Prog.Id.1\t\t\tdescription\t\t\n";
1288 static const char rei_install_exec_seq_dat[] =
1289 "Action\tCondition\tSequence\n"
1291 "InstallExecuteSequence\tAction\n"
1292 "LaunchConditions\t\t100\n"
1293 "CostInitialize\t\t800\n"
1295 "CostFinalize\t\t1000\n"
1296 "InstallValidate\t\t1400\n"
1297 "InstallInitialize\t\t1500\n"
1298 "ProcessComponents\t\t1600\n"
1299 "RemoveFiles\t\t1700\n"
1300 "InstallFiles\t\t2000\n"
1301 "UnregisterExtensionInfo\t\t3000\n"
1302 "RegisterExtensionInfo\t\t4000\n"
1303 "RegisterProduct\t\t5000\n"
1304 "PublishFeatures\t\t5100\n"
1305 "PublishProduct\t\t5200\n"
1306 "InstallFinalize\t\t6000\n";
1308 static const char rmi_file_dat[] =
1309 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1310 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1312 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1314 static const char rmi_feature_dat[] =
1315 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1316 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1317 "Feature\tFeature\n"
1318 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1320 static const char rmi_feature_comp_dat[] =
1321 "Feature_\tComponent_\n"
1323 "FeatureComponents\tFeature_\tComponent_\n"
1326 static const char rmi_component_dat[] =
1327 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1328 "s72\tS38\ts72\ti2\tS255\tS72\n"
1329 "Component\tComponent\n"
1330 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1332 static const char rmi_extension_dat[] =
1333 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1334 "s255\ts72\tS255\tS64\ts38\n"
1335 "Extension\tExtension\tComponent_\n"
1336 "mime\tmime\t\tmime/type\tmime\n";
1338 static const char rmi_verb_dat[] =
1339 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1340 "s255\ts32\tI2\tL255\tL255\n"
1341 "Verb\tExtension_\tVerb\n"
1342 "mime\tOpen\t1\t&Open\t/argument\n";
1344 static const char rmi_mime_dat[] =
1345 "ContentType\tExtension_\tCLSID\n"
1347 "MIME\tContentType\n"
1348 "mime/type\tmime\t\n";
1350 static const char rmi_install_exec_seq_dat[] =
1351 "Action\tCondition\tSequence\n"
1353 "InstallExecuteSequence\tAction\n"
1354 "LaunchConditions\t\t100\n"
1355 "CostInitialize\t\t800\n"
1357 "CostFinalize\t\t1000\n"
1358 "InstallValidate\t\t1400\n"
1359 "InstallInitialize\t\t1500\n"
1360 "ProcessComponents\t\t1600\n"
1361 "RemoveFiles\t\t1700\n"
1362 "InstallFiles\t\t2000\n"
1363 "UnregisterExtensionInfo\t\t3000\n"
1364 "UnregisterMIMEInfo\t\t3500\n"
1365 "RegisterExtensionInfo\t\t4000\n"
1366 "RegisterMIMEInfo\t\t4500\n"
1367 "RegisterProduct\t\t5000\n"
1368 "PublishFeatures\t\t5100\n"
1369 "PublishProduct\t\t5200\n"
1370 "InstallFinalize\t\t6000\n";
1372 static const char pa_file_dat[] =
1373 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1374 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1376 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1377 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1378 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1379 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1380 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1381 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1382 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1383 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1385 static const char pa_feature_dat[] =
1386 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1387 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1388 "Feature\tFeature\n"
1389 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1391 static const char pa_feature_comp_dat[] =
1392 "Feature_\tComponent_\n"
1394 "FeatureComponents\tFeature_\tComponent_\n"
1396 "assembly\twin32_local\n"
1397 "assembly\tdotnet\n"
1398 "assembly\tdotnet_local\n";
1400 static const char pa_component_dat[] =
1401 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1402 "s72\tS38\ts72\ti2\tS255\tS72\n"
1403 "Component\tComponent\n"
1404 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1405 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1406 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1407 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1409 static const char pa_msi_assembly_dat[] =
1410 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1411 "s72\ts38\tS72\tS72\tI2\n"
1412 "MsiAssembly\tComponent_\n"
1413 "win32\tassembly\tmanifest.txt\t\t1\n"
1414 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1415 "dotnet\tassembly\t\t\t0\n"
1416 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1418 static const char pa_msi_assembly_name_dat[] =
1419 "Component_\tName\tValue\n"
1421 "MsiAssemblyName\tComponent_\tName\n"
1422 "win32\tName\tWine.Win32.Assembly\n"
1423 "win32\tprocessorArchitecture\tx86\n"
1424 "win32\tpublicKeyToken\tabcdef0123456789\n"
1425 "win32\ttype\twin32\n"
1426 "win32\tversion\t1.0.0.0\n"
1427 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1428 "win32_local\tprocessorArchitecture\tx86\n"
1429 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1430 "win32_local\ttype\twin32\n"
1431 "win32_local\tversion\t1.0.0.0\n"
1432 "dotnet\tName\tWine.Dotnet.Assembly\n"
1433 "dotnet\tprocessorArchitecture\tMSIL\n"
1434 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1435 "dotnet\tculture\tneutral\n"
1436 "dotnet\tversion\t1.0.0.0\n"
1437 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1438 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1439 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1440 "dotnet_local\tculture\tneutral\n"
1441 "dotnet_local\tversion\t1.0.0.0\n";
1443 static const char pa_install_exec_seq_dat[] =
1444 "Action\tCondition\tSequence\n"
1446 "InstallExecuteSequence\tAction\n"
1447 "LaunchConditions\t\t100\n"
1448 "CostInitialize\t\t800\n"
1450 "CostFinalize\t\t1000\n"
1451 "InstallValidate\t\t1400\n"
1452 "InstallInitialize\t\t1500\n"
1453 "ProcessComponents\t\t1600\n"
1454 "MsiPublishAssemblies\t\t3000\n"
1455 "MsiUnpublishAssemblies\t\t4000\n"
1456 "RegisterProduct\t\t5000\n"
1457 "PublishFeatures\t\t5100\n"
1458 "PublishProduct\t\t5200\n"
1459 "InstallFinalize\t\t6000\n";
1461 typedef struct _msi_table
1463 const char *filename;
1468 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1470 static const msi_table env_tables[] =
1472 ADD_TABLE(component),
1473 ADD_TABLE(directory),
1475 ADD_TABLE(feature_comp),
1477 ADD_TABLE(install_exec_seq),
1479 ADD_TABLE(property),
1480 ADD_TABLE(environment)
1483 static const msi_table pp_tables[] =
1485 ADD_TABLE(pp_component),
1486 ADD_TABLE(directory),
1487 ADD_TABLE(rof_feature),
1488 ADD_TABLE(rof_feature_comp),
1489 ADD_TABLE(rof_file),
1490 ADD_TABLE(pp_install_exec_seq),
1491 ADD_TABLE(rof_media),
1492 ADD_TABLE(property),
1495 static const msi_table ppc_tables[] =
1497 ADD_TABLE(ppc_component),
1498 ADD_TABLE(directory),
1499 ADD_TABLE(rof_feature),
1500 ADD_TABLE(ppc_feature_comp),
1501 ADD_TABLE(ppc_file),
1502 ADD_TABLE(pp_install_exec_seq),
1503 ADD_TABLE(ppc_media),
1504 ADD_TABLE(property),
1507 static const msi_table rem_tables[] =
1509 ADD_TABLE(rem_component),
1510 ADD_TABLE(directory),
1511 ADD_TABLE(rof_feature),
1512 ADD_TABLE(rem_feature_comp),
1513 ADD_TABLE(rem_file),
1514 ADD_TABLE(rem_install_exec_seq),
1515 ADD_TABLE(rof_media),
1516 ADD_TABLE(property),
1517 ADD_TABLE(rem_remove_files),
1520 static const msi_table mov_tables[] =
1522 ADD_TABLE(cwd_component),
1523 ADD_TABLE(directory),
1524 ADD_TABLE(rof_feature),
1525 ADD_TABLE(ci2_feature_comp),
1526 ADD_TABLE(ci2_file),
1527 ADD_TABLE(install_exec_seq),
1528 ADD_TABLE(rof_media),
1529 ADD_TABLE(property),
1530 ADD_TABLE(mov_move_file),
1533 static const msi_table df_tables[] =
1535 ADD_TABLE(rof_component),
1536 ADD_TABLE(df_directory),
1537 ADD_TABLE(rof_feature),
1538 ADD_TABLE(rof_feature_comp),
1539 ADD_TABLE(rof_file),
1540 ADD_TABLE(install_exec_seq),
1541 ADD_TABLE(rof_media),
1542 ADD_TABLE(property),
1543 ADD_TABLE(df_duplicate_file),
1546 static const msi_table wrv_tables[] =
1548 ADD_TABLE(wrv_component),
1549 ADD_TABLE(directory),
1550 ADD_TABLE(rof_feature),
1551 ADD_TABLE(ci2_feature_comp),
1552 ADD_TABLE(ci2_file),
1553 ADD_TABLE(install_exec_seq),
1554 ADD_TABLE(rof_media),
1555 ADD_TABLE(property),
1556 ADD_TABLE(wrv_registry),
1559 static const msi_table cf_tables[] =
1561 ADD_TABLE(cf_component),
1562 ADD_TABLE(cf_directory),
1563 ADD_TABLE(cf_feature),
1564 ADD_TABLE(cf_feature_comp),
1566 ADD_TABLE(cf_create_folders),
1567 ADD_TABLE(cf_install_exec_seq),
1572 static const msi_table sss_tables[] =
1574 ADD_TABLE(component),
1575 ADD_TABLE(directory),
1577 ADD_TABLE(feature_comp),
1579 ADD_TABLE(sss_install_exec_seq),
1580 ADD_TABLE(sss_service_control),
1585 static const msi_table sds_tables[] =
1587 ADD_TABLE(component),
1588 ADD_TABLE(directory),
1590 ADD_TABLE(feature_comp),
1592 ADD_TABLE(sds_install_exec_seq),
1593 ADD_TABLE(service_control),
1594 ADD_TABLE(service_install),
1599 static const msi_table sr_tables[] =
1601 ADD_TABLE(component),
1602 ADD_TABLE(directory),
1604 ADD_TABLE(feature_comp),
1606 ADD_TABLE(sr_selfreg),
1607 ADD_TABLE(sr_install_exec_seq),
1612 static const msi_table font_tables[] =
1614 ADD_TABLE(font_component),
1615 ADD_TABLE(directory),
1616 ADD_TABLE(font_feature),
1617 ADD_TABLE(font_feature_comp),
1618 ADD_TABLE(font_file),
1620 ADD_TABLE(font_install_exec_seq),
1621 ADD_TABLE(font_media),
1625 static const msi_table vp_tables[] =
1627 ADD_TABLE(component),
1628 ADD_TABLE(directory),
1630 ADD_TABLE(feature_comp),
1632 ADD_TABLE(vp_custom_action),
1633 ADD_TABLE(vp_install_exec_seq),
1635 ADD_TABLE(vp_property)
1638 static const msi_table odbc_tables[] =
1640 ADD_TABLE(odbc_component),
1641 ADD_TABLE(directory),
1642 ADD_TABLE(odbc_feature),
1643 ADD_TABLE(odbc_feature_comp),
1644 ADD_TABLE(odbc_file),
1645 ADD_TABLE(odbc_driver),
1646 ADD_TABLE(odbc_translator),
1647 ADD_TABLE(odbc_datasource),
1648 ADD_TABLE(odbc_install_exec_seq),
1649 ADD_TABLE(odbc_media),
1653 static const msi_table tl_tables[] =
1655 ADD_TABLE(tl_component),
1656 ADD_TABLE(directory),
1657 ADD_TABLE(tl_feature),
1658 ADD_TABLE(tl_feature_comp),
1660 ADD_TABLE(tl_typelib),
1661 ADD_TABLE(tl_install_exec_seq),
1666 static const msi_table crs_tables[] =
1668 ADD_TABLE(crs_component),
1669 ADD_TABLE(directory),
1670 ADD_TABLE(crs_feature),
1671 ADD_TABLE(crs_feature_comp),
1672 ADD_TABLE(crs_file),
1673 ADD_TABLE(crs_shortcut),
1674 ADD_TABLE(crs_install_exec_seq),
1679 static const msi_table pub_tables[] =
1681 ADD_TABLE(directory),
1682 ADD_TABLE(pub_component),
1683 ADD_TABLE(pub_feature),
1684 ADD_TABLE(pub_feature_comp),
1685 ADD_TABLE(pub_file),
1686 ADD_TABLE(pub_publish_component),
1687 ADD_TABLE(pub_install_exec_seq),
1692 static const msi_table rd_tables[] =
1694 ADD_TABLE(directory),
1695 ADD_TABLE(rd_component),
1696 ADD_TABLE(rd_feature),
1697 ADD_TABLE(rd_feature_comp),
1699 ADD_TABLE(rd_duplicate_file),
1700 ADD_TABLE(rd_install_exec_seq),
1705 static const msi_table rrv_tables[] =
1707 ADD_TABLE(directory),
1708 ADD_TABLE(rrv_component),
1709 ADD_TABLE(rrv_feature),
1710 ADD_TABLE(rrv_feature_comp),
1711 ADD_TABLE(rrv_file),
1712 ADD_TABLE(rrv_registry),
1713 ADD_TABLE(rrv_remove_registry),
1714 ADD_TABLE(rrv_install_exec_seq),
1719 static const msi_table frp_tables[] =
1721 ADD_TABLE(directory),
1722 ADD_TABLE(frp_component),
1723 ADD_TABLE(frp_feature),
1724 ADD_TABLE(frp_feature_comp),
1725 ADD_TABLE(frp_file),
1726 ADD_TABLE(frp_upgrade),
1727 ADD_TABLE(frp_custom_action),
1728 ADD_TABLE(frp_install_exec_seq),
1733 static const msi_table riv_tables[] =
1735 ADD_TABLE(directory),
1736 ADD_TABLE(riv_component),
1737 ADD_TABLE(riv_feature),
1738 ADD_TABLE(riv_feature_comp),
1739 ADD_TABLE(riv_file),
1740 ADD_TABLE(riv_ini_file),
1741 ADD_TABLE(riv_remove_ini_file),
1742 ADD_TABLE(riv_install_exec_seq),
1747 static const msi_table res_tables[] =
1749 ADD_TABLE(directory),
1750 ADD_TABLE(res_component),
1751 ADD_TABLE(res_feature),
1752 ADD_TABLE(res_feature_comp),
1753 ADD_TABLE(res_file),
1754 ADD_TABLE(res_environment),
1755 ADD_TABLE(res_install_exec_seq),
1760 static const msi_table rci_tables[] =
1762 ADD_TABLE(directory),
1763 ADD_TABLE(rci_component),
1764 ADD_TABLE(rci_feature),
1765 ADD_TABLE(rci_feature_comp),
1766 ADD_TABLE(rci_file),
1767 ADD_TABLE(rci_appid),
1768 ADD_TABLE(rci_class),
1769 ADD_TABLE(rci_install_exec_seq),
1774 static const msi_table rei_tables[] =
1776 ADD_TABLE(directory),
1777 ADD_TABLE(rei_component),
1778 ADD_TABLE(rei_feature),
1779 ADD_TABLE(rei_feature_comp),
1780 ADD_TABLE(rei_file),
1781 ADD_TABLE(rei_extension),
1782 ADD_TABLE(rei_verb),
1783 ADD_TABLE(rei_progid),
1784 ADD_TABLE(rei_install_exec_seq),
1789 static const msi_table rmi_tables[] =
1791 ADD_TABLE(directory),
1792 ADD_TABLE(rmi_component),
1793 ADD_TABLE(rmi_feature),
1794 ADD_TABLE(rmi_feature_comp),
1795 ADD_TABLE(rmi_file),
1796 ADD_TABLE(rmi_extension),
1797 ADD_TABLE(rmi_verb),
1798 ADD_TABLE(rmi_mime),
1799 ADD_TABLE(rmi_install_exec_seq),
1804 static const msi_table pa_tables[] =
1806 ADD_TABLE(directory),
1807 ADD_TABLE(pa_component),
1808 ADD_TABLE(pa_feature),
1809 ADD_TABLE(pa_feature_comp),
1811 ADD_TABLE(pa_msi_assembly),
1812 ADD_TABLE(pa_msi_assembly_name),
1813 ADD_TABLE(pa_install_exec_seq),
1818 /* cabinet definitions */
1820 /* make the max size large so there is only one cab file */
1821 #define MEDIA_SIZE 0x7FFFFFFF
1822 #define FOLDER_THRESHOLD 900000
1824 /* the FCI callbacks */
1826 static void * CDECL mem_alloc(ULONG cb)
1828 return HeapAlloc(GetProcessHeap(), 0, cb);
1831 static void CDECL mem_free(void *memory)
1833 HeapFree(GetProcessHeap(), 0, memory);
1836 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
1838 sprintf(pccab->szCab, pv, pccab->iCab);
1842 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
1847 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
1848 BOOL fContinuation, void *pv)
1853 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
1857 DWORD dwShareMode = 0;
1858 DWORD dwCreateDisposition = OPEN_EXISTING;
1860 dwAccess = GENERIC_READ | GENERIC_WRITE;
1861 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
1863 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
1864 dwCreateDisposition = OPEN_EXISTING;
1866 dwCreateDisposition = CREATE_NEW;
1868 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
1869 dwCreateDisposition, 0, NULL);
1871 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
1873 return (INT_PTR)handle;
1876 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
1878 HANDLE handle = (HANDLE)hf;
1882 res = ReadFile(handle, memory, cb, &dwRead, NULL);
1883 ok(res, "Failed to ReadFile\n");
1888 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
1890 HANDLE handle = (HANDLE)hf;
1894 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
1895 ok(res, "Failed to WriteFile\n");
1900 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
1902 HANDLE handle = (HANDLE)hf;
1903 ok(CloseHandle(handle), "Failed to CloseHandle\n");
1908 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
1910 HANDLE handle = (HANDLE)hf;
1913 ret = SetFilePointer(handle, dist, NULL, seektype);
1914 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
1919 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
1921 BOOL ret = DeleteFileA(pszFile);
1922 ok(ret, "Failed to DeleteFile %s\n", pszFile);
1927 static void init_functionpointers(void)
1929 HMODULE hmsi = GetModuleHandleA("msi.dll");
1930 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
1931 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
1933 #define GET_PROC(mod, func) \
1934 p ## func = (void*)GetProcAddress(mod, #func); \
1936 trace("GetProcAddress(%s) failed\n", #func);
1938 GET_PROC(hmsi, MsiQueryComponentStateA);
1939 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
1940 GET_PROC(hmsi, MsiSourceListGetInfoA);
1941 GET_PROC(hmsi, MsiGetComponentPathExA);
1943 GET_PROC(hadvapi32, ConvertSidToStringSidA);
1944 GET_PROC(hadvapi32, GetTokenInformation);
1945 GET_PROC(hadvapi32, OpenProcessToken);
1946 GET_PROC(hadvapi32, RegDeleteKeyExA)
1947 GET_PROC(hkernel32, IsWow64Process)
1949 hsrclient = LoadLibraryA("srclient.dll");
1950 GET_PROC(hsrclient, SRRemoveRestorePoint);
1951 GET_PROC(hsrclient, SRSetRestorePointA);
1956 static BOOL is_process_limited(void)
1960 if (!pOpenProcessToken || !pGetTokenInformation) return FALSE;
1962 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
1965 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
1968 ret = pGetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
1970 return (ret && type == TokenElevationTypeLimited);
1975 static char *get_user_sid(void)
1980 char *usersid = NULL;
1982 if (!pConvertSidToStringSidA)
1984 win_skip("ConvertSidToStringSidA is not available\n");
1987 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
1988 GetTokenInformation(token, TokenUser, NULL, size, &size);
1990 user = HeapAlloc(GetProcessHeap(), 0, size);
1991 GetTokenInformation(token, TokenUser, user, size, &size);
1992 pConvertSidToStringSidA(user->User.Sid, &usersid);
1993 HeapFree(GetProcessHeap(), 0, user);
1999 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
2003 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
2004 GetTempFileNameA(".", "xx", 0, tempname);
2006 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2008 lstrcpyA(pszTempName, tempname);
2009 HeapFree(GetProcessHeap(), 0, tempname);
2013 HeapFree(GetProcessHeap(), 0, tempname);
2018 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
2019 USHORT *pattribs, int *err, void *pv)
2021 BY_HANDLE_FILE_INFORMATION finfo;
2027 handle = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
2028 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
2030 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2032 res = GetFileInformationByHandle(handle, &finfo);
2033 ok(res, "Expected GetFileInformationByHandle to succeed\n");
2035 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
2036 FileTimeToDosDateTime(&filetime, pdate, ptime);
2038 attrs = GetFileAttributes(pszName);
2039 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2041 return (INT_PTR)handle;
2044 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
2046 char path[MAX_PATH];
2047 char filename[MAX_PATH];
2049 lstrcpyA(path, CURR_DIR);
2050 lstrcatA(path, "\\");
2051 lstrcatA(path, file);
2053 lstrcpyA(filename, file);
2055 return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
2056 progress, get_open_info, compress);
2059 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
2061 ZeroMemory(pCabParams, sizeof(CCAB));
2063 pCabParams->cb = max_size;
2064 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2065 pCabParams->setID = 0xbeef;
2066 pCabParams->iCab = 1;
2067 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2068 lstrcatA(pCabParams->szCabPath, "\\");
2069 lstrcpyA(pCabParams->szCab, name);
2072 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
2080 set_cab_parameters(&cabParams, name, max_size);
2082 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
2083 fci_read, fci_write, fci_close, fci_seek, fci_delete,
2084 get_temp_file, &cabParams, NULL);
2086 ok(hfci != NULL, "Failed to create an FCI context\n");
2091 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2092 ok(res, "Failed to add file: %s\n", ptr);
2093 ptr += lstrlen(ptr) + 1;
2096 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
2097 ok(res, "Failed to flush the cabinet\n");
2099 res = FCIDestroy(hfci);
2100 ok(res, "Failed to destroy the cabinet\n");
2103 static BOOL get_user_dirs(void)
2108 if (RegOpenKey(HKEY_CURRENT_USER,
2109 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey))
2113 if (RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size))
2123 static BOOL get_system_dirs(void)
2128 if (RegOpenKey(HKEY_LOCAL_MACHINE,
2129 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
2133 if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
2134 RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size))
2141 if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
2142 RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size))
2150 if (!GetWindowsDirectoryA(WINDOWS_DIR, MAX_PATH))
2156 static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
2161 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
2162 if (file == INVALID_HANDLE_VALUE)
2165 WriteFile(file, data, strlen(data), &written, NULL);
2169 SetFilePointer(file, size, NULL, FILE_BEGIN);
2176 #define create_file(name, size) create_file_data(name, name, size)
2178 static void create_test_files(void)
2180 CreateDirectoryA("msitest", NULL);
2181 create_file("msitest\\one.txt", 100);
2182 CreateDirectoryA("msitest\\first", NULL);
2183 create_file("msitest\\first\\two.txt", 100);
2184 CreateDirectoryA("msitest\\second", NULL);
2185 create_file("msitest\\second\\three.txt", 100);
2187 create_file("four.txt", 100);
2188 create_file("five.txt", 100);
2189 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2191 create_file("msitest\\filename", 100);
2192 create_file("msitest\\service.exe", 100);
2193 create_file("msitest\\service2.exe", 100);
2195 DeleteFileA("four.txt");
2196 DeleteFileA("five.txt");
2199 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
2201 CHAR path[MAX_PATH];
2203 lstrcpyA(path, PROG_FILES_DIR);
2204 lstrcatA(path, "\\");
2205 lstrcatA(path, rel_path);
2208 return DeleteFileA(path);
2210 return RemoveDirectoryA(path);
2213 static void delete_test_files(void)
2215 DeleteFileA("msitest.msi");
2216 DeleteFileA("msitest.cab");
2217 DeleteFileA("msitest\\second\\three.txt");
2218 DeleteFileA("msitest\\first\\two.txt");
2219 DeleteFileA("msitest\\one.txt");
2220 DeleteFileA("msitest\\service.exe");
2221 DeleteFileA("msitest\\service2.exe");
2222 DeleteFileA("msitest\\filename");
2223 RemoveDirectoryA("msitest\\second");
2224 RemoveDirectoryA("msitest\\first");
2225 RemoveDirectoryA("msitest");
2228 static void write_file(const CHAR *filename, const char *data, int data_size)
2231 HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
2232 WriteFile(hf, data, data_size, &size, NULL);
2236 static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template)
2241 r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
2242 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2244 r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template);
2245 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2247 r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL,
2248 "{004757CA-5092-49c2-AD20-28E1CE0DF5F2}");
2249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2251 r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, version, NULL, NULL);
2252 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2254 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
2255 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2257 r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
2258 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2260 /* write the summary changes back to the stream */
2261 r = MsiSummaryInfoPersist(summary);
2262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2264 MsiCloseHandle(summary);
2267 #define create_database(name, tables, num_tables) \
2268 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2270 #define create_database_template(name, tables, num_tables, version, template) \
2271 create_database_wordcount(name, tables, num_tables, version, 0, template);
2273 static void create_database_wordcount(const CHAR *name, const msi_table *tables,
2274 int num_tables, INT version, INT wordcount,
2275 const char *template)
2281 r = MsiOpenDatabaseA(name, MSIDBOPEN_CREATE, &db);
2282 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2284 /* import the tables into the database */
2285 for (j = 0; j < num_tables; j++)
2287 const msi_table *table = &tables[j];
2289 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2291 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2294 DeleteFileA(table->filename);
2297 write_msi_summary_info(db, version, wordcount, template);
2299 r = MsiDatabaseCommit(db);
2300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2305 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
2307 RESTOREPOINTINFOA spec;
2309 spec.dwEventType = event_type;
2310 spec.dwRestorePtType = APPLICATION_INSTALL;
2311 spec.llSequenceNumber = status->llSequenceNumber;
2312 lstrcpyA(spec.szDescription, "msitest restore point");
2314 return pSRSetRestorePointA(&spec, status);
2317 static void remove_restore_point(DWORD seq_number)
2321 res = pSRRemoveRestorePoint(seq_number);
2322 if (res != ERROR_SUCCESS)
2323 trace("Failed to remove the restore point : %08x\n", res);
2326 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
2328 if (pRegDeleteKeyExA)
2329 return pRegDeleteKeyExA( key, subkey, access, 0 );
2330 return RegDeleteKeyA( key, subkey );
2333 static BOOL file_exists(LPCSTR file)
2335 return GetFileAttributes(file) != INVALID_FILE_ATTRIBUTES;
2338 static BOOL pf_exists(LPCSTR file)
2340 CHAR path[MAX_PATH];
2342 lstrcpyA(path, PROG_FILES_DIR);
2343 lstrcatA(path, "\\");
2344 lstrcatA(path, file);
2346 return file_exists(path);
2349 static void delete_pfmsitest_files(void)
2351 SHFILEOPSTRUCT shfl;
2352 CHAR path[MAX_PATH+11];
2354 lstrcpyA(path, PROG_FILES_DIR);
2355 lstrcatA(path, "\\msitest\\*");
2356 path[strlen(path) + 1] = '\0';
2359 shfl.wFunc = FO_DELETE;
2362 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
2364 SHFileOperation(&shfl);
2366 lstrcpyA(path, PROG_FILES_DIR);
2367 lstrcatA(path, "\\msitest");
2368 RemoveDirectoryA(path);
2371 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, DWORD line)
2379 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)val, &size);
2381 if (res != ERROR_SUCCESS ||
2382 (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_MULTI_SZ))
2384 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2389 ok_(__FILE__, line)(lstrlenA(val) == 0, "Expected empty string, got %s\n", val);
2393 ok_(__FILE__, line)(!lstrcmpA(val, expected), "Expected %s, got %s\n", expected, val);
2395 ok_(__FILE__, line)(!lstrcmpiA(val, expected), "Expected %s, got %s\n", expected, val);
2399 static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line)
2401 DWORD val, size, type;
2404 size = sizeof(DWORD);
2405 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2407 if (res != ERROR_SUCCESS || type != REG_DWORD)
2409 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2413 ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val);
2416 static void check_reg_dword4(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD expected3,
2417 DWORD expected4, DWORD line)
2419 DWORD val, size, type;
2422 size = sizeof(DWORD);
2423 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2425 if (res != ERROR_SUCCESS || type != REG_DWORD)
2427 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2431 ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3 || val == expected4,
2432 "Expected %d, %d, %d or %d, got %d\n", expected1, expected2, expected3, expected4, val);
2435 static void check_reg_dword5(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD expected3,
2436 DWORD expected4, DWORD expected5, DWORD line)
2438 DWORD val, size, type;
2441 size = sizeof(DWORD);
2442 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2444 if (res != ERROR_SUCCESS || type != REG_DWORD)
2446 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2450 ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3 || val == expected4 ||
2452 "Expected %d, %d, %d, %d or %d, got %d\n", expected1, expected2, expected3, expected4, expected5, val);
2455 #define CHECK_REG_STR(prodkey, name, expected) \
2456 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2458 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2459 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2460 RegDeleteValueA(prodkey, name);
2462 #define CHECK_REG_ISTR(prodkey, name, expected) \
2463 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2465 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2466 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2467 RegDeleteValueA(prodkey, name);
2469 #define CHECK_REG_DWORD(prodkey, name, expected) \
2470 check_reg_dword(prodkey, name, expected, __LINE__);
2472 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2473 check_reg_dword(prodkey, name, expected, __LINE__); \
2474 RegDeleteValueA(prodkey, name);
2476 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
2477 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
2479 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
2480 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
2481 RegDeleteValueA(prodkey, name);
2483 #define CHECK_REG_DWORD4(prodkey, name, expected1, expected2, expected3, expected4) \
2484 check_reg_dword4(prodkey, name, expected1, expected2, expected3, expected4, __LINE__);
2486 #define CHECK_DEL_REG_DWORD5(prodkey, name, expected1, expected2, expected3, expected4 ,expected5) \
2487 check_reg_dword5(prodkey, name, expected1, expected2, expected3, expected4, expected5, __LINE__); \
2488 RegDeleteValueA(prodkey, name);
2490 static void get_date_str(LPSTR date)
2494 static const char date_fmt[] = "%d%02d%02d";
2495 GetLocalTime(&systime);
2496 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
2499 static void test_register_product(void)
2503 HKEY hkey, props, usage;
2505 char date[MAX_PATH], temp[MAX_PATH], keypath[MAX_PATH], path[MAX_PATH];
2507 REGSAM access = KEY_ALL_ACCESS;
2509 static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2510 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2511 static const CHAR uninstall_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2512 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2513 static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2514 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2515 static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2516 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2517 static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2518 "\\51AAE0C44620A5E4788506E91F249BD2";
2520 if (is_process_limited())
2522 skip("process is limited\n");
2526 if (!(usersid = get_user_sid()))
2530 GetTempPath(MAX_PATH, temp);
2532 CreateDirectoryA("msitest", NULL);
2533 create_file("msitest\\maximus", 500);
2535 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2538 access |= KEY_WOW64_64KEY;
2540 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2542 /* RegisterProduct */
2543 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
2544 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2546 skip("Not enough rights to perform tests\n");
2549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2550 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2551 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2553 res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
2554 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2558 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
2559 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2563 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
2564 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2567 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2568 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2569 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2570 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2571 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2572 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2573 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2574 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2575 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2576 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2577 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2578 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2579 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2580 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2581 CHECK_DEL_REG_STR(hkey, "Size", NULL);
2582 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2583 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2584 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2585 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2586 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2587 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2588 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2591 CHECK_DEL_REG_DWORD5(hkey, "EstimatedSize", 12, -12, 4, 10, 24);
2594 delete_key(hkey, "", access);
2597 sprintf(keypath, userdata, usersid);
2598 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2599 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2601 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2602 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2604 size = sizeof(path);
2605 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2607 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2609 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2610 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2611 CHECK_DEL_REG_STR(props, "InstallDate", date);
2612 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2613 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2614 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2615 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2616 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
2617 CHECK_DEL_REG_STR(props, "Comments", NULL);
2618 CHECK_DEL_REG_STR(props, "Contact", NULL);
2619 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
2620 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
2621 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
2622 CHECK_DEL_REG_STR(props, "Readme", NULL);
2623 CHECK_DEL_REG_STR(props, "Size", NULL);
2624 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
2625 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
2626 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2627 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2628 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2629 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2630 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2633 CHECK_DEL_REG_DWORD5(props, "EstimatedSize", 12, -12, 4, 10, 24);
2636 delete_key(props, "", access);
2639 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
2642 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2645 delete_key(usage, "", access);
2647 delete_key(hkey, "", access);
2650 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
2651 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2653 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2655 delete_key(hkey, "", access);
2658 /* RegisterProduct, machine */
2659 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1");
2660 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2661 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2662 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2664 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, access, &hkey);
2665 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2669 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
2670 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2674 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
2675 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2678 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2679 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2680 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2681 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2682 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2683 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2684 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2685 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2686 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2687 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2688 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2689 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2690 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2691 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2692 CHECK_DEL_REG_STR(hkey, "Size", NULL);
2693 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2694 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2695 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2696 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2697 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2698 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2699 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2702 CHECK_DEL_REG_DWORD5(hkey, "EstimatedSize", 12, -12, 4, 10, 24);
2705 delete_key(hkey, "", access);
2708 sprintf(keypath, userdata, "S-1-5-18");
2709 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2710 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2712 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2713 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2715 size = sizeof(path);
2716 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2718 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2720 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2721 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2722 CHECK_DEL_REG_STR(props, "InstallDate", date);
2723 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2724 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2725 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2726 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2727 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
2728 CHECK_DEL_REG_STR(props, "Comments", NULL);
2729 CHECK_DEL_REG_STR(props, "Contact", NULL);
2730 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
2731 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
2732 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
2733 CHECK_DEL_REG_STR(props, "Readme", NULL);
2734 CHECK_DEL_REG_STR(props, "Size", NULL);
2735 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
2736 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
2737 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2738 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2739 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2740 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2741 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2744 CHECK_DEL_REG_DWORD5(props, "EstimatedSize", 12, -12, 4, 10, 24);
2747 delete_key(props, "", access);
2750 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
2753 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2756 delete_key(usage, "", access);
2758 delete_key(hkey, "", access);
2761 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
2762 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2764 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2766 delete_key(hkey, "", access);
2770 DeleteFile(msifile);
2771 DeleteFile("msitest\\maximus");
2772 RemoveDirectory("msitest");
2773 HeapFree(GetProcessHeap(), 0, usersid);
2776 static void test_publish_product(void)
2781 HKEY sourcelist, net, props;
2782 HKEY hkey, patches, media;
2783 CHAR keypath[MAX_PATH];
2784 CHAR temp[MAX_PATH];
2785 CHAR path[MAX_PATH];
2786 BOOL old_installer = FALSE;
2787 REGSAM access = KEY_ALL_ACCESS;
2789 static const CHAR prodpath[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2790 "\\Installer\\UserData\\%s\\Products"
2791 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2792 static const CHAR cuprodpath[] = "Software\\Microsoft\\Installer\\Products"
2793 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2794 static const CHAR cuupgrades[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2795 "\\51AAE0C44620A5E4788506E91F249BD2";
2796 static const CHAR badprod[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2797 "\\Installer\\Products"
2798 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2799 static const CHAR machprod[] = "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2800 static const CHAR machup[] = "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2802 if (is_process_limited())
2804 skip("process is limited\n");
2808 if (!(usersid = get_user_sid()))
2811 GetTempPath(MAX_PATH, temp);
2813 CreateDirectoryA("msitest", NULL);
2814 create_file("msitest\\maximus", 500);
2816 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2819 access |= KEY_WOW64_64KEY;
2821 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2823 /* PublishProduct, current user */
2824 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
2825 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2827 skip("Not enough rights to perform tests\n");
2830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2831 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2832 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2834 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
2835 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2837 sprintf(keypath, prodpath, usersid);
2838 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2839 if (res == ERROR_FILE_NOT_FOUND)
2841 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
2842 if (res == ERROR_SUCCESS)
2844 win_skip("Windows Installer < 3.0 detected\n");
2846 old_installer = TRUE;
2851 win_skip("Install failed, no need to continue\n");
2855 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2857 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2858 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2860 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
2863 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2864 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
2867 delete_key(patches, "", access);
2868 RegCloseKey(patches);
2869 delete_key(hkey, "", access);
2873 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
2874 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2876 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
2877 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
2878 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2879 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2881 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
2882 CHECK_DEL_REG_DWORD(hkey, "Assignment", 0);
2883 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
2884 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
2885 CHECK_DEL_REG_STR(hkey, "Clients", ":");
2887 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
2888 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2890 lstrcpyA(path, "n;1;");
2891 lstrcatA(path, temp);
2892 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
2893 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
2895 res = RegOpenKeyA(sourcelist, "Net", &net);
2896 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2898 CHECK_DEL_REG_STR(net, "1", temp);
2900 RegDeleteKeyA(net, "");
2903 res = RegOpenKeyA(sourcelist, "Media", &media);
2904 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2906 CHECK_DEL_REG_STR(media, "1", "DISK1;");
2908 RegDeleteKeyA(media, "");
2910 RegDeleteKeyA(sourcelist, "");
2911 RegCloseKey(sourcelist);
2912 RegDeleteKeyA(hkey, "");
2915 res = RegOpenKeyA(HKEY_CURRENT_USER, cuupgrades, &hkey);
2916 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2918 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2920 RegDeleteKeyA(hkey, "");
2923 /* PublishProduct, machine */
2924 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
2927 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2928 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2929 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2931 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
2932 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2934 sprintf(keypath, prodpath, "S-1-5-18");
2935 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2936 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2938 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2939 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2941 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
2944 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2945 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
2948 delete_key(patches, "", access);
2949 RegCloseKey(patches);
2950 delete_key(hkey, "", access);
2954 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machprod, 0, access, &hkey);
2955 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2957 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
2958 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052c94DA02821EECD05F2F");
2959 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2960 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2962 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
2963 todo_wine CHECK_DEL_REG_DWORD(hkey, "Assignment", 1);
2964 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
2965 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
2966 CHECK_DEL_REG_STR(hkey, "Clients", ":");
2968 res = RegOpenKeyExA(hkey, "SourceList", 0, access, &sourcelist);
2969 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2971 lstrcpyA(path, "n;1;");
2972 lstrcatA(path, temp);
2973 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
2974 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
2976 res = RegOpenKeyExA(sourcelist, "Net", 0, access, &net);
2977 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2979 CHECK_DEL_REG_STR(net, "1", temp);
2981 res = delete_key(net, "", access);
2982 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2985 res = RegOpenKeyExA(sourcelist, "Media", 0, access, &media);
2986 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2988 CHECK_DEL_REG_STR(media, "1", "DISK1;");
2990 res = delete_key(media, "", access);
2991 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2993 res = delete_key(sourcelist, "", access);
2994 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2995 RegCloseKey(sourcelist);
2996 res = delete_key(hkey, "", access);
2997 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3000 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machup, 0, access, &hkey);
3001 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3003 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
3005 res = delete_key(hkey, "", access);
3006 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3010 DeleteFile(msifile);
3011 DeleteFile("msitest\\maximus");
3012 RemoveDirectory("msitest");
3013 HeapFree(GetProcessHeap(), 0, usersid);
3016 static void test_publish_features(void)
3022 CHAR keypath[MAX_PATH];
3023 REGSAM access = KEY_ALL_ACCESS;
3025 static const CHAR cupath[] = "Software\\Microsoft\\Installer\\Features"
3026 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3027 static const CHAR udfeatpath[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3028 "\\Installer\\UserData\\%s\\Products"
3029 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3030 static const CHAR udpridpath[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3031 "\\Installer\\UserData\\%s\\Products"
3032 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3033 static const CHAR featkey[] = "Software\\Microsoft\\Windows\\CurrentVersion"
3034 "\\Installer\\Features";
3035 static const CHAR classfeat[] = "Software\\Classes\\Installer\\Features"
3036 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3038 if (is_process_limited())
3040 skip("process is limited\n");
3044 if (!(usersid = get_user_sid()))
3047 CreateDirectoryA("msitest", NULL);
3048 create_file("msitest\\maximus", 500);
3050 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3053 access |= KEY_WOW64_64KEY;
3055 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
3057 /* PublishFeatures, current user */
3058 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
3059 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3061 skip("Not enough rights to perform tests\n");
3064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3065 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3066 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3068 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3069 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3071 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3072 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3074 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3075 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3077 CHECK_REG_STR(hkey, "feature", "");
3078 CHECK_REG_STR(hkey, "montecristo", "");
3080 RegDeleteValueA(hkey, "feature");
3081 RegDeleteValueA(hkey, "montecristo");
3082 delete_key(hkey, "", access);
3085 sprintf(keypath, udfeatpath, usersid);
3086 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3087 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3089 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3090 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3092 RegDeleteValueA(hkey, "feature");
3093 RegDeleteValueA(hkey, "montecristo");
3094 delete_key(hkey, "", access);
3096 sprintf(keypath, udpridpath, usersid);
3097 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3099 /* PublishFeatures, machine */
3100 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
3101 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3102 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3103 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3105 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3106 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3108 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3109 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3110 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3111 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3113 CHECK_REG_STR(hkey, "feature", "");
3114 CHECK_REG_STR(hkey, "montecristo", "");
3116 RegDeleteValueA(hkey, "feature");
3117 RegDeleteValueA(hkey, "montecristo");
3118 delete_key(hkey, "", access);
3121 sprintf(keypath, udfeatpath, "S-1-5-18");
3122 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3123 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3125 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3126 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3128 RegDeleteValueA(hkey, "feature");
3129 RegDeleteValueA(hkey, "montecristo");
3130 delete_key(hkey, "", access);
3132 sprintf(keypath, udpridpath, "S-1-5-18");
3133 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3136 DeleteFile(msifile);
3137 DeleteFile("msitest\\maximus");
3138 RemoveDirectory("msitest");
3139 HeapFree(GetProcessHeap(), 0, usersid);
3142 static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
3148 r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
3149 if (r != ERROR_SUCCESS)
3152 len += sizeof (WCHAR);
3153 val = HeapAlloc(GetProcessHeap(), 0, len);
3154 if (!val) return NULL;
3156 RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len);
3160 static void get_owner_company(LPSTR *owner, LPSTR *company)
3164 REGSAM access = KEY_ALL_ACCESS;
3166 *owner = *company = NULL;
3169 access |= KEY_WOW64_64KEY;
3171 res = RegOpenKeyA(HKEY_CURRENT_USER,
3172 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
3173 if (res == ERROR_SUCCESS)
3175 *owner = reg_get_val_str(hkey, "DefName");
3176 *company = reg_get_val_str(hkey, "DefCompany");
3180 if (!*owner || !*company)
3182 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3183 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
3184 if (res == ERROR_SUCCESS)
3186 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3187 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3192 if (!*owner || !*company)
3194 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3195 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
3196 if (res == ERROR_SUCCESS)
3198 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3199 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3205 static void test_register_user(void)
3211 LPSTR owner, company;
3212 CHAR keypath[MAX_PATH];
3213 REGSAM access = KEY_ALL_ACCESS;
3215 static const CHAR keypropsfmt[] =
3216 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3217 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3218 static const CHAR keypridfmt[] =
3219 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3220 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3222 if (is_process_limited())
3224 skip("process is limited\n");
3228 if (!(usersid = get_user_sid()))
3231 get_owner_company(&owner, &company);
3233 CreateDirectoryA("msitest", NULL);
3234 create_file("msitest\\maximus", 500);
3236 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3239 access |= KEY_WOW64_64KEY;
3241 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3243 /* RegisterUser, per-user */
3244 r = MsiInstallProductA(msifile, "REGISTER_USER=1");
3245 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3247 skip("Not enough rights to perform tests\n");
3250 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3251 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3252 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3254 sprintf(keypath, keypropsfmt, usersid);
3255 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3256 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3258 CHECK_REG_STR(props, "ProductID", "none");
3259 CHECK_REG_STR(props, "RegCompany", company);
3260 CHECK_REG_STR(props, "RegOwner", owner);
3262 RegDeleteValueA(props, "ProductID");
3263 RegDeleteValueA(props, "RegCompany");
3264 RegDeleteValueA(props, "RegOwner");
3265 delete_key(props, "", access);
3267 sprintf(keypath, keypridfmt, usersid);
3268 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3270 /* RegisterUser, machine */
3271 r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
3272 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3273 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3274 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3276 sprintf(keypath, keypropsfmt, "S-1-5-18");
3277 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3278 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3280 CHECK_REG_STR(props, "ProductID", "none");
3281 CHECK_REG_STR(props, "RegCompany", company);
3282 CHECK_REG_STR(props, "RegOwner", owner);
3284 RegDeleteValueA(props, "ProductID");
3285 RegDeleteValueA(props, "RegCompany");
3286 RegDeleteValueA(props, "RegOwner");
3287 delete_key(props, "", access);
3289 sprintf(keypath, keypridfmt, "S-1-5-18");
3290 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3293 HeapFree(GetProcessHeap(), 0, company);
3294 HeapFree(GetProcessHeap(), 0, owner);
3296 DeleteFile(msifile);
3297 DeleteFile("msitest\\maximus");
3298 RemoveDirectory("msitest");
3302 static void test_process_components(void)
3310 CHAR keypath[MAX_PATH];
3311 CHAR program_files_maximus[MAX_PATH];
3312 REGSAM access = KEY_ALL_ACCESS;
3314 static const CHAR keyfmt[] =
3315 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3316 "UserData\\%s\\Components\\%s";
3317 static const CHAR compkey[] =
3318 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3320 if (is_process_limited())
3322 skip("process is limited\n");
3326 if (!(usersid = get_user_sid()))
3329 CreateDirectoryA("msitest", NULL);
3330 create_file("msitest\\maximus", 500);
3332 create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table));
3335 access |= KEY_WOW64_64KEY;
3337 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3339 /* ProcessComponents, per-user */
3340 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
3341 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3343 skip("Not enough rights to perform tests\n");
3346 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3347 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3348 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3350 sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
3351 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3352 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3355 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3356 NULL, NULL, (LPBYTE)val, &size);
3357 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3359 lstrcpyA(program_files_maximus,PROG_FILES_DIR);
3360 lstrcatA(program_files_maximus,"\\msitest\\maximus");
3362 ok(!lstrcmpiA(val, program_files_maximus),
3363 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3365 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3366 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3368 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3369 delete_key(comp, "", access);
3372 sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
3373 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3374 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3377 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3378 NULL, NULL, (LPBYTE)val, &size);
3379 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3380 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3381 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3383 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3384 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3386 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3387 delete_key(comp, "", access);
3390 /* ProcessComponents, machine */
3391 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3392 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3393 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3394 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3396 sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3397 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3398 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3401 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3402 NULL, NULL, (LPBYTE)val, &size);
3403 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3404 ok(!lstrcmpiA(val, program_files_maximus),
3405 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3407 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3408 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3410 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3411 delete_key(comp, "", access);
3414 sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3415 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3416 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3419 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3420 NULL, NULL, (LPBYTE)val, &size);
3421 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3422 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3423 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3425 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3426 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3428 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3429 delete_key(comp, "", access);
3433 DeleteFile(msifile);
3434 DeleteFile("msitest\\maximus");
3435 RemoveDirectory("msitest");
3439 static void test_publish(void)
3443 HKEY uninstall, prodkey, uninstall_32node = NULL;
3445 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3446 char date[MAX_PATH], temp[MAX_PATH];
3447 REGSAM access = KEY_ALL_ACCESS;
3449 static const CHAR subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3450 static const CHAR subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3452 if (!pMsiQueryComponentStateA)
3454 win_skip("MsiQueryComponentStateA is not available\n");
3457 if (is_process_limited())
3459 skip("process is limited\n");
3464 GetTempPath(MAX_PATH, temp);
3467 access |= KEY_WOW64_64KEY;
3469 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
3470 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3474 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
3475 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3478 CreateDirectoryA("msitest", NULL);
3479 create_file("msitest\\maximus", 500);
3481 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3483 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3485 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3486 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3488 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3489 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3491 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3492 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3494 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3495 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3496 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3497 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3499 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3500 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3502 /* nothing published */
3503 r = MsiInstallProductA(msifile, NULL);
3504 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3506 skip("Not enough rights to perform tests\n");
3509 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3510 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3511 ok(pf_exists("msitest"), "File not installed\n");
3513 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3514 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3516 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3517 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3519 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3520 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3522 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3523 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3524 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3525 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3527 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3528 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3530 /* PublishProduct and RegisterProduct */
3531 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3532 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3533 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3534 ok(pf_exists("msitest"), "File not installed\n");
3536 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3537 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3539 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3540 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3542 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3543 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3545 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3546 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3547 ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
3548 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3552 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3553 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3557 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3558 if (is_wow64 && res == ERROR_FILE_NOT_FOUND) /* XP - Vista, Wow64 */
3559 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3560 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3563 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3564 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3565 CHECK_REG_STR(prodkey, "InstallDate", date);
3566 CHECK_REG_STR(prodkey, "InstallSource", temp);
3567 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3568 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3569 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3570 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3571 CHECK_REG_STR(prodkey, "Comments", NULL);
3572 CHECK_REG_STR(prodkey, "Contact", NULL);
3573 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3574 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3575 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3576 CHECK_REG_STR(prodkey, "Readme", NULL);
3577 CHECK_REG_STR(prodkey, "Size", NULL);
3578 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3579 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3580 CHECK_REG_DWORD(prodkey, "Language", 1033);
3581 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3582 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3583 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3584 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3587 CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -12, 10, 24);
3590 RegCloseKey(prodkey);
3592 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3593 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3594 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3595 ok(pf_exists("msitest"), "File deleted\n");
3597 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3598 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3600 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3601 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3603 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3604 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3606 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3607 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3608 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3609 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3611 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3612 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3614 /* complete install */
3615 r = MsiInstallProductA(msifile, "FULL=1");
3616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3617 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3618 ok(pf_exists("msitest"), "File not installed\n");
3620 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3621 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3623 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3624 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3626 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3627 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3629 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3630 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3632 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3636 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3637 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3641 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3642 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3645 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3646 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3647 CHECK_REG_STR(prodkey, "InstallDate", date);
3648 CHECK_REG_STR(prodkey, "InstallSource", temp);
3649 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3650 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3651 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3652 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3653 CHECK_REG_STR(prodkey, "Comments", NULL);
3654 CHECK_REG_STR(prodkey, "Contact", NULL);
3655 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3656 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3657 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3658 CHECK_REG_STR(prodkey, "Readme", NULL);
3659 CHECK_REG_STR(prodkey, "Size", NULL);
3660 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3661 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3662 CHECK_REG_DWORD(prodkey, "Language", 1033);
3663 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3664 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3665 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3666 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3669 CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -12, 10, 24);
3672 RegCloseKey(prodkey);
3674 /* no UnpublishFeatures */
3675 r = MsiInstallProductA(msifile, "REMOVE=ALL");
3676 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3677 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3678 ok(!pf_exists("msitest"), "Directory not deleted\n");
3680 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3681 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3683 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3684 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3686 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3687 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3689 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3690 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3691 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3692 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3694 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3695 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3697 /* complete install */
3698 r = MsiInstallProductA(msifile, "FULL=1");
3699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3700 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3701 ok(pf_exists("msitest"), "File not installed\n");
3703 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3704 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3706 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3707 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3709 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3710 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3712 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3713 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3715 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3719 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3720 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3724 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3725 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3728 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3729 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3730 CHECK_REG_STR(prodkey, "InstallDate", date);
3731 CHECK_REG_STR(prodkey, "InstallSource", temp);
3732 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3733 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3734 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3735 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3736 CHECK_REG_STR(prodkey, "Comments", NULL);
3737 CHECK_REG_STR(prodkey, "Contact", NULL);
3738 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3739 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3740 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3741 CHECK_REG_STR(prodkey, "Readme", NULL);
3742 CHECK_REG_STR(prodkey, "Size", NULL);
3743 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3744 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3745 CHECK_REG_DWORD(prodkey, "Language", 1033);
3746 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3747 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3748 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3749 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3752 CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -12, 10, 24);
3755 RegCloseKey(prodkey);
3757 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
3758 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
3759 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3760 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3761 ok(pf_exists("msitest"), "Directory deleted\n");
3763 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3764 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3766 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3767 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3769 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3770 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3772 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3773 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3774 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3775 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3779 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3780 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3784 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3785 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3788 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3789 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3790 CHECK_REG_STR(prodkey, "InstallDate", date);
3791 CHECK_REG_STR(prodkey, "InstallSource", temp);
3792 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3793 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3794 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3795 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3796 CHECK_REG_STR(prodkey, "Comments", NULL);
3797 CHECK_REG_STR(prodkey, "Contact", NULL);
3798 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3799 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3800 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3801 CHECK_REG_STR(prodkey, "Readme", NULL);
3802 CHECK_REG_STR(prodkey, "Size", NULL);
3803 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3804 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3805 CHECK_REG_DWORD(prodkey, "Language", 1033);
3806 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3807 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3808 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3809 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3812 CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -12, 10, 24);
3815 RegCloseKey(prodkey);
3817 /* complete install */
3818 r = MsiInstallProductA(msifile, "FULL=1");
3819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3820 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3821 ok(pf_exists("msitest"), "File not installed\n");
3823 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3824 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3826 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3827 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3829 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3830 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3832 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3833 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3834 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3835 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3839 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3840 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3844 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3845 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3848 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3849 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3850 CHECK_REG_STR(prodkey, "InstallDate", date);
3851 CHECK_REG_STR(prodkey, "InstallSource", temp);
3852 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3853 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3854 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3855 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3856 CHECK_REG_STR(prodkey, "Comments", NULL);
3857 CHECK_REG_STR(prodkey, "Contact", NULL);
3858 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3859 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3860 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3861 CHECK_REG_STR(prodkey, "Readme", NULL);
3862 CHECK_REG_STR(prodkey, "Size", NULL);
3863 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3864 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3865 CHECK_REG_DWORD(prodkey, "Language", 1033);
3866 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3867 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3868 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3869 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3872 CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -20, 10, 24);
3875 RegCloseKey(prodkey);
3877 /* UnpublishFeatures, both features removed */
3878 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
3879 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3880 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3881 ok(!pf_exists("msitest"), "Directory not deleted\n");
3883 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3884 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3886 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3887 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3889 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3890 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3892 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3893 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3894 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3895 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3897 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3898 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3900 /* complete install */
3901 r = MsiInstallProductA(msifile, "FULL=1");
3902 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3903 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3904 ok(pf_exists("msitest"), "File not installed\n");
3906 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3907 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3909 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3910 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3912 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3913 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3915 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3916 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3917 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3918 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3922 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3923 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3927 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3928 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3931 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3932 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3933 CHECK_REG_STR(prodkey, "InstallDate", date);
3934 CHECK_REG_STR(prodkey, "InstallSource", temp);
3935 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3936 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3937 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3938 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3939 CHECK_REG_STR(prodkey, "Comments", NULL);
3940 CHECK_REG_STR(prodkey, "Contact", NULL);
3941 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3942 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3943 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3944 CHECK_REG_STR(prodkey, "Readme", NULL);
3945 CHECK_REG_STR(prodkey, "Size", NULL);
3946 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3947 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3948 CHECK_REG_DWORD(prodkey, "Language", 1033);
3949 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3950 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3951 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3952 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3955 CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -12, 10, 24);
3958 RegCloseKey(prodkey);
3960 /* complete uninstall */
3961 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3963 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3964 ok(!pf_exists("msitest"), "Directory not deleted\n");
3966 state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3967 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3969 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");
3970 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3972 state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo");
3973 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3975 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3976 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3977 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3978 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3980 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3981 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3983 /* make sure 'Program Files\msitest' is removed */
3984 delete_pfmsitest_files();
3987 RegCloseKey(uninstall);
3988 RegCloseKey(uninstall_32node);
3989 DeleteFile(msifile);
3990 DeleteFile("msitest\\maximus");
3991 RemoveDirectory("msitest");
3994 static void test_publish_sourcelist(void)
3998 CHAR value[MAX_PATH];
3999 CHAR path[MAX_PATH];
4000 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4002 if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
4004 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4007 if (is_process_limited())
4009 skip("process is limited\n");
4013 CreateDirectoryA("msitest", NULL);
4014 create_file("msitest\\maximus", 500);
4016 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
4018 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4020 r = MsiInstallProductA(msifile, NULL);
4021 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4023 skip("Not enough rights to perform tests\n");
4026 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4027 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4028 ok(pf_exists("msitest"), "File not installed\n");
4030 /* nothing published */
4032 lstrcpyA(value, "aaa");
4033 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4034 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
4035 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4036 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4037 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4040 lstrcpyA(value, "aaa");
4041 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4042 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4043 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4044 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4045 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4047 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
4048 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4049 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4050 ok(pf_exists("msitest"), "File not installed\n");
4052 /* after RegisterProduct */
4054 lstrcpyA(value, "aaa");
4055 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4056 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
4057 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4058 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4059 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4062 lstrcpyA(value, "aaa");
4063 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4064 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4065 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4066 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4067 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4069 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
4070 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4071 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4072 ok(pf_exists("msitest"), "File not installed\n");
4074 /* after ProcessComponents */
4076 lstrcpyA(value, "aaa");
4077 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4078 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
4079 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4080 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4081 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4084 lstrcpyA(value, "aaa");
4085 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4086 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4087 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4088 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4089 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4091 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
4092 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4093 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4094 ok(pf_exists("msitest"), "File not installed\n");
4096 /* after PublishFeatures */
4098 lstrcpyA(value, "aaa");
4099 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4100 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
4101 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4102 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4103 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4106 lstrcpyA(value, "aaa");
4107 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4108 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4109 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4110 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4111 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4113 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
4114 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4115 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4116 ok(pf_exists("msitest"), "File not installed\n");
4118 /* after PublishProduct */
4120 lstrcpyA(value, "aaa");
4121 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4122 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
4123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4124 ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
4125 ok(size == 11, "Expected 11, got %d\n", size);
4128 lstrcpyA(value, "aaa");
4129 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4130 MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATH, value, &size);
4131 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4132 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4133 ok(size == 0, "Expected 0, got %d\n", size);
4136 lstrcpyA(value, "aaa");
4137 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4138 MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPT, value, &size);
4139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4140 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4141 ok(size == 0, "Expected 0, got %d\n", size);
4143 lstrcpyA(path, CURR_DIR);
4144 lstrcatA(path, "\\");
4147 lstrcpyA(value, "aaa");
4148 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4149 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
4150 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4151 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4152 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4155 lstrcpyA(value, "aaa");
4156 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4157 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPE, value, &size);
4158 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4159 ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
4160 ok(size == 1, "Expected 1, got %d\n", size);
4163 lstrcpyA(value, "aaa");
4164 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4165 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4166 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4167 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4168 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
4171 lstrcpyA(value, "aaa");
4172 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4173 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
4174 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4175 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4176 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4179 lstrcpyA(value, "aaa");
4180 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4181 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
4182 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4183 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4184 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
4186 /* complete uninstall */
4187 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
4188 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4189 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4190 ok(!pf_exists("msitest"), "Directory not deleted\n");
4192 /* make sure 'Program Files\msitest' is removed */
4193 delete_pfmsitest_files();
4196 DeleteFile(msifile);
4197 DeleteFile("msitest\\maximus");
4198 RemoveDirectory("msitest");
4201 static void create_pf_data(LPCSTR file, LPCSTR data, BOOL is_file)
4203 CHAR path[MAX_PATH];
4205 lstrcpyA(path, PROG_FILES_DIR);
4206 lstrcatA(path, "\\");
4207 lstrcatA(path, file);
4210 create_file_data(path, data, 500);
4212 CreateDirectoryA(path, NULL);
4215 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
4217 static void test_remove_files(void)
4221 if (is_process_limited())
4223 skip("process is limited\n");
4227 CreateDirectoryA("msitest", NULL);
4228 create_file("msitest\\hydrogen", 500);
4229 create_file("msitest\\helium", 500);
4230 create_file("msitest\\lithium", 500);
4232 create_database(msifile, rem_tables, sizeof(rem_tables) / sizeof(msi_table));
4234 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4236 r = MsiInstallProductA(msifile, NULL);
4237 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4239 skip("Not enough rights to perform tests\n");
4242 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4243 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4244 ok(!pf_exists("msitest\\helium"), "File installed\n");
4245 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4246 ok(pf_exists("msitest"), "File not installed\n");
4248 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4250 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4251 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4252 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4253 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4255 create_pf("msitest", FALSE);
4256 create_pf("msitest\\hydrogen", TRUE);
4257 create_pf("msitest\\helium", TRUE);
4258 create_pf("msitest\\lithium", TRUE);
4260 r = MsiInstallProductA(msifile, NULL);
4261 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4262 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4263 ok(pf_exists("msitest\\helium"), "File not installed\n");
4264 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4265 ok(pf_exists("msitest"), "File not installed\n");
4267 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4268 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4269 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4270 ok(delete_pf("msitest\\helium", TRUE), "File deleted\n");
4271 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4272 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4274 create_pf("msitest", FALSE);
4275 create_pf("msitest\\furlong", TRUE);
4276 create_pf("msitest\\firkin", TRUE);
4277 create_pf("msitest\\fortnight", TRUE);
4278 create_pf("msitest\\becquerel", TRUE);
4279 create_pf("msitest\\dioptre", TRUE);
4280 create_pf("msitest\\attoparsec", TRUE);
4281 create_pf("msitest\\storeys", TRUE);
4282 create_pf("msitest\\block", TRUE);
4283 create_pf("msitest\\siriometer", TRUE);
4284 create_pf("msitest\\cabout", FALSE);
4285 create_pf("msitest\\cabout\\blocker", TRUE);
4287 r = MsiInstallProductA(msifile, NULL);
4288 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4289 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4290 ok(!pf_exists("msitest\\helium"), "File installed\n");
4291 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4292 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4293 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4294 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4295 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4296 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4297 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4298 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4299 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4300 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4301 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4302 ok(pf_exists("msitest"), "File not installed\n");
4304 create_pf("msitest\\furlong", TRUE);
4305 create_pf("msitest\\firkin", TRUE);
4306 create_pf("msitest\\fortnight", TRUE);
4307 create_pf("msitest\\storeys", TRUE);
4308 create_pf("msitest\\block", TRUE);
4309 create_pf("msitest\\siriometer", TRUE);
4311 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4312 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4313 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
4314 ok(!delete_pf("msitest\\helium", TRUE), "File not deleted\n");
4315 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4316 ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
4317 ok(delete_pf("msitest\\firkin", TRUE), "File deleted\n");
4318 ok(delete_pf("msitest\\fortnight", TRUE), "File deleted\n");
4319 ok(!delete_pf("msitest\\becquerel", TRUE), "File not deleted\n");
4320 ok(!delete_pf("msitest\\dioptre", TRUE), "File not deleted\n");
4321 ok(delete_pf("msitest\\attoparsec", TRUE), "File deleted\n");
4322 ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
4323 ok(!delete_pf("msitest\\block", TRUE), "File not deleted\n");
4324 ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
4325 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4326 ok(pf_exists("msitest"), "Directory deleted\n");
4328 r = MsiInstallProductA(msifile, NULL);
4329 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4330 ok(delete_pf("msitest\\hydrogen", TRUE), "File not installed\n");
4331 ok(!delete_pf("msitest\\helium", TRUE), "File installed\n");
4332 ok(delete_pf("msitest\\lithium", TRUE), "File not installed\n");
4333 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4334 ok(pf_exists("msitest"), "Directory deleted\n");
4336 delete_pf("msitest\\cabout\\blocker", TRUE);
4338 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4339 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4340 ok(!delete_pf("msitest\\cabout", FALSE), "Directory not deleted\n");
4341 delete_pf("msitest", FALSE);
4344 DeleteFile(msifile);
4345 DeleteFile("msitest\\hydrogen");
4346 DeleteFile("msitest\\helium");
4347 DeleteFile("msitest\\lithium");
4348 RemoveDirectory("msitest");
4351 static void test_move_files(void)
4354 char props[MAX_PATH];
4356 if (is_process_limited())
4358 skip("process is limited\n");
4362 CreateDirectoryA("msitest", NULL);
4363 create_file("msitest\\augustus", 100);
4364 create_file("cameroon", 100);
4365 create_file("djibouti", 100);
4366 create_file("egypt", 100);
4367 create_file("finland", 100);
4368 create_file("gambai", 100);
4369 create_file("honduras", 100);
4370 create_file("msitest\\india", 100);
4371 create_file("japan", 100);
4372 create_file("kenya", 100);
4373 CreateDirectoryA("latvia", NULL);
4374 create_file("nauru", 100);
4375 create_file("peru", 100);
4376 create_file("apple", 100);
4377 create_file("application", 100);
4378 create_file("ape", 100);
4379 create_file("foo", 100);
4380 create_file("fao", 100);
4381 create_file("fbod", 100);
4382 create_file("budding", 100);
4383 create_file("buddy", 100);
4384 create_file("bud", 100);
4385 create_file("bar", 100);
4386 create_file("bur", 100);
4387 create_file("bird", 100);
4389 create_database(msifile, mov_tables, sizeof(mov_tables) / sizeof(msi_table));
4391 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4393 /* if the source or dest property is not a full path,
4394 * windows tries to access it as a network resource
4397 sprintf(props, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4398 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4399 CURR_DIR, PROG_FILES_DIR, CURR_DIR, CURR_DIR);
4401 r = MsiInstallProductA(msifile, props);
4402 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4404 skip("Not enough rights to perform tests\n");
4407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4408 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4409 ok(!delete_pf("msitest\\dest", TRUE), "File copied\n");
4410 ok(delete_pf("msitest\\canada", TRUE), "File not copied\n");
4411 ok(delete_pf("msitest\\dominica", TRUE), "File not moved\n");
4412 ok(!delete_pf("msitest\\elsalvador", TRUE), "File moved\n");
4413 ok(!delete_pf("msitest\\france", TRUE), "File moved\n");
4414 ok(!delete_pf("msitest\\georgia", TRUE), "File moved\n");
4415 ok(delete_pf("msitest\\hungary", TRUE), "File not moved\n");
4416 ok(!delete_pf("msitest\\indonesia", TRUE), "File moved\n");
4417 ok(!delete_pf("msitest\\jordan", TRUE), "File moved\n");
4418 ok(delete_pf("msitest\\kiribati", TRUE), "File not moved\n");
4419 ok(!delete_pf("msitest\\lebanon", TRUE), "File moved\n");
4420 ok(!delete_pf("msitest\\lebanon", FALSE), "Directory moved\n");
4421 ok(delete_pf("msitest\\poland", TRUE), "File not moved\n");
4422 /* either apple or application will be moved depending on directory order */
4423 if (!delete_pf("msitest\\apple", TRUE))
4424 ok(delete_pf("msitest\\application", TRUE), "File not moved\n");
4426 ok(!delete_pf("msitest\\application", TRUE), "File should not exist\n");
4427 ok(delete_pf("msitest\\wildcard", TRUE), "File not moved\n");
4428 ok(!delete_pf("msitest\\ape", TRUE), "File moved\n");
4429 /* either fao or foo will be moved depending on directory order */
4430 if (delete_pf("msitest\\foo", TRUE))
4431 ok(!delete_pf("msitest\\fao", TRUE), "File should not exist\n");
4433 ok(delete_pf("msitest\\fao", TRUE), "File not moved\n");
4434 ok(delete_pf("msitest\\single", TRUE), "File not moved\n");
4435 ok(!delete_pf("msitest\\fbod", TRUE), "File moved\n");
4436 ok(delete_pf("msitest\\budding", TRUE), "File not moved\n");
4437 ok(delete_pf("msitest\\buddy", TRUE), "File not moved\n");
4438 ok(!delete_pf("msitest\\bud", TRUE), "File moved\n");
4439 ok(delete_pf("msitest\\bar", TRUE), "File not moved\n");
4440 ok(delete_pf("msitest\\bur", TRUE), "File not moved\n");
4441 ok(!delete_pf("msitest\\bird", TRUE), "File moved\n");
4442 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4443 ok(DeleteFileA("cameroon"), "File moved\n");
4444 ok(!DeleteFileA("djibouti"), "File not moved\n");
4445 ok(DeleteFileA("egypt"), "File moved\n");
4446 ok(DeleteFileA("finland"), "File moved\n");
4447 ok(DeleteFileA("gambai"), "File moved\n");
4448 ok(!DeleteFileA("honduras"), "File not moved\n");
4449 ok(DeleteFileA("msitest\\india"), "File moved\n");
4450 ok(DeleteFileA("japan"), "File moved\n");
4451 ok(!DeleteFileA("kenya"), "File not moved\n");
4452 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4453 ok(!DeleteFileA("nauru"), "File not moved\n");
4454 ok(!DeleteFileA("peru"), "File not moved\n");
4455 ok(!DeleteFileA("apple"), "File not moved\n");
4456 ok(!DeleteFileA("application"), "File not moved\n");
4457 ok(DeleteFileA("ape"), "File moved\n");
4458 ok(!DeleteFileA("foo"), "File not moved\n");
4459 ok(!DeleteFileA("fao"), "File not moved\n");
4460 ok(DeleteFileA("fbod"), "File moved\n");
4461 ok(!DeleteFileA("budding"), "File not moved\n");
4462 ok(!DeleteFileA("buddy"), "File not moved\n");
4463 ok(DeleteFileA("bud"), "File moved\n");
4464 ok(!DeleteFileA("bar"), "File not moved\n");
4465 ok(!DeleteFileA("bur"), "File not moved\n");
4466 ok(DeleteFileA("bird"), "File moved\n");
4469 DeleteFile("cameroon");
4470 DeleteFile("djibouti");
4471 DeleteFile("egypt");
4472 DeleteFile("finland");
4473 DeleteFile("gambai");
4474 DeleteFile("honduras");
4475 DeleteFile("japan");
4476 DeleteFile("kenya");
4477 DeleteFile("nauru");
4479 DeleteFile("apple");
4480 DeleteFile("application");
4485 DeleteFile("budding");
4486 DeleteFile("buddy");
4491 DeleteFile("msitest\\india");
4492 DeleteFile("msitest\\augustus");
4493 RemoveDirectory("latvia");
4494 RemoveDirectory("msitest");
4495 DeleteFile(msifile);
4498 static void test_duplicate_files(void)
4502 if (is_process_limited())
4504 skip("process is limited\n");
4508 CreateDirectoryA("msitest", NULL);
4509 create_file("msitest\\maximus", 500);
4510 create_database(msifile, df_tables, sizeof(df_tables) / sizeof(msi_table));
4512 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4514 /* fails if the destination folder is not a valid property */
4516 r = MsiInstallProductA(msifile, NULL);
4517 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4519 skip("Not enough rights to perform tests\n");
4522 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4523 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4524 ok(delete_pf("msitest\\augustus", TRUE), "File not duplicated\n");
4525 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE), "File not duplicated\n");
4526 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE), "Directory not created\n");
4527 ok(delete_pf("msitest\\this\\doesnot", FALSE), "Directory not created\n");
4528 ok(delete_pf("msitest\\this", FALSE), "Directory not created\n");
4529 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4532 DeleteFile("msitest\\maximus");
4533 RemoveDirectory("msitest");
4534 DeleteFile(msifile);
4537 static void test_write_registry_values(void)
4543 CHAR path[MAX_PATH];
4545 if (is_process_limited())
4547 skip("process is limited\n");
4551 CreateDirectoryA("msitest", NULL);
4552 create_file("msitest\\augustus", 500);
4554 create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table));
4556 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4558 r = MsiInstallProductA(msifile, NULL);
4559 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4561 skip("Not enough rights to perform tests\n");
4564 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4565 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
4566 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4569 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
4571 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
4572 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4575 type = REG_MULTI_SZ;
4576 memset(path, 'a', MAX_PATH);
4577 res = RegQueryValueExA(hkey, "Value", NULL, &type, (LPBYTE)path, &size);
4578 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4579 ok(!memcmp(path, "one\0two\0three\0\0", size), "Wrong multi-sz data\n");
4580 ok(size == 15, "Expected 15, got %d\n", size);
4581 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4583 RegDeleteValueA(hkey, "Value");
4585 RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
4588 DeleteFile(msifile);
4589 DeleteFile("msitest\\augustus");
4590 RemoveDirectory("msitest");
4593 static void test_envvar(void)
4595 static const char *results[] =
4597 "1;2", /* MSITESTVAR11 */
4598 "1", /* MSITESTVAR12 */
4599 "1;2", /* MSITESTVAR13 */
4600 ";1;", /* MSITESTVAR14 */
4601 ";;1;;", /* MSITESTVAR15 */
4602 " 1 ", /* MSITESTVAR16 */
4603 ";;2;;1", /* MSITESTVAR17 */
4604 "1;;2;;", /* MSITESTVAR18 */
4605 "1", /* MSITESTVAR19 */
4606 "1", /* MSITESTVAR20 */
4616 if (is_process_limited())
4618 skip("process is limited\n");
4622 create_test_files();
4623 create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table));
4625 res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
4626 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4628 res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2);
4629 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4631 res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2);
4632 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4634 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4636 r = MsiInstallProductA(msifile, NULL);
4637 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4639 skip("Not enough rights to perform tests\n");
4642 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4645 size = sizeof(buffer);
4647 res = RegQueryValueExA(env, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
4648 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4649 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
4650 ok(!lstrcmp(buffer, "1"), "Expected \"1\", got %s\n", buffer);
4652 res = RegDeleteValueA(env, "MSITESTVAR1");
4653 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4656 size = sizeof(buffer);
4658 res = RegQueryValueExA(env, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
4659 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4660 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
4661 ok(!lstrcmp(buffer, "1"), "Expected \"1\", got %s\n", buffer);
4663 res = RegDeleteValueA(env, "MSITESTVAR2");
4664 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4666 res = RegDeleteValueA(env, "MSITESTVAR3");
4667 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4669 res = RegDeleteValueA(env, "MSITESTVAR4");
4670 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4672 res = RegDeleteValueA(env, "MSITESTVAR5");
4673 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4675 res = RegDeleteValueA(env, "MSITESTVAR6");
4676 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4678 res = RegDeleteValueA(env, "MSITESTVAR7");
4679 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4681 res = RegDeleteValueA(env, "MSITESTVAR8");
4682 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4684 res = RegDeleteValueA(env, "MSITESTVAR9");
4685 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4687 res = RegDeleteValueA(env, "MSITESTVAR10");
4688 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4691 while (results[i - 11])
4694 sprintf(name, "MSITESTVAR%d", i);
4697 size = sizeof(buffer);
4699 res = RegQueryValueExA(env, name, NULL, &type, (LPBYTE)buffer, &size);
4700 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
4701 ok(type == REG_SZ, "%d: Expected REG_SZ, got %u\n", i, type);
4702 ok(!lstrcmp(buffer, results[i - 11]), "%d: Expected %s, got %s\n", i, results[i - 11], buffer);
4704 res = RegDeleteValueA(env, name);
4705 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
4709 delete_pf("msitest\\cabout\\new\\five.txt", TRUE);
4710 delete_pf("msitest\\cabout\\new", FALSE);
4711 delete_pf("msitest\\cabout\\four.txt", TRUE);
4712 delete_pf("msitest\\cabout", FALSE);
4713 delete_pf("msitest\\changed\\three.txt", TRUE);
4714 delete_pf("msitest\\changed", FALSE);
4715 delete_pf("msitest\\first\\two.txt", TRUE);
4716 delete_pf("msitest\\first", FALSE);
4717 delete_pf("msitest\\filename", TRUE);
4718 delete_pf("msitest\\one.txt", TRUE);
4719 delete_pf("msitest\\service.exe", TRUE);
4720 delete_pf("msitest\\service2.exe", TRUE);
4721 delete_pf("msitest", FALSE);
4724 RegDeleteValueA(env, "MSITESTVAR1");
4725 RegDeleteValueA(env, "MSITESTVAR2");
4728 delete_test_files();
4729 DeleteFile(msifile);
4732 static void test_create_remove_folder(void)
4736 if (is_process_limited())
4738 skip("process is limited\n");
4742 CreateDirectoryA("msitest", NULL);
4743 CreateDirectoryA("msitest\\first", NULL);
4744 CreateDirectoryA("msitest\\second", NULL);
4745 create_file("msitest\\first\\one.txt", 1000);
4746 create_file("msitest\\second\\two.txt", 1000);
4747 create_database(msifile, cf_tables, sizeof(cf_tables) / sizeof(msi_table));
4749 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4751 r = MsiInstallProductA(msifile, NULL);
4752 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4754 skip("Not enough rights to perform tests\n");
4757 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4759 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
4760 ok(pf_exists("msitest\\first"), "directory not created\n");
4761 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
4762 ok(pf_exists("msitest\\second"), "directory not created\n");
4763 ok(pf_exists("msitest\\third"), "directory not created\n");
4764 ok(pf_exists("msitest"), "directory not created\n");
4766 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4767 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4769 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
4770 ok(!pf_exists("msitest\\first"), "directory not removed\n");
4771 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
4772 ok(!pf_exists("msitest\\second"), "directory not removed\n");
4773 ok(!pf_exists("msitest\\third"), "directory not removed\n");
4774 todo_wine ok(!pf_exists("msitest"), "directory not removed\n");
4777 DeleteFileA("msitest\\first\\one.txt");
4778 DeleteFileA("msitest\\second\\two.txt");
4779 RemoveDirectoryA("msitest\\first");
4780 RemoveDirectoryA("msitest\\second");
4781 RemoveDirectoryA("msitest");
4782 DeleteFile(msifile);
4785 static void test_start_services(void)
4788 SC_HANDLE scm, service;
4790 DWORD error = ERROR_SUCCESS;
4792 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4793 if (!scm && GetLastError() == ERROR_ACCESS_DENIED)
4795 skip("Not enough rights to perform tests\n");
4798 ok(scm != NULL, "Failed to open the SC Manager\n");
4801 service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
4802 if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST)
4804 win_skip("The 'Spooler' service does not exist\n");
4805 CloseServiceHandle(scm);
4808 ok(service != NULL, "Failed to open Spooler, error %d\n", GetLastError());
4810 CloseServiceHandle(scm);
4814 ret = StartService(service, 0, NULL);
4815 if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING)
4817 skip("Spooler service not available, skipping test\n");
4818 CloseServiceHandle(service);
4819 CloseServiceHandle(scm);
4823 CloseServiceHandle(service);
4824 CloseServiceHandle(scm);
4826 create_test_files();
4827 create_database(msifile, sss_tables, sizeof(sss_tables) / sizeof(msi_table));
4829 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4831 r = MsiInstallProductA(msifile, NULL);
4832 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4834 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4835 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
4836 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4837 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
4838 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
4839 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
4840 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
4841 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
4842 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4843 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4844 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4845 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
4846 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4848 delete_test_files();
4849 DeleteFile(msifile);
4851 if (error == ERROR_SUCCESS)
4853 SERVICE_STATUS status;
4855 scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4856 service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
4858 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
4859 ok(ret, "ControlService failed %u\n", GetLastError());
4861 CloseServiceHandle(service);
4862 CloseServiceHandle(scm);
4866 static void test_delete_services(void)
4869 SC_HANDLE manager, service;
4872 if (is_process_limited())
4874 skip("process is limited\n");
4878 manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4879 ok(manager != NULL, "can't open service manager %u\n", GetLastError());
4880 if (!manager) return;
4882 service = CreateServiceA(manager, "TestService3", "TestService3",
4883 SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START,
4884 SERVICE_ERROR_NORMAL, "C:\\doesnt_exist.exe", NULL, NULL, NULL, NULL, NULL);
4885 ok(service != NULL, "can't create service %u\n", GetLastError());
4886 CloseServiceHandle(service);
4887 CloseServiceHandle(manager);
4888 if (!service) goto error;
4890 create_test_files();
4891 create_database(msifile, sds_tables, sizeof(sds_tables) / sizeof(msi_table));
4893 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4895 r = MsiInstallProductA(msifile, NULL);
4896 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4898 skip("Not enough rights to perform tests\n");
4901 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4903 manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4904 ok(manager != NULL, "can't open service manager\n");
4905 if (!manager) goto error;
4907 service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
4908 error = GetLastError();
4909 ok(service == NULL, "TestService3 not deleted\n");
4910 ok(error == ERROR_SERVICE_DOES_NOT_EXIST, "wrong error %u\n", error);
4911 CloseServiceHandle(manager);
4913 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4916 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4917 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
4918 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4919 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
4920 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
4921 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
4922 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
4923 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
4924 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4925 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4926 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4927 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
4928 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4931 delete_test_files();
4932 DeleteFile(msifile);
4935 static void test_self_registration(void)
4939 if (is_process_limited())
4941 skip("process is limited\n");
4945 create_test_files();
4946 create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table));
4948 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4950 r = MsiInstallProductA(msifile, NULL);
4951 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4953 skip("Not enough rights to perform tests\n");
4956 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4958 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4959 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
4960 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4961 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
4962 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
4963 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
4964 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
4965 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
4966 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4967 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4968 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4969 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
4970 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4973 delete_test_files();
4974 DeleteFile(msifile);
4977 static void test_register_font(void)
4979 static const char regfont1[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
4980 static const char regfont2[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
4984 REGSAM access = KEY_ALL_ACCESS;
4986 if (is_process_limited())
4988 skip("process is limited\n");
4992 create_test_files();
4993 create_file("msitest\\font.ttf", 1000);
4994 create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table));
4997 access |= KEY_WOW64_64KEY;
4999 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5001 r = MsiInstallProductA(msifile, NULL);
5002 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5004 skip("Not enough rights to perform tests\n");
5007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5009 ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont1, 0, access, &key);
5011 RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont2, 0, access, &key);
5013 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5014 ok(ret != ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
5016 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5017 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5019 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5021 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5022 ok(ret == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
5024 RegDeleteValueA(key, "msi test font");
5028 DeleteFileA("msitest\\font.ttf");
5029 delete_test_files();
5030 DeleteFile(msifile);
5033 static void test_validate_product_id(void)
5037 if (is_process_limited())
5039 skip("process is limited\n");
5043 create_test_files();
5044 create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table));
5046 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5048 r = MsiInstallProductA(msifile, NULL);
5049 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5051 skip("Not enough rights to perform tests\n");
5054 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5056 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=1");
5057 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5059 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=2");
5060 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5062 r = MsiInstallProductA(msifile, "PIDKEY=123-1234567");
5063 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5065 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5066 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5067 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5068 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5069 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5070 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5071 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5072 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5073 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5074 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5075 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5076 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5077 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5080 delete_test_files();
5081 DeleteFile(msifile);
5084 static void test_install_remove_odbc(void)
5088 if (is_process_limited())
5090 skip("process is limited\n");
5094 create_test_files();
5095 create_file("msitest\\ODBCdriver.dll", 1000);
5096 create_file("msitest\\ODBCdriver2.dll", 1000);
5097 create_file("msitest\\ODBCtranslator.dll", 1000);
5098 create_file("msitest\\ODBCtranslator2.dll", 1000);
5099 create_file("msitest\\ODBCsetup.dll", 1000);
5100 create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table));
5102 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5104 r = MsiInstallProductA(msifile, NULL);
5105 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5107 skip("Not enough rights to perform tests\n");
5110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5112 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5113 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5114 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5115 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5116 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5118 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5119 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5121 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not removed\n");
5122 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not removed\n");
5123 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not removed\n");
5124 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not removed\n");
5125 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
5126 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5129 DeleteFileA("msitest\\ODBCdriver.dll");
5130 DeleteFileA("msitest\\ODBCdriver2.dll");
5131 DeleteFileA("msitest\\ODBCtranslator.dll");
5132 DeleteFileA("msitest\\ODBCtranslator2.dll");
5133 DeleteFileA("msitest\\ODBCsetup.dll");
5134 delete_test_files();
5135 DeleteFile(msifile);
5138 static void test_register_typelib(void)
5142 if (is_process_limited())
5144 skip("process is limited\n");
5148 create_test_files();
5149 create_file("msitest\\typelib.dll", 1000);
5150 create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table));
5152 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5154 r = MsiInstallProductA(msifile, "REGISTER_TYPELIB=1");
5155 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5157 skip("Not enough rights to perform tests\n");
5160 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5162 r = MsiInstallProductA(msifile, NULL);
5163 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5165 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5168 ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n");
5169 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5172 DeleteFileA("msitest\\typelib.dll");
5173 delete_test_files();
5174 DeleteFile(msifile);
5177 static void test_create_remove_shortcut(void)
5181 if (is_process_limited())
5183 skip("process is limited\n");
5187 create_test_files();
5188 create_file("msitest\\target.txt", 1000);
5189 create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table));
5191 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5193 r = MsiInstallProductA(msifile, NULL);
5194 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5196 skip("Not enough rights to perform tests\n");
5199 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5201 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5202 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5204 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5207 ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n");
5208 ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n");
5209 todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5212 DeleteFileA("msitest\\target.txt");
5213 delete_test_files();
5214 DeleteFile(msifile);
5217 static void test_publish_components(void)
5219 static char keypath[] =
5220 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5226 if (is_process_limited())
5228 skip("process is limited\n");
5232 create_test_files();
5233 create_file("msitest\\english.txt", 1000);
5234 create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table));
5236 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5238 r = MsiInstallProductA(msifile, NULL);
5239 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5241 skip("Not enough rights to perform tests\n");
5244 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5246 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5247 ok(res == ERROR_SUCCESS, "components key not created %d\n", res);
5249 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL);
5250 ok(res == ERROR_SUCCESS, "value not found %d\n", res);
5253 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5254 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5256 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5257 ok(res == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", res);
5259 ok(!delete_pf("msitest\\english.txt", TRUE), "file not removed\n");
5260 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5263 DeleteFileA("msitest\\english.txt");
5264 delete_test_files();
5265 DeleteFile(msifile);
5268 static void test_remove_duplicate_files(void)
5272 if (is_process_limited())
5274 skip("process is limited\n");
5278 create_test_files();
5279 create_file("msitest\\original.txt", 1000);
5280 create_file("msitest\\original2.txt", 1000);
5281 create_file("msitest\\original3.txt", 1000);
5282 create_database(msifile, rd_tables, sizeof(rd_tables) / sizeof(msi_table));
5284 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5286 r = MsiInstallProductA(msifile, NULL);
5287 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5289 skip("Not enough rights to perform tests\n");
5292 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5294 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5295 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5296 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5297 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5298 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5300 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5301 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5303 ok(delete_pf("msitest\\original.txt", TRUE), "file removed\n");
5304 ok(!delete_pf("msitest\\original2.txt", TRUE), "file not removed\n");
5305 ok(!delete_pf("msitest\\original3.txt", TRUE), "file not removed\n");
5306 ok(!delete_pf("msitest\\duplicate.txt", TRUE), "file not removed\n");
5307 ok(!delete_pf("msitest\\duplicate2.txt", TRUE), "file not removed\n");
5308 ok(delete_pf("msitest", FALSE), "directory removed\n");
5311 DeleteFileA("msitest\\original.txt");
5312 DeleteFileA("msitest\\original2.txt");
5313 DeleteFileA("msitest\\original3.txt");
5314 delete_test_files();
5315 DeleteFile(msifile);
5318 static void test_remove_registry_values(void)
5323 REGSAM access = KEY_ALL_ACCESS;
5325 if (is_process_limited())
5327 skip("process is limited\n");
5331 create_test_files();
5332 create_file("msitest\\registry.txt", 1000);
5333 create_database(msifile, rrv_tables, sizeof(rrv_tables) / sizeof(msi_table));
5336 access |= KEY_WOW64_64KEY;
5338 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5340 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, NULL, 0, access, NULL, &key, NULL);
5341 RegSetValueExA(key, "value1", 0, REG_SZ, (const BYTE *)"1", 2);
5344 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
5345 RegSetValueExA(key, "value2", 0, REG_SZ, (const BYTE *)"2", 2);
5348 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, NULL, 0, access, NULL, &key, NULL);
5349 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
5350 RegSetValueExA(key, "valueA", 0, REG_SZ, (const BYTE *)"A", 2);
5351 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
5354 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, NULL, 0, access, NULL, &key, NULL);
5355 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
5356 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
5359 r = MsiInstallProductA(msifile, NULL);
5360 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5362 skip("Not enough rights to perform tests\n");
5365 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5367 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, access, &key);
5368 ok(res == ERROR_SUCCESS, "key removed\n");
5373 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
5374 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5378 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
5379 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5382 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
5383 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5386 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5387 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5391 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
5392 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5396 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
5397 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5400 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, access, &key);
5401 ok(res == ERROR_SUCCESS, "key removed\n");
5404 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, access, &key);
5405 ok(res == ERROR_SUCCESS, "key removed\n");
5410 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
5411 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5415 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
5416 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5419 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
5420 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
5421 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine", access);
5423 ok(!delete_pf("msitest\\registry.txt", TRUE), "file not removed\n");
5424 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5427 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", access);
5428 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
5429 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
5430 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", access);
5432 DeleteFileA("msitest\\registry.txt");
5433 delete_test_files();
5434 DeleteFile(msifile);
5437 static void test_find_related_products(void)
5441 if (is_process_limited())
5443 skip("process is limited\n");
5447 create_test_files();
5448 create_file("msitest\\product.txt", 1000);
5449 create_database(msifile, frp_tables, sizeof(frp_tables) / sizeof(msi_table));
5451 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5453 r = MsiInstallProductA(msifile, NULL);
5454 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5456 skip("Not enough rights to perform tests\n");
5459 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5461 /* install again, so it finds the upgrade code */
5462 r = MsiInstallProductA(msifile, NULL);
5463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5465 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5466 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5468 ok(!delete_pf("msitest\\product.txt", TRUE), "file not removed\n");
5469 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5472 DeleteFileA("msitest\\product.txt");
5473 delete_test_files();
5474 DeleteFile(msifile);
5477 static void test_remove_ini_values(void)
5481 char inifile[MAX_PATH], buf[0x10];
5485 if (is_process_limited())
5487 skip("process is limited\n");
5491 create_test_files();
5492 create_file("msitest\\inifile.txt", 1000);
5493 create_database(msifile, riv_tables, sizeof(riv_tables) / sizeof(msi_table));
5495 lstrcpyA(inifile, PROG_FILES_DIR);
5496 lstrcatA(inifile, "\\msitest");
5497 ret = CreateDirectoryA(inifile, NULL);
5498 if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
5500 skip("Not enough rights to perform tests\n");
5503 lstrcatA(inifile, "\\test.ini");
5504 file = CreateFileA(inifile, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0, NULL);
5507 ret = WritePrivateProfileStringA("section1", "key1", "value1", inifile);
5508 ok(ret, "failed to write profile string %u\n", GetLastError());
5510 ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile);
5511 ok(ret, "failed to write profile string %u\n", GetLastError());
5513 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5515 r = MsiInstallProductA(msifile, NULL);
5516 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5518 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5519 ok(len == 6, "got %u expected 6\n", len);
5521 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5522 ok(!len, "got %u expected 0\n", len);
5524 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5527 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5528 ok(!len, "got %u expected 0\n", len);
5530 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5531 ok(!len, "got %u expected 0\n", len);
5533 todo_wine ok(!delete_pf("msitest\\test.ini", TRUE), "file removed\n");
5534 ok(!delete_pf("msitest\\inifile.txt", TRUE), "file not removed\n");
5535 ok(delete_pf("msitest", FALSE), "directory removed\n");
5538 DeleteFileA("msitest\\inifile.txt");
5539 delete_test_files();
5540 DeleteFile(msifile);
5543 static void test_remove_env_strings(void)
5551 if (is_process_limited())
5553 skip("process is limited\n");
5557 create_test_files();
5558 create_file("msitest\\envvar.txt", 1000);
5559 create_database(msifile, res_tables, sizeof(res_tables) / sizeof(msi_table));
5561 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5563 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
5564 ok(!res, "failed to open environment key %d\n", res);
5566 RegSetValueExA(key, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"1", 2);
5567 RegSetValueExA(key, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"1", 2);
5568 RegSetValueExA(key, "MSITESTVAR3", 0, REG_SZ, (const BYTE *)"1", 2);
5569 RegSetValueExA(key, "MSITESTVAR4", 0, REG_SZ, (const BYTE *)"1", 2);
5570 RegSetValueExA(key, "MSITESTVAR5", 0, REG_SZ, (const BYTE *)"1", 2);
5574 r = MsiInstallProductA(msifile, NULL);
5575 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5577 skip("Not enough rights to perform tests\n");
5580 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5582 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
5583 ok(!res, "failed to open environment key %d\n", res);
5587 size = sizeof(buffer);
5588 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
5589 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5590 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5591 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5595 size = sizeof(buffer);
5596 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
5597 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5598 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5599 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5603 size = sizeof(buffer);
5604 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
5605 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5606 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5607 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5611 size = sizeof(buffer);
5612 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, &type, (LPBYTE)buffer, &size);
5613 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5614 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5615 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5619 size = sizeof(buffer);
5620 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
5621 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5622 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5623 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5627 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5628 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5630 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
5631 ok(!res, "failed to open environment key %d\n", res);
5633 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, NULL, NULL, NULL);
5634 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5636 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, NULL, NULL, NULL);
5637 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5641 size = sizeof(buffer);
5642 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
5643 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5644 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5645 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5646 RegDeleteValueA(key, "MSITESTVAR3");
5648 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, NULL, NULL, NULL);
5649 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5653 size = sizeof(buffer);
5654 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
5655 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5656 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5657 ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5658 RegDeleteValueA(key, "MSITESTVAR5");
5660 ok(!delete_pf("msitest\\envvar.txt", TRUE), "file not removed\n");
5661 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5664 RegDeleteValueA(key, "MSITESTVAR1");
5665 RegDeleteValueA(key, "MSITESTVAR2");
5666 RegDeleteValueA(key, "MSITESTVAR3");
5667 RegDeleteValueA(key, "MSITESTVAR4");
5668 RegDeleteValueA(key, "MSITESTVAR5");
5671 DeleteFileA("msitest\\envvar.txt");
5672 delete_test_files();
5673 DeleteFile(msifile);
5676 static void test_register_class_info(void)
5682 if (is_process_limited())
5684 skip("process is limited\n");
5688 create_test_files();
5689 create_file("msitest\\class.txt", 1000);
5690 create_database(msifile, rci_tables, sizeof(rci_tables) / sizeof(msi_table));
5692 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5694 r = MsiInstallProductA(msifile, NULL);
5695 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5697 skip("Not enough rights to perform tests\n");
5700 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5703 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
5705 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
5706 ok(res == ERROR_SUCCESS, "key not created\n");
5709 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
5710 ok(res == ERROR_SUCCESS, "key not created\n");
5713 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
5714 ok(res == ERROR_SUCCESS, "key not created\n");
5717 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5718 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5721 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
5723 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
5724 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5726 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
5727 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5729 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
5730 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5732 ok(!delete_pf("msitest\\class.txt", TRUE), "file not removed\n");
5733 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5736 DeleteFileA("msitest\\class.txt");
5737 delete_test_files();
5738 DeleteFile(msifile);
5741 static void test_register_extension_info(void)
5747 if (is_process_limited())
5749 skip("process is limited\n");
5753 create_test_files();
5754 create_file("msitest\\extension.txt", 1000);
5755 create_database(msifile, rei_tables, sizeof(rei_tables) / sizeof(msi_table));
5757 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5759 r = MsiInstallProductA(msifile, NULL);
5760 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5762 skip("Not enough rights to perform tests\n");
5765 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5767 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
5768 ok(res == ERROR_SUCCESS, "key not created\n");
5771 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &hkey);
5772 ok(res == ERROR_SUCCESS, "key not created\n");
5775 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5776 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5778 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
5779 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5781 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1", &hkey);
5782 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5784 ok(!delete_pf("msitest\\extension.txt", TRUE), "file not removed\n");
5785 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5788 DeleteFileA("msitest\\extension.txt");
5789 delete_test_files();
5790 DeleteFile(msifile);
5793 static void test_register_mime_info(void)
5799 if (is_process_limited())
5801 skip("process is limited\n");
5805 create_test_files();
5806 create_file("msitest\\mime.txt", 1000);
5807 create_database(msifile, rmi_tables, sizeof(rmi_tables) / sizeof(msi_table));
5809 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5811 r = MsiInstallProductA(msifile, NULL);
5812 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5814 skip("Not enough rights to perform tests\n");
5817 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5819 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
5820 ok(res == ERROR_SUCCESS, "key not created\n");
5823 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5824 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5826 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
5827 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5829 ok(!delete_pf("msitest\\mime.txt", TRUE), "file not removed\n");
5830 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5833 DeleteFileA("msitest\\mime.txt");
5834 delete_test_files();
5835 DeleteFile(msifile);
5838 static void test_publish_assemblies(void)
5840 static const char manifest[] =
5841 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
5842 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
5843 "processorArchitecture=\"x86\"/>";
5844 static const char manifest_local[] =
5845 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
5846 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
5847 "processorArchitecture=\"x86\"/>";
5848 static const char classes_path_dotnet[] =
5849 "Installer\\Assemblies\\Global";
5850 static const char classes_path_dotnet_local[] =
5851 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
5852 static const char classes_path_dotnet_local_wow64[] =
5853 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
5854 static const char classes_path_win32[] =
5855 "Installer\\Win32Assemblies\\Global";
5856 static const char classes_path_win32_local[] =
5857 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
5858 static const char classes_path_win32_local_wow64[] =
5859 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
5860 static const char path_dotnet[] =
5861 "Software\\Microsoft\\Installer\\Assemblies\\Global";
5862 static const char path_dotnet_local[] =
5863 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
5864 static const char path_dotnet_local_wow64[] =
5865 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
5866 static const char path_win32[] =
5867 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
5868 static const char path_win32_local[] =
5869 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
5870 static const char path_win32_local_wow64[] =
5871 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
5872 static const char name_dotnet[] =
5873 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
5874 "version=\"1.0.0.0\",culture=\"neutral\"";
5875 static const char name_dotnet_local[] =
5876 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
5877 "version=\"1.0.0.0\",culture=\"neutral\"";
5878 static const char name_win32[] =
5879 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
5880 "type=\"win32\",version=\"1.0.0.0\"";
5881 static const char name_win32_local[] =
5882 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
5883 "type=\"win32\",version=\"1.0.0.0\"";
5890 if (is_process_limited())
5892 skip("process is limited\n");
5896 create_test_files();
5897 create_file("msitest\\win32.txt", 1000);
5898 create_file("msitest\\win32_local.txt", 1000);
5899 create_file("msitest\\dotnet.txt", 1000);
5900 create_file("msitest\\dotnet_local.txt", 1000);
5901 create_file_data("msitest\\manifest.txt", manifest, 0);
5902 create_file_data("msitest\\manifest_local.txt", manifest_local, 0);
5903 create_file("msitest\\application_win32.txt", 1000);
5904 create_file("msitest\\application_dotnet.txt", 1000);
5905 create_database(msifile, pa_tables, sizeof(pa_tables) / sizeof(msi_table));
5907 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5909 r = MsiInstallProductA(msifile, NULL);
5910 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5912 skip("Not enough rights to perform tests\n");
5915 if (r == ERROR_INSTALL_FAILURE)
5917 skip("No support for installing side-by-side assemblies\n");
5920 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5922 res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey);
5923 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5924 CHECK_REG_STR(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
5927 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
5928 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
5929 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5930 CHECK_REG_STR(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
5933 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
5934 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
5935 "Expected ERROR_SUCCESS, got %d\n", res);
5936 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
5939 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
5940 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
5941 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
5942 "Expected ERROR_SUCCESS, got %d\n", res);
5943 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
5946 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5947 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5949 res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey);
5950 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
5951 if (res == ERROR_SUCCESS)
5953 res = RegDeleteValueA(hkey, name_dotnet);
5954 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5958 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
5959 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
5960 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5962 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
5963 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
5964 if (res == ERROR_SUCCESS)
5966 res = RegDeleteValueA(hkey, name_win32);
5967 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5971 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
5972 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
5973 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5975 r = MsiInstallProductA(msifile, "ALLUSERS=1");
5976 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5978 access = KEY_QUERY_VALUE;
5979 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
5980 if (res == ERROR_FILE_NOT_FOUND && is_wow64) /* Vista WOW64 */
5982 trace("Using 64-bit registry view for HKCR\\Installer\n");
5983 access = KEY_QUERY_VALUE | KEY_WOW64_64KEY;
5984 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
5986 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5987 CHECK_REG_STR(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
5990 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
5991 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
5992 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5993 CHECK_REG_STR(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
5996 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_win32, 0, access, &hkey);
5997 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
5998 "Expected ERROR_SUCCESS, got %d\n", res);
5999 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6002 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6003 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6004 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6005 "Expected ERROR_SUCCESS, got %d\n", res);
6006 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6009 r = MsiInstallProductA(msifile, "REMOVE=ALL ALLUSERS=1");
6010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6012 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_dotnet, &hkey);
6013 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6014 if (res == ERROR_SUCCESS)
6016 res = RegDeleteValueA(hkey, name_dotnet);
6017 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6021 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6022 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6023 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6025 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_win32, &hkey);
6026 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6027 if (res == ERROR_SUCCESS)
6029 res = RegDeleteValueA(hkey, name_win32);
6030 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6034 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6035 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6036 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6039 DeleteFileA("msitest\\win32.txt");
6040 DeleteFileA("msitest\\win32_local.txt");
6041 DeleteFileA("msitest\\dotnet.txt");
6042 DeleteFileA("msitest\\dotnet_local.txt");
6043 DeleteFileA("msitest\\manifest.txt");
6044 DeleteFileA("msitest\\manifest_local.txt");
6045 DeleteFileA("msitest\\application_win32.txt");
6046 DeleteFileA("msitest\\application_dotnet.txt");
6047 delete_test_files();
6048 DeleteFile(msifile);
6054 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6055 STATEMGRSTATUS status;
6058 init_functionpointers();
6060 if (pIsWow64Process)
6061 pIsWow64Process(GetCurrentProcess(), &is_wow64);
6063 GetCurrentDirectoryA(MAX_PATH, prev_path);
6064 GetTempPath(MAX_PATH, temp_path);
6065 SetCurrentDirectoryA(temp_path);
6067 lstrcpyA(CURR_DIR, temp_path);
6068 len = lstrlenA(CURR_DIR);
6070 if(len && (CURR_DIR[len - 1] == '\\'))
6071 CURR_DIR[len - 1] = 0;
6073 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6074 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6076 /* Create a restore point ourselves so we circumvent the multitude of restore points
6077 * that would have been created by all the installation and removal tests.
6079 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6080 * creation of restore points.
6082 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
6084 memset(&status, 0, sizeof(status));
6085 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
6088 /* Create only one log file and don't append. We have to pass something
6089 * for the log mode for this to work. The logfile needs to have an absolute
6090 * path otherwise we still end up with some extra logfiles as some tests
6091 * change the current directory.
6093 lstrcpyA(log_file, temp_path);
6094 lstrcatA(log_file, "\\msitest.log");
6095 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
6097 test_register_product();
6098 test_publish_product();
6099 test_publish_features();
6100 test_register_user();
6101 test_process_components();
6103 test_publish_sourcelist();
6104 test_remove_files();
6106 test_duplicate_files();
6107 test_write_registry_values();
6109 test_create_remove_folder();
6110 test_start_services();
6111 test_delete_services();
6112 test_self_registration();
6113 test_register_font();
6114 test_validate_product_id();
6115 test_install_remove_odbc();
6116 test_register_typelib();
6117 test_create_remove_shortcut();
6118 test_publish_components();
6119 test_remove_duplicate_files();
6120 test_remove_registry_values();
6121 test_find_related_products();
6122 test_remove_ini_values();
6123 test_remove_env_strings();
6124 test_register_class_info();
6125 test_register_extension_info();
6126 test_register_mime_info();
6127 test_publish_assemblies();
6129 DeleteFileA(log_file);
6131 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
6133 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
6135 remove_restore_point(status.llSequenceNumber);
6137 FreeLibrary(hsrclient);
6139 SetCurrentDirectoryA(prev_path);