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
32 #include <srrestoreptapi.h>
39 #include "wine/test.h"
43 static UINT (WINAPI
*pMsiQueryComponentStateA
)
44 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
45 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
46 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
47 static UINT (WINAPI
*pMsiSourceListGetInfoA
)
48 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, LPCSTR
, LPSTR
, LPDWORD
);
49 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
50 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
51 static UINT (WINAPI
*pMsiQueryFeatureStateExA
)
52 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
54 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
55 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
57 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
58 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
61 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
63 static const char *msifile
= "msitest.msi";
65 /* msi database data */
67 static const char component_dat
[] =
68 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
69 "s72\tS38\ts72\ti2\tS255\tS72\n"
70 "Component\tComponent\n"
71 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
72 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
73 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
74 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
75 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
76 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
77 "component\t\tMSITESTDIR\t0\t1\tfile\n"
78 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
79 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
80 "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
82 static const char directory_dat
[] =
83 "Directory\tDirectory_Parent\tDefaultDir\n"
85 "Directory\tDirectory\n"
86 "CABOUTDIR\tMSITESTDIR\tcabout\n"
87 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
88 "FIRSTDIR\tMSITESTDIR\tfirst\n"
89 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
90 "NEWDIR\tCABOUTDIR\tnew\n"
91 "ProgramFilesFolder\tTARGETDIR\t.\n"
92 "TARGETDIR\t\tSourceDir";
94 static const char feature_dat
[] =
95 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
96 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
98 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
99 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
100 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
101 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
102 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
103 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
104 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
106 static const char feature_comp_dat
[] =
107 "Feature_\tComponent_\n"
109 "FeatureComponents\tFeature_\tComponent_\n"
115 "feature\tcomponent\n"
116 "service_feature\tservice_comp\n"
117 "service_feature\tservice_comp2\n"
118 "service_feature\tservice_comp3";
120 static const char file_dat
[] =
121 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
122 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
124 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
125 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
126 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
127 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
128 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
129 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
130 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
131 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
133 static const char install_exec_seq_dat
[] =
134 "Action\tCondition\tSequence\n"
136 "InstallExecuteSequence\tAction\n"
137 "AllocateRegistrySpace\tNOT Installed\t1550\n"
138 "CostFinalize\t\t1000\n"
139 "CostInitialize\t\t800\n"
141 "ResolveSource\t\t950\n"
142 "MoveFiles\t\t1700\n"
143 "InstallFiles\t\t4000\n"
144 "DuplicateFiles\t\t4500\n"
145 "CreateShortcuts\t\t4600\n"
146 "InstallServices\t\t5000\n"
147 "InstallFinalize\t\t6600\n"
148 "InstallInitialize\t\t1500\n"
149 "InstallValidate\t\t1400\n"
150 "LaunchConditions\t\t100\n"
151 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
153 static const char media_dat
[] =
154 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
155 "i2\ti4\tL64\tS255\tS32\tS72\n"
157 "1\t3\t\t\tDISK1\t\n"
158 "2\t7\t\tmsitest.cab\tDISK2\t\n";
160 static const char property_dat
[] =
163 "Property\tProperty\n"
164 "DefaultUIFont\tDlgFont8\n"
167 "InstallMode\tTypical\n"
168 "Manufacturer\tWine\n"
169 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
170 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
172 "ProductLanguage\t1033\n"
173 "ProductName\tMSITEST\n"
174 "ProductVersion\t1.1.1\n"
175 "PROMPTROLLBACKCOST\tP\n"
177 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
178 "AdminProperties\tPOSTADMIN\n"
180 "SERVNAME\tTestService\n"
181 "SERVNAME2\tTestService2\n"
182 "SERVDISP\tTestServiceDisp\n"
183 "SERVDISP2\tTestServiceDisp2\n"
184 "MSIFASTINSTALL\t1\n"
188 static const char env_install_exec_seq_dat
[] =
189 "Action\tCondition\tSequence\n"
191 "InstallExecuteSequence\tAction\n"
192 "CostInitialize\t\t100\n"
194 "CostFinalize\t\t300\n"
195 "InstallValidate\t\t400\n"
196 "InstallInitialize\t\t500\n"
197 "ProcessComponents\t\t600\n"
198 "WriteEnvironmentStrings\t\t700\n"
199 "wes_immediate\tNOT REMOVE\t701\n"
200 "wes_deferred\tNOT REMOVE\t702\n"
201 "RemoveEnvironmentStrings\t\t800\n"
202 "res_immediate\tREMOVE\t801\n"
203 "res_deferred\tREMOVE\t802\n"
204 "RegisterProduct\t\t900\n"
205 "PublishFeatures\t\t1000\n"
206 "PublishProduct\t\t1100\n"
207 "UnpublishFeatures\t\t1150\n"
208 "InstallFinalize\t\t1200\n";
210 static const char env_custom_action_dat
[] =
211 "Action\tType\tSource\tTarget\n"
213 "CustomAction\tAction\n"
214 "wes_immediate\t1\tcustom.dll\tenv_absent\n"
215 "wes_deferred\t1025\tcustom.dll\tenv_present\n"
216 "res_immediate\t1\tcustom.dll\tenv_present\n"
217 "res_deferred\t1025\tcustom.dll\tenv_absent\n";
219 static const char env_environment_dat
[] =
220 "Environment\tName\tValue\tComponent_\n"
221 "s72\tl255\tL255\ts72\n"
222 "Environment\tEnvironment\n"
223 "Var1\t=-MSITESTVAR1\t1\tOne\n"
224 "Var2\tMSITESTVAR2\t1\tOne\n"
225 "Var3\t=-MSITESTVAR3\t1\tOne\n"
226 "Var4\tMSITESTVAR4\t1\tOne\n"
227 "Var5\t-MSITESTVAR5\t\tOne\n"
228 "Var6\tMSITESTVAR6\t\tOne\n"
229 "Var7\t!-MSITESTVAR7\t\tOne\n"
230 "Var8\t!-*MSITESTVAR8\t\tOne\n"
231 "Var9\t=-MSITESTVAR9\t\tOne\n"
232 "Var10\t=MSITESTVAR10\t\tOne\n"
233 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
234 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
235 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
236 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
237 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
238 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
239 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
240 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
241 "Var19\t+-MSITESTVAR17\t1\tOne\n"
242 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
243 "Var21\t+-MSITESTVAR18\t1\tOne\n"
244 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
245 "Var23\t+-MSITESTVAR19\t1\tOne\n"
246 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
247 "Var25\t+-MSITESTVAR20\t1\tOne\n"
248 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"
249 "Var27\t+-MSITESTVAR21\t[~];1\tOne\n"
250 "Var28\t-MSITESTVAR22\t1\tOne\n"
251 "Var29\t-MSITESTVAR23\t2\tOne\n"
252 "Var30\t*MSITESTVAR100\t1\tOne\n";
254 static const char service_install_dat
[] =
255 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
256 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
257 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
258 "ServiceInstall\tServiceInstall\n"
259 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
260 "TestService2\t[SERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription\n";
262 static const char service_install2_dat
[] =
263 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
264 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
265 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
266 "ServiceInstall\tServiceInstall\n"
267 "TestService\tTestService\tTestService\t2\t3\t32768\t\t\tTestService\t\t\tservice_comp\t\n"
268 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
270 static const char service_control_dat
[] =
271 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
272 "s72\tl255\ti2\tL255\tI2\ts72\n"
273 "ServiceControl\tServiceControl\n"
274 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
275 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
277 static const char sss_service_control_dat
[] =
278 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
279 "s72\tl255\ti2\tL255\tI2\ts72\n"
280 "ServiceControl\tServiceControl\n"
281 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
282 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
283 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
284 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
286 static const char sss_install_exec_seq_dat
[] =
287 "Action\tCondition\tSequence\n"
289 "InstallExecuteSequence\tAction\n"
290 "LaunchConditions\t\t100\n"
291 "CostInitialize\t\t800\n"
293 "ResolveSource\t\t950\n"
294 "CostFinalize\t\t1000\n"
295 "InstallValidate\t\t1400\n"
296 "InstallInitialize\t\t1500\n"
297 "StopServices\t\t4000\n"
298 "stop_immediate\tNOT REMOVE\t4001\n"
299 "stop_deferred\tNOT REMOVE\t4002\n"
300 "DeleteServices\t\t5000\n"
301 "MoveFiles\t\t5100\n"
302 "InstallFiles\t\t5200\n"
303 "DuplicateFiles\t\t5300\n"
304 "StartServices\t\t5400\n"
305 "start_deferred\tNOT REMOVE\t5401\n"
306 "RegisterProduct\t\t5500\n"
307 "PublishFeatures\t\t5600\n"
308 "PublishProduct\t\t5700\n"
309 "UnpublishFeatures\t\t5800\n"
310 "InstallFinalize\t\t6000\n";
312 static const char sss_custom_action_dat
[] =
313 "Action\tType\tSource\tTarget\n"
315 "CustomAction\tAction\n"
316 "stop_immediate\t1\tcustom.dll\tsss_started\n"
317 "stop_deferred\t1025\tcustom.dll\tsss_stopped\n"
318 "start_deferred\t1025\tcustom.dll\tsss_started\n";
320 static const char sds_install_exec_seq_dat
[] =
321 "Action\tCondition\tSequence\n"
323 "InstallExecuteSequence\tAction\n"
324 "LaunchConditions\t\t100\n"
325 "CostInitialize\t\t800\n"
327 "ResolveSource\t\t950\n"
328 "CostFinalize\t\t1000\n"
329 "InstallValidate\t\t1400\n"
330 "InstallInitialize\t\t1500\n"
331 "StopServices\t\t5000\n"
332 "DeleteServices\t\t5050\n"
333 "sds_immediate\tNOT REMOVE\t5051\n"
334 "sds_deferred\tNOT REMOVE\t5052\n"
335 "MoveFiles\t\t5100\n"
336 "InstallFiles\t\t5200\n"
337 "DuplicateFiles\t\t5300\n"
338 "InstallServices\t\t5400\n"
339 "StartServices\t\t5450\n"
340 "RegisterProduct\t\t5500\n"
341 "PublishFeatures\t\t5600\n"
342 "PublishProduct\t\t5700\n"
343 "UnpublishFeatures\t\t5800\n"
344 "InstallFinalize\t\t6000\n";
346 static const char sds_custom_action_dat
[] =
347 "Action\tType\tSource\tTarget\n"
349 "CustomAction\tAction\n"
350 "sds_immediate\t1\tcustom.dll\tsds_present\n"
351 "sds_deferred\t1025\tcustom.dll\tsds_absent\n";
353 static const char sis_install_exec_seq_dat
[] =
354 "Action\tCondition\tSequence\n"
356 "InstallExecuteSequence\tAction\n"
357 "CostInitialize\t\t800\n"
359 "CostFinalize\t\t1000\n"
360 "InstallValidate\t\t1400\n"
361 "InstallInitialize\t\t1500\n"
362 "StopServices\t\t5000\n"
363 "DeleteServices\t\t5050\n"
364 "InstallFiles\t\t5200\n"
365 "InstallServices\t\t5400\n"
366 "sis_immediate\tNOT REMOVE\t5401\n"
367 "sis_deferred\tNOT REMOVE\t5402\n"
368 "StartServices\t\t5450\n"
369 "RegisterProduct\t\t5500\n"
370 "PublishFeatures\t\t5600\n"
371 "PublishProduct\t\t5700\n"
372 "UnpublishFeatures\t\t5800\n"
373 "InstallFinalize\t\t6000\n";
375 static const char sis_custom_action_dat
[] =
376 "Action\tType\tSource\tTarget\n"
378 "CustomAction\tAction\n"
379 "sis_immediate\t1\tcustom.dll\tsis_absent\n"
380 "sis_deferred\t1025\tcustom.dll\tsis_present\n";
382 static const char rof_component_dat
[] =
383 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
384 "s72\tS38\ts72\ti2\tS255\tS72\n"
385 "Component\tComponent\n"
386 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
388 static const char rof_feature_dat
[] =
389 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
390 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
392 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
393 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
395 static const char rof_feature_comp_dat
[] =
396 "Feature_\tComponent_\n"
398 "FeatureComponents\tFeature_\tComponent_\n"
400 "montecristo\tmaximus";
402 static const char rof_file_dat
[] =
403 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
404 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
406 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
408 static const char rof_media_dat
[] =
409 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
410 "i2\ti4\tL64\tS255\tS32\tS72\n"
412 "1\t1\t\t\tDISK1\t\n";
414 static const char ci2_feature_comp_dat
[] =
415 "Feature_\tComponent_\n"
417 "FeatureComponents\tFeature_\tComponent_\n"
420 static const char ci2_file_dat
[] =
421 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
422 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
424 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
426 static const char pp_install_exec_seq_dat
[] =
427 "Action\tCondition\tSequence\n"
429 "InstallExecuteSequence\tAction\n"
430 "ValidateProductID\t\t700\n"
431 "CostInitialize\t\t800\n"
433 "CostFinalize\t\t1000\n"
434 "InstallValidate\t\t1400\n"
435 "InstallInitialize\t\t1500\n"
436 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
437 "ppc_immediate\tPROCESS_COMPONENTS AND ALLUSERS\t1601\n"
438 "ppc_deferred\tPROCESS_COMPONENTS AND ALLUSERS\t1602\n"
439 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
440 "uf_immediate\tUNPUBLISH_FEATURES AND ALLUSERS\t1801\n"
441 "uf_deferred\tUNPUBLISH_FEATURES AND ALLUSERS\t1802\n"
442 "RemoveFiles\t\t3500\n"
443 "InstallFiles\t\t4000\n"
444 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
445 "ru_immediate\tREGISTER_USER AND ALLUSERS\t6001\n"
446 "ru_deferred\tREGISTER_USER AND ALLUSERS\t6002\n"
447 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
448 "rp_immediate\tREGISTER_PRODUCT AND ALLUSERS AND NOT RP_TEST64\t6101\n"
449 "rp_deferred\tREGISTER_PRODUCT AND ALLUSERS AND NOT RP_TEST64\t6102\n"
450 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
451 "pf_immediate\tPUBLISH_FEATURES AND ALLUSERS\t6301\n"
452 "pf_deferred\tPUBLISH_FEATURES AND ALLUSERS\t6302\n"
453 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
454 "pp_immediate\tPUBLISH_PRODUCT AND ALLUSERS\t6401\n"
455 "pp_deferred\tPUBLISH_PRODUCT AND ALLUSERS\t6402\n"
456 "InstallFinalize\t\t6600";
458 static const char pp_custom_action_dat
[] =
459 "Action\tType\tSource\tTarget\n"
461 "CustomAction\tAction\n"
462 "pf_immediate\t1\tcustom.dll\tpf_absent\n"
463 "pf_deferred\t1025\tcustom.dll\tpf_present\n"
464 "uf_immediate\t1\tcustom.dll\tpf_present\n"
465 "uf_deferred\t1025\tcustom.dll\tpf_absent\n"
466 "pp_immediate\t1\tcustom.dll\tpp_absent\n"
467 "pp_deferred\t1025\tcustom.dll\tpp_present\n"
468 "rp_immediate\t1\tcustom.dll\trp_absent\n"
469 "rp_deferred\t1025\tcustom.dll\trp_present\n"
470 "ru_immediate\t1\tcustom.dll\tru_absent\n"
471 "ru_deferred\t1025\tcustom.dll\tru_present\n"
472 "ppc_immediate\t1\tcustom.dll\tppc_absent\n"
473 "ppc_deferred\t1025\tcustom.dll\tppc_present\n";
475 static const char pp_component_dat
[] =
476 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
477 "s72\tS38\ts72\ti2\tS255\tS72\n"
478 "Component\tComponent\n"
479 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
481 static const char ppc_component_dat
[] =
482 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
483 "s72\tS38\ts72\ti2\tS255\tS72\n"
484 "Component\tComponent\n"
485 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
486 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
488 static const char ppc_file_dat
[] =
489 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
490 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
492 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
493 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
495 static const char ppc_media_dat
[] =
496 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
497 "i2\ti4\tL64\tS255\tS32\tS72\n"
499 "1\t2\t\t\tDISK1\t\n";
501 static const char ppc_feature_comp_dat
[] =
502 "Feature_\tComponent_\n"
504 "FeatureComponents\tFeature_\tComponent_\n"
506 "feature\taugustus\n"
507 "montecristo\tmaximus";
509 static const char cwd_component_dat
[] =
510 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
511 "s72\tS38\ts72\ti2\tS255\tS72\n"
512 "Component\tComponent\n"
513 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
515 static const char rem_component_dat
[] =
516 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
517 "s72\tS38\ts72\ti2\tS255\tS72\n"
518 "Component\tComponent\n"
519 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
520 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
521 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
523 static const char rem_feature_comp_dat
[] =
524 "Feature_\tComponent_\n"
526 "FeatureComponents\tFeature_\tComponent_\n"
527 "feature\thydrogen\n"
531 static const char rem_file_dat
[] =
532 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
533 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
535 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
536 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
537 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
539 static const char rem_install_exec_seq_dat
[] =
540 "Action\tCondition\tSequence\n"
542 "InstallExecuteSequence\tAction\n"
543 "ValidateProductID\t\t700\n"
544 "CostInitialize\t\t800\n"
546 "CostFinalize\t\t1000\n"
547 "InstallValidate\t\t1400\n"
548 "InstallInitialize\t\t1500\n"
549 "ProcessComponents\t\t1600\n"
550 "RemoveFiles\t\t3500\n"
551 "InstallFiles\t\t4000\n"
552 "RegisterProduct\t\t6100\n"
553 "PublishFeatures\t\t6300\n"
554 "PublishProduct\t\t6400\n"
555 "UnpublishFeatures\t\t6500\n"
556 "InstallFinalize\t\t6600";
558 static const char rem_remove_files_dat
[] =
559 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
560 "s72\ts72\tS255\ts72\tI2\n"
561 "RemoveFile\tFileKey\n"
562 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
563 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
564 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
565 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
566 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
567 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
568 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
569 "block\thelium\tblock\tMSITESTDIR\t3\n"
570 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
571 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
573 static const char mov_move_file_dat
[] =
574 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
575 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
576 "MoveFile\tFileKey\n"
577 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
578 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
579 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
580 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
581 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
582 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
583 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
584 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
585 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
586 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
587 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
588 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
589 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
590 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
591 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
592 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
593 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
594 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
596 static const char mov_install_exec_seq_dat
[] =
597 "Action\tCondition\tSequence\n"
599 "InstallExecuteSequence\tAction\n"
600 "CostInitialize\t\t100\n"
602 "ResolveSource\t\t300\n"
603 "CostFinalize\t\t400\n"
604 "InstallValidate\t\t500\n"
605 "InstallInitialize\t\t600\n"
607 "mov_immediate\t\t701\n"
608 "mov_deferred\t\t702\n"
609 "InstallFiles\t\t800\n"
610 "InstallFinalize\t\t900\n";
612 static const char mov_custom_action_dat
[] =
613 "Action\tType\tSource\tTarget\n"
615 "CustomAction\tAction\n"
616 "mov_immediate\t1\tcustom.dll\tmov_absent\n"
617 "mov_deferred\t1025\tcustom.dll\tmov_present\n";
619 static const char df_directory_dat
[] =
620 "Directory\tDirectory_Parent\tDefaultDir\n"
622 "Directory\tDirectory\n"
623 "THIS\tMSITESTDIR\tthis\n"
624 "DOESNOT\tTHIS\tdoesnot\n"
625 "NONEXISTENT\tDOESNOT\texist\n"
626 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
627 "ProgramFilesFolder\tTARGETDIR\t.\n"
628 "TARGETDIR\t\tSourceDir";
630 static const char df_duplicate_file_dat
[] =
631 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
632 "s72\ts72\ts72\tS255\tS72\n"
633 "DuplicateFile\tFileKey\n"
634 "maximus\tmaximus\tmaximus\taugustus\t\n"
635 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
636 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
638 static const char wrv_component_dat
[] =
639 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
640 "s72\tS38\ts72\ti2\tS255\tS72\n"
641 "Component\tComponent\n"
642 "augustus\t{bafe0297-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t0\t\t\n"
643 "caesar\t{bafe0298-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t1\t\t\n";
645 static const char wrv_feature_dat
[] =
646 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
647 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
649 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
650 "feature2\t\tFeature2\tFeature2\t2\t1\tTARGETDIR\t1";
652 static const char wrv_feature_comp_dat
[] =
653 "Feature_\tComponent_\n"
655 "FeatureComponents\tFeature_\tComponent_\n"
656 "feature\taugustus\n"
659 static const char wrv_registry_dat
[] =
660 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
661 "s72\ti2\tl255\tL255\tL0\ts72\n"
662 "Registry\tRegistry\n"
663 "regdata0\t1\tmsitest\tsz\tstring\taugustus\n"
664 "regdata1\t1\tmsitest\tmultisz\tone[~]two[~]three\taugustus\n"
665 "regdata2\t1\tmsitest\texpandsz\t#%string\taugustus\n"
666 "regdata3\t1\tmsitest\tdword\t#123\taugustus\n"
667 "regdata4\t1\tmsitest\tbinary\t#x01234567\taugustus\n"
668 "regdata5\t1\tmsitest\t\tdefault\taugustus\n"
669 "regdata6\t1\tmsitest\\subkey\t*\t\taugustus\n"
670 "regdata7\t1\tmsitest\\subkey\t*\t#%\taugustus\n"
671 "regdata8\t1\tmsitest\\subkey\t*\t#x\taugustus\n"
672 "regdata9\t1\tmsitest\\VisualStudio\\10.0\\AD7Metrics\\Exception\\{049EC4CC-30D2-4032-9256-EE18EB41B62B}\\Common Language Runtime Exceptions\\System.Workflow.ComponentModel.Serialization\\System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException\tlong\tkey\taugustus\n"
673 "regdata10\t1\tmsitest\tValue1\t[~]one[~]\taugustus\n"
674 "regdata11\t1\tmsitest\tValue2\t[~]two\taugustus\n"
675 "regdata12\t1\tmsitest\tValue3\tone[~]\taugustus\n"
676 "regdata13\t1\tmsitest\tValue4\tone[~]two\taugustus\n"
677 "regdata14\t1\tmsitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
678 "regdata15\t1\tmsitest\tValue6\t[~]\taugustus\n"
679 "regdata16\t1\tmsitest\tValue7\t[~]two\taugustus\n"
680 "regdata17\t1\tmsitest\tformat\t[regdata17]\taugustus\n"
681 "regdata18\t1\tmsitest\tsource\t#1\tcaesar\n"
682 "regdata19\t1\tmsitest\\create\t+\t\taugustus\n"
683 "regdata20\t1\tmsitest\\delete\t-\t\taugustus\n";
685 static const char wrv_remove_registry_dat
[] =
686 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
687 "s72\ti2\tl255\tL255\ts72\n"
688 "RemoveRegistry\tRemoveRegistry\n"
689 "regdata0\t1\tmsitest\tinstremove\taugustus\n"
690 "regdata1\t1\tmsitest\\instremove\t-\taugustus\n";
692 static const char wrv_install_exec_seq_dat
[] =
693 "Action\tCondition\tSequence\n"
695 "InstallExecuteSequence\tAction\n"
696 "CostInitialize\t\t800\n"
698 "CostFinalize\t\t1000\n"
699 "InstallValidate\t\t1400\n"
700 "InstallInitialize\t\t1500\n"
701 "ProcessComponents\t\t1600\n"
702 "RemoveRegistryValues\t\t4900\n"
703 "rrv_immediate\tREMOVE\t4901\n"
704 "rrv_deferred\tREMOVE\t4902\n"
705 "WriteRegistryValues\t\t5000\n"
706 "wrv_immediate\tNOT REMOVE\t5001\n"
707 "wrv_deferred\tNOT REMOVE\t5002\n"
708 "RegisterProduct\t\t6100\n"
709 "PublishFeatures\t\t6200\n"
710 "PublishProduct\t\t6300\n"
711 "UnpublishFeatures\t\t6400\n"
712 "InstallFinalize\t\t6600\n";
714 static const char wrv_custom_action_dat
[] =
715 "Action\tType\tSource\tTarget\n"
717 "CustomAction\tAction\n"
718 "wrv_immediate\t1\tcustom.dll\twrv_absent\n"
719 "wrv_deferred\t1025\tcustom.dll\twrv_present\n"
720 "rrv_immediate\t1\tcustom.dll\twrv_present\n"
721 "rrv_deferred\t1025\tcustom.dll\twrv_absent\n";
723 static const char cf_directory_dat
[] =
724 "Directory\tDirectory_Parent\tDefaultDir\n"
726 "Directory\tDirectory\n"
727 "FIRSTDIR\tMSITESTDIR\tfirst\n"
728 "SECONDDIR\tMSITESTDIR\tsecond\n"
729 "THIRDDIR\tMSITESTDIR\tthird\n"
730 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
731 "ProgramFilesFolder\tTARGETDIR\t.\n"
732 "TARGETDIR\t\tSourceDir";
734 static const char cf_component_dat
[] =
735 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
736 "s72\tS38\ts72\ti2\tS255\tS72\n"
737 "Component\tComponent\n"
738 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
739 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
741 static const char cf_feature_dat
[] =
742 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
743 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
745 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
746 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
748 static const char cf_feature_comp_dat
[] =
749 "Feature_\tComponent_\n"
751 "FeatureComponents\tFeature_\tComponent_\n"
755 static const char cf_file_dat
[] =
756 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
757 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
759 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
760 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
762 static const char cf_create_folders_dat
[] =
763 "Directory_\tComponent_\n"
765 "CreateFolder\tDirectory_\tComponent_\n"
770 static const char cf_install_exec_seq_dat
[] =
771 "Action\tCondition\tSequence\n"
773 "InstallExecuteSequence\tAction\n"
774 "CostFinalize\t\t1000\n"
775 "ValidateProductID\t\t700\n"
776 "CostInitialize\t\t800\n"
778 "RemoveFiles\t\t3500\n"
779 "rfi_immediate\tREMOVE\t3501\n"
780 "rfi_deferred\tREMOVE\t3502\n"
781 "CreateFolders\t\t3700\n"
782 "cf_immediate\tNOT REMOVE\t3701\n"
783 "cf_deferred\tNOT REMOVE\t3702\n"
784 "RemoveFolders\t\t3800\n"
785 "rf_immediate\tREMOVE\t3801\n"
786 "rf_deferred\tREMOVE\t3802\n"
787 "InstallFiles\t\t4000\n"
788 "ifi_immediate\tNOT REMOVE\t4001\n"
789 "ifi_deferred\tNOT REMOVE\t4002\n"
790 "RegisterUser\t\t6000\n"
791 "RegisterProduct\t\t6100\n"
792 "PublishFeatures\t\t6300\n"
793 "PublishProduct\t\t6400\n"
794 "InstallFinalize\t\t6600\n"
795 "InstallInitialize\t\t1500\n"
796 "ProcessComponents\t\t1600\n"
797 "UnpublishFeatures\t\t1800\n"
798 "InstallValidate\t\t1400\n"
799 "LaunchConditions\t\t100\n";
801 static const char cf_custom_action_dat
[] =
802 "Action\tType\tSource\tTarget\n"
804 "CustomAction\tAction\n"
805 "ifi_immediate\t1\tcustom.dll\tfile_absent\n"
806 "ifi_deferred\t1025\tcustom.dll\tfile_present\n"
807 "rfi_immediate\t1\tcustom.dll\tfile_present\n"
808 "rfi_deferred\t1025\tcustom.dll\tfile_absent\n"
809 "cf_immediate\t1\tcustom.dll\tcf_absent\n"
810 "cf_deferred\t1025\tcustom.dll\tcf_present\n"
811 "rf_immediate\t1\tcustom.dll\tcf_present\n"
812 "rf_deferred\t1025\tcustom.dll\tcf_absent\n";
814 static const char sr_file_dat
[] =
815 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
816 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
818 "selfreg.dll\tselfreg\tselfreg.dll\t1000\t\t\t8192\t1\n";
820 static const char sr_feature_dat
[] =
821 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
822 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
824 "selfreg\t\t\tselfreg feature\t1\t2\tMSITESTDIR\t0\n";
826 static const char sr_feature_comp_dat
[] =
827 "Feature_\tComponent_\n"
829 "FeatureComponents\tFeature_\tComponent_\n"
830 "selfreg\tselfreg\n";
832 static const char sr_component_dat
[] =
833 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
834 "s72\tS38\ts72\ti2\tS255\tS72\n"
835 "Component\tComponent\n"
836 "selfreg\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\tselfreg.dll\n";
838 static const char sr_selfreg_dat
[] =
844 static const char sr_install_exec_seq_dat
[] =
845 "Action\tCondition\tSequence\n"
847 "InstallExecuteSequence\tAction\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 "SelfUnregModules\t\t3800\n"
855 "su_immediate\tREMOVE\t3801\n"
856 "su_deferred\tREMOVE\t3802\n"
857 "RemoveFiles\t\t3900\n"
858 "InstallFiles\t\t4000\n"
859 "SelfRegModules\t\t4100\n"
860 "sr_immediate\tNOT REMOVE\t4101\n"
861 "sr_deferred\tNOT REMOVE\t4102\n"
862 "CreateShortcuts\t\t4600\n"
863 "RegisterProduct\t\t5100\n"
864 "PublishFeatures\t\t5200\n"
865 "PublishProduct\t\t5300\n"
866 "UnpublishFeatures\t\t5400\n"
867 "InstallFinalize\t\t6600\n";
869 static const char sr_custom_action_dat
[] =
870 "Action\tType\tSource\tTarget\n"
872 "CustomAction\tAction\n"
873 "sr_immediate\t1\tcustom.dll\tsr_absent\n"
874 "sr_deferred\t1025\tcustom.dll\tsr_present\n"
875 "su_immediate\t1\tcustom.dll\tsr_present\n"
876 "su_deferred\t1025\tcustom.dll\tsr_absent\n";
878 static const char font_media_dat
[] =
879 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
880 "i2\ti4\tL64\tS255\tS32\tS72\n"
882 "1\t3\t\t\tDISK1\t\n";
884 static const char font_file_dat
[] =
885 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
886 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
888 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
890 static const char font_feature_dat
[] =
891 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
892 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
894 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
896 static const char font_component_dat
[] =
897 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
898 "s72\tS38\ts72\ti2\tS255\tS72\n"
899 "Component\tComponent\n"
900 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
902 static const char font_feature_comp_dat
[] =
903 "Feature_\tComponent_\n"
905 "FeatureComponents\tFeature_\tComponent_\n"
908 static const char font_dat
[] =
912 "font.ttf\tmsi test font\n";
914 static const char font_install_exec_seq_dat
[] =
915 "Action\tCondition\tSequence\n"
917 "InstallExecuteSequence\tAction\n"
918 "ValidateProductID\t\t700\n"
919 "CostInitialize\t\t800\n"
921 "CostFinalize\t\t1000\n"
922 "InstallValidate\t\t1400\n"
923 "InstallInitialize\t\t1500\n"
924 "ProcessComponents\t\t1600\n"
925 "RemoveFiles\t\t3500\n"
926 "InstallFiles\t\t4000\n"
927 "RegisterFonts\t\t4100\n"
928 "rf_immediate\tNOT REMOVE\t4101\n"
929 "rf_deferred\tNOT REMOVE\t4102\n"
930 "UnregisterFonts\t\t4200\n"
931 "uf_immediate\tREMOVE\t4201\n"
932 "uf_deferred\tREMOVE\t4202\n"
933 "RegisterUser\t\t6000\n"
934 "RegisterProduct\t\t6100\n"
935 "PublishFeatures\t\t6300\n"
936 "PublishProduct\t\t6400\n"
937 "UnpublishFeatures\t\t6500\n"
938 "InstallFinalize\t\t6600";
940 static const char font_custom_action_dat
[] =
941 "Action\tType\tSource\tTarget\n"
943 "CustomAction\tAction\n"
944 "rf_immediate\t1\tcustom.dll\tfont_absent\n"
945 "rf_deferred\t1025\tcustom.dll\tfont_present\n"
946 "uf_immediate\t1\tcustom.dll\tfont_present\n"
947 "uf_deferred\t1025\tcustom.dll\tfont_absent\n";
949 static const char vp_property_dat
[] =
952 "Property\tProperty\n"
955 "InstallMode\tTypical\n"
956 "Manufacturer\tWine\n"
957 "PIDTemplate\t###-#######\n"
958 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
959 "ProductLanguage\t1033\n"
960 "ProductName\tMSITEST\n"
961 "ProductVersion\t1.1.1\n"
962 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
963 "MSIFASTINSTALL\t1\n";
965 static const char vp_custom_action_dat
[] =
966 "Action\tType\tSource\tTarget\tISComments\n"
967 "s72\ti2\tS64\tS0\tS255\n"
968 "CustomAction\tAction\n"
969 "SetProductID1\t51\tProductID\t1\t\n"
970 "SetProductID2\t51\tProductID\t2\t\n"
971 "TestProductID1\t19\t\t\tHalts installation\n"
972 "TestProductID2\t19\t\t\tHalts installation\n";
974 static const char vp_install_exec_seq_dat
[] =
975 "Action\tCondition\tSequence\n"
977 "InstallExecuteSequence\tAction\n"
978 "LaunchConditions\t\t100\n"
979 "CostInitialize\t\t800\n"
981 "CostFinalize\t\t1000\n"
982 "InstallValidate\t\t1400\n"
983 "InstallInitialize\t\t1500\n"
984 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
985 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
986 "ValidateProductID\t\t3200\n"
987 "InstallExecute\t\t3300\n"
988 "TestProductID1\tProductID=1\t3400\n"
989 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
990 "InstallFiles\t\t4000\n"
991 "InstallFinalize\t\t6000\n";
993 static const char odbc_file_dat
[] =
994 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
995 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
997 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
998 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
999 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
1000 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
1001 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
1003 static const char odbc_feature_dat
[] =
1004 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1005 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1006 "Feature\tFeature\n"
1007 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
1009 static const char odbc_feature_comp_dat
[] =
1010 "Feature_\tComponent_\n"
1012 "FeatureComponents\tFeature_\tComponent_\n"
1016 static const char odbc_component_dat
[] =
1017 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1018 "s72\tS38\ts72\ti2\tS255\tS72\n"
1019 "Component\tComponent\n"
1020 "odbc64\t{B6F3E4AF-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t256\tMsix64\tODBCdriver.dll\n"
1021 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
1023 static const char odbc_driver_dat
[] =
1024 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
1025 "s72\ts72\ts255\ts72\tS72\n"
1026 "ODBCDriver\tDriver\n"
1027 "64-bit driver\todbc64\tODBC test driver\tODBCdriver.dll\t\n"
1028 "64-bit driver2\todbc64\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n"
1029 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
1030 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
1032 static const char odbc_translator_dat
[] =
1033 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
1034 "s72\ts72\ts255\ts72\tS72\n"
1035 "ODBCTranslator\tTranslator\n"
1036 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
1037 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
1039 static const char odbc_datasource_dat
[] =
1040 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
1041 "s72\ts72\ts255\ts255\ti2\n"
1042 "ODBCDataSource\tDataSource\n"
1043 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
1045 static const char odbc_install_exec_seq_dat
[] =
1046 "Action\tCondition\tSequence\n"
1048 "InstallExecuteSequence\tAction\n"
1049 "LaunchConditions\t\t100\n"
1050 "CostInitialize\t\t800\n"
1052 "CostFinalize\t\t1000\n"
1053 "InstallValidate\t\t1400\n"
1054 "InstallInitialize\t\t1500\n"
1055 "ProcessComponents\t\t1600\n"
1056 "InstallODBC\t\t3000\n"
1057 "io_immediate\tNOT REMOVE\t3001\n"
1058 "io_deferred\tNOT REMOVE\t3002\n"
1059 "RemoveODBC\t\t3100\n"
1060 "ro_immediate\tREMOVE\t3101\n"
1061 "ro_deferred\tREMOVE\t3102\n"
1062 "RemoveFiles\t\t3900\n"
1063 "InstallFiles\t\t4000\n"
1064 "RegisterProduct\t\t5000\n"
1065 "PublishFeatures\t\t5100\n"
1066 "PublishProduct\t\t5200\n"
1067 "UnpublishFeatures\t\t5300\n"
1068 "InstallFinalize\t\t6000\n";
1070 static const char odbc_custom_action_dat
[] =
1071 "Action\tType\tSource\tTarget\n"
1072 "s72\ti2\tS64\tS0\n"
1073 "CustomAction\tAction\n"
1074 "io_immediate\t1\tcustom.dll\todbc_absent\n"
1075 "io_deferred\t1025\tcustom.dll\todbc_present\n"
1076 "ro_immediate\t1\tcustom.dll\todbc_present\n"
1077 "ro_deferred\t1025\tcustom.dll\todbc_absent\n";
1079 static const char odbc_media_dat
[] =
1080 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1081 "i2\ti4\tL64\tS255\tS32\tS72\n"
1083 "1\t5\t\t\tDISK1\t\n";
1085 static const char tl_file_dat
[] =
1086 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1087 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1089 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
1091 static const char tl_feature_dat
[] =
1092 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1093 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1094 "Feature\tFeature\n"
1095 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
1097 static const char tl_feature_comp_dat
[] =
1098 "Feature_\tComponent_\n"
1100 "FeatureComponents\tFeature_\tComponent_\n"
1101 "typelib\ttypelib\n";
1103 static const char tl_component_dat
[] =
1104 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1105 "s72\tS38\ts72\ti2\tS255\tS72\n"
1106 "Component\tComponent\n"
1107 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
1109 static const char tl_typelib_dat
[] =
1110 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
1111 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
1112 "TypeLib\tLibID\tLanguage\tComponent_\n"
1113 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
1115 static const char tl_install_exec_seq_dat
[] =
1116 "Action\tCondition\tSequence\n"
1118 "InstallExecuteSequence\tAction\n"
1119 "LaunchConditions\t\t100\n"
1120 "CostInitialize\t\t800\n"
1122 "CostFinalize\t\t1000\n"
1123 "InstallValidate\t\t1400\n"
1124 "InstallInitialize\t\t1500\n"
1125 "ProcessComponents\t\t1600\n"
1126 "UnregisterTypeLibraries\t\t3100\n"
1127 "ut_immediate\tREMOVE\t3101\n"
1128 "ut_deferred\tREMOVE\t3102\n"
1129 "RemoveFiles\t\t3200\n"
1130 "InstallFiles\t\t3300\n"
1131 "RegisterTypeLibraries\t\t3400\n"
1132 "rt_immediate\tNOT REMOVE\t3401\n"
1133 "rt_deferred\tNOT REMOVE\t3402\n"
1134 "RegisterProduct\t\t5100\n"
1135 "PublishFeatures\t\t5200\n"
1136 "PublishProduct\t\t5300\n"
1137 "UnpublishFeatures\t\t5400\n"
1138 "InstallFinalize\t\t6000\n";
1140 static const char tl_custom_action_dat
[] =
1141 "Action\tType\tSource\tTarget\n"
1142 "s72\ti2\tS64\tS0\n"
1143 "CustomAction\tAction\n"
1144 "rt_immediate\t1\tcustom.dll\ttl_absent\n"
1145 "rt_deferred\t1025\tcustom.dll\ttl_present\n"
1146 "ut_immediate\t1\tcustom.dll\ttl_present\n"
1147 "ut_deferred\t1025\tcustom.dll\ttl_absent\n";
1149 static const char crs_file_dat
[] =
1150 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1151 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1153 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
1155 static const char crs_feature_dat
[] =
1156 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1157 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1158 "Feature\tFeature\n"
1159 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
1161 static const char crs_feature_comp_dat
[] =
1162 "Feature_\tComponent_\n"
1164 "FeatureComponents\tFeature_\tComponent_\n"
1165 "shortcut\tshortcut\n";
1167 static const char crs_component_dat
[] =
1168 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1169 "s72\tS38\ts72\ti2\tS255\tS72\n"
1170 "Component\tComponent\n"
1171 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
1173 static const char crs_shortcut_dat
[] =
1174 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
1175 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
1176 "Shortcut\tShortcut\n"
1177 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
1179 static const char crs_install_exec_seq_dat
[] =
1180 "Action\tCondition\tSequence\n"
1182 "InstallExecuteSequence\tAction\n"
1183 "LaunchConditions\t\t100\n"
1184 "CostInitialize\t\t800\n"
1186 "CostFinalize\t\t1000\n"
1187 "InstallValidate\t\t1400\n"
1188 "InstallInitialize\t\t1500\n"
1189 "ProcessComponents\t\t1600\n"
1190 "RemoveFiles\t\t1700\n"
1191 "InstallFiles\t\t2000\n"
1192 "RemoveShortcuts\t\t3000\n"
1193 "rs_immediate\tREMOVE\t3001\n"
1194 "rs_deferred\tREMOVE\t3002\n"
1195 "CreateShortcuts\t\t3100\n"
1196 "cs_immediate\tNOT REMOVE\t3101\n"
1197 "cs_deferred\tNOT REMOVE\t3102\n"
1198 "RegisterProduct\t\t5000\n"
1199 "PublishFeatures\t\t5100\n"
1200 "PublishProduct\t\t5200\n"
1201 "UnpublishFeatures\t\t5300\n"
1202 "InstallFinalize\t\t6000\n";
1204 static const char crs_custom_action_dat
[] =
1205 "Action\tType\tSource\tTarget\n"
1206 "s72\ti2\tS64\tS0\n"
1207 "CustomAction\tAction\n"
1208 "cs_immediate\t1\tcustom.dll\tcrs_absent\n"
1209 "cs_deferred\t1025\tcustom.dll\tcrs_present\n"
1210 "rs_immediate\t1\tcustom.dll\tcrs_present\n"
1211 "rs_deferred\t1025\tcustom.dll\tcrs_absent\n";
1213 static const char pub_file_dat
[] =
1214 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1215 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1217 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
1219 static const char pub_feature_dat
[] =
1220 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1221 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1222 "Feature\tFeature\n"
1223 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
1225 static const char pub_feature_comp_dat
[] =
1226 "Feature_\tComponent_\n"
1228 "FeatureComponents\tFeature_\tComponent_\n"
1229 "publish\tpublish\n";
1231 static const char pub_component_dat
[] =
1232 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1233 "s72\tS38\ts72\ti2\tS255\tS72\n"
1234 "Component\tComponent\n"
1235 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
1237 static const char pub_publish_component_dat
[] =
1238 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
1239 "s38\ts255\ts72\tL255\ts38\n"
1240 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
1241 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
1243 static const char pub_install_exec_seq_dat
[] =
1244 "Action\tCondition\tSequence\n"
1246 "InstallExecuteSequence\tAction\n"
1247 "LaunchConditions\t\t100\n"
1248 "CostInitialize\t\t800\n"
1250 "CostFinalize\t\t1000\n"
1251 "InstallValidate\t\t1400\n"
1252 "InstallInitialize\t\t1500\n"
1253 "ProcessComponents\t\t1600\n"
1254 "RemoveFiles\t\t1700\n"
1255 "InstallFiles\t\t2000\n"
1256 "PublishComponents\t\t3000\n"
1257 "pub_immediate\tNOT REMOVE\t3001\n"
1258 "pub_deferred\tNOT REMOVE\t3002\n"
1259 "UnpublishComponents\t\t3100\n"
1260 "unp_immediate\tREMOVE\t3101\n"
1261 "unp_deferred\tREMOVE\t3102\n"
1262 "RegisterProduct\t\t5000\n"
1263 "PublishFeatures\t\t5100\n"
1264 "PublishProduct\t\t5200\n"
1265 "UnpublishFeatures\t\t5300\n"
1266 "InstallFinalize\t\t6000\n";
1268 static const char pub_custom_action_dat
[] =
1269 "Action\tType\tSource\tTarget\n"
1270 "s72\ti2\tS64\tS0\n"
1271 "CustomAction\tAction\n"
1272 "pub_immediate\t1\tcustom.dll\tpub_absent\n"
1273 "pub_deferred\t1025\tcustom.dll\tpub_present\n"
1274 "unp_immediate\t1\tcustom.dll\tpub_present\n"
1275 "unp_deferred\t1025\tcustom.dll\tpub_absent\n";
1277 static const char rd_file_dat
[] =
1278 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1279 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1281 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
1282 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
1283 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
1285 static const char rd_feature_dat
[] =
1286 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1287 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1288 "Feature\tFeature\n"
1289 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
1291 static const char rd_feature_comp_dat
[] =
1292 "Feature_\tComponent_\n"
1294 "FeatureComponents\tFeature_\tComponent_\n"
1295 "duplicate\tduplicate\n";
1297 static const char rd_component_dat
[] =
1298 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1299 "s72\tS38\ts72\ti2\tS255\tS72\n"
1300 "Component\tComponent\n"
1301 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
1302 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
1304 static const char rd_duplicate_file_dat
[] =
1305 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
1306 "s72\ts72\ts72\tS255\tS72\n"
1307 "DuplicateFile\tFileKey\n"
1308 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
1309 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
1310 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
1312 static const char rd_install_exec_seq_dat
[] =
1313 "Action\tCondition\tSequence\n"
1315 "InstallExecuteSequence\tAction\n"
1316 "LaunchConditions\t\t100\n"
1317 "CostInitialize\t\t800\n"
1319 "CostFinalize\t\t1000\n"
1320 "InstallValidate\t\t1400\n"
1321 "InstallInitialize\t\t1500\n"
1322 "ProcessComponents\t\t1600\n"
1323 "RemoveDuplicateFiles\t\t1900\n"
1324 "rd_immediate\tREMOVE\t1901\n"
1325 "rd_deferred\tREMOVE\t1902\n"
1326 "InstallFiles\t\t2000\n"
1327 "DuplicateFiles\t\t2100\n"
1328 "df_immediate\tNOT REMOVE\t2101\n"
1329 "df_deferred\tNOT REMOVE\t2102\n"
1330 "RegisterProduct\t\t5000\n"
1331 "PublishFeatures\t\t5100\n"
1332 "PublishProduct\t\t5200\n"
1333 "UnpublishFeatures\t\t5300\n"
1334 "InstallFinalize\t\t6000\n";
1336 static const char rd_custom_action_dat
[] =
1337 "Action\tType\tSource\tTarget\n"
1338 "s72\ti2\tS64\tS0\n"
1339 "CustomAction\tAction\n"
1340 "df_immediate\t1\tcustom.dll\trd_absent\n"
1341 "df_deferred\t1025\tcustom.dll\trd_present\n"
1342 "rd_immediate\t1\tcustom.dll\trd_present\n"
1343 "rd_deferred\t1025\tcustom.dll\trd_absent\n";
1345 static const char frp_file_dat
[] =
1346 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1347 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1349 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1351 static const char frp_feature_dat
[] =
1352 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1353 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1354 "Feature\tFeature\n"
1355 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1357 static const char frp_feature_comp_dat
[] =
1358 "Feature_\tComponent_\n"
1360 "FeatureComponents\tFeature_\tComponent_\n"
1361 "product\tproduct\n";
1363 static const char frp_component_dat
[] =
1364 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1365 "s72\tS38\ts72\ti2\tS255\tS72\n"
1366 "Component\tComponent\n"
1367 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1369 static const char frp_custom_action_dat
[] =
1370 "Action\tType\tSource\tTarget\tISComments\n"
1371 "s72\ti2\tS64\tS0\tS255\n"
1372 "CustomAction\tAction\n"
1373 "TestProp\t19\t\t\tPROP set\n";
1375 static const char frp_upgrade_dat
[] =
1376 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1377 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1378 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1379 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1381 static const char frp_install_exec_seq_dat
[] =
1382 "Action\tCondition\tSequence\n"
1384 "InstallExecuteSequence\tAction\n"
1385 "FindRelatedProducts\t\t50\n"
1386 "TestProp\tPROP AND NOT REMOVE\t51\n"
1387 "LaunchConditions\t\t100\n"
1388 "CostInitialize\t\t800\n"
1390 "CostFinalize\t\t1000\n"
1391 "InstallValidate\t\t1400\n"
1392 "InstallInitialize\t\t1500\n"
1393 "ProcessComponents\t\t1600\n"
1394 "RemoveFiles\t\t1700\n"
1395 "InstallFiles\t\t2000\n"
1396 "RegisterProduct\t\t5000\n"
1397 "PublishFeatures\t\t5100\n"
1398 "PublishProduct\t\t5200\n"
1399 "UnpublishFeatures\t\t5300\n"
1400 "InstallFinalize\t\t6000\n";
1402 static const char ini_file_dat
[] =
1403 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1404 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1406 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1408 static const char ini_feature_dat
[] =
1409 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1410 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1411 "Feature\tFeature\n"
1412 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1414 static const char ini_feature_comp_dat
[] =
1415 "Feature_\tComponent_\n"
1417 "FeatureComponents\tFeature_\tComponent_\n"
1418 "inifile\tinifile\n";
1420 static const char ini_component_dat
[] =
1421 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1422 "s72\tS38\ts72\ti2\tS255\tS72\n"
1423 "Component\tComponent\n"
1424 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1426 static const char ini_ini_file_dat
[] =
1427 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1428 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1429 "IniFile\tIniFile\n"
1430 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1432 static const char ini_remove_ini_file_dat
[] =
1433 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1434 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1435 "RemoveIniFile\tRemoveIniFile\n"
1436 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1438 static const char ini_install_exec_seq_dat
[] =
1439 "Action\tCondition\tSequence\n"
1441 "InstallExecuteSequence\tAction\n"
1442 "LaunchConditions\t\t100\n"
1443 "CostInitialize\t\t800\n"
1445 "CostFinalize\t\t1000\n"
1446 "InstallValidate\t\t1400\n"
1447 "InstallInitialize\t\t1500\n"
1448 "ProcessComponents\t\t1600\n"
1449 "RemoveFiles\t\t1700\n"
1450 "InstallFiles\t\t2000\n"
1451 "RemoveIniValues\t\t3000\n"
1452 "riv_immediate\tREMOVE\t3001\n"
1453 "riv_deferred\tREMOVE\t3002\n"
1454 "WriteIniValues\t\t3100\n"
1455 "wiv_immediate\tNOT REMOVE\t3101\n"
1456 "wiv_deferred\tNOT REMOVE\t3102\n"
1457 "RegisterProduct\t\t5000\n"
1458 "PublishFeatures\t\t5100\n"
1459 "PublishProduct\t\t5200\n"
1460 "UnpublishFeatures\t\t5300\n"
1461 "InstallFinalize\t\t6000\n";
1463 static const char ini_custom_action_dat
[] =
1464 "Action\tType\tSource\tTarget\n"
1465 "s72\ti2\tS64\tS0\n"
1466 "CustomAction\tAction\n"
1467 "wiv_immediate\t1\tcustom.dll\tini_absent\n"
1468 "wiv_deferred\t1025\tcustom.dll\tini_present\n"
1469 "riv_immediate\t1\tcustom.dll\tini_present\n"
1470 "riv_deferred\t1025\tcustom.dll\tini_absent\n";
1472 static const char rci_file_dat
[] =
1473 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1474 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1476 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1478 static const char rci_feature_dat
[] =
1479 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1480 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1481 "Feature\tFeature\n"
1482 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1484 static const char rci_feature_comp_dat
[] =
1485 "Feature_\tComponent_\n"
1487 "FeatureComponents\tFeature_\tComponent_\n"
1490 static const char rci_component_dat
[] =
1491 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1492 "s72\tS38\ts72\ti2\tS255\tS72\n"
1493 "Component\tComponent\n"
1494 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1496 static const char rci_appid_dat
[] =
1497 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1498 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1500 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1502 static const char rci_class_dat
[] =
1503 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1504 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1505 "Class\tCLSID\tContext\tComponent_\n"
1506 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1508 static const char rci_install_exec_seq_dat
[] =
1509 "Action\tCondition\tSequence\n"
1511 "InstallExecuteSequence\tAction\n"
1512 "LaunchConditions\t\t100\n"
1513 "CostInitialize\t\t800\n"
1515 "CostFinalize\t\t1000\n"
1516 "InstallValidate\t\t1400\n"
1517 "InstallInitialize\t\t1500\n"
1518 "ProcessComponents\t\t1600\n"
1519 "RemoveFiles\t\t1700\n"
1520 "InstallFiles\t\t2000\n"
1521 "UnregisterClassInfo\t\t3000\n"
1522 "uci_immediate\tREMOVE\t3001\n"
1523 "uci_deferred\tREMOVE\t3002\n"
1524 "RegisterClassInfo\t\t4000\n"
1525 "rci_immediate\tNOT REMOVE\t4001\n"
1526 "rci_deferred\tNOT REMOVE\t4002\n"
1527 "RegisterProduct\t\t5000\n"
1528 "PublishFeatures\t\t5100\n"
1529 "PublishProduct\t\t5200\n"
1530 "UnpublishFeatures\t\t5300\n"
1531 "InstallFinalize\t\t6000\n";
1533 static const char rci_custom_action_dat
[] =
1534 "Action\tType\tSource\tTarget\n"
1535 "s72\ti2\tS64\tS0\n"
1536 "CustomAction\tAction\n"
1537 "rci_immediate\t1\tcustom.dll\trci_absent\n"
1538 "rci_deferred\t1025\tcustom.dll\trci_present\n"
1539 "uci_immediate\t1\tcustom.dll\trci_present\n"
1540 "uci_deferred\t1025\tcustom.dll\trci_absent\n";
1542 static const char rei_file_dat
[] =
1543 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1544 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1546 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1548 static const char rei_feature_dat
[] =
1549 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1550 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1551 "Feature\tFeature\n"
1552 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1554 static const char rei_feature_comp_dat
[] =
1555 "Feature_\tComponent_\n"
1557 "FeatureComponents\tFeature_\tComponent_\n"
1558 "extension\textension\n";
1560 static const char rei_component_dat
[] =
1561 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1562 "s72\tS38\ts72\ti2\tS255\tS72\n"
1563 "Component\tComponent\n"
1564 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1566 static const char rei_extension_dat
[] =
1567 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1568 "s255\ts72\tS255\tS64\ts38\n"
1569 "Extension\tExtension\tComponent_\n"
1570 "extension\textension\tProg.Id.1\t\textension\n";
1572 static const char rei_verb_dat
[] =
1573 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1574 "s255\ts32\tI2\tL255\tL255\n"
1575 "Verb\tExtension_\tVerb\n"
1576 "extension\tOpen\t1\t&Open\t/argument\n";
1578 static const char rei_progid_dat
[] =
1579 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1580 "s255\tS255\tS38\tL255\tS72\tI2\n"
1582 "Prog.Id.1\t\t\tdescription\t\t\n";
1584 static const char rei_install_exec_seq_dat
[] =
1585 "Action\tCondition\tSequence\n"
1587 "InstallExecuteSequence\tAction\n"
1588 "LaunchConditions\t\t100\n"
1589 "CostInitialize\t\t800\n"
1591 "CostFinalize\t\t1000\n"
1592 "InstallValidate\t\t1400\n"
1593 "InstallInitialize\t\t1500\n"
1594 "ProcessComponents\t\t1600\n"
1595 "RemoveFiles\t\t1700\n"
1596 "InstallFiles\t\t2000\n"
1597 "UnregisterExtensionInfo\t\t3000\n"
1598 "uei_immediate\tREMOVE\t3001\n"
1599 "uei_deferred\tREMOVE\t3002\n"
1600 "RegisterExtensionInfo\t\t4000\n"
1601 "rei_immediate\tNOT REMOVE\t4001\n"
1602 "rei_deferred\tNOT REMOVE\t4002\n"
1603 "RegisterProduct\t\t5000\n"
1604 "PublishFeatures\t\t5100\n"
1605 "PublishProduct\t\t5200\n"
1606 "UnpublishFeatures\t\t5300\n"
1607 "InstallFinalize\t\t6000\n";
1609 static const char rei_custom_action_dat
[] =
1610 "Action\tType\tSource\tTarget\n"
1611 "s72\ti2\tS64\tS0\n"
1612 "CustomAction\tAction\n"
1613 "rei_immediate\t1\tcustom.dll\trei_absent\n"
1614 "rei_deferred\t1025\tcustom.dll\trei_present\n"
1615 "uei_immediate\t1\tcustom.dll\trei_present\n"
1616 "uei_deferred\t1025\tcustom.dll\trei_absent\n";
1618 static const char rpi_file_dat
[] =
1619 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1620 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1622 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1624 static const char rpi_feature_dat
[] =
1625 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1626 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1627 "Feature\tFeature\n"
1628 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1630 static const char rpi_feature_comp_dat
[] =
1631 "Feature_\tComponent_\n"
1633 "FeatureComponents\tFeature_\tComponent_\n"
1636 static const char rpi_component_dat
[] =
1637 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1638 "s72\tS38\ts72\ti2\tS255\tS72\n"
1639 "Component\tComponent\n"
1640 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1642 static const char rpi_appid_dat
[] =
1643 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1644 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1646 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1648 static const char rpi_class_dat
[] =
1649 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1650 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1651 "Class\tCLSID\tContext\tComponent_\n"
1652 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tprogid\tWinetest.Class.1\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n"
1653 "{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tLocalServer\tprogid\tWinetest.VerClass\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n"
1654 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1656 static const char rpi_extension_dat
[] =
1657 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1658 "s255\ts72\tS255\tS64\ts38\n"
1659 "Extension\tExtension\tComponent_\n"
1660 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1662 static const char rpi_verb_dat
[] =
1663 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1664 "s255\ts32\tI2\tL255\tL255\n"
1665 "Verb\tExtension_\tVerb\n"
1666 "winetest\tOpen\t1\t&Open\t/argument\n";
1668 static const char rpi_progid_dat
[] =
1669 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1670 "s255\tS255\tS38\tL255\tS72\tI2\n"
1672 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1673 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1674 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1675 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1676 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1677 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1678 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1679 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1680 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1681 "Winetest.Extension\t\t\tdescription\t\t\n";
1683 static const char rpi_install_exec_seq_dat
[] =
1684 "Action\tCondition\tSequence\n"
1686 "InstallExecuteSequence\tAction\n"
1687 "LaunchConditions\t\t100\n"
1688 "CostInitialize\t\t800\n"
1690 "CostFinalize\t\t1000\n"
1691 "InstallValidate\t\t1400\n"
1692 "InstallInitialize\t\t1500\n"
1693 "ProcessComponents\t\t1600\n"
1694 "RemoveFiles\t\t1700\n"
1695 "UnregisterClassInfo\t\t3000\n"
1696 "UnregisterExtensionInfo\t\t3200\n"
1697 "UnregisterProgIdInfo\t\t3400\n"
1698 "upi_immediate\tREMOVE\t3401\n"
1699 "upi_deferred\tREMOVE\t3402\n"
1700 "InstallFiles\t\t3600\n"
1701 "RegisterClassInfo\t\t4000\n"
1702 "RegisterExtensionInfo\t\t4200\n"
1703 "RegisterProgIdInfo\t\t4400\n"
1704 "rpi_immediate\tNOT REMOVE\t4401\n"
1705 "rpi_deferred\tNOT REMOVE\t4402\n"
1706 "RegisterProduct\t\t5000\n"
1707 "PublishFeatures\t\t5100\n"
1708 "PublishProduct\t\t5200\n"
1709 "UnpublishFeatures\t\t5300\n"
1710 "InstallFinalize\t\t6000\n";
1712 static const char rpi_custom_action_dat
[] =
1713 "Action\tType\tSource\tTarget\n"
1714 "s72\ti2\tS64\tS0\n"
1715 "CustomAction\tAction\n"
1716 "rpi_immediate\t1\tcustom.dll\trpi_absent\n"
1717 "rpi_deferred\t1025\tcustom.dll\trpi_present\n"
1718 "upi_immediate\t1\tcustom.dll\trpi_present\n"
1719 "upi_deferred\t1025\tcustom.dll\trpi_absent\n";
1721 static const char rmi_file_dat
[] =
1722 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1723 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1725 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1727 static const char rmi_feature_dat
[] =
1728 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1729 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1730 "Feature\tFeature\n"
1731 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1733 static const char rmi_feature_comp_dat
[] =
1734 "Feature_\tComponent_\n"
1736 "FeatureComponents\tFeature_\tComponent_\n"
1739 static const char rmi_component_dat
[] =
1740 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1741 "s72\tS38\ts72\ti2\tS255\tS72\n"
1742 "Component\tComponent\n"
1743 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1745 static const char rmi_extension_dat
[] =
1746 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1747 "s255\ts72\tS255\tS64\ts38\n"
1748 "Extension\tExtension\tComponent_\n"
1749 "mime\tmime\t\tmime/type\tmime\n";
1751 static const char rmi_verb_dat
[] =
1752 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1753 "s255\ts32\tI2\tL255\tL255\n"
1754 "Verb\tExtension_\tVerb\n"
1755 "mime\tOpen\t1\t&Open\t/argument\n";
1757 static const char rmi_mime_dat
[] =
1758 "ContentType\tExtension_\tCLSID\n"
1760 "MIME\tContentType\n"
1761 "mime/type\tmime\t\n";
1763 static const char rmi_install_exec_seq_dat
[] =
1764 "Action\tCondition\tSequence\n"
1766 "InstallExecuteSequence\tAction\n"
1767 "LaunchConditions\t\t100\n"
1768 "CostInitialize\t\t800\n"
1770 "CostFinalize\t\t1000\n"
1771 "InstallValidate\t\t1400\n"
1772 "InstallInitialize\t\t1500\n"
1773 "ProcessComponents\t\t1600\n"
1774 "RemoveFiles\t\t1700\n"
1775 "InstallFiles\t\t2000\n"
1776 "UnregisterExtensionInfo\t\t3000\n"
1777 "UnregisterMIMEInfo\t\t3500\n"
1778 "umi_immediate\tREMOVE\t3501\n"
1779 "umi_deferred\tREMOVE\t3502\n"
1780 "RegisterExtensionInfo\t\t4000\n"
1781 "RegisterMIMEInfo\t\t4500\n"
1782 "rmi_immediate\tNOT REMOVE\t4501\n"
1783 "rmi_deferred\tNOT REMOVE\t4502\n"
1784 "RegisterProduct\t\t5000\n"
1785 "PublishFeatures\t\t5100\n"
1786 "PublishProduct\t\t5200\n"
1787 "UnpublishFeatures\t\t5300\n"
1788 "InstallFinalize\t\t6000\n";
1790 static const char rmi_custom_action_dat
[] =
1791 "Action\tType\tSource\tTarget\n"
1792 "s72\ti2\tS64\tS0\n"
1793 "CustomAction\tAction\n"
1794 "rmi_immediate\t1\tcustom.dll\trmi_absent\n"
1795 "rmi_deferred\t1025\tcustom.dll\trmi_present\n"
1796 "umi_immediate\t1\tcustom.dll\trmi_present\n"
1797 "umi_deferred\t1025\tcustom.dll\trmi_absent\n";
1799 static const char pa_file_dat
[] =
1800 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1801 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1803 "fake_local.txt\tfake_local\tfake_local.txt\t1000\t\t\t8192\t1\n"
1804 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1805 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1806 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1807 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1808 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1809 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1810 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1811 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1813 static const char pa_feature_dat
[] =
1814 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1815 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1816 "Feature\tFeature\n"
1817 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1819 static const char pa_feature_comp_dat
[] =
1820 "Feature_\tComponent_\n"
1822 "FeatureComponents\tFeature_\tComponent_\n"
1823 "assembly\tfake_local\n"
1825 "assembly\twin32_local\n"
1826 "assembly\tdotnet\n"
1827 "assembly\tdotnet_local\n";
1829 static const char pa_component_dat
[] =
1830 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1831 "s72\tS38\ts72\ti2\tS255\tS72\n"
1832 "Component\tComponent\n"
1833 "fake_local\t{F515549D-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\tfake_local.txt\n"
1834 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1835 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1836 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1837 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1839 static const char pa_msi_assembly_dat
[] =
1840 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1841 "s72\ts38\tS72\tS72\tI2\n"
1842 "MsiAssembly\tComponent_\n"
1843 "fake_local\tassembly\t\tnonexistent.txt\t0\n"
1844 "win32\tassembly\tmanifest.txt\t\t1\n"
1845 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1846 "dotnet\tassembly\t\t\t0\n"
1847 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1849 static const char pa_msi_assembly_name_dat
[] =
1850 "Component_\tName\tValue\n"
1852 "MsiAssemblyName\tComponent_\tName\n"
1853 "fake_local\tName\tWine.Fake.Application.Assembly\n"
1854 "fake_local\tprocessorArchitecture\tx86\n"
1855 "fake_local\tpublicKeyToken\tabcdef0123456789\n"
1856 "fake_local\ttype\twin32\n"
1857 "fake_local\tversion\t1.0.0.0\n"
1858 "win32\tName\tWine.Win32.Assembly\n"
1859 "win32\tprocessorArchitecture\tx86\n"
1860 "win32\tpublicKeyToken\tabcdef0123456789\n"
1861 "win32\ttype\twin32\n"
1862 "win32\tversion\t1.0.0.0\n"
1863 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1864 "win32_local\tprocessorArchitecture\tx86\n"
1865 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1866 "win32_local\ttype\twin32\n"
1867 "win32_local\tversion\t1.0.0.0\n"
1868 "dotnet\tName\tWine.Dotnet.Assembly\n"
1869 "dotnet\tprocessorArchitecture\tMSIL\n"
1870 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1871 "dotnet\tculture\tneutral\n"
1872 "dotnet\tversion\t1.0.0.0\n"
1873 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1874 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1875 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1876 "dotnet_local\tculture\tneutral\n"
1877 "dotnet_local\tversion\t1.0.0.0\n";
1879 static const char pa_install_exec_seq_dat
[] =
1880 "Action\tCondition\tSequence\n"
1882 "InstallExecuteSequence\tAction\n"
1883 "LaunchConditions\t\t100\n"
1884 "CostInitialize\t\t800\n"
1886 "CostFinalize\t\t1000\n"
1887 "InstallValidate\t\t1400\n"
1888 "InstallInitialize\t\t1500\n"
1889 "ProcessComponents\t\t1600\n"
1890 "MsiPublishAssemblies\t\t3000\n"
1891 "pa_immediate\tNOT REMOVE AND NOT ALLUSERS\t3001\n"
1892 "pa_deferred\tNOT REMOVE AND NOT ALLUSERS\t3002\n"
1893 "MsiUnpublishAssemblies\t\t4000\n"
1894 "ua_immediate\tREMOVE AND NOT ALLUSERS\t4001\n"
1895 "ua_deferred\tREMOVE AND NOT ALLUSERS\t4002\n"
1896 "RegisterProduct\t\t5000\n"
1897 "PublishFeatures\t\t5100\n"
1898 "PublishProduct\t\t5200\n"
1899 "UnpublishFeatures\t\t5300\n"
1900 "InstallFinalize\t\t6000\n";
1902 static const char pa_custom_action_dat
[] =
1903 "Action\tType\tSource\tTarget\n"
1904 "s72\ti2\tS64\tS0\n"
1905 "CustomAction\tAction\n"
1906 "pa_immediate\t1\tcustom.dll\tpa_absent\n"
1907 "pa_deferred\t1025\tcustom.dll\tpa_present\n"
1908 "ua_immediate\t1\tcustom.dll\tpa_present\n"
1909 "ua_deferred\t1025\tcustom.dll\tpa_absent\n";
1911 static const char rep_file_dat
[] =
1912 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1913 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1915 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1917 static const char rep_feature_dat
[] =
1918 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1919 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1920 "Feature\tFeature\n"
1921 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1923 static const char rep_feature_comp_dat
[] =
1924 "Feature_\tComponent_\n"
1926 "FeatureComponents\tFeature_\tComponent_\n"
1929 static const char rep_component_dat
[] =
1930 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1931 "s72\tS38\ts72\ti2\tS255\tS72\n"
1932 "Component\tComponent\n"
1933 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1935 static const char rep_upgrade_dat
[] =
1936 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1937 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1938 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1939 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1941 static const char rep_property_dat
[] =
1944 "Property\tProperty\n"
1947 "InstallMode\tTypical\n"
1948 "Manufacturer\tWine\n"
1949 "PIDTemplate\t###-#######\n"
1950 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1951 "ProductLanguage\t1033\n"
1952 "ProductName\tMSITEST\n"
1953 "ProductVersion\t1.1.1\n"
1954 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1955 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1956 "MSIFASTINSTALL\t1\n";
1958 static const char rep_install_exec_seq_dat
[] =
1959 "Action\tCondition\tSequence\n"
1961 "InstallExecuteSequence\tAction\n"
1962 "FindRelatedProducts\t\t100\n"
1963 "CostInitialize\t\t800\n"
1965 "CostFinalize\t\t1000\n"
1966 "InstallValidate\t\t1400\n"
1967 "RemoveExistingProducts\t\t1499\n"
1968 "InstallInitialize\t\t1500\n"
1969 "ProcessComponents\t\t1600\n"
1970 "RemoveFiles\t\t1700\n"
1971 "InstallFiles\t\t2000\n"
1972 "UnregisterExtensionInfo\t\t3000\n"
1973 "UnregisterMIMEInfo\t\t3500\n"
1974 "RegisterExtensionInfo\t\t4000\n"
1975 "RegisterMIMEInfo\t\t4500\n"
1976 "RegisterProduct\t\t5000\n"
1977 "PublishFeatures\t\t5100\n"
1978 "PublishProduct\t\t5200\n"
1979 "UnpublishFeatures\t\t5300\n"
1980 "InstallFinalize\t\t6000\n";
1982 static const msi_table env_tables
[] =
1984 ADD_TABLE(component
),
1985 ADD_TABLE(directory
),
1987 ADD_TABLE(feature_comp
),
1989 ADD_TABLE(env_install_exec_seq
),
1990 ADD_TABLE(env_custom_action
),
1992 ADD_TABLE(property
),
1993 ADD_TABLE(env_environment
)
1996 static const msi_table pp_tables
[] =
1998 ADD_TABLE(pp_component
),
1999 ADD_TABLE(directory
),
2000 ADD_TABLE(rof_feature
),
2001 ADD_TABLE(rof_feature_comp
),
2002 ADD_TABLE(rof_file
),
2003 ADD_TABLE(pp_install_exec_seq
),
2004 ADD_TABLE(pp_custom_action
),
2005 ADD_TABLE(rof_media
),
2006 ADD_TABLE(property
),
2009 static const msi_table ppc_tables
[] =
2011 ADD_TABLE(ppc_component
),
2012 ADD_TABLE(directory
),
2013 ADD_TABLE(rof_feature
),
2014 ADD_TABLE(ppc_feature_comp
),
2015 ADD_TABLE(ppc_file
),
2016 ADD_TABLE(pp_install_exec_seq
),
2017 ADD_TABLE(pp_custom_action
),
2018 ADD_TABLE(ppc_media
),
2019 ADD_TABLE(property
),
2022 static const msi_table rem_tables
[] =
2024 ADD_TABLE(rem_component
),
2025 ADD_TABLE(directory
),
2026 ADD_TABLE(rof_feature
),
2027 ADD_TABLE(rem_feature_comp
),
2028 ADD_TABLE(rem_file
),
2029 ADD_TABLE(rem_install_exec_seq
),
2030 ADD_TABLE(rof_media
),
2031 ADD_TABLE(property
),
2032 ADD_TABLE(rem_remove_files
),
2035 static const msi_table mov_tables
[] =
2037 ADD_TABLE(cwd_component
),
2038 ADD_TABLE(directory
),
2039 ADD_TABLE(rof_feature
),
2040 ADD_TABLE(ci2_feature_comp
),
2041 ADD_TABLE(ci2_file
),
2042 ADD_TABLE(mov_install_exec_seq
),
2043 ADD_TABLE(mov_custom_action
),
2044 ADD_TABLE(rof_media
),
2045 ADD_TABLE(property
),
2046 ADD_TABLE(mov_move_file
),
2049 static const msi_table df_tables
[] =
2051 ADD_TABLE(rof_component
),
2052 ADD_TABLE(df_directory
),
2053 ADD_TABLE(rof_feature
),
2054 ADD_TABLE(rof_feature_comp
),
2055 ADD_TABLE(rof_file
),
2056 ADD_TABLE(install_exec_seq
),
2057 ADD_TABLE(rof_media
),
2058 ADD_TABLE(property
),
2059 ADD_TABLE(df_duplicate_file
),
2062 static const msi_table wrv_tables
[] =
2064 ADD_TABLE(wrv_component
),
2065 ADD_TABLE(directory
),
2066 ADD_TABLE(wrv_feature
),
2067 ADD_TABLE(wrv_feature_comp
),
2068 ADD_TABLE(wrv_install_exec_seq
),
2069 ADD_TABLE(wrv_custom_action
),
2070 ADD_TABLE(property
),
2072 ADD_TABLE(wrv_registry
),
2073 ADD_TABLE(wrv_remove_registry
),
2076 static const msi_table cf_tables
[] =
2078 ADD_TABLE(cf_component
),
2079 ADD_TABLE(cf_directory
),
2080 ADD_TABLE(cf_feature
),
2081 ADD_TABLE(cf_feature_comp
),
2083 ADD_TABLE(cf_create_folders
),
2084 ADD_TABLE(cf_install_exec_seq
),
2085 ADD_TABLE(cf_custom_action
),
2090 static const msi_table sss_tables
[] =
2092 ADD_TABLE(component
),
2093 ADD_TABLE(directory
),
2095 ADD_TABLE(feature_comp
),
2097 ADD_TABLE(sss_install_exec_seq
),
2098 ADD_TABLE(sss_service_control
),
2099 ADD_TABLE(sss_custom_action
),
2104 static const msi_table sds_tables
[] =
2106 ADD_TABLE(component
),
2107 ADD_TABLE(directory
),
2109 ADD_TABLE(feature_comp
),
2111 ADD_TABLE(sds_install_exec_seq
),
2112 ADD_TABLE(sds_custom_action
),
2113 ADD_TABLE(service_control
),
2114 ADD_TABLE(service_install
),
2119 static const msi_table sis_tables
[] =
2121 ADD_TABLE(component
),
2122 ADD_TABLE(directory
),
2124 ADD_TABLE(feature_comp
),
2126 ADD_TABLE(sis_install_exec_seq
),
2127 ADD_TABLE(sis_custom_action
),
2128 ADD_TABLE(service_install2
),
2133 static const msi_table sr_tables
[] =
2135 ADD_TABLE(sr_component
),
2136 ADD_TABLE(directory
),
2137 ADD_TABLE(sr_feature
),
2138 ADD_TABLE(sr_feature_comp
),
2140 ADD_TABLE(sr_selfreg
),
2141 ADD_TABLE(sr_install_exec_seq
),
2142 ADD_TABLE(sr_custom_action
),
2147 static const msi_table font_tables
[] =
2149 ADD_TABLE(font_component
),
2150 ADD_TABLE(directory
),
2151 ADD_TABLE(font_feature
),
2152 ADD_TABLE(font_feature_comp
),
2153 ADD_TABLE(font_file
),
2155 ADD_TABLE(font_install_exec_seq
),
2156 ADD_TABLE(font_custom_action
),
2157 ADD_TABLE(font_media
),
2161 static const msi_table vp_tables
[] =
2163 ADD_TABLE(component
),
2164 ADD_TABLE(directory
),
2166 ADD_TABLE(feature_comp
),
2168 ADD_TABLE(vp_custom_action
),
2169 ADD_TABLE(vp_install_exec_seq
),
2171 ADD_TABLE(vp_property
)
2174 static const msi_table odbc_tables
[] =
2176 ADD_TABLE(odbc_component
),
2177 ADD_TABLE(directory
),
2178 ADD_TABLE(odbc_feature
),
2179 ADD_TABLE(odbc_feature_comp
),
2180 ADD_TABLE(odbc_file
),
2181 ADD_TABLE(odbc_driver
),
2182 ADD_TABLE(odbc_translator
),
2183 ADD_TABLE(odbc_datasource
),
2184 ADD_TABLE(odbc_install_exec_seq
),
2185 ADD_TABLE(odbc_custom_action
),
2186 ADD_TABLE(odbc_media
),
2190 static const msi_table tl_tables
[] =
2192 ADD_TABLE(tl_component
),
2193 ADD_TABLE(directory
),
2194 ADD_TABLE(tl_feature
),
2195 ADD_TABLE(tl_feature_comp
),
2197 ADD_TABLE(tl_typelib
),
2198 ADD_TABLE(tl_install_exec_seq
),
2199 ADD_TABLE(tl_custom_action
),
2204 static const msi_table crs_tables
[] =
2206 ADD_TABLE(crs_component
),
2207 ADD_TABLE(directory
),
2208 ADD_TABLE(crs_feature
),
2209 ADD_TABLE(crs_feature_comp
),
2210 ADD_TABLE(crs_file
),
2211 ADD_TABLE(crs_shortcut
),
2212 ADD_TABLE(crs_install_exec_seq
),
2213 ADD_TABLE(crs_custom_action
),
2218 static const msi_table pub_tables
[] =
2220 ADD_TABLE(directory
),
2221 ADD_TABLE(pub_component
),
2222 ADD_TABLE(pub_feature
),
2223 ADD_TABLE(pub_feature_comp
),
2224 ADD_TABLE(pub_file
),
2225 ADD_TABLE(pub_publish_component
),
2226 ADD_TABLE(pub_install_exec_seq
),
2227 ADD_TABLE(pub_custom_action
),
2232 static const msi_table rd_tables
[] =
2234 ADD_TABLE(directory
),
2235 ADD_TABLE(rd_component
),
2236 ADD_TABLE(rd_feature
),
2237 ADD_TABLE(rd_feature_comp
),
2239 ADD_TABLE(rd_duplicate_file
),
2240 ADD_TABLE(rd_install_exec_seq
),
2241 ADD_TABLE(rd_custom_action
),
2246 static const msi_table frp_tables
[] =
2248 ADD_TABLE(directory
),
2249 ADD_TABLE(frp_component
),
2250 ADD_TABLE(frp_feature
),
2251 ADD_TABLE(frp_feature_comp
),
2252 ADD_TABLE(frp_file
),
2253 ADD_TABLE(frp_upgrade
),
2254 ADD_TABLE(frp_custom_action
),
2255 ADD_TABLE(frp_install_exec_seq
),
2260 static const msi_table ini_tables
[] =
2262 ADD_TABLE(directory
),
2263 ADD_TABLE(ini_component
),
2264 ADD_TABLE(ini_feature
),
2265 ADD_TABLE(ini_feature_comp
),
2266 ADD_TABLE(ini_file
),
2267 ADD_TABLE(ini_ini_file
),
2268 ADD_TABLE(ini_remove_ini_file
),
2269 ADD_TABLE(ini_install_exec_seq
),
2270 ADD_TABLE(ini_custom_action
),
2275 static const msi_table rci_tables
[] =
2277 ADD_TABLE(directory
),
2278 ADD_TABLE(rci_component
),
2279 ADD_TABLE(rci_feature
),
2280 ADD_TABLE(rci_feature_comp
),
2281 ADD_TABLE(rci_file
),
2282 ADD_TABLE(rci_appid
),
2283 ADD_TABLE(rci_class
),
2284 ADD_TABLE(rci_install_exec_seq
),
2285 ADD_TABLE(rci_custom_action
),
2290 static const msi_table rei_tables
[] =
2292 ADD_TABLE(directory
),
2293 ADD_TABLE(rei_component
),
2294 ADD_TABLE(rei_feature
),
2295 ADD_TABLE(rei_feature_comp
),
2296 ADD_TABLE(rei_file
),
2297 ADD_TABLE(rei_extension
),
2298 ADD_TABLE(rei_verb
),
2299 ADD_TABLE(rei_progid
),
2300 ADD_TABLE(rei_install_exec_seq
),
2301 ADD_TABLE(rei_custom_action
),
2306 static const msi_table rpi_tables
[] =
2308 ADD_TABLE(directory
),
2309 ADD_TABLE(rpi_component
),
2310 ADD_TABLE(rpi_feature
),
2311 ADD_TABLE(rpi_feature_comp
),
2312 ADD_TABLE(rpi_file
),
2313 ADD_TABLE(rpi_appid
),
2314 ADD_TABLE(rpi_class
),
2315 ADD_TABLE(rpi_extension
),
2316 ADD_TABLE(rpi_verb
),
2317 ADD_TABLE(rpi_progid
),
2318 ADD_TABLE(rpi_install_exec_seq
),
2319 ADD_TABLE(rpi_custom_action
),
2324 static const msi_table rmi_tables
[] =
2326 ADD_TABLE(directory
),
2327 ADD_TABLE(rmi_component
),
2328 ADD_TABLE(rmi_feature
),
2329 ADD_TABLE(rmi_feature_comp
),
2330 ADD_TABLE(rmi_file
),
2331 ADD_TABLE(rmi_extension
),
2332 ADD_TABLE(rmi_verb
),
2333 ADD_TABLE(rmi_mime
),
2334 ADD_TABLE(rmi_install_exec_seq
),
2335 ADD_TABLE(rmi_custom_action
),
2340 static const msi_table pa_tables
[] =
2342 ADD_TABLE(directory
),
2343 ADD_TABLE(pa_component
),
2344 ADD_TABLE(pa_feature
),
2345 ADD_TABLE(pa_feature_comp
),
2347 ADD_TABLE(pa_msi_assembly
),
2348 ADD_TABLE(pa_msi_assembly_name
),
2349 ADD_TABLE(pa_install_exec_seq
),
2350 ADD_TABLE(pa_custom_action
),
2355 static const msi_table rep_tables
[] =
2357 ADD_TABLE(directory
),
2358 ADD_TABLE(rep_component
),
2359 ADD_TABLE(rep_feature
),
2360 ADD_TABLE(rep_feature_comp
),
2361 ADD_TABLE(rep_file
),
2362 ADD_TABLE(rep_upgrade
),
2363 ADD_TABLE(rep_property
),
2364 ADD_TABLE(rep_install_exec_seq
),
2368 /* cabinet definitions */
2370 /* make the max size large so there is only one cab file */
2371 #define MEDIA_SIZE 0x7FFFFFFF
2373 static void init_functionpointers(void)
2375 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2376 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2377 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2378 HMODULE hsrclient
= LoadLibraryA("srclient.dll");
2380 #define GET_PROC(mod, func) \
2381 p ## func = (void*)GetProcAddress(mod, #func); \
2383 trace("GetProcAddress(%s) failed\n", #func);
2385 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2386 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2387 GET_PROC(hmsi
, MsiSourceListGetInfoA
);
2388 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2389 GET_PROC(hmsi
, MsiQueryFeatureStateExA
);
2391 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2392 GET_PROC(hkernel32
, IsWow64Process
)
2394 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2395 GET_PROC(hsrclient
, SRSetRestorePointA
);
2400 static char *get_user_sid(void)
2405 char *usersid
= NULL
;
2407 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
2408 GetTokenInformation(token
, TokenUser
, NULL
, size
, &size
);
2410 user
= HeapAlloc(GetProcessHeap(), 0, size
);
2411 GetTokenInformation(token
, TokenUser
, user
, size
, &size
);
2412 ConvertSidToStringSidA(user
->User
.Sid
, &usersid
);
2413 HeapFree(GetProcessHeap(), 0, user
);
2419 static void create_test_files(void)
2421 CreateDirectoryA("msitest", NULL
);
2422 create_file("msitest\\one.txt", 100);
2423 CreateDirectoryA("msitest\\first", NULL
);
2424 create_file("msitest\\first\\two.txt", 100);
2425 CreateDirectoryA("msitest\\second", NULL
);
2426 create_file("msitest\\second\\three.txt", 100);
2428 create_file("four.txt", 100);
2429 create_file("five.txt", 100);
2430 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2432 create_file("msitest\\filename", 100);
2433 create_file("msitest\\service.exe", 100);
2434 create_file("msitest\\service2.exe", 100);
2436 DeleteFileA("four.txt");
2437 DeleteFileA("five.txt");
2440 static void delete_test_files(void)
2442 DeleteFileA("msitest.msi");
2443 DeleteFileA("msitest.cab");
2444 DeleteFileA("msitest\\second\\three.txt");
2445 DeleteFileA("msitest\\first\\two.txt");
2446 DeleteFileA("msitest\\one.txt");
2447 DeleteFileA("msitest\\service.exe");
2448 DeleteFileA("msitest\\service2.exe");
2449 DeleteFileA("msitest\\filename");
2450 RemoveDirectoryA("msitest\\second");
2451 RemoveDirectoryA("msitest\\first");
2452 RemoveDirectoryA("msitest");
2455 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2457 RESTOREPOINTINFOA spec
;
2459 spec
.dwEventType
= event_type
;
2460 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2461 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2462 lstrcpyA(spec
.szDescription
, "msitest restore point");
2464 return pSRSetRestorePointA(&spec
, status
);
2467 static void remove_restore_point(DWORD seq_number
)
2471 res
= pSRRemoveRestorePoint(seq_number
);
2472 if (res
!= ERROR_SUCCESS
)
2473 trace("Failed to remove the restore point : %08x\n", res
);
2476 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2478 if (pRegDeleteKeyExA
)
2479 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2480 return RegDeleteKeyA( key
, subkey
);
2483 static void delete_pfmsitest_files(void)
2485 SHFILEOPSTRUCTA shfl
;
2486 CHAR path
[MAX_PATH
+11];
2488 lstrcpyA(path
, PROG_FILES_DIR
);
2489 lstrcatA(path
, "\\msitest\\*");
2490 path
[strlen(path
) + 1] = '\0';
2493 shfl
.wFunc
= FO_DELETE
;
2496 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
2498 SHFileOperationA(&shfl
);
2500 lstrcpyA(path
, PROG_FILES_DIR
);
2501 lstrcatA(path
, "\\msitest");
2502 RemoveDirectoryA(path
);
2505 static void check_reg_str(HKEY prodkey
, LPCSTR name
, LPCSTR expected
, BOOL bcase
, DWORD line
)
2513 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)val
, &size
);
2515 if (res
!= ERROR_SUCCESS
||
2516 (type
!= REG_SZ
&& type
!= REG_EXPAND_SZ
&& type
!= REG_MULTI_SZ
))
2518 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2523 ok_(__FILE__
, line
)(!val
[0], "Expected empty string, got %s\n", val
);
2527 ok_(__FILE__
, line
)(!lstrcmpA(val
, expected
), "Expected \"%s\", got \"%s\"\n", expected
, val
);
2529 ok_(__FILE__
, line
)(!lstrcmpiA(val
, expected
), "Expected \"%s\", got \"%s\"\n", expected
, val
);
2533 static void check_reg_multi(HKEY prodkey
, const char *name
, const char *expect
, DWORD line
)
2541 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (BYTE
*)val
, &size
);
2543 if (res
!= ERROR_SUCCESS
|| type
!= REG_MULTI_SZ
)
2545 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2549 ok_(__FILE__
, line
)(!memcmp(val
, expect
, size
), "wrong data\n");
2552 static void check_reg_dword(HKEY prodkey
, LPCSTR name
, DWORD expected
, DWORD line
)
2554 DWORD val
, size
, type
;
2557 size
= sizeof(DWORD
);
2558 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2560 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2562 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2566 ok_(__FILE__
, line
)(val
== expected
, "Expected %d, got %d\n", expected
, val
);
2569 #define CHECK_REG_STR(prodkey, name, expected) \
2570 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2572 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2574 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2575 RegDeleteValueA(prodkey, name); \
2578 #define CHECK_REG_ISTR(prodkey, name, expected) \
2579 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2581 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2583 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2584 RegDeleteValueA(prodkey, name); \
2587 #define CHECK_REG_MULTI(key, name, expect) \
2588 check_reg_multi(key, name, expect, __LINE__);
2590 #define CHECK_REG_DWORD(prodkey, name, expected) \
2591 check_reg_dword(prodkey, name, expected, __LINE__);
2593 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2595 check_reg_dword(prodkey, name, expected, __LINE__); \
2596 RegDeleteValueA(prodkey, name); \
2599 static void get_date_str(LPSTR date
)
2603 static const char date_fmt
[] = "%d%02d%02d";
2604 GetLocalTime(&systime
);
2605 sprintf(date
, date_fmt
, systime
.wYear
, systime
.wMonth
, systime
.wDay
);
2608 /* EstimatedSize is the size in KiB of .msi + installed files, rounded up to page size. */
2609 static DWORD
get_estimated_size(void)
2617 file
= CreateFileA(msifile
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, 0, NULL
);
2618 size
= ((GetFileSize(file
, NULL
) + si
.dwPageSize
- 1) / si
.dwPageSize
+ 1);
2619 size
= size
* si
.dwPageSize
/ 1024;
2624 static void extract_resource(const char *name
, const char *type
, const char *path
)
2631 file
= CreateFileA(path
, GENERIC_READ
|GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, 0);
2632 ok(file
!= INVALID_HANDLE_VALUE
, "file creation failed, at %s, error %d\n", path
, GetLastError());
2634 res
= FindResourceA(NULL
, name
, type
);
2635 ok( res
!= 0, "couldn't find resource\n" );
2636 ptr
= LockResource( LoadResource( GetModuleHandleA(NULL
), res
));
2637 WriteFile( file
, ptr
, SizeofResource( GetModuleHandleA(NULL
), res
), &written
, NULL
);
2638 ok( written
== SizeofResource( GetModuleHandleA(NULL
), res
), "couldn't write resource\n" );
2639 CloseHandle( file
);
2642 static void test_register_product(void)
2646 HKEY hkey
, props
, usage
;
2648 char date
[MAX_PATH
], temp
[MAX_PATH
], keypath
[MAX_PATH
], path
[MAX_PATH
];
2651 static const CHAR uninstall
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2652 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2653 static const CHAR userdata
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2654 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2655 static const CHAR ugkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2656 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2657 static const CHAR userugkey
[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2658 "\\51AAE0C44620A5E4788506E91F249BD2";
2660 if (is_process_limited())
2662 skip("process is limited\n");
2666 if (!(usersid
= get_user_sid()))
2670 GetTempPathA(MAX_PATH
, temp
);
2672 CreateDirectoryA("msitest", NULL
);
2673 create_file("msitest\\maximus", 500);
2675 create_database(msifile
, pp_tables
, ARRAY_SIZE(pp_tables
));
2677 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
2679 /* RegisterProduct */
2680 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
2681 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2683 skip("Not enough rights to perform tests\n");
2686 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2687 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2688 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2690 res
= RegOpenKeyA(HKEY_CURRENT_USER
, userugkey
, &hkey
);
2691 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2693 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_READ
| KEY_WOW64_32KEY
, &hkey
);
2694 ok(!res
, "got %d\n", res
);
2696 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
2697 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
2698 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
2699 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
2700 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2701 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
2702 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2703 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
2704 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
2705 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
2706 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
2707 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
2708 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
2709 CHECK_DEL_REG_DWORD(hkey
, "NoModify", 1);
2710 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
2711 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
2712 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
2713 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
2714 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
2715 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
2716 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
2717 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
2718 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
2720 CHECK_DEL_REG_DWORD(hkey
, "EstimatedSize", get_estimated_size());
2722 res
= RegDeleteKeyA(hkey
, "");
2723 ok(!res
, "got %d\n", res
);
2726 sprintf(keypath
, userdata
, usersid
);
2727 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, KEY_ALL_ACCESS
| KEY_WOW64_64KEY
, &hkey
);
2728 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2730 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, KEY_READ
, &props
);
2731 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2733 size
= sizeof(path
);
2734 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
2736 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
2738 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
2739 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
2740 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
2741 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
2742 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2743 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
2744 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2745 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
2746 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
2747 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
2748 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
2749 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
2750 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
2751 CHECK_DEL_REG_DWORD(props
, "NoModify", 1);
2752 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
2753 CHECK_DEL_REG_STR(props
, "Size", NULL
);
2754 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
2755 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
2756 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
2757 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
2758 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
2759 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
2760 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
2762 CHECK_DEL_REG_DWORD(props
, "EstimatedSize", get_estimated_size());
2764 res
= RegDeleteKeyA(props
, "");
2765 ok(!res
, "got %d\n", res
);
2768 res
= RegOpenKeyExA(hkey
, "Usage", 0, KEY_READ
, &usage
);
2771 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2774 res
= RegDeleteKeyA(usage
, "");
2776 ok(!res
, "got %d\n", res
);
2778 res
= RegDeleteKeyA(hkey
, "");
2779 ok(!res
, "got %d\n", res
);
2782 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
2783 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2785 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
2787 res
= RegDeleteKeyA(hkey
, "");
2788 ok(!res
, "got %d\n", res
);
2791 /* RegisterProduct, machine */
2792 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 ALLUSERS=1");
2793 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2794 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2795 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2797 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, userugkey
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
2798 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2800 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_READ
| KEY_WOW64_32KEY
, &hkey
);
2801 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2803 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
2804 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
2805 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
2806 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
2807 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2808 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
2809 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2810 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
2811 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
2812 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
2813 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
2814 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
2815 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
2816 CHECK_DEL_REG_DWORD(hkey
, "NoModify", 1);
2817 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
2818 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
2819 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
2820 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
2821 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
2822 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
2823 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
2824 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
2825 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
2827 CHECK_DEL_REG_DWORD(hkey
, "EstimatedSize", get_estimated_size());
2829 res
= RegDeleteKeyA(hkey
, "");
2830 ok(!res
, "got %d\n", res
);
2833 sprintf(keypath
, userdata
, "S-1-5-18");
2834 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
2835 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2837 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, KEY_READ
, &props
);
2838 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2840 size
= sizeof(path
);
2841 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
2843 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
2845 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
2846 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
2847 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
2848 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
2849 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2850 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
2851 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2852 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
2853 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
2854 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
2855 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
2856 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
2857 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
2858 CHECK_DEL_REG_DWORD(props
, "NoModify", 1);
2859 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
2860 CHECK_DEL_REG_STR(props
, "Size", NULL
);
2861 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
2862 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
2863 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
2864 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
2865 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
2866 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
2867 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
2869 CHECK_DEL_REG_DWORD(props
, "EstimatedSize", get_estimated_size());
2871 res
= RegDeleteKeyA(props
, "");
2872 ok(!res
, "got %d\n", res
);
2875 res
= RegOpenKeyExA(hkey
, "Usage", 0, KEY_READ
, &usage
);
2878 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2881 res
= RegDeleteKeyA(usage
, "");
2883 ok(!res
, "got %d\n", res
);
2885 res
= RegDeleteKeyA(hkey
, "");
2886 ok(!res
, "got %d\n", res
);
2889 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
2890 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2892 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
2894 res
= RegDeleteKeyA(hkey
, "");
2895 ok(!res
, "got %d\n", res
);
2898 if (is_wow64
|| is_64bit
)
2900 DeleteFileA(msifile
);
2901 create_database_template(msifile
, pp_tables
, ARRAY_SIZE(pp_tables
), 200, "x64;1033");
2903 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 ALLUSERS=1 RP_TEST64=1");
2904 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2905 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2906 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2908 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, userugkey
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
2909 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2911 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_READ
| KEY_WOW64_32KEY
, &hkey
);
2912 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_SUCCESS, got %d\n", res
);
2914 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
2915 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2917 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
2918 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
2919 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
2920 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
2921 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2922 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
2923 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2924 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
2925 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
2926 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
2927 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
2928 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
2929 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
2930 CHECK_DEL_REG_DWORD(hkey
, "NoModify", 1);
2931 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
2932 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
2933 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
2934 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
2935 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
2936 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
2937 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
2938 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
2939 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
2941 CHECK_DEL_REG_DWORD(hkey
, "EstimatedSize", get_estimated_size());
2943 res
= RegDeleteKeyA(hkey
, "");
2944 ok(!res
, "got %d\n", res
);
2947 sprintf(keypath
, userdata
, "S-1-5-18");
2948 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
2949 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2951 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, KEY_READ
, &props
);
2952 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2954 size
= sizeof(path
);
2955 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
2957 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
2959 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
2960 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
2961 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
2962 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
2963 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2964 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
2965 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2966 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
2967 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
2968 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
2969 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
2970 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
2971 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
2972 CHECK_DEL_REG_DWORD(props
, "NoModify", 1);
2973 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
2974 CHECK_DEL_REG_STR(props
, "Size", NULL
);
2975 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
2976 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
2977 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
2978 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
2979 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
2980 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
2981 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
2983 CHECK_DEL_REG_DWORD(props
, "EstimatedSize", get_estimated_size());
2985 res
= RegDeleteKeyA(props
, "");
2986 ok(!res
, "got %d\n", res
);
2989 res
= RegOpenKeyExA(hkey
, "Usage", 0, KEY_READ
, &usage
);
2992 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2995 res
= RegDeleteKeyA(usage
, "");
2997 ok(!res
, "got %d\n", res
);
2999 res
= RegDeleteKeyA(hkey
, "");
3000 ok(!res
, "got %d\n", res
);
3003 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, KEY_READ
| KEY_WOW64_64KEY
, &hkey
);
3004 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3006 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3008 res
= RegDeleteKeyA(hkey
, "");
3009 ok(!res
, "got %d\n", res
);
3013 skip("64-bit RegisterProduct tests\n");
3016 DeleteFileA(msifile
);
3017 DeleteFileA("msitest\\maximus");
3018 RemoveDirectoryA("msitest");
3019 HeapFree(GetProcessHeap(), 0, usersid
);
3022 static void test_publish_product(void)
3024 static const char prodpath
[] =
3025 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3026 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3027 static const char cuprodpath
[] =
3028 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3029 static const char cuupgrades
[] =
3030 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3031 static const char badprod
[] =
3032 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
3033 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3034 static const char machprod
[] =
3035 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3036 static const char machup
[] =
3037 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3041 HKEY sourcelist
, net
, props
;
3042 HKEY hkey
, patches
, media
;
3043 CHAR keypath
[MAX_PATH
];
3044 CHAR temp
[MAX_PATH
];
3045 CHAR path
[MAX_PATH
];
3046 BOOL old_installer
= FALSE
;
3047 REGSAM access
= KEY_ALL_ACCESS
;
3049 if (is_process_limited())
3051 skip("process is limited\n");
3055 if (!(usersid
= get_user_sid()))
3058 GetTempPathA(MAX_PATH
, temp
);
3060 CreateDirectoryA("msitest", NULL
);
3061 create_file("msitest\\maximus", 500);
3063 create_database(msifile
, pp_tables
, ARRAY_SIZE(pp_tables
));
3066 access
|= KEY_WOW64_64KEY
;
3068 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3070 /* PublishProduct, current user */
3071 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
3072 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3074 skip("Not enough rights to perform tests\n");
3077 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3078 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3079 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3081 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3082 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3084 sprintf(keypath
, prodpath
, usersid
);
3085 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3086 if (res
== ERROR_FILE_NOT_FOUND
)
3088 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3089 if (res
== ERROR_SUCCESS
)
3091 win_skip("Windows Installer < 3.0 detected\n");
3093 old_installer
= TRUE
;
3098 win_skip("Install failed, no need to continue\n");
3102 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3104 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3105 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3107 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3110 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3111 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3114 delete_key(patches
, "", access
);
3115 RegCloseKey(patches
);
3116 delete_key(hkey
, "", access
);
3120 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3121 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3123 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3124 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3125 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3126 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3128 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3129 CHECK_DEL_REG_DWORD(hkey
, "Assignment", 0);
3130 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3131 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3132 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3134 res
= RegOpenKeyA(hkey
, "SourceList", &sourcelist
);
3135 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3137 lstrcpyA(path
, "n;1;");
3138 lstrcatA(path
, temp
);
3139 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3140 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3142 res
= RegOpenKeyA(sourcelist
, "Net", &net
);
3143 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3145 CHECK_DEL_REG_STR(net
, "1", temp
);
3147 RegDeleteKeyA(net
, "");
3150 res
= RegOpenKeyA(sourcelist
, "Media", &media
);
3151 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3153 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3155 RegDeleteKeyA(media
, "");
3157 RegDeleteKeyA(sourcelist
, "");
3158 RegCloseKey(sourcelist
);
3159 RegDeleteKeyA(hkey
, "");
3162 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuupgrades
, &hkey
);
3163 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3165 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3167 RegDeleteKeyA(hkey
, "");
3170 /* PublishProduct, machine */
3171 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3174 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3175 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3176 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3178 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3179 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3181 sprintf(keypath
, prodpath
, "S-1-5-18");
3182 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3183 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3185 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3186 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3188 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3191 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3192 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3195 delete_key(patches
, "", access
);
3196 RegCloseKey(patches
);
3197 delete_key(hkey
, "", access
);
3201 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machprod
, 0, access
, &hkey
);
3202 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3204 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3205 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3206 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3207 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3209 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3210 todo_wine
CHECK_DEL_REG_DWORD(hkey
, "Assignment", 1);
3211 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3212 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3213 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3215 res
= RegOpenKeyExA(hkey
, "SourceList", 0, access
, &sourcelist
);
3216 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3218 lstrcpyA(path
, "n;1;");
3219 lstrcatA(path
, temp
);
3220 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3221 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3223 res
= RegOpenKeyExA(sourcelist
, "Net", 0, access
, &net
);
3224 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3226 CHECK_DEL_REG_STR(net
, "1", temp
);
3228 res
= delete_key(net
, "", access
);
3229 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3232 res
= RegOpenKeyExA(sourcelist
, "Media", 0, access
, &media
);
3233 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3235 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3237 res
= delete_key(media
, "", access
);
3238 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3240 res
= delete_key(sourcelist
, "", access
);
3241 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3242 RegCloseKey(sourcelist
);
3243 res
= delete_key(hkey
, "", access
);
3244 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3247 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machup
, 0, access
, &hkey
);
3248 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3250 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3252 res
= delete_key(hkey
, "", access
);
3253 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3257 DeleteFileA(msifile
);
3258 DeleteFileA("msitest\\maximus");
3259 RemoveDirectoryA("msitest");
3260 HeapFree(GetProcessHeap(), 0, usersid
);
3263 static void test_publish_features(void)
3265 static const char cupath
[] =
3266 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3267 static const char udfeatpath
[] =
3268 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3269 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3270 static const char udpridpath
[] =
3271 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3272 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3273 static const char featkey
[] =
3274 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3275 static const char classfeat
[] =
3276 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3281 CHAR keypath
[MAX_PATH
];
3282 REGSAM access
= KEY_ALL_ACCESS
;
3284 if (is_process_limited())
3286 skip("process is limited\n");
3290 if (!(usersid
= get_user_sid()))
3293 CreateDirectoryA("msitest", NULL
);
3294 create_file("msitest\\maximus", 500);
3296 create_database(msifile
, pp_tables
, ARRAY_SIZE(pp_tables
));
3299 access
|= KEY_WOW64_64KEY
;
3301 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3303 /* PublishFeatures, current user */
3304 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
3305 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3307 skip("Not enough rights to perform tests\n");
3310 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3311 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3312 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3314 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3315 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3317 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3318 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3320 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3321 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3323 CHECK_REG_STR(hkey
, "feature", "");
3324 CHECK_REG_STR(hkey
, "montecristo", "");
3326 RegDeleteValueA(hkey
, "feature");
3327 RegDeleteValueA(hkey
, "montecristo");
3328 delete_key(hkey
, "", access
);
3331 sprintf(keypath
, udfeatpath
, usersid
);
3332 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3333 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3335 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3336 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3338 RegDeleteValueA(hkey
, "feature");
3339 RegDeleteValueA(hkey
, "montecristo");
3340 delete_key(hkey
, "", access
);
3342 sprintf(keypath
, udpridpath
, usersid
);
3343 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3345 /* PublishFeatures, machine */
3346 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1 ALLUSERS=1");
3347 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3348 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3349 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3351 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3352 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3354 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3355 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3356 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3357 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3359 CHECK_REG_STR(hkey
, "feature", "");
3360 CHECK_REG_STR(hkey
, "montecristo", "");
3362 RegDeleteValueA(hkey
, "feature");
3363 RegDeleteValueA(hkey
, "montecristo");
3364 delete_key(hkey
, "", access
);
3367 sprintf(keypath
, udfeatpath
, "S-1-5-18");
3368 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3369 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3371 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3372 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3374 RegDeleteValueA(hkey
, "feature");
3375 RegDeleteValueA(hkey
, "montecristo");
3376 delete_key(hkey
, "", access
);
3378 sprintf(keypath
, udpridpath
, "S-1-5-18");
3379 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3382 DeleteFileA(msifile
);
3383 DeleteFileA("msitest\\maximus");
3384 RemoveDirectoryA("msitest");
3385 HeapFree(GetProcessHeap(), 0, usersid
);
3388 static LPSTR
reg_get_val_str(HKEY hkey
, LPCSTR name
)
3394 r
= RegQueryValueExA(hkey
, name
, NULL
, NULL
, NULL
, &len
);
3395 if (r
!= ERROR_SUCCESS
)
3398 len
+= sizeof (WCHAR
);
3399 val
= HeapAlloc(GetProcessHeap(), 0, len
);
3400 if (!val
) return NULL
;
3402 RegQueryValueExA(hkey
, name
, NULL
, NULL
, (LPBYTE
)val
, &len
);
3406 static void get_owner_company(LPSTR
*owner
, LPSTR
*company
)
3410 REGSAM access
= KEY_ALL_ACCESS
;
3412 *owner
= *company
= NULL
;
3415 access
|= KEY_WOW64_64KEY
;
3417 res
= RegOpenKeyA(HKEY_CURRENT_USER
,
3418 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey
);
3419 if (res
== ERROR_SUCCESS
)
3421 *owner
= reg_get_val_str(hkey
, "DefName");
3422 *company
= reg_get_val_str(hkey
, "DefCompany");
3426 if (!*owner
|| !*company
)
3428 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3429 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey
);
3430 if (res
== ERROR_SUCCESS
)
3432 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3433 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3438 if (!*owner
|| !*company
)
3440 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3441 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access
, &hkey
);
3442 if (res
== ERROR_SUCCESS
)
3444 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3445 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3451 static void test_register_user(void)
3457 LPSTR owner
, company
;
3458 CHAR keypath
[MAX_PATH
];
3459 REGSAM access
= KEY_ALL_ACCESS
;
3461 static const CHAR keypropsfmt
[] =
3462 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3463 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3464 static const CHAR keypridfmt
[] =
3465 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3466 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3468 if (is_process_limited())
3470 skip("process is limited\n");
3474 if (!(usersid
= get_user_sid()))
3477 get_owner_company(&owner
, &company
);
3479 CreateDirectoryA("msitest", NULL
);
3480 create_file("msitest\\maximus", 500);
3482 create_database(msifile
, pp_tables
, ARRAY_SIZE(pp_tables
));
3485 access
|= KEY_WOW64_64KEY
;
3487 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3489 /* RegisterUser, per-user */
3490 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1");
3491 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3493 skip("Not enough rights to perform tests\n");
3496 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3497 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3498 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3500 sprintf(keypath
, keypropsfmt
, usersid
);
3501 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3502 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3504 CHECK_REG_STR(props
, "ProductID", "none");
3505 CHECK_REG_STR(props
, "RegCompany", company
);
3506 CHECK_REG_STR(props
, "RegOwner", owner
);
3508 RegDeleteValueA(props
, "ProductID");
3509 RegDeleteValueA(props
, "RegCompany");
3510 RegDeleteValueA(props
, "RegOwner");
3511 delete_key(props
, "", access
);
3513 sprintf(keypath
, keypridfmt
, usersid
);
3514 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3516 /* RegisterUser, machine */
3517 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1 ALLUSERS=1");
3518 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3519 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3520 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3522 sprintf(keypath
, keypropsfmt
, "S-1-5-18");
3523 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3524 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3526 CHECK_REG_STR(props
, "ProductID", "none");
3527 CHECK_REG_STR(props
, "RegCompany", company
);
3528 CHECK_REG_STR(props
, "RegOwner", owner
);
3530 RegDeleteValueA(props
, "ProductID");
3531 RegDeleteValueA(props
, "RegCompany");
3532 RegDeleteValueA(props
, "RegOwner");
3533 delete_key(props
, "", access
);
3535 sprintf(keypath
, keypridfmt
, "S-1-5-18");
3536 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3539 HeapFree(GetProcessHeap(), 0, company
);
3540 HeapFree(GetProcessHeap(), 0, owner
);
3542 DeleteFileA(msifile
);
3543 DeleteFileA("msitest\\maximus");
3544 RemoveDirectoryA("msitest");
3548 static void test_process_components(void)
3550 static const char keyfmt
[] =
3551 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3552 static const char compkey
[] =
3553 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3560 CHAR keypath
[MAX_PATH
];
3561 CHAR program_files_maximus
[MAX_PATH
];
3562 REGSAM access
= KEY_ALL_ACCESS
;
3564 if (is_process_limited())
3566 skip("process is limited\n");
3570 if (!(usersid
= get_user_sid()))
3573 CreateDirectoryA("msitest", NULL
);
3574 create_file("msitest\\maximus", 500);
3576 create_database(msifile
, ppc_tables
, ARRAY_SIZE(ppc_tables
));
3579 access
|= KEY_WOW64_64KEY
;
3581 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3583 /* ProcessComponents, per-user */
3584 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
3585 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3587 skip("Not enough rights to perform tests\n");
3590 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3591 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3592 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3594 sprintf(keypath
, keyfmt
, usersid
, "CBABC2FDCCB35E749A8944D8C1C098B5");
3595 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3596 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3599 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3600 NULL
, NULL
, (LPBYTE
)val
, &size
);
3601 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3603 lstrcpyA(program_files_maximus
,PROG_FILES_DIR
);
3604 lstrcatA(program_files_maximus
,"\\msitest\\maximus");
3606 ok(!lstrcmpiA(val
, program_files_maximus
),
3607 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3609 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3610 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3612 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3613 delete_key(comp
, "", access
);
3616 sprintf(keypath
, keyfmt
, usersid
, "241C3DA58FECD0945B9687D408766058");
3617 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3618 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3621 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3622 NULL
, NULL
, (LPBYTE
)val
, &size
);
3623 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3624 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3625 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3627 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3628 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3630 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3631 delete_key(comp
, "", access
);
3634 /* ProcessComponents, machine */
3635 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3636 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3637 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3638 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3640 sprintf(keypath
, keyfmt
, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3641 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3642 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3645 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3646 NULL
, NULL
, (LPBYTE
)val
, &size
);
3647 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3648 ok(!lstrcmpiA(val
, program_files_maximus
),
3649 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3651 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3652 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3654 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3655 delete_key(comp
, "", access
);
3658 sprintf(keypath
, keyfmt
, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3659 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3660 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3663 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3664 NULL
, NULL
, (LPBYTE
)val
, &size
);
3665 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3666 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3667 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3669 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3670 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3672 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3673 delete_key(comp
, "", access
);
3677 DeleteFileA(msifile
);
3678 DeleteFileA("msitest\\maximus");
3679 RemoveDirectoryA("msitest");
3683 static void test_publish(void)
3685 static const char subkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3686 static const char subkey_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3689 HKEY uninstall
, prodkey
, uninstall_32node
= NULL
;
3691 char date
[MAX_PATH
], temp
[MAX_PATH
], prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3692 REGSAM access
= KEY_ALL_ACCESS
;
3695 if (!pMsiQueryFeatureStateExA
)
3697 win_skip("MsiQueryFeatureStateExA is not available\n");
3700 if (is_process_limited())
3702 skip("process is limited\n");
3707 GetTempPathA(MAX_PATH
, temp
);
3710 access
|= KEY_WOW64_64KEY
;
3712 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey
, 0, KEY_ALL_ACCESS
, &uninstall
);
3713 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3717 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey_32node
, 0, KEY_ALL_ACCESS
, &uninstall_32node
);
3718 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3721 CreateDirectoryA("msitest", NULL
);
3722 create_file("msitest\\maximus", 500);
3724 create_database(msifile
, pp_tables
, ARRAY_SIZE(pp_tables
));
3726 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3728 state
= MsiQueryProductStateA(prodcode
);
3729 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3731 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3732 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3735 SetLastError(0xdeadbeef);
3736 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3737 error
= GetLastError();
3738 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3739 ok(state
== 0xdead, "got %d\n", state
);
3740 ok(error
== 0xdeadbeef, "got %u\n", error
);
3743 SetLastError(0xdeadbeef);
3744 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
3745 error
= GetLastError();
3746 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3747 ok(state
== 0xdead, "got %d\n", state
);
3748 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3751 SetLastError(0xdeadbeef);
3752 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
3753 error
= GetLastError();
3754 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3755 ok(state
== 0xdead, "got %d\n", state
);
3756 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3758 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3759 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3761 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3762 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3764 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3765 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3766 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3767 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3769 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3770 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3772 /* nothing published */
3773 r
= MsiInstallProductA(msifile
, NULL
);
3774 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3776 skip("Not enough rights to perform tests\n");
3779 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3780 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3781 ok(pf_exists("msitest"), "File not installed\n");
3783 state
= MsiQueryProductStateA(prodcode
);
3784 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3786 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3787 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3789 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3790 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3792 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3793 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3794 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3795 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3797 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3798 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3800 /* PublishProduct and RegisterProduct */
3801 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3802 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3803 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3804 ok(pf_exists("msitest"), "File not installed\n");
3806 state
= MsiQueryProductStateA(prodcode
);
3807 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3809 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3810 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3812 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3813 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3815 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3816 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3817 ok(r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3818 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3822 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3823 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3827 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3828 if (is_wow64
&& res
== ERROR_FILE_NOT_FOUND
) /* XP - Vista, Wow64 */
3829 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3830 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3833 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
3834 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
3835 CHECK_REG_STR(prodkey
, "InstallDate", date
);
3836 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
3837 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3838 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
3839 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3840 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
3841 CHECK_REG_STR(prodkey
, "Comments", NULL
);
3842 CHECK_REG_STR(prodkey
, "Contact", NULL
);
3843 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
3844 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
3845 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
3846 CHECK_REG_DWORD(prodkey
, "NoModify", 1);
3847 CHECK_REG_STR(prodkey
, "Readme", NULL
);
3848 CHECK_REG_STR(prodkey
, "Size", NULL
);
3849 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
3850 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
3851 CHECK_REG_DWORD(prodkey
, "Language", 1033);
3852 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
3853 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
3854 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
3855 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
3857 CHECK_REG_DWORD(prodkey
, "EstimatedSize", get_estimated_size());
3859 RegCloseKey(prodkey
);
3861 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
3862 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3863 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3864 ok(pf_exists("msitest"), "File deleted\n");
3866 state
= MsiQueryProductStateA(prodcode
);
3867 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3869 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3870 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3872 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3873 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3875 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3876 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3877 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3878 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3880 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3881 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3883 /* complete install */
3884 r
= MsiInstallProductA(msifile
, "FULL=1");
3885 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3886 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3887 ok(pf_exists("msitest"), "File not installed\n");
3889 state
= MsiQueryProductStateA(prodcode
);
3890 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3892 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3893 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3896 SetLastError(0xdeadbeef);
3897 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3898 error
= GetLastError();
3899 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3900 ok(state
== 0xdead, "got %d\n", state
);
3901 ok(error
== 0xdeadbeef, "got %u\n", error
);
3904 SetLastError(0xdeadbeef);
3905 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
3906 error
= GetLastError();
3907 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3908 ok(state
== 0xdead, "got %d\n", state
);
3909 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3912 SetLastError(0xdeadbeef);
3913 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
3914 error
= GetLastError();
3915 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
3916 ok(state
== INSTALLSTATE_LOCAL
, "got %d\n", state
);
3917 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3919 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3920 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3922 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3923 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3924 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3925 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3929 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3930 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3934 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3935 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3938 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
3939 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
3940 CHECK_REG_STR(prodkey
, "InstallDate", date
);
3941 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
3942 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3943 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
3944 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3945 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
3946 CHECK_REG_STR(prodkey
, "Comments", NULL
);
3947 CHECK_REG_STR(prodkey
, "Contact", NULL
);
3948 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
3949 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
3950 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
3951 CHECK_REG_DWORD(prodkey
, "NoModify", 1);
3952 CHECK_REG_STR(prodkey
, "Readme", NULL
);
3953 CHECK_REG_STR(prodkey
, "Size", NULL
);
3954 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
3955 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
3956 CHECK_REG_DWORD(prodkey
, "Language", 1033);
3957 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
3958 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
3959 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
3960 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
3962 CHECK_REG_DWORD(prodkey
, "EstimatedSize", get_estimated_size());
3964 RegCloseKey(prodkey
);
3966 /* no UnpublishFeatures */
3967 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
3968 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3969 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3970 ok(!pf_exists("msitest"), "Directory not deleted\n");
3972 state
= MsiQueryProductStateA(prodcode
);
3973 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3975 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3976 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3978 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3979 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3981 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3982 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3983 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3984 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3986 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3987 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3989 /* complete install */
3990 r
= MsiInstallProductA(msifile
, "FULL=1");
3991 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3992 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3993 ok(pf_exists("msitest"), "File not installed\n");
3995 state
= MsiQueryProductStateA(prodcode
);
3996 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3998 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3999 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4001 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4002 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4004 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4005 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4006 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4007 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4011 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4012 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4016 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4017 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4020 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4021 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4022 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4023 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4024 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4025 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4026 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4027 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4028 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4029 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4030 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4031 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4032 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4033 CHECK_REG_DWORD(prodkey
, "NoModify", 1);
4034 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4035 CHECK_REG_STR(prodkey
, "Size", NULL
);
4036 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4037 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4038 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4039 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4040 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4041 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4042 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4044 CHECK_REG_DWORD(prodkey
, "EstimatedSize", get_estimated_size());
4046 RegCloseKey(prodkey
);
4048 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4049 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4050 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4051 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4052 ok(pf_exists("msitest"), "Directory deleted\n");
4054 state
= MsiQueryProductStateA(prodcode
);
4055 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4057 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4058 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4060 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4061 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4063 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4064 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4065 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4066 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4070 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4071 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4075 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4076 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4079 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4080 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4081 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4082 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4083 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4084 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4085 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4086 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4087 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4088 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4089 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4090 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4091 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4092 CHECK_REG_DWORD(prodkey
, "NoModify", 1);
4093 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4094 CHECK_REG_STR(prodkey
, "Size", NULL
);
4095 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4096 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4097 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4098 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4099 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4100 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4101 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4103 CHECK_REG_DWORD(prodkey
, "EstimatedSize", get_estimated_size());
4105 RegCloseKey(prodkey
);
4107 /* complete install */
4108 r
= MsiInstallProductA(msifile
, "FULL=1");
4109 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4110 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4111 ok(pf_exists("msitest"), "File not installed\n");
4113 state
= MsiQueryProductStateA(prodcode
);
4114 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4116 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4117 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4119 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4120 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4122 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4123 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4124 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4125 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4129 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4130 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4134 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4135 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4138 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4139 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4140 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4141 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4142 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4143 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4144 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4145 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4146 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4147 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4148 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4149 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4150 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4151 CHECK_REG_DWORD(prodkey
, "NoModify", 1);
4152 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4153 CHECK_REG_STR(prodkey
, "Size", NULL
);
4154 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4155 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4156 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4157 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4158 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4159 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4160 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4162 CHECK_REG_DWORD(prodkey
, "EstimatedSize", get_estimated_size());
4164 RegCloseKey(prodkey
);
4166 /* UnpublishFeatures, both features removed */
4167 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4168 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4169 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4170 ok(!pf_exists("msitest"), "Directory not deleted\n");
4172 state
= MsiQueryProductStateA(prodcode
);
4173 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4175 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4176 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4178 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4179 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4181 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4182 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4183 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4184 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4186 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4187 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4189 /* complete install */
4190 r
= MsiInstallProductA(msifile
, "FULL=1");
4191 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4192 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4193 ok(pf_exists("msitest"), "File not installed\n");
4195 state
= MsiQueryProductStateA(prodcode
);
4196 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4198 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4199 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4201 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4202 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4204 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4205 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4206 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4207 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4211 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4212 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4216 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4217 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4220 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4221 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4222 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4223 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4224 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4225 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4226 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4227 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4228 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4229 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4230 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4231 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4232 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4233 CHECK_REG_DWORD(prodkey
, "NoModify", 1);
4234 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4235 CHECK_REG_STR(prodkey
, "Size", NULL
);
4236 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4237 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4238 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4239 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4240 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4241 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4242 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4244 CHECK_REG_DWORD(prodkey
, "EstimatedSize", get_estimated_size());
4246 RegCloseKey(prodkey
);
4248 /* complete uninstall */
4249 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4250 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4251 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4252 ok(!pf_exists("msitest"), "Directory not deleted\n");
4254 state
= MsiQueryProductStateA(prodcode
);
4255 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4257 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4258 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4260 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4261 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4263 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4264 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4265 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4266 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4268 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4269 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4271 /* make sure 'Program Files\msitest' is removed */
4272 delete_pfmsitest_files();
4275 RegCloseKey(uninstall
);
4276 RegCloseKey(uninstall_32node
);
4277 DeleteFileA(msifile
);
4278 DeleteFileA("msitest\\maximus");
4279 RemoveDirectoryA("msitest");
4282 static void test_publish_sourcelist(void)
4286 CHAR value
[MAX_PATH
];
4287 CHAR path
[MAX_PATH
];
4288 CHAR prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4290 if (!pMsiSourceListEnumSourcesA
|| !pMsiSourceListGetInfoA
)
4292 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4295 if (is_process_limited())
4297 skip("process is limited\n");
4301 CreateDirectoryA("msitest", NULL
);
4302 create_file("msitest\\maximus", 500);
4304 create_database(msifile
, pp_tables
, ARRAY_SIZE(pp_tables
));
4306 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4308 r
= MsiInstallProductA(msifile
, NULL
);
4309 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4311 skip("Not enough rights to perform tests\n");
4314 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4315 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4316 ok(pf_exists("msitest"), "File not installed\n");
4318 /* nothing published */
4320 lstrcpyA(value
, "aaa");
4321 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4322 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4323 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4324 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4325 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4328 lstrcpyA(value
, "aaa");
4329 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4330 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4331 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4332 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4333 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4335 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
4336 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4337 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4338 ok(pf_exists("msitest"), "File not installed\n");
4340 /* after RegisterProduct */
4342 lstrcpyA(value
, "aaa");
4343 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4344 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4345 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4346 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4347 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4350 lstrcpyA(value
, "aaa");
4351 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4352 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4353 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4354 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4355 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4357 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
4358 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4359 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4360 ok(pf_exists("msitest"), "File not installed\n");
4362 /* after ProcessComponents */
4364 lstrcpyA(value
, "aaa");
4365 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4366 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4367 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4368 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4369 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4372 lstrcpyA(value
, "aaa");
4373 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4374 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4375 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4376 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4377 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4379 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
4380 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4381 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4382 ok(pf_exists("msitest"), "File not installed\n");
4384 /* after PublishFeatures */
4386 lstrcpyA(value
, "aaa");
4387 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4388 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4389 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4390 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4391 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4394 lstrcpyA(value
, "aaa");
4395 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4396 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4397 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4398 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4399 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4401 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
4402 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4403 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4404 ok(pf_exists("msitest"), "File not installed\n");
4406 /* after PublishProduct */
4408 lstrcpyA(value
, "aaa");
4409 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4410 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4411 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4412 ok(!lstrcmpA(value
, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value
);
4413 ok(size
== 11, "Expected 11, got %d\n", size
);
4416 lstrcpyA(value
, "aaa");
4417 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4418 MSICODE_PRODUCT
, INSTALLPROPERTY_MEDIAPACKAGEPATHA
, value
, &size
);
4419 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4420 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4421 ok(size
== 0, "Expected 0, got %d\n", size
);
4424 lstrcpyA(value
, "aaa");
4425 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4426 MSICODE_PRODUCT
, INSTALLPROPERTY_DISKPROMPTA
, value
, &size
);
4427 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4428 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4429 ok(size
== 0, "Expected 0, got %d\n", size
);
4431 lstrcpyA(path
, CURR_DIR
);
4432 lstrcatA(path
, "\\");
4435 lstrcpyA(value
, "aaa");
4436 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4437 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCEA
, value
, &size
);
4438 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4439 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4440 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4443 lstrcpyA(value
, "aaa");
4444 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4445 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDTYPEA
, value
, &size
);
4446 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4447 ok(!lstrcmpA(value
, "n"), "Expected \"n\", got \"%s\"\n", value
);
4448 ok(size
== 1, "Expected 1, got %d\n", size
);
4451 lstrcpyA(value
, "aaa");
4452 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4453 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4454 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4455 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4456 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4459 lstrcpyA(value
, "aaa");
4460 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4461 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 0, value
, &size
);
4462 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4463 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4464 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4467 lstrcpyA(value
, "aaa");
4468 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4469 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 1, value
, &size
);
4470 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4471 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4472 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4474 /* complete uninstall */
4475 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4476 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4477 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4478 ok(!pf_exists("msitest"), "Directory not deleted\n");
4480 /* make sure 'Program Files\msitest' is removed */
4481 delete_pfmsitest_files();
4484 DeleteFileA(msifile
);
4485 DeleteFileA("msitest\\maximus");
4486 RemoveDirectoryA("msitest");
4489 static void test_remove_files(void)
4493 if (is_process_limited())
4495 skip("process is limited\n");
4499 CreateDirectoryA("msitest", NULL
);
4500 create_file("msitest\\hydrogen", 500);
4501 create_file("msitest\\helium", 500);
4502 create_file("msitest\\lithium", 500);
4504 create_database(msifile
, rem_tables
, ARRAY_SIZE(rem_tables
));
4506 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4508 r
= MsiInstallProductA(msifile
, NULL
);
4509 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4511 skip("Not enough rights to perform tests\n");
4514 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4515 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4516 ok(!pf_exists("msitest\\helium"), "File installed\n");
4517 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4518 ok(pf_exists("msitest"), "File not installed\n");
4520 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4522 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4523 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4524 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4525 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4527 create_pf("msitest", FALSE
);
4528 create_pf("msitest\\hydrogen", TRUE
);
4529 create_pf("msitest\\helium", TRUE
);
4530 create_pf("msitest\\lithium", TRUE
);
4532 r
= MsiInstallProductA(msifile
, NULL
);
4533 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4534 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4535 ok(pf_exists("msitest\\helium"), "File not installed\n");
4536 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4537 ok(pf_exists("msitest"), "File not installed\n");
4539 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4540 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4541 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4542 ok(delete_pf("msitest\\helium", TRUE
), "File deleted\n");
4543 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4544 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4546 create_pf("msitest", FALSE
);
4547 create_pf("msitest\\furlong", TRUE
);
4548 create_pf("msitest\\firkin", TRUE
);
4549 create_pf("msitest\\fortnight", TRUE
);
4550 create_pf("msitest\\becquerel", TRUE
);
4551 create_pf("msitest\\dioptre", TRUE
);
4552 create_pf("msitest\\attoparsec", TRUE
);
4553 create_pf("msitest\\storeys", TRUE
);
4554 create_pf("msitest\\block", TRUE
);
4555 create_pf("msitest\\siriometer", TRUE
);
4556 create_pf("msitest\\cabout", FALSE
);
4557 create_pf("msitest\\cabout\\blocker", TRUE
);
4559 r
= MsiInstallProductA(msifile
, NULL
);
4560 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4561 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4562 ok(!pf_exists("msitest\\helium"), "File installed\n");
4563 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4564 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4565 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4566 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4567 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4568 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4569 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4570 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4571 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4572 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4573 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4574 ok(pf_exists("msitest"), "File not installed\n");
4576 create_pf("msitest\\furlong", TRUE
);
4577 create_pf("msitest\\firkin", TRUE
);
4578 create_pf("msitest\\fortnight", TRUE
);
4579 create_pf("msitest\\storeys", TRUE
);
4580 create_pf("msitest\\block", TRUE
);
4581 create_pf("msitest\\siriometer", TRUE
);
4583 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4584 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4585 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not deleted\n");
4586 ok(!delete_pf("msitest\\helium", TRUE
), "File not deleted\n");
4587 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4588 ok(delete_pf("msitest\\furlong", TRUE
), "File deleted\n");
4589 ok(delete_pf("msitest\\firkin", TRUE
), "File deleted\n");
4590 ok(delete_pf("msitest\\fortnight", TRUE
), "File deleted\n");
4591 ok(!delete_pf("msitest\\becquerel", TRUE
), "File not deleted\n");
4592 ok(!delete_pf("msitest\\dioptre", TRUE
), "File not deleted\n");
4593 ok(delete_pf("msitest\\attoparsec", TRUE
), "File deleted\n");
4594 ok(!delete_pf("msitest\\storeys", TRUE
), "File not deleted\n");
4595 ok(!delete_pf("msitest\\block", TRUE
), "File not deleted\n");
4596 ok(delete_pf("msitest\\siriometer", TRUE
), "File deleted\n");
4597 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4598 ok(pf_exists("msitest"), "Directory deleted\n");
4600 r
= MsiInstallProductA(msifile
, NULL
);
4601 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4602 ok(delete_pf("msitest\\hydrogen", TRUE
), "File not installed\n");
4603 ok(!delete_pf("msitest\\helium", TRUE
), "File installed\n");
4604 ok(delete_pf("msitest\\lithium", TRUE
), "File not installed\n");
4605 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4606 ok(pf_exists("msitest"), "Directory deleted\n");
4608 delete_pf("msitest\\cabout\\blocker", TRUE
);
4610 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4611 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4612 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory not deleted\n");
4613 delete_pf("msitest", FALSE
);
4616 DeleteFileA(msifile
);
4617 DeleteFileA("msitest\\hydrogen");
4618 DeleteFileA("msitest\\helium");
4619 DeleteFileA("msitest\\lithium");
4620 RemoveDirectoryA("msitest");
4623 static void test_move_files(void)
4626 char props
[4 * MAX_PATH
+ 74];
4628 if (is_process_limited())
4630 skip("process is limited\n");
4634 CreateDirectoryA("msitest", NULL
);
4635 create_file("msitest\\augustus", 100);
4636 create_file("cameroon", 100);
4637 create_file("djibouti", 100);
4638 create_file("egypt", 100);
4639 create_file("finland", 100);
4640 create_file("gambai", 100);
4641 create_file("honduras", 100);
4642 create_file("msitest\\india", 100);
4643 create_file("japan", 100);
4644 create_file("kenya", 100);
4645 CreateDirectoryA("latvia", NULL
);
4646 create_file("nauru", 100);
4647 create_file("peru", 100);
4648 create_file("apple", 100);
4649 create_file("application", 100);
4650 create_file("ape", 100);
4651 create_file("foo", 100);
4652 create_file("fao", 100);
4653 create_file("fbod", 100);
4654 create_file("budding", 100);
4655 create_file("buddy", 100);
4656 create_file("bud", 100);
4657 create_file("bar", 100);
4658 create_file("bur", 100);
4659 create_file("bird", 100);
4661 create_database(msifile
, mov_tables
, ARRAY_SIZE(mov_tables
));
4663 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4665 /* if the source or dest property is not a full path,
4666 * windows tries to access it as a network resource
4669 sprintf(props
, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4670 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4671 CURR_DIR
, PROG_FILES_DIR
, CURR_DIR
, CURR_DIR
);
4673 r
= MsiInstallProductA(msifile
, props
);
4674 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4676 skip("Not enough rights to perform tests\n");
4679 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4680 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4681 ok(!delete_pf("msitest\\dest", TRUE
), "File copied\n");
4682 ok(delete_pf("msitest\\canada", TRUE
), "File not copied\n");
4683 ok(delete_pf("msitest\\dominica", TRUE
), "File not moved\n");
4684 ok(!delete_pf("msitest\\elsalvador", TRUE
), "File moved\n");
4685 ok(!delete_pf("msitest\\france", TRUE
), "File moved\n");
4686 ok(!delete_pf("msitest\\georgia", TRUE
), "File moved\n");
4687 ok(delete_pf("msitest\\hungary", TRUE
), "File not moved\n");
4688 ok(!delete_pf("msitest\\indonesia", TRUE
), "File moved\n");
4689 ok(!delete_pf("msitest\\jordan", TRUE
), "File moved\n");
4690 ok(delete_pf("msitest\\kiribati", TRUE
), "File not moved\n");
4691 ok(!delete_pf("msitest\\lebanon", TRUE
), "File moved\n");
4692 ok(!delete_pf("msitest\\lebanon", FALSE
), "Directory moved\n");
4693 ok(delete_pf("msitest\\poland", TRUE
), "File not moved\n");
4694 /* either apple or application will be moved depending on directory order */
4695 if (!delete_pf("msitest\\apple", TRUE
))
4696 ok(delete_pf("msitest\\application", TRUE
), "File not moved\n");
4698 ok(!delete_pf("msitest\\application", TRUE
), "File should not exist\n");
4699 ok(delete_pf("msitest\\wildcard", TRUE
), "File not moved\n");
4700 ok(!delete_pf("msitest\\ape", TRUE
), "File moved\n");
4701 /* either fao or foo will be moved depending on directory order */
4702 if (delete_pf("msitest\\foo", TRUE
))
4703 ok(!delete_pf("msitest\\fao", TRUE
), "File should not exist\n");
4705 ok(delete_pf("msitest\\fao", TRUE
), "File not moved\n");
4706 ok(delete_pf("msitest\\single", TRUE
), "File not moved\n");
4707 ok(!delete_pf("msitest\\fbod", TRUE
), "File moved\n");
4708 ok(delete_pf("msitest\\budding", TRUE
), "File not moved\n");
4709 ok(delete_pf("msitest\\buddy", TRUE
), "File not moved\n");
4710 ok(!delete_pf("msitest\\bud", TRUE
), "File moved\n");
4711 ok(delete_pf("msitest\\bar", TRUE
), "File not moved\n");
4712 ok(delete_pf("msitest\\bur", TRUE
), "File not moved\n");
4713 ok(!delete_pf("msitest\\bird", TRUE
), "File moved\n");
4714 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4715 ok(DeleteFileA("cameroon"), "File moved\n");
4716 ok(!DeleteFileA("djibouti"), "File not moved\n");
4717 ok(DeleteFileA("egypt"), "File moved\n");
4718 ok(DeleteFileA("finland"), "File moved\n");
4719 ok(DeleteFileA("gambai"), "File moved\n");
4720 ok(!DeleteFileA("honduras"), "File not moved\n");
4721 ok(DeleteFileA("msitest\\india"), "File moved\n");
4722 ok(DeleteFileA("japan"), "File moved\n");
4723 ok(!DeleteFileA("kenya"), "File not moved\n");
4724 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4725 ok(!DeleteFileA("nauru"), "File not moved\n");
4726 ok(!DeleteFileA("peru"), "File not moved\n");
4727 ok(!DeleteFileA("apple"), "File not moved\n");
4728 ok(!DeleteFileA("application"), "File not moved\n");
4729 ok(DeleteFileA("ape"), "File moved\n");
4730 ok(!DeleteFileA("foo"), "File not moved\n");
4731 ok(!DeleteFileA("fao"), "File not moved\n");
4732 ok(DeleteFileA("fbod"), "File moved\n");
4733 ok(!DeleteFileA("budding"), "File not moved\n");
4734 ok(!DeleteFileA("buddy"), "File not moved\n");
4735 ok(DeleteFileA("bud"), "File moved\n");
4736 ok(!DeleteFileA("bar"), "File not moved\n");
4737 ok(!DeleteFileA("bur"), "File not moved\n");
4738 ok(DeleteFileA("bird"), "File moved\n");
4741 DeleteFileA("cameroon");
4742 DeleteFileA("djibouti");
4743 DeleteFileA("egypt");
4744 DeleteFileA("finland");
4745 DeleteFileA("gambai");
4746 DeleteFileA("honduras");
4747 DeleteFileA("japan");
4748 DeleteFileA("kenya");
4749 DeleteFileA("nauru");
4750 DeleteFileA("peru");
4751 DeleteFileA("apple");
4752 DeleteFileA("application");
4756 DeleteFileA("fbod");
4757 DeleteFileA("budding");
4758 DeleteFileA("buddy");
4762 DeleteFileA("bird");
4763 DeleteFileA("msitest\\india");
4764 DeleteFileA("msitest\\augustus");
4765 RemoveDirectoryA("latvia");
4766 RemoveDirectoryA("msitest");
4767 DeleteFileA(msifile
);
4770 static void test_duplicate_files(void)
4774 if (is_process_limited())
4776 skip("process is limited\n");
4780 CreateDirectoryA("msitest", NULL
);
4781 create_file("msitest\\maximus", 500);
4782 create_database(msifile
, df_tables
, ARRAY_SIZE(df_tables
));
4784 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4786 /* fails if the destination folder is not a valid property */
4788 r
= MsiInstallProductA(msifile
, NULL
);
4789 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4791 skip("Not enough rights to perform tests\n");
4794 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4795 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
4796 ok(delete_pf("msitest\\augustus", TRUE
), "File not duplicated\n");
4797 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE
), "File not duplicated\n");
4798 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE
), "Directory not created\n");
4799 ok(delete_pf("msitest\\this\\doesnot", FALSE
), "Directory not created\n");
4800 ok(delete_pf("msitest\\this", FALSE
), "Directory not created\n");
4801 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4804 DeleteFileA("msitest\\maximus");
4805 RemoveDirectoryA("msitest");
4806 DeleteFileA(msifile
);
4809 static void test_write_registry_values(void)
4817 if (is_process_limited())
4819 skip("process is limited\n");
4823 CreateDirectoryA("msitest", NULL
);
4825 create_database(msifile
, wrv_tables
, ARRAY_SIZE(wrv_tables
));
4827 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4829 res
= RegCreateKeyA(HKEY_CURRENT_USER
, "msitest", &hkey
);
4830 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4832 res
= RegSetValueExA(hkey
, "Value1", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4833 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4834 res
= RegSetValueExA(hkey
, "Value2", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4835 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4836 res
= RegSetValueExA(hkey
, "Value3", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4837 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4838 res
= RegSetValueExA(hkey
, "Value4", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4839 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4840 res
= RegSetValueExA(hkey
, "Value5", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0two\0", 9);
4841 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4842 res
= RegSetValueExA(hkey
, "Value6", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4843 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4844 res
= RegSetValueExA(hkey
, "Value7", 0, REG_SZ
, (const BYTE
*)"one", 4);
4845 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4847 res
= RegSetValueExA(hkey
, "instremove", 0, REG_SZ
, (const BYTE
*)"val", 3);
4848 ok(!res
, "got %u\n", res
);
4850 res
= RegCreateKeyA(hkey
, "instremove", &subkey
);
4851 ok(!res
, "got %u\n", res
);
4852 RegCloseKey(subkey
);
4854 r
= MsiInstallProductA(msifile
, NULL
);
4855 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4857 skip("Not enough rights to perform tests\n");
4860 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4862 CHECK_REG_STR(hkey
, "sz", "string");
4863 CHECK_REG_MULTI(hkey
, "multisz", "one\0two\0three\0");
4864 CHECK_REG_DWORD(hkey
, "dword", 123);
4867 res
= RegQueryValueExA(hkey
, "expandsz", NULL
, &type
, (BYTE
*)buf
, &size
);
4868 ok(!res
, "got %u\n", res
);
4869 ok(type
== REG_EXPAND_SZ
, "got %d\n", type
);
4870 ok(!strcmp(buf
, "string"), "got %s\n", buf
);
4873 res
= RegQueryValueExA(hkey
, "binary", NULL
, &type
, (BYTE
*)buf
, &size
);
4874 ok(!res
, "got %u\n", res
);
4875 ok(type
== REG_BINARY
, "got %d\n", type
);
4876 ok(size
== 4, "got size %u\n", size
);
4877 ok(!memcmp(buf
, "\x01\x23\x45\x67", 4), "wrong data\n");
4879 CHECK_REG_STR(hkey
, "", "default");
4881 res
= RegOpenKeyA(hkey
, "VisualStudio", &subkey
);
4882 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4883 RegCloseKey(subkey
);
4885 CHECK_REG_MULTI(hkey
, "Value1", "one\0");
4886 CHECK_REG_MULTI(hkey
, "Value2", "one\0two\0");
4887 CHECK_REG_MULTI(hkey
, "Value3", "one\0two\0");
4888 CHECK_REG_MULTI(hkey
, "Value4", "one\0two\0");
4889 CHECK_REG_MULTI(hkey
, "Value5", "one\0two\0three\0");
4890 CHECK_REG_MULTI(hkey
, "Value6", "");
4891 CHECK_REG_MULTI(hkey
, "Value7", "two\0");
4893 CHECK_REG_DWORD(hkey
, "format", 1);
4894 CHECK_REG_DWORD(hkey
, "source", 1);
4896 res
= RegOpenKeyA(hkey
, "subkey", &subkey
);
4897 ok(!res
, "got %u\n", res
);
4898 res
= RegQueryValueExA(subkey
, "", NULL
, NULL
, NULL
, NULL
);
4899 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4900 RegCloseKey(subkey
);
4902 res
= RegOpenKeyA(hkey
, "create", &subkey
);
4903 ok(!res
, "got %u\n", res
);
4904 RegCloseKey(subkey
);
4906 res
= RegOpenKeyA(hkey
, "delete", &subkey
);
4907 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4908 res
= RegCreateKeyA(hkey
, "delete", &subkey
);
4909 ok(!res
, "got %u\n", res
);
4910 RegCloseKey(subkey
);
4912 res
= RegQueryValueExA(hkey
, "instremove", NULL
, NULL
, NULL
, NULL
);
4913 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4914 res
= RegOpenKeyA(hkey
, "instremove", &subkey
);
4915 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4917 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4918 ok(!r
, "got %u\n", r
);
4920 res
= RegQueryValueExA(hkey
, "sz", NULL
, NULL
, NULL
, NULL
);
4921 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4922 res
= RegQueryValueExA(hkey
, "multisz", NULL
, NULL
, NULL
, NULL
);
4923 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4924 res
= RegQueryValueExA(hkey
, "dword", NULL
, NULL
, NULL
, NULL
);
4925 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4926 res
= RegQueryValueExA(hkey
, "expandsz", NULL
, NULL
, NULL
, NULL
);
4927 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4928 res
= RegQueryValueExA(hkey
, "binary", NULL
, NULL
, NULL
, NULL
);
4929 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4930 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, NULL
, NULL
);
4931 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4933 res
= RegOpenKeyA(hkey
, "VisualStudio", &subkey
);
4934 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4936 res
= RegQueryValueExA(hkey
, "Value1", NULL
, NULL
, NULL
, NULL
);
4937 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4938 res
= RegQueryValueExA(hkey
, "Value4", NULL
, NULL
, NULL
, NULL
);
4939 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4940 res
= RegQueryValueExA(hkey
, "Value5", NULL
, NULL
, NULL
, NULL
);
4941 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4942 res
= RegQueryValueExA(hkey
, "Value6", NULL
, NULL
, NULL
, NULL
);
4943 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4944 res
= RegQueryValueExA(hkey
, "Value7", NULL
, NULL
, NULL
, NULL
);
4945 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4948 CHECK_REG_MULTI(hkey
, "Value2", "one\0");
4949 CHECK_REG_MULTI(hkey
, "Value3", "two\0");
4952 res
= RegQueryValueExA(hkey
, "format", NULL
, NULL
, NULL
, NULL
);
4953 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4954 res
= RegQueryValueExA(hkey
, "source", NULL
, NULL
, NULL
, NULL
);
4955 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4957 res
= RegOpenKeyA(hkey
, "subkey", &subkey
);
4958 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4960 res
= RegOpenKeyA(hkey
, "create", &subkey
);
4961 ok(!res
, "got %u\n", res
);
4962 RegCloseKey(subkey
);
4963 res
= RegDeleteKeyA(hkey
, "create");
4964 ok(!res
, "got %u\n", res
);
4966 res
= RegOpenKeyA(hkey
, "delete", &subkey
);
4967 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
4970 res
= RegDeleteKeyA(HKEY_CURRENT_USER
, "msitest");
4971 ok(!res
, "got %u\n", res
);
4974 DeleteFileA(msifile
);
4975 RemoveDirectoryA("msitest");
4978 static void test_envvar(void)
4985 if (is_process_limited())
4987 skip("process is limited\n");
4991 create_database(msifile
, env_tables
, ARRAY_SIZE(env_tables
));
4993 res
= RegCreateKeyExA(HKEY_CURRENT_USER
, "Environment", 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &env
, NULL
);
4994 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4996 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "System\\CurrentControlSet\\Control\\Session Manager\\Environment",
4997 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &env2
, NULL
);
4998 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5000 res
= RegSetValueExA(env
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"0", 2);
5001 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5003 res
= RegSetValueExA(env
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"0", 2);
5004 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5006 res
= RegSetValueExA(env
, "MSITESTVAR21", 0, REG_SZ
, (const BYTE
*)"1", 2);
5007 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5009 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5011 r
= MsiInstallProductA(msifile
, NULL
);
5012 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5014 skip("Not enough rights to perform tests\n");
5017 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5019 CHECK_REG_STR(env
, "MSITESTVAR1", "1");
5020 CHECK_REG_STR(env
, "MSITESTVAR2", "1");
5021 CHECK_REG_STR(env
, "MSITESTVAR3", "1");
5022 CHECK_REG_STR(env
, "MSITESTVAR4", "1");
5024 res
= RegDeleteValueA(env
, "MSITESTVAR5");
5025 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5027 res
= RegDeleteValueA(env
, "MSITESTVAR6");
5028 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5030 res
= RegDeleteValueA(env
, "MSITESTVAR7");
5031 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5033 res
= RegDeleteValueA(env
, "MSITESTVAR8");
5034 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5036 res
= RegDeleteValueA(env
, "MSITESTVAR9");
5037 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5039 res
= RegDeleteValueA(env
, "MSITESTVAR10");
5040 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5042 CHECK_REG_STR(env
, "MSITESTVAR11", "1;2");
5043 CHECK_REG_STR(env
, "MSITESTVAR12", "1");
5044 CHECK_REG_STR(env
, "MSITESTVAR13", "1;2");
5045 CHECK_REG_STR(env
, "MSITESTVAR14", ";1;");
5046 CHECK_REG_STR(env
, "MSITESTVAR15", ";;1;;");
5047 CHECK_REG_STR(env
, "MSITESTVAR16", " 1 ");
5048 CHECK_REG_STR(env
, "MSITESTVAR17", ";;2;;1");
5049 CHECK_REG_STR(env
, "MSITESTVAR18", "1;;2;;");
5050 CHECK_REG_STR(env
, "MSITESTVAR19", "1");
5051 CHECK_REG_STR(env
, "MSITESTVAR20", "1");
5052 CHECK_REG_STR(env
, "MSITESTVAR21", "1");
5053 CHECK_REG_STR(env2
, "MSITESTVAR100", "1");
5055 res
= RegSetValueExA(env
, "MSITESTVAR22", 0, REG_SZ
, (const BYTE
*)"1", 2);
5056 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5058 res
= RegSetValueExA(env
, "MSITESTVAR23", 0, REG_SZ
, (const BYTE
*)"1", 2);
5059 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5061 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5062 ok(!r
, "got %u\n", r
);
5064 CHECK_DEL_REG_STR(env
, "MSITESTVAR13", "1;2");
5065 CHECK_DEL_REG_STR(env
, "MSITESTVAR14", ";1;");
5066 CHECK_DEL_REG_STR(env
, "MSITESTVAR15", ";;1;;");
5067 CHECK_DEL_REG_STR(env
, "MSITESTVAR16", " 1 ");
5069 CHECK_DEL_REG_STR(env
, "MSITESTVAR17", "1");
5070 CHECK_DEL_REG_STR(env
, "MSITESTVAR18", "1");
5072 CHECK_DEL_REG_STR(env
, "MSITESTVAR23", "1");
5074 for (i
= 1; i
<= 23; i
++)
5076 sprintf(buffer
, "MSITESTVAR%i", i
);
5077 res
= RegDeleteValueA(env
, buffer
);
5078 ok(res
== ERROR_FILE_NOT_FOUND
, "[%d] got %u\n", i
, res
);
5081 res
= RegDeleteValueA(env2
, "MSITESTVAR100");
5082 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5085 RegDeleteValueA(env
, "MSITESTVAR1");
5086 RegDeleteValueA(env
, "MSITESTVAR2");
5087 RegDeleteValueA(env
, "MSITESTVAR21");
5091 DeleteFileA(msifile
);
5094 static void test_create_remove_folder(void)
5098 if (is_process_limited())
5100 skip("process is limited\n");
5104 CreateDirectoryA("msitest", NULL
);
5105 CreateDirectoryA("msitest\\first", NULL
);
5106 CreateDirectoryA("msitest\\second", NULL
);
5107 create_file("msitest\\first\\one.txt", 1000);
5108 create_file("msitest\\second\\two.txt", 1000);
5109 create_database(msifile
, cf_tables
, ARRAY_SIZE(cf_tables
));
5111 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5113 r
= MsiInstallProductA(msifile
, NULL
);
5114 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5116 skip("Not enough rights to perform tests\n");
5119 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5121 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5122 ok(pf_exists("msitest\\first"), "directory not created\n");
5123 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5124 ok(pf_exists("msitest\\second"), "directory not created\n");
5125 ok(pf_exists("msitest\\third"), "directory not created\n");
5126 ok(pf_exists("msitest"), "directory not created\n");
5128 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5129 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5131 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5132 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5133 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5134 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5135 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5136 todo_wine
ok(!pf_exists("msitest"), "directory not removed\n");
5139 DeleteFileA("msitest\\first\\one.txt");
5140 DeleteFileA("msitest\\second\\two.txt");
5141 RemoveDirectoryA("msitest\\first");
5142 RemoveDirectoryA("msitest\\second");
5143 RemoveDirectoryA("msitest");
5144 DeleteFileA(msifile
);
5147 static void test_start_stop_services(void)
5150 SC_HANDLE scm
, service
;
5152 DWORD error
= ERROR_SUCCESS
;
5154 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5155 if (!scm
&& GetLastError() == ERROR_ACCESS_DENIED
)
5157 skip("Not enough rights to perform tests\n");
5160 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
5163 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5164 if (!service
&& GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST
)
5166 win_skip("The 'Spooler' service does not exist\n");
5167 CloseServiceHandle(scm
);
5170 ok(service
!= NULL
, "Failed to open Spooler, error %d\n", GetLastError());
5172 CloseServiceHandle(scm
);
5176 ret
= StartServiceA(service
, 0, NULL
);
5177 if (!ret
&& (error
= GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING
)
5179 skip("Spooler service not available, skipping test\n");
5180 CloseServiceHandle(service
);
5181 CloseServiceHandle(scm
);
5185 CloseServiceHandle(service
);
5186 CloseServiceHandle(scm
);
5188 create_test_files();
5189 create_database(msifile
, sss_tables
, ARRAY_SIZE(sss_tables
));
5191 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5193 r
= MsiInstallProductA(msifile
, NULL
);
5194 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5196 if (error
== ERROR_SUCCESS
)
5198 SERVICE_STATUS status
;
5200 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5201 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5203 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5204 ok(ret
, "ControlService failed %u\n", GetLastError());
5206 CloseServiceHandle(service
);
5207 CloseServiceHandle(scm
);
5210 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5211 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5213 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5214 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5215 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5216 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5217 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5218 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5219 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5220 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5221 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5222 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5223 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5224 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5225 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5227 if (error
== ERROR_SUCCESS
)
5229 SERVICE_STATUS status
;
5231 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5232 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5234 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5235 ok(ret
, "ControlService failed %u\n", GetLastError());
5237 CloseServiceHandle(service
);
5238 CloseServiceHandle(scm
);
5241 delete_test_files();
5242 DeleteFileA(msifile
);
5245 static void delete_test_service(const char *name
)
5248 SC_HANDLE manager
, service
;
5250 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5251 ok(manager
!= NULL
, "can't open service manager\n");
5252 if (!manager
) return;
5254 service
= OpenServiceA(manager
, name
, GENERIC_ALL
);
5257 ret
= DeleteService( service
);
5258 ok( ret
, "failed to delete service %u\n", GetLastError() );
5259 CloseServiceHandle(service
);
5261 CloseServiceHandle(manager
);
5264 static void test_delete_services(void)
5267 SC_HANDLE manager
, service
;
5270 if (is_process_limited())
5272 skip("process is limited\n");
5276 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5277 ok(manager
!= NULL
, "can't open service manager %u\n", GetLastError());
5278 if (!manager
) return;
5280 service
= CreateServiceA(manager
, "TestService3", "TestService3",
5281 SERVICE_ALL_ACCESS
, SERVICE_WIN32_OWN_PROCESS
, SERVICE_DEMAND_START
,
5282 SERVICE_ERROR_NORMAL
, "C:\\doesnt_exist.exe", NULL
, NULL
, NULL
, NULL
, NULL
);
5283 ok(service
!= NULL
, "can't create service %u\n", GetLastError());
5284 CloseServiceHandle(service
);
5285 CloseServiceHandle(manager
);
5286 if (!service
) return;
5288 create_test_files();
5289 create_database(msifile
, sds_tables
, ARRAY_SIZE(sds_tables
));
5291 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5293 r
= MsiInstallProductA(msifile
, NULL
);
5294 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5296 skip("Not enough rights to perform tests\n");
5299 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5301 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5302 ok(manager
!= NULL
, "can't open service manager\n");
5303 if (!manager
) goto error
;
5305 service
= OpenServiceA(manager
, "TestService3", GENERIC_ALL
);
5306 error
= GetLastError();
5307 ok(service
== NULL
, "TestService3 not deleted\n");
5308 ok(error
== ERROR_SERVICE_DOES_NOT_EXIST
, "wrong error %u\n", error
);
5309 CloseServiceHandle(manager
);
5311 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5312 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5314 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5315 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5316 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5317 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5318 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5319 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5320 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5321 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5322 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5323 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5324 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5325 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5326 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5329 delete_test_service("TestService");
5330 delete_test_service("TestService2");
5331 delete_test_service("TestService3");
5332 delete_test_files();
5333 DeleteFileA(msifile
);
5336 static void test_install_services(void)
5339 SC_HANDLE manager
, service
;
5342 DWORD err_control
, err_controlsize
, err_controltype
;
5344 if (is_process_limited())
5346 skip("process is limited\n");
5350 create_test_files();
5351 create_database(msifile
, sis_tables
, ARRAY_SIZE(sis_tables
));
5353 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5355 r
= MsiInstallProductA(msifile
, NULL
);
5356 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5358 skip("Not enough rights to perform tests\n");
5361 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5363 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5364 ok(manager
!= NULL
, "can't open service manager\n");
5365 if (!manager
) goto error
;
5367 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5368 ok(service
!= NULL
, "TestService not installed\n");
5369 CloseServiceHandle(service
);
5371 service
= OpenServiceA(manager
, "TestService4", GENERIC_ALL
);
5372 ok(service
== NULL
, "TestService4 installed\n");
5374 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey
);
5375 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5377 if (res
== ERROR_SUCCESS
)
5379 err_control
= 0xBEEF;
5380 err_controltype
= REG_DWORD
;
5381 err_controlsize
= sizeof(err_control
);
5382 res
= RegQueryValueExA(hKey
, "ErrorControl", NULL
, &err_controltype
, (LPBYTE
)&err_control
, &err_controlsize
);
5383 ok(err_control
== 0, "TestService.ErrorControl wrong, expected 0, got %u\n", err_control
);
5387 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5388 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5390 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5391 ok(service
!= NULL
, "TestService deleted\n");
5392 CloseServiceHandle(service
);
5393 CloseServiceHandle(manager
);
5395 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5396 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5397 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5398 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5399 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5400 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5401 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5402 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5403 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5404 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5405 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5406 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5407 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5410 delete_test_service("TestService");
5411 delete_test_files();
5412 DeleteFileA(msifile
);
5415 static void test_self_registration(void)
5420 if (is_process_limited())
5422 skip("process is limited\n");
5426 create_test_files();
5427 extract_resource("selfreg.dll", "TESTDLL", "msitest\\selfreg.dll");
5428 create_database(msifile
, sr_tables
, ARRAY_SIZE(sr_tables
));
5430 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5432 r
= MsiInstallProductA(msifile
, NULL
);
5433 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5435 skip("Not enough rights to perform tests\n");
5438 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5440 r
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "selfreg_test", &key
);
5441 ok(!r
, "got %u\n", r
);
5444 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5445 ok(!r
, "got %u\n", r
);
5447 r
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "selfreg_test", &key
);
5448 ok(r
== ERROR_FILE_NOT_FOUND
, "got %u\n", r
);
5450 ok(!delete_pf("msitest\\selfreg.dll", TRUE
), "file not removed\n");
5451 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5454 DeleteFileA("msitest\\selfreg.dll");
5455 delete_test_files();
5456 DeleteFileA(msifile
);
5459 static void test_register_font(void)
5461 static const char regfont1
[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5462 static const char regfont2
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5466 REGSAM access
= KEY_ALL_ACCESS
;
5468 if (is_process_limited())
5470 skip("process is limited\n");
5474 create_test_files();
5475 create_file("msitest\\font.ttf", 1000);
5476 create_database(msifile
, font_tables
, ARRAY_SIZE(font_tables
));
5479 access
|= KEY_WOW64_64KEY
;
5481 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5483 r
= MsiInstallProductA(msifile
, NULL
);
5484 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5486 skip("Not enough rights to perform tests\n");
5489 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5491 ret
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont1
, 0, access
, &key
);
5493 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont2
, 0, access
, &key
);
5495 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5496 ok(ret
!= ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5498 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5499 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5501 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5503 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5504 ok(ret
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5506 RegDeleteValueA(key
, "msi test font");
5510 DeleteFileA("msitest\\font.ttf");
5511 delete_test_files();
5512 DeleteFileA(msifile
);
5515 static void test_validate_product_id(void)
5519 if (is_process_limited())
5521 skip("process is limited\n");
5525 create_test_files();
5526 create_database(msifile
, vp_tables
, ARRAY_SIZE(vp_tables
));
5528 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5530 r
= MsiInstallProductA(msifile
, NULL
);
5531 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5533 skip("Not enough rights to perform tests\n");
5536 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5538 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=1");
5539 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5541 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=2");
5542 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5544 r
= MsiInstallProductA(msifile
, "PIDKEY=123-1234567");
5545 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5547 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5548 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5549 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5550 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5551 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5552 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5553 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5554 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5555 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5556 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5557 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5558 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5559 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5562 delete_test_files();
5563 DeleteFileA(msifile
);
5566 static void test_install_remove_odbc(void)
5568 int gotdriver
= 0, gotdriver2
= 0;
5569 char buffer
[1000], *p
;
5573 if (is_process_limited())
5575 skip("process is limited\n");
5579 create_test_files();
5580 create_file("msitest\\ODBCdriver.dll", 1000);
5581 create_file("msitest\\ODBCdriver2.dll", 1000);
5582 create_file("msitest\\ODBCtranslator.dll", 1000);
5583 create_file("msitest\\ODBCtranslator2.dll", 1000);
5584 create_file("msitest\\ODBCsetup.dll", 1000);
5585 create_database(msifile
, odbc_tables
, ARRAY_SIZE(odbc_tables
));
5587 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5589 r
= MsiInstallProductA(msifile
, NULL
);
5590 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5592 skip("Not enough rights to perform tests\n");
5595 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5597 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5598 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5599 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5600 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5601 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5603 r
= SQLGetInstalledDrivers(buffer
, sizeof(buffer
), &len
);
5604 ok(len
< sizeof(buffer
), "buffer too small\n");
5605 ok(r
, "SQLGetInstalledDrivers failed\n");
5606 for (p
= buffer
; *p
; p
+= strlen(p
) + 1)
5608 if (!strcmp(p
, "ODBC test driver"))
5610 if (!strcmp(p
, "ODBC test driver2"))
5613 ok(gotdriver
, "driver not installed\n");
5614 ok(gotdriver2
, "driver 2 not installed\n");
5616 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5617 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5619 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE
), "file not removed\n");
5620 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE
), "file not removed\n");
5621 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE
), "file not removed\n");
5622 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE
), "file not removed\n");
5623 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE
), "file not removed\n");
5624 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5626 gotdriver
= gotdriver2
= 0;
5627 r
= SQLGetInstalledDrivers(buffer
, sizeof(buffer
), &len
);
5628 ok(len
< sizeof(buffer
), "buffer too small\n");
5629 ok(r
, "SQLGetInstalledDrivers failed\n");
5630 for (p
= buffer
; *p
; p
+= strlen(p
) + 1)
5632 if (!strcmp(p
, "ODBC test driver"))
5634 if (!strcmp(p
, "ODBC test driver2"))
5637 ok(!gotdriver
, "driver not installed\n");
5638 ok(!gotdriver2
, "driver 2 not installed\n");
5641 DeleteFileA("msitest\\ODBCdriver.dll");
5642 DeleteFileA("msitest\\ODBCdriver2.dll");
5643 DeleteFileA("msitest\\ODBCtranslator.dll");
5644 DeleteFileA("msitest\\ODBCtranslator2.dll");
5645 DeleteFileA("msitest\\ODBCsetup.dll");
5646 delete_test_files();
5647 DeleteFileA(msifile
);
5650 static void test_register_typelib(void)
5656 if (is_process_limited())
5658 skip("process is limited\n");
5662 /* UnregisterTypeLibraries action fails in 64-bit Windows <= 7 */
5663 if (sizeof(void *) == 8 && strcmp( winetest_platform
, "wine" ))
5665 win_skip("broken on 64-bit Windows\n");
5669 create_test_files();
5670 extract_resource("typelib.tlb", "TYPELIB", "msitest\\typelib.dll");
5671 create_database(msifile
, tl_tables
, ARRAY_SIZE(tl_tables
));
5673 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5675 r
= MsiInstallProductA(msifile
, NULL
);
5676 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5678 skip("Not enough rights to perform tests\n");
5681 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
5683 hr
= LoadRegTypeLib(&LIBID_register_test
, 7, 1, 0, &tlb
);
5684 ok(hr
== S_OK
, "got %#x\n", hr
);
5685 ITypeLib_Release(tlb
);
5687 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5688 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5690 hr
= LoadRegTypeLib(&LIBID_register_test
, 7, 1, 0, &tlb
);
5691 ok(hr
== TYPE_E_LIBNOTREGISTERED
, "got %#x\n", hr
);
5693 ok(!delete_pf("msitest\\typelib.dll", TRUE
), "file not removed\n");
5694 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5697 DeleteFileA("msitest\\typelib.dll");
5698 delete_test_files();
5699 DeleteFileA(msifile
);
5702 static void test_create_remove_shortcut(void)
5706 if (is_process_limited())
5708 skip("process is limited\n");
5712 create_test_files();
5713 create_file("msitest\\target.txt", 1000);
5714 create_database(msifile
, crs_tables
, ARRAY_SIZE(crs_tables
));
5716 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5718 r
= MsiInstallProductA(msifile
, NULL
);
5719 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5721 skip("Not enough rights to perform tests\n");
5724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5726 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5727 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5729 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5732 ok(!delete_pf("msitest\\shortcut.lnk", TRUE
), "file not removed\n");
5733 ok(!delete_pf("msitest\\target.txt", TRUE
), "file not removed\n");
5734 todo_wine
ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5737 DeleteFileA("msitest\\target.txt");
5738 delete_test_files();
5739 DeleteFileA(msifile
);
5742 static void test_publish_components(void)
5744 static const char keypath
[] =
5745 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5746 static const char keypath2
[] =
5747 "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5755 if (is_process_limited())
5757 skip("process is limited\n");
5761 create_test_files();
5762 create_file("msitest\\english.txt", 1000);
5763 create_database(msifile
, pub_tables
, ARRAY_SIZE(pub_tables
));
5765 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5767 r
= MsiInstallProductA(msifile
, NULL
);
5768 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5770 skip("Not enough rights to perform tests\n");
5773 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5776 r
= MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5777 "english.txt", INSTALLMODE_DEFAULT
, NULL
, &size
);
5778 ok(r
== ERROR_SUCCESS
, "MsiProvideQualifiedComponent returned %d\n", r
);
5780 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5781 ok(res
== ERROR_SUCCESS
, "components key not created %d\n", res
);
5783 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, NULL
, &size
);
5784 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5786 data
= HeapAlloc(GetProcessHeap(), 0, size
);
5787 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, data
, &size
);
5788 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5791 res
= RegDeleteKeyA(HKEY_CURRENT_USER
, keypath
);
5792 ok(res
== ERROR_SUCCESS
, "RegDeleteKey failed %d\n", res
);
5794 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath2
, 0, NULL
, REG_OPTION_NON_VOLATILE
,
5795 MAXIMUM_ALLOWED
| KEY_WOW64_64KEY
, NULL
, &key
, NULL
);
5796 ok(res
== ERROR_SUCCESS
, "RegCreateKeyEx failed %d\n", res
);
5797 res
= RegSetValueExA(key
, "english.txt", 0, REG_MULTI_SZ
, data
, size
);
5798 ok(res
== ERROR_SUCCESS
, "RegSetValueEx failed %d\n", res
);
5802 r
= MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5803 "english.txt", INSTALLMODE_DEFAULT
, NULL
, &size
);
5804 ok(r
== ERROR_SUCCESS
, "MsiProvideQualifiedComponent returned %d\n", r
);
5806 if (pRegDeleteKeyExA
)
5807 res
= pRegDeleteKeyExA(HKEY_LOCAL_MACHINE
, keypath2
, KEY_WOW64_64KEY
, 0);
5809 res
= RegDeleteKeyA(HKEY_LOCAL_MACHINE
, keypath2
);
5810 ok(res
== ERROR_SUCCESS
, "RegDeleteKey failed %d\n", res
);
5812 res
= RegCreateKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5813 ok(res
== ERROR_SUCCESS
, "RegCreateKey failed %d\n", res
);
5815 res
= RegSetValueExA(key
, "english.txt", 0, REG_MULTI_SZ
, data
, size
);
5816 ok(res
== ERROR_SUCCESS
, "RegSetValueEx failed %d\n", res
);
5817 HeapFree(GetProcessHeap(), 0, data
);
5820 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5821 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5823 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5824 ok(res
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", res
);
5826 ok(!delete_pf("msitest\\english.txt", TRUE
), "file not removed\n");
5827 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5830 DeleteFileA("msitest\\english.txt");
5831 delete_test_files();
5832 DeleteFileA(msifile
);
5835 static void test_remove_duplicate_files(void)
5839 if (is_process_limited())
5841 skip("process is limited\n");
5845 create_test_files();
5846 create_file("msitest\\original.txt", 1000);
5847 create_file("msitest\\original2.txt", 1000);
5848 create_file("msitest\\original3.txt", 1000);
5849 create_database(msifile
, rd_tables
, ARRAY_SIZE(rd_tables
));
5851 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5853 r
= MsiInstallProductA(msifile
, NULL
);
5854 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5856 skip("Not enough rights to perform tests\n");
5859 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5861 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5862 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5863 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5864 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5865 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5867 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5868 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5870 ok(delete_pf("msitest\\original.txt", TRUE
), "file removed\n");
5871 ok(!delete_pf("msitest\\original2.txt", TRUE
), "file not removed\n");
5872 ok(!delete_pf("msitest\\original3.txt", TRUE
), "file not removed\n");
5873 ok(!delete_pf("msitest\\duplicate.txt", TRUE
), "file not removed\n");
5874 ok(!delete_pf("msitest\\duplicate2.txt", TRUE
), "file not removed\n");
5875 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5878 DeleteFileA("msitest\\original.txt");
5879 DeleteFileA("msitest\\original2.txt");
5880 DeleteFileA("msitest\\original3.txt");
5881 delete_test_files();
5882 DeleteFileA(msifile
);
5885 static void test_find_related_products(void)
5889 if (is_process_limited())
5891 skip("process is limited\n");
5895 create_test_files();
5896 create_file("msitest\\product.txt", 1000);
5897 create_database(msifile
, frp_tables
, ARRAY_SIZE(frp_tables
));
5899 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5901 r
= MsiInstallProductA(msifile
, NULL
);
5902 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5904 skip("Not enough rights to perform tests\n");
5907 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5909 /* install again, so it finds the upgrade code */
5910 r
= MsiInstallProductA(msifile
, NULL
);
5911 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5913 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5914 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5916 ok(!delete_pf("msitest\\product.txt", TRUE
), "file not removed\n");
5917 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5920 DeleteFileA("msitest\\product.txt");
5921 delete_test_files();
5922 DeleteFileA(msifile
);
5925 static void test_ini_values(void)
5929 char inifile
[MAX_PATH
], buf
[0x10];
5933 if (is_process_limited())
5935 skip("process is limited\n");
5939 create_test_files();
5940 create_file("msitest\\inifile.txt", 1000);
5941 create_database(msifile
, ini_tables
, ARRAY_SIZE(ini_tables
));
5943 lstrcpyA(inifile
, PROG_FILES_DIR
);
5944 lstrcatA(inifile
, "\\msitest");
5945 ret
= CreateDirectoryA(inifile
, NULL
);
5946 if (!ret
&& GetLastError() == ERROR_ACCESS_DENIED
)
5948 skip("Not enough rights to perform tests\n");
5951 lstrcatA(inifile
, "\\test.ini");
5952 file
= CreateFileA(inifile
, GENERIC_WRITE
|GENERIC_READ
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
5955 ret
= WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile
);
5956 ok(ret
, "failed to write profile string %u\n", GetLastError());
5958 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5960 r
= MsiInstallProductA(msifile
, NULL
);
5961 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5963 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
5964 ok(len
== 6, "got %u expected 6\n", len
);
5966 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
5967 ok(!len
, "got %u expected 0\n", len
);
5969 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5970 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5972 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
5973 ok(!len
, "got %u expected 0\n", len
);
5975 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
5976 ok(!len
, "got %u expected 0\n", len
);
5978 todo_wine
ok(!delete_pf("msitest\\test.ini", TRUE
), "file removed\n");
5979 ok(!delete_pf("msitest\\inifile.txt", TRUE
), "file not removed\n");
5980 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5983 DeleteFileA("msitest\\inifile.txt");
5984 delete_test_files();
5985 DeleteFileA(msifile
);
5988 static void test_register_class_info(void)
5994 if (is_process_limited())
5996 skip("process is limited\n");
6000 create_test_files();
6001 create_file("msitest\\class.txt", 1000);
6002 create_database(msifile
, rci_tables
, ARRAY_SIZE(rci_tables
));
6004 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6006 r
= MsiInstallProductA(msifile
, NULL
);
6007 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6009 skip("Not enough rights to perform tests\n");
6012 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6015 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6017 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6018 ok(res
== ERROR_SUCCESS
, "key not created\n");
6021 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6022 ok(res
== ERROR_SUCCESS
, "key not created\n");
6025 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6026 ok(res
== ERROR_SUCCESS
, "key not created\n");
6029 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6030 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6033 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6035 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6036 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6038 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6039 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6041 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6042 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6044 ok(!delete_pf("msitest\\class.txt", TRUE
), "file not removed\n");
6045 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6048 DeleteFileA("msitest\\class.txt");
6049 delete_test_files();
6050 DeleteFileA(msifile
);
6053 static void test_register_extension_info(void)
6059 if (is_process_limited())
6061 skip("process is limited\n");
6065 create_test_files();
6066 create_file("msitest\\extension.txt", 1000);
6067 create_database(msifile
, rei_tables
, ARRAY_SIZE(rei_tables
));
6069 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6071 r
= MsiInstallProductA(msifile
, NULL
);
6072 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6074 skip("Not enough rights to perform tests\n");
6077 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6079 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6080 ok(res
== ERROR_SUCCESS
, "key not created\n");
6083 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1\\shell\\Open\\command", &hkey
);
6084 ok(res
== ERROR_SUCCESS
, "key not created\n");
6087 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6088 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6090 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6091 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6093 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1", &hkey
);
6094 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6096 ok(!delete_pf("msitest\\extension.txt", TRUE
), "file not removed\n");
6097 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6100 DeleteFileA("msitest\\extension.txt");
6101 delete_test_files();
6102 DeleteFileA(msifile
);
6105 static void test_register_progid_info(void)
6111 if (is_process_limited())
6113 skip("process is limited\n");
6117 create_test_files();
6118 create_file("msitest\\progid.txt", 1000);
6119 create_database(msifile
, rpi_tables
, ARRAY_SIZE(rpi_tables
));
6121 res
= RegCreateKeyExA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", 0, NULL
, 0,
6122 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
6123 ok(res
== ERROR_SUCCESS
, "key not created\n");
6126 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6128 r
= MsiInstallProductA(msifile
, NULL
);
6129 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6131 skip("Not enough rights to perform tests\n");
6134 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6137 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6139 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6140 ok(res
== ERROR_SUCCESS
, "key not created\n");
6143 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6144 ok(res
== ERROR_SUCCESS
, "key not created\n");
6147 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6148 ok(res
== ERROR_SUCCESS
, "key not created\n");
6151 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6152 ok(res
== ERROR_SUCCESS
, "key not created\n");
6155 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6156 ok(res
== ERROR_SUCCESS
, "key not created\n");
6159 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6160 ok(res
== ERROR_SUCCESS
, "key not created\n");
6163 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6164 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6165 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6167 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6168 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6170 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6171 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6172 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6174 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6175 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6177 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6178 ok(res
== ERROR_SUCCESS
, "key not created\n");
6181 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6182 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6185 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6187 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6188 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6190 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6191 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6193 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6194 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6196 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6197 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6199 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6200 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6202 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6203 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6205 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6206 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6208 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6209 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6211 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6212 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6213 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6215 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6216 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6218 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6219 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6221 ok(!delete_pf("msitest\\progid.txt", TRUE
), "file not removed\n");
6222 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6225 DeleteFileA("msitest\\progid.txt");
6226 delete_test_files();
6227 DeleteFileA(msifile
);
6228 RegDeleteKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned");
6231 static void test_register_mime_info(void)
6237 if (is_process_limited())
6239 skip("process is limited\n");
6243 create_test_files();
6244 create_file("msitest\\mime.txt", 1000);
6245 create_database(msifile
, rmi_tables
, ARRAY_SIZE(rmi_tables
));
6247 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6249 r
= MsiInstallProductA(msifile
, NULL
);
6250 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6252 skip("Not enough rights to perform tests\n");
6255 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6257 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6258 ok(res
== ERROR_SUCCESS
, "key not created\n");
6261 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6262 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6264 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6265 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6267 ok(!delete_pf("msitest\\mime.txt", TRUE
), "file not removed\n");
6268 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6271 DeleteFileA("msitest\\mime.txt");
6272 delete_test_files();
6273 DeleteFileA(msifile
);
6276 static void test_publish_assemblies(void)
6278 static const char manifest
[] =
6279 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6280 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6281 "processorArchitecture=\"x86\"/>";
6282 static const char manifest_local
[] =
6283 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6284 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6285 "processorArchitecture=\"x86\"/>";
6286 static const char classes_path_dotnet
[] =
6287 "Installer\\Assemblies\\Global";
6288 static const char classes_path_dotnet_local
[] =
6289 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6290 static const char classes_path_dotnet_local_wow64
[] =
6291 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6292 static const char classes_path_fake_local
[] =
6293 "Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt";
6294 static const char classes_path_fake_local_wow64
[] =
6295 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt";
6296 static const char classes_path_win32
[] =
6297 "Installer\\Win32Assemblies\\Global";
6298 static const char classes_path_win32_local
[] =
6299 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6300 static const char classes_path_win32_local_wow64
[] =
6301 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6302 static const char path_dotnet
[] =
6303 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6304 static const char path_dotnet_local
[] =
6305 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6306 static const char path_dotnet_local_wow64
[] =
6307 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6308 static const char path_fake_local
[] =
6309 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt";
6310 static const char path_fake_local_wow64
[] =
6311 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt";
6312 static const char path_win32
[] =
6313 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6314 static const char path_win32_local
[] =
6315 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6316 static const char path_win32_local_wow64
[] =
6317 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6318 static const char name_dotnet
[] =
6319 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6320 "version=\"1.0.0.0\",culture=\"neutral\"";
6321 static const char name_dotnet_local
[] =
6322 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6323 "version=\"1.0.0.0\",culture=\"neutral\"";
6324 static const char name_win32
[] =
6325 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6326 "type=\"win32\",version=\"1.0.0.0\"";
6327 static const char name_win32_local
[] =
6328 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6329 "type=\"win32\",version=\"1.0.0.0\"";
6336 if (is_process_limited())
6338 skip("process is limited\n");
6342 create_test_files();
6343 create_file("msitest\\win32.txt", 1000);
6344 create_file("msitest\\win32_local.txt", 1000);
6345 create_file("msitest\\dotnet.txt", 1000);
6346 create_file("msitest\\dotnet_local.txt", 1000);
6347 create_file_data("msitest\\manifest.txt", manifest
, 0);
6348 create_file_data("msitest\\manifest_local.txt", manifest_local
, 0);
6349 create_file("msitest\\application_win32.txt", 1000);
6350 create_file("msitest\\application_dotnet.txt", 1000);
6351 create_file("msitest\\fake_local.txt", 1000);
6352 create_database(msifile
, pa_tables
, ARRAY_SIZE(pa_tables
));
6354 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6356 r
= MsiInstallProductA(msifile
, NULL
);
6357 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6359 skip("Not enough rights to perform tests\n");
6362 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6364 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6365 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6366 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6369 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6370 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6371 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6372 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6375 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6376 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6377 CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6380 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6381 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6382 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6383 CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6386 /* No registration is done for a local assembly with no matching file */
6387 path
= (is_wow64
|| is_64bit
) ? path_fake_local_wow64
: path_fake_local
;
6388 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6389 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
6391 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6392 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6394 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6395 if (res
== ERROR_SUCCESS
)
6397 res
= RegDeleteValueA(hkey
, name_dotnet
);
6398 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6402 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6403 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6404 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6406 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6407 if (res
== ERROR_SUCCESS
)
6409 res
= RegDeleteValueA(hkey
, name_win32
);
6410 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6414 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6415 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6416 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6418 r
= MsiInstallProductA(msifile
, "ALLUSERS=1");
6419 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6421 access
= KEY_QUERY_VALUE
;
6422 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6423 if (res
== ERROR_FILE_NOT_FOUND
&& is_wow64
) /* Vista WOW64 */
6425 trace("Using 64-bit registry view for HKCR\\Installer\n");
6426 access
= KEY_QUERY_VALUE
| KEY_WOW64_64KEY
;
6427 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6429 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6430 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6433 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6434 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6435 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6436 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6439 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_win32
, 0, access
, &hkey
);
6440 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6441 CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6444 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6445 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6446 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6447 CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6450 /* No registration is done for a local assembly with no matching file */
6451 path
= (is_wow64
|| is_64bit
) ? classes_path_fake_local_wow64
: classes_path_fake_local
;
6452 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6453 ok(res
== ERROR_FILE_NOT_FOUND
, "got %u\n", res
);
6455 r
= MsiInstallProductA(msifile
, "REMOVE=ALL ALLUSERS=1");
6456 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6458 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, &hkey
);
6459 if (res
== ERROR_SUCCESS
)
6461 res
= RegDeleteValueA(hkey
, name_dotnet
);
6462 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6466 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6467 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6468 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6470 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_win32
, &hkey
);
6471 if (res
== ERROR_SUCCESS
)
6473 res
= RegDeleteValueA(hkey
, name_win32
);
6474 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6478 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6479 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6480 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6483 DeleteFileA("msitest\\win32.txt");
6484 DeleteFileA("msitest\\win32_local.txt");
6485 DeleteFileA("msitest\\dotnet.txt");
6486 DeleteFileA("msitest\\dotnet_local.txt");
6487 DeleteFileA("msitest\\manifest.txt");
6488 DeleteFileA("msitest\\manifest_local.txt");
6489 DeleteFileA("msitest\\application_win32.txt");
6490 DeleteFileA("msitest\\application_dotnet.txt");
6491 DeleteFileA("msitest\\fake_local.txt");
6492 delete_test_files();
6493 DeleteFileA(msifile
);
6496 static void test_remove_existing_products(void)
6500 if (is_process_limited())
6502 skip("process is limited\n");
6506 create_test_files();
6507 create_file("msitest\\rep.txt", 1000);
6508 create_database(msifile
, rep_tables
, ARRAY_SIZE(rep_tables
));
6510 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6512 r
= MsiInstallProductA(msifile
, NULL
);
6513 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6515 skip("Not enough rights to perform tests\n");
6518 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6520 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6523 ok(!delete_pf("msitest\\rep.txt", TRUE
), "file not removed\n");
6524 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6527 DeleteFileA("msitest\\rep.txt");
6528 delete_test_files();
6529 DeleteFileA(msifile
);
6535 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6536 STATEMGRSTATUS status
;
6539 init_functionpointers();
6542 if (pIsWow64Process
)
6543 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
6545 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6546 GetTempPathA(MAX_PATH
, temp_path
);
6547 SetCurrentDirectoryA(temp_path
);
6549 lstrcpyA(CURR_DIR
, temp_path
);
6550 len
= lstrlenA(CURR_DIR
);
6552 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
6553 CURR_DIR
[len
- 1] = 0;
6555 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6556 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6558 /* Create a restore point ourselves so we circumvent the multitude of restore points
6559 * that would have been created by all the installation and removal tests.
6561 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6562 * creation of restore points.
6564 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
6566 memset(&status
, 0, sizeof(status
));
6567 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
6570 /* Create only one log file and don't append. We have to pass something
6571 * for the log mode for this to work. The logfile needs to have an absolute
6572 * path otherwise we still end up with some extra logfiles as some tests
6573 * change the current directory.
6575 lstrcpyA(log_file
, temp_path
);
6576 lstrcatA(log_file
, "\\msitest.log");
6577 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
6579 test_register_product();
6580 test_publish_product();
6581 test_publish_features();
6582 test_register_user();
6583 test_process_components();
6585 test_publish_sourcelist();
6586 test_remove_files();
6588 test_duplicate_files();
6589 test_write_registry_values();
6591 test_create_remove_folder();
6592 test_start_stop_services();
6593 test_delete_services();
6594 test_install_services();
6595 test_self_registration();
6596 test_register_font();
6597 test_validate_product_id();
6598 test_install_remove_odbc();
6599 test_register_typelib();
6600 test_create_remove_shortcut();
6601 test_publish_components();
6602 test_remove_duplicate_files();
6603 test_find_related_products();
6605 test_register_class_info();
6606 test_register_extension_info();
6607 test_register_progid_info();
6608 test_register_mime_info();
6609 test_publish_assemblies();
6610 test_remove_existing_products();
6612 DeleteFileA(log_file
);
6614 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
6616 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
6618 remove_restore_point(status
.llSequenceNumber
);
6621 SetCurrentDirectoryA(prev_path
);