2 * Copyright (C) 2006 James Hawkins
3 * Copyright 2010 Hans Leidekker for CodeWeavers
5 * Tests concentrating on standard actions
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define _WIN32_MSI 300
30 #include <srrestoreptapi.h>
32 #include "wine/test.h"
34 static UINT (WINAPI
*pMsiQueryComponentStateA
)
35 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
36 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
37 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
38 static UINT (WINAPI
*pMsiSourceListGetInfoA
)
39 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, LPCSTR
, LPSTR
, LPDWORD
);
40 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
41 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
42 static UINT (WINAPI
*pMsiQueryFeatureStateExA
)
43 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
45 static BOOL (WINAPI
*pCheckTokenMembership
)(HANDLE
,PSID
,PBOOL
);
46 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
47 static BOOL (WINAPI
*pOpenProcessToken
)(HANDLE
, DWORD
, PHANDLE
);
48 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
49 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
51 static HMODULE hsrclient
;
52 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
53 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
56 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
58 static const char *msifile
= "msitest.msi";
59 static CHAR CURR_DIR
[MAX_PATH
];
60 static CHAR PROG_FILES_DIR
[MAX_PATH
];
61 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
62 static CHAR APP_DATA_DIR
[MAX_PATH
];
63 static CHAR WINDOWS_DIR
[MAX_PATH
];
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 "WriteEnvironmentStrings\t\t4550\n"
146 "CreateShortcuts\t\t4600\n"
147 "InstallServices\t\t5000\n"
148 "InstallFinalize\t\t6600\n"
149 "InstallInitialize\t\t1500\n"
150 "InstallValidate\t\t1400\n"
151 "LaunchConditions\t\t100\n"
152 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
154 static const char media_dat
[] =
155 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
156 "i2\ti4\tL64\tS255\tS32\tS72\n"
158 "1\t3\t\t\tDISK1\t\n"
159 "2\t7\t\tmsitest.cab\tDISK2\t\n";
161 static const char property_dat
[] =
164 "Property\tProperty\n"
165 "DefaultUIFont\tDlgFont8\n"
168 "InstallMode\tTypical\n"
169 "Manufacturer\tWine\n"
170 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
171 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
173 "ProductLanguage\t1033\n"
174 "ProductName\tMSITEST\n"
175 "ProductVersion\t1.1.1\n"
176 "PROMPTROLLBACKCOST\tP\n"
178 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
179 "AdminProperties\tPOSTADMIN\n"
181 "SERVNAME\tTestService\n"
182 "SERVNAME2\tTestService2\n"
183 "SERVDISP\tTestServiceDisp\n"
184 "SERVDISP2\tTestServiceDisp2\n"
185 "MSIFASTINSTALL\t1\n"
188 static const char environment_dat
[] =
189 "Environment\tName\tValue\tComponent_\n"
190 "s72\tl255\tL255\ts72\n"
191 "Environment\tEnvironment\n"
192 "Var1\t=-MSITESTVAR1\t1\tOne\n"
193 "Var2\tMSITESTVAR2\t1\tOne\n"
194 "Var3\t=-MSITESTVAR3\t1\tOne\n"
195 "Var4\tMSITESTVAR4\t1\tOne\n"
196 "Var5\t-MSITESTVAR5\t\tOne\n"
197 "Var6\tMSITESTVAR6\t\tOne\n"
198 "Var7\t!-MSITESTVAR7\t\tOne\n"
199 "Var8\t!-*MSITESTVAR8\t\tOne\n"
200 "Var9\t=-MSITESTVAR9\t\tOne\n"
201 "Var10\t=MSITESTVAR10\t\tOne\n"
202 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
203 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
204 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
205 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
206 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
207 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
208 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
209 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
210 "Var19\t+-MSITESTVAR17\t1\tOne\n"
211 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
212 "Var21\t+-MSITESTVAR18\t1\tOne\n"
213 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
214 "Var23\t+-MSITESTVAR19\t1\tOne\n"
215 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
216 "Var25\t+-MSITESTVAR20\t1\tOne\n"
217 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n";
219 static const char service_install_dat
[] =
220 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
221 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
222 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
223 "ServiceInstall\tServiceInstall\n"
224 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
225 "TestService2\tSERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription";
227 static const char service_install2_dat
[] =
228 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
229 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
230 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
231 "ServiceInstall\tServiceInstall\n"
232 "TestService\tTestService\tTestService\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\n"
233 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
235 static const char service_control_dat
[] =
236 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
237 "s72\tl255\ti2\tL255\tI2\ts72\n"
238 "ServiceControl\tServiceControl\n"
239 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
240 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
242 static const char sss_service_control_dat
[] =
243 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
244 "s72\tl255\ti2\tL255\tI2\ts72\n"
245 "ServiceControl\tServiceControl\n"
246 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
247 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
248 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
249 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
251 static const char sss_install_exec_seq_dat
[] =
252 "Action\tCondition\tSequence\n"
254 "InstallExecuteSequence\tAction\n"
255 "LaunchConditions\t\t100\n"
256 "CostInitialize\t\t800\n"
258 "ResolveSource\t\t950\n"
259 "CostFinalize\t\t1000\n"
260 "InstallValidate\t\t1400\n"
261 "InstallInitialize\t\t1500\n"
262 "StopServices\t\t4000\n"
263 "DeleteServices\t\t5000\n"
264 "MoveFiles\t\t5100\n"
265 "InstallFiles\t\t5200\n"
266 "DuplicateFiles\t\t5300\n"
267 "StartServices\t\t5400\n"
268 "RegisterProduct\t\t5500\n"
269 "PublishFeatures\t\t5600\n"
270 "PublishProduct\t\t5700\n"
271 "InstallFinalize\t\t6000\n";
273 static const char sds_install_exec_seq_dat
[] =
274 "Action\tCondition\tSequence\n"
276 "InstallExecuteSequence\tAction\n"
277 "LaunchConditions\t\t100\n"
278 "CostInitialize\t\t800\n"
280 "ResolveSource\t\t950\n"
281 "CostFinalize\t\t1000\n"
282 "InstallValidate\t\t1400\n"
283 "InstallInitialize\t\t1500\n"
284 "StopServices\t\t5000\n"
285 "DeleteServices\t\t5050\n"
286 "MoveFiles\t\t5100\n"
287 "InstallFiles\t\t5200\n"
288 "DuplicateFiles\t\t5300\n"
289 "InstallServices\t\t5400\n"
290 "StartServices\t\t5450\n"
291 "RegisterProduct\t\t5500\n"
292 "PublishFeatures\t\t5600\n"
293 "PublishProduct\t\t5700\n"
294 "InstallFinalize\t\t6000\n";
296 static const char rof_component_dat
[] =
297 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
298 "s72\tS38\ts72\ti2\tS255\tS72\n"
299 "Component\tComponent\n"
300 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
302 static const char rof_feature_dat
[] =
303 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
304 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
306 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
307 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
309 static const char rof_feature_comp_dat
[] =
310 "Feature_\tComponent_\n"
312 "FeatureComponents\tFeature_\tComponent_\n"
314 "montecristo\tmaximus";
316 static const char rof_file_dat
[] =
317 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
318 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
320 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
322 static const char rof_media_dat
[] =
323 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
324 "i2\ti4\tL64\tS255\tS32\tS72\n"
326 "1\t1\t\t\tDISK1\t\n";
328 static const char ci2_feature_comp_dat
[] =
329 "Feature_\tComponent_\n"
331 "FeatureComponents\tFeature_\tComponent_\n"
334 static const char ci2_file_dat
[] =
335 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
336 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
338 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
340 static const char pp_install_exec_seq_dat
[] =
341 "Action\tCondition\tSequence\n"
343 "InstallExecuteSequence\tAction\n"
344 "ValidateProductID\t\t700\n"
345 "CostInitialize\t\t800\n"
347 "CostFinalize\t\t1000\n"
348 "InstallValidate\t\t1400\n"
349 "InstallInitialize\t\t1500\n"
350 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
351 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
352 "RemoveFiles\t\t3500\n"
353 "InstallFiles\t\t4000\n"
354 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
355 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
356 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
357 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
358 "InstallFinalize\t\t6600";
360 static const char pp_component_dat
[] =
361 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
362 "s72\tS38\ts72\ti2\tS255\tS72\n"
363 "Component\tComponent\n"
364 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
366 static const char ppc_component_dat
[] =
367 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
368 "s72\tS38\ts72\ti2\tS255\tS72\n"
369 "Component\tComponent\n"
370 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
371 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
373 static const char ppc_file_dat
[] =
374 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
375 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
377 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
378 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
380 static const char ppc_media_dat
[] =
381 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
382 "i2\ti4\tL64\tS255\tS32\tS72\n"
384 "1\t2\t\t\tDISK1\t\n";
386 static const char ppc_feature_comp_dat
[] =
387 "Feature_\tComponent_\n"
389 "FeatureComponents\tFeature_\tComponent_\n"
391 "feature\taugustus\n"
392 "montecristo\tmaximus";
394 static const char cwd_component_dat
[] =
395 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
396 "s72\tS38\ts72\ti2\tS255\tS72\n"
397 "Component\tComponent\n"
398 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
400 static const char rem_component_dat
[] =
401 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
402 "s72\tS38\ts72\ti2\tS255\tS72\n"
403 "Component\tComponent\n"
404 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
405 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
406 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
408 static const char rem_feature_comp_dat
[] =
409 "Feature_\tComponent_\n"
411 "FeatureComponents\tFeature_\tComponent_\n"
412 "feature\thydrogen\n"
416 static const char rem_file_dat
[] =
417 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
418 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
420 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
421 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
422 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
424 static const char rem_install_exec_seq_dat
[] =
425 "Action\tCondition\tSequence\n"
427 "InstallExecuteSequence\tAction\n"
428 "ValidateProductID\t\t700\n"
429 "CostInitialize\t\t800\n"
431 "CostFinalize\t\t1000\n"
432 "InstallValidate\t\t1400\n"
433 "InstallInitialize\t\t1500\n"
434 "ProcessComponents\t\t1600\n"
435 "UnpublishFeatures\t\t1800\n"
436 "RemoveFiles\t\t3500\n"
437 "InstallFiles\t\t4000\n"
438 "RegisterProduct\t\t6100\n"
439 "PublishFeatures\t\t6300\n"
440 "PublishProduct\t\t6400\n"
441 "InstallFinalize\t\t6600";
443 static const char rem_remove_files_dat
[] =
444 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
445 "s72\ts72\tS255\ts72\tI2\n"
446 "RemoveFile\tFileKey\n"
447 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
448 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
449 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
450 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
451 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
452 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
453 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
454 "block\thelium\tblock\tMSITESTDIR\t3\n"
455 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
456 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
458 static const char mov_move_file_dat
[] =
459 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
460 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
461 "MoveFile\tFileKey\n"
462 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
463 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
464 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
465 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
466 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
467 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
468 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
469 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
470 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
471 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
472 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
473 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
474 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
475 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
476 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
477 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
478 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
479 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
481 static const char df_directory_dat
[] =
482 "Directory\tDirectory_Parent\tDefaultDir\n"
484 "Directory\tDirectory\n"
485 "THIS\tMSITESTDIR\tthis\n"
486 "DOESNOT\tTHIS\tdoesnot\n"
487 "NONEXISTENT\tDOESNOT\texist\n"
488 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
489 "ProgramFilesFolder\tTARGETDIR\t.\n"
490 "TARGETDIR\t\tSourceDir";
492 static const char df_duplicate_file_dat
[] =
493 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
494 "s72\ts72\ts72\tS255\tS72\n"
495 "DuplicateFile\tFileKey\n"
496 "maximus\tmaximus\tmaximus\taugustus\t\n"
497 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
498 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
500 static const char wrv_component_dat
[] =
501 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
502 "s72\tS38\ts72\ti2\tS255\tS72\n"
503 "Component\tComponent\n"
504 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
506 static const char wrv_registry_dat
[] =
507 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
508 "s72\ti2\tl255\tL255\tL0\ts72\n"
509 "Registry\tRegistry\n"
510 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
511 "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
512 "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
513 "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
514 "regdata4\t2\tSOFTWARE\\Wine\\msitest\\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"
515 "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
516 "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
517 "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
518 "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
519 "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
520 "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
521 "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
522 "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
523 "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
524 "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
525 "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n";
527 static const char cf_directory_dat
[] =
528 "Directory\tDirectory_Parent\tDefaultDir\n"
530 "Directory\tDirectory\n"
531 "FIRSTDIR\tMSITESTDIR\tfirst\n"
532 "SECONDDIR\tMSITESTDIR\tsecond\n"
533 "THIRDDIR\tMSITESTDIR\tthird\n"
534 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
535 "ProgramFilesFolder\tTARGETDIR\t.\n"
536 "TARGETDIR\t\tSourceDir";
538 static const char cf_component_dat
[] =
539 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
540 "s72\tS38\ts72\ti2\tS255\tS72\n"
541 "Component\tComponent\n"
542 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
543 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
545 static const char cf_feature_dat
[] =
546 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
547 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
549 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
550 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
552 static const char cf_feature_comp_dat
[] =
553 "Feature_\tComponent_\n"
555 "FeatureComponents\tFeature_\tComponent_\n"
559 static const char cf_file_dat
[] =
560 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
561 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
563 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
564 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
566 static const char cf_create_folders_dat
[] =
567 "Directory_\tComponent_\n"
569 "CreateFolder\tDirectory_\tComponent_\n"
574 static const char cf_install_exec_seq_dat
[] =
575 "Action\tCondition\tSequence\n"
577 "InstallExecuteSequence\tAction\n"
578 "CostFinalize\t\t1000\n"
579 "ValidateProductID\t\t700\n"
580 "CostInitialize\t\t800\n"
582 "RemoveFiles\t\t3500\n"
583 "CreateFolders\t\t3700\n"
584 "RemoveFolders\t\t3800\n"
585 "InstallFiles\t\t4000\n"
586 "RegisterUser\t\t6000\n"
587 "RegisterProduct\t\t6100\n"
588 "PublishFeatures\t\t6300\n"
589 "PublishProduct\t\t6400\n"
590 "InstallFinalize\t\t6600\n"
591 "InstallInitialize\t\t1500\n"
592 "ProcessComponents\t\t1600\n"
593 "UnpublishFeatures\t\t1800\n"
594 "InstallValidate\t\t1400\n"
595 "LaunchConditions\t\t100\n";
597 static const char sr_selfreg_dat
[] =
603 static const char sr_install_exec_seq_dat
[] =
604 "Action\tCondition\tSequence\n"
606 "InstallExecuteSequence\tAction\n"
607 "CostFinalize\t\t1000\n"
608 "CostInitialize\t\t800\n"
610 "ResolveSource\t\t950\n"
611 "MoveFiles\t\t1700\n"
612 "SelfUnregModules\t\t3900\n"
613 "InstallFiles\t\t4000\n"
614 "DuplicateFiles\t\t4500\n"
615 "WriteEnvironmentStrings\t\t4550\n"
616 "CreateShortcuts\t\t4600\n"
617 "InstallFinalize\t\t6600\n"
618 "InstallInitialize\t\t1500\n"
619 "InstallValidate\t\t1400\n"
620 "LaunchConditions\t\t100\n";
622 static const char font_media_dat
[] =
623 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
624 "i2\ti4\tL64\tS255\tS32\tS72\n"
626 "1\t3\t\t\tDISK1\t\n";
628 static const char font_file_dat
[] =
629 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
630 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
632 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
634 static const char font_feature_dat
[] =
635 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
636 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
638 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
640 static const char font_component_dat
[] =
641 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
642 "s72\tS38\ts72\ti2\tS255\tS72\n"
643 "Component\tComponent\n"
644 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
646 static const char font_feature_comp_dat
[] =
647 "Feature_\tComponent_\n"
649 "FeatureComponents\tFeature_\tComponent_\n"
652 static const char font_dat
[] =
656 "font.ttf\tmsi test font\n";
658 static const char font_install_exec_seq_dat
[] =
659 "Action\tCondition\tSequence\n"
661 "InstallExecuteSequence\tAction\n"
662 "ValidateProductID\t\t700\n"
663 "CostInitialize\t\t800\n"
665 "CostFinalize\t\t1000\n"
666 "InstallValidate\t\t1400\n"
667 "InstallInitialize\t\t1500\n"
668 "ProcessComponents\t\t1600\n"
669 "UnpublishFeatures\t\t1800\n"
670 "RemoveFiles\t\t3500\n"
671 "InstallFiles\t\t4000\n"
672 "RegisterFonts\t\t4100\n"
673 "UnregisterFonts\t\t4200\n"
674 "RegisterUser\t\t6000\n"
675 "RegisterProduct\t\t6100\n"
676 "PublishFeatures\t\t6300\n"
677 "PublishProduct\t\t6400\n"
678 "InstallFinalize\t\t6600";
680 static const char vp_property_dat
[] =
683 "Property\tProperty\n"
686 "InstallMode\tTypical\n"
687 "Manufacturer\tWine\n"
688 "PIDTemplate\t###-#######\n"
689 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
690 "ProductLanguage\t1033\n"
691 "ProductName\tMSITEST\n"
692 "ProductVersion\t1.1.1\n"
693 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
694 "MSIFASTINSTALL\t1\n";
696 static const char vp_custom_action_dat
[] =
697 "Action\tType\tSource\tTarget\tISComments\n"
698 "s72\ti2\tS64\tS0\tS255\n"
699 "CustomAction\tAction\n"
700 "SetProductID1\t51\tProductID\t1\t\n"
701 "SetProductID2\t51\tProductID\t2\t\n"
702 "TestProductID1\t19\t\t\tHalts installation\n"
703 "TestProductID2\t19\t\t\tHalts installation\n";
705 static const char vp_install_exec_seq_dat
[] =
706 "Action\tCondition\tSequence\n"
708 "InstallExecuteSequence\tAction\n"
709 "LaunchConditions\t\t100\n"
710 "CostInitialize\t\t800\n"
712 "CostFinalize\t\t1000\n"
713 "InstallValidate\t\t1400\n"
714 "InstallInitialize\t\t1500\n"
715 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
716 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
717 "ValidateProductID\t\t3200\n"
718 "InstallExecute\t\t3300\n"
719 "TestProductID1\tProductID=1\t3400\n"
720 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
721 "InstallFiles\t\t4000\n"
722 "InstallFinalize\t\t6000\n";
724 static const char odbc_file_dat
[] =
725 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
726 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
728 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
729 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
730 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
731 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
732 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
734 static const char odbc_feature_dat
[] =
735 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
736 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
738 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
740 static const char odbc_feature_comp_dat
[] =
741 "Feature_\tComponent_\n"
743 "FeatureComponents\tFeature_\tComponent_\n"
746 static const char odbc_component_dat
[] =
747 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
748 "s72\tS38\ts72\ti2\tS255\tS72\n"
749 "Component\tComponent\n"
750 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
752 static const char odbc_driver_dat
[] =
753 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
754 "s72\ts72\ts255\ts72\tS72\n"
755 "ODBCDriver\tDriver\n"
756 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
757 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
759 static const char odbc_translator_dat
[] =
760 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
761 "s72\ts72\ts255\ts72\tS72\n"
762 "ODBCTranslator\tTranslator\n"
763 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
764 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
766 static const char odbc_datasource_dat
[] =
767 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
768 "s72\ts72\ts255\ts255\ti2\n"
769 "ODBCDataSource\tDataSource\n"
770 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
772 static const char odbc_install_exec_seq_dat
[] =
773 "Action\tCondition\tSequence\n"
775 "InstallExecuteSequence\tAction\n"
776 "LaunchConditions\t\t100\n"
777 "CostInitialize\t\t800\n"
779 "CostFinalize\t\t1000\n"
780 "InstallValidate\t\t1400\n"
781 "InstallInitialize\t\t1500\n"
782 "ProcessComponents\t\t1600\n"
783 "InstallODBC\t\t3000\n"
784 "RemoveODBC\t\t3100\n"
785 "RemoveFiles\t\t3900\n"
786 "InstallFiles\t\t4000\n"
787 "RegisterProduct\t\t5000\n"
788 "PublishFeatures\t\t5100\n"
789 "PublishProduct\t\t5200\n"
790 "InstallFinalize\t\t6000\n";
792 static const char odbc_media_dat
[] =
793 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
794 "i2\ti4\tL64\tS255\tS32\tS72\n"
796 "1\t5\t\t\tDISK1\t\n";
798 static const char tl_file_dat
[] =
799 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
800 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
802 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
804 static const char tl_feature_dat
[] =
805 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
806 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
808 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
810 static const char tl_feature_comp_dat
[] =
811 "Feature_\tComponent_\n"
813 "FeatureComponents\tFeature_\tComponent_\n"
814 "typelib\ttypelib\n";
816 static const char tl_component_dat
[] =
817 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
818 "s72\tS38\ts72\ti2\tS255\tS72\n"
819 "Component\tComponent\n"
820 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
822 static const char tl_typelib_dat
[] =
823 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
824 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
825 "TypeLib\tLibID\tLanguage\tComponent_\n"
826 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
828 static const char tl_install_exec_seq_dat
[] =
829 "Action\tCondition\tSequence\n"
831 "InstallExecuteSequence\tAction\n"
832 "LaunchConditions\t\t100\n"
833 "CostInitialize\t\t800\n"
835 "CostFinalize\t\t1000\n"
836 "InstallValidate\t\t1400\n"
837 "InstallInitialize\t\t1500\n"
838 "ProcessComponents\t\t1600\n"
839 "RemoveFiles\t\t1700\n"
840 "InstallFiles\t\t2000\n"
841 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
842 "UnregisterTypeLibraries\t\t3100\n"
843 "RegisterProduct\t\t5100\n"
844 "PublishFeatures\t\t5200\n"
845 "PublishProduct\t\t5300\n"
846 "InstallFinalize\t\t6000\n";
848 static const char crs_file_dat
[] =
849 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
850 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
852 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
854 static const char crs_feature_dat
[] =
855 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
856 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
858 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
860 static const char crs_feature_comp_dat
[] =
861 "Feature_\tComponent_\n"
863 "FeatureComponents\tFeature_\tComponent_\n"
864 "shortcut\tshortcut\n";
866 static const char crs_component_dat
[] =
867 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
868 "s72\tS38\ts72\ti2\tS255\tS72\n"
869 "Component\tComponent\n"
870 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
872 static const char crs_shortcut_dat
[] =
873 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
874 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
875 "Shortcut\tShortcut\n"
876 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
878 static const char crs_install_exec_seq_dat
[] =
879 "Action\tCondition\tSequence\n"
881 "InstallExecuteSequence\tAction\n"
882 "LaunchConditions\t\t100\n"
883 "CostInitialize\t\t800\n"
885 "CostFinalize\t\t1000\n"
886 "InstallValidate\t\t1400\n"
887 "InstallInitialize\t\t1500\n"
888 "ProcessComponents\t\t1600\n"
889 "RemoveFiles\t\t1700\n"
890 "InstallFiles\t\t2000\n"
891 "RemoveShortcuts\t\t3000\n"
892 "CreateShortcuts\t\t3100\n"
893 "RegisterProduct\t\t5000\n"
894 "PublishFeatures\t\t5100\n"
895 "PublishProduct\t\t5200\n"
896 "InstallFinalize\t\t6000\n";
898 static const char pub_file_dat
[] =
899 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
900 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
902 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
904 static const char pub_feature_dat
[] =
905 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
906 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
908 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
910 static const char pub_feature_comp_dat
[] =
911 "Feature_\tComponent_\n"
913 "FeatureComponents\tFeature_\tComponent_\n"
914 "publish\tpublish\n";
916 static const char pub_component_dat
[] =
917 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
918 "s72\tS38\ts72\ti2\tS255\tS72\n"
919 "Component\tComponent\n"
920 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
922 static const char pub_publish_component_dat
[] =
923 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
924 "s38\ts255\ts72\tL255\ts38\n"
925 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
926 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
928 static const char pub_install_exec_seq_dat
[] =
929 "Action\tCondition\tSequence\n"
931 "InstallExecuteSequence\tAction\n"
932 "LaunchConditions\t\t100\n"
933 "CostInitialize\t\t800\n"
935 "CostFinalize\t\t1000\n"
936 "InstallValidate\t\t1400\n"
937 "InstallInitialize\t\t1500\n"
938 "ProcessComponents\t\t1600\n"
939 "RemoveFiles\t\t1700\n"
940 "InstallFiles\t\t2000\n"
941 "PublishComponents\t\t3000\n"
942 "UnpublishComponents\t\t3100\n"
943 "RegisterProduct\t\t5000\n"
944 "PublishFeatures\t\t5100\n"
945 "PublishProduct\t\t5200\n"
946 "InstallFinalize\t\t6000\n";
948 static const char rd_file_dat
[] =
949 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
950 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
952 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
953 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
954 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
956 static const char rd_feature_dat
[] =
957 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
958 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
960 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
962 static const char rd_feature_comp_dat
[] =
963 "Feature_\tComponent_\n"
965 "FeatureComponents\tFeature_\tComponent_\n"
966 "duplicate\tduplicate\n";
968 static const char rd_component_dat
[] =
969 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
970 "s72\tS38\ts72\ti2\tS255\tS72\n"
971 "Component\tComponent\n"
972 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
973 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
975 static const char rd_duplicate_file_dat
[] =
976 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
977 "s72\ts72\ts72\tS255\tS72\n"
978 "DuplicateFile\tFileKey\n"
979 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
980 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
981 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
983 static const char rd_install_exec_seq_dat
[] =
984 "Action\tCondition\tSequence\n"
986 "InstallExecuteSequence\tAction\n"
987 "LaunchConditions\t\t100\n"
988 "CostInitialize\t\t800\n"
990 "CostFinalize\t\t1000\n"
991 "InstallValidate\t\t1400\n"
992 "InstallInitialize\t\t1500\n"
993 "ProcessComponents\t\t1600\n"
994 "RemoveDuplicateFiles\t\t1900\n"
995 "InstallFiles\t\t2000\n"
996 "DuplicateFiles\t\t2100\n"
997 "RegisterProduct\t\t5000\n"
998 "PublishFeatures\t\t5100\n"
999 "PublishProduct\t\t5200\n"
1000 "InstallFinalize\t\t6000\n";
1002 static const char rrv_file_dat
[] =
1003 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1004 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1006 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1008 static const char rrv_feature_dat
[] =
1009 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1010 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1011 "Feature\tFeature\n"
1012 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1014 static const char rrv_feature_comp_dat
[] =
1015 "Feature_\tComponent_\n"
1017 "FeatureComponents\tFeature_\tComponent_\n"
1018 "registry\tregistry\n";
1020 static const char rrv_component_dat
[] =
1021 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1022 "s72\tS38\ts72\ti2\tS255\tS72\n"
1023 "Component\tComponent\n"
1024 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1026 static const char rrv_registry_dat
[] =
1027 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1028 "s72\ti2\tl255\tL255\tL0\ts72\n"
1029 "Registry\tRegistry\n"
1030 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1031 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1032 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1034 static const char rrv_remove_registry_dat
[] =
1035 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1036 "s72\ti2\tl255\tL255\ts72\n"
1037 "RemoveRegistry\tRemoveRegistry\n"
1038 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1039 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1040 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1042 static const char rrv_install_exec_seq_dat
[] =
1043 "Action\tCondition\tSequence\n"
1045 "InstallExecuteSequence\tAction\n"
1046 "LaunchConditions\t\t100\n"
1047 "CostInitialize\t\t800\n"
1049 "CostFinalize\t\t1000\n"
1050 "InstallValidate\t\t1400\n"
1051 "InstallInitialize\t\t1500\n"
1052 "ProcessComponents\t\t1600\n"
1053 "RemoveFiles\t\t1700\n"
1054 "InstallFiles\t\t2000\n"
1055 "RemoveRegistryValues\t\t3000\n"
1056 "RegisterProduct\t\t5000\n"
1057 "PublishFeatures\t\t5100\n"
1058 "PublishProduct\t\t5200\n"
1059 "InstallFinalize\t\t6000\n";
1061 static const char frp_file_dat
[] =
1062 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1063 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1065 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1067 static const char frp_feature_dat
[] =
1068 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1069 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1070 "Feature\tFeature\n"
1071 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1073 static const char frp_feature_comp_dat
[] =
1074 "Feature_\tComponent_\n"
1076 "FeatureComponents\tFeature_\tComponent_\n"
1077 "product\tproduct\n";
1079 static const char frp_component_dat
[] =
1080 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1081 "s72\tS38\ts72\ti2\tS255\tS72\n"
1082 "Component\tComponent\n"
1083 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1085 static const char frp_custom_action_dat
[] =
1086 "Action\tType\tSource\tTarget\tISComments\n"
1087 "s72\ti2\tS64\tS0\tS255\n"
1088 "CustomAction\tAction\n"
1089 "TestProp\t19\t\t\tPROP set\n";
1091 static const char frp_upgrade_dat
[] =
1092 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1093 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1094 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1095 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1097 static const char frp_install_exec_seq_dat
[] =
1098 "Action\tCondition\tSequence\n"
1100 "InstallExecuteSequence\tAction\n"
1101 "FindRelatedProducts\t\t50\n"
1102 "TestProp\tPROP AND NOT REMOVE\t51\n"
1103 "LaunchConditions\t\t100\n"
1104 "CostInitialize\t\t800\n"
1106 "CostFinalize\t\t1000\n"
1107 "InstallValidate\t\t1400\n"
1108 "InstallInitialize\t\t1500\n"
1109 "ProcessComponents\t\t1600\n"
1110 "RemoveFiles\t\t1700\n"
1111 "InstallFiles\t\t2000\n"
1112 "RegisterProduct\t\t5000\n"
1113 "PublishFeatures\t\t5100\n"
1114 "PublishProduct\t\t5200\n"
1115 "InstallFinalize\t\t6000\n";
1117 static const char riv_file_dat
[] =
1118 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1119 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1121 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1123 static const char riv_feature_dat
[] =
1124 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1125 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1126 "Feature\tFeature\n"
1127 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1129 static const char riv_feature_comp_dat
[] =
1130 "Feature_\tComponent_\n"
1132 "FeatureComponents\tFeature_\tComponent_\n"
1133 "inifile\tinifile\n";
1135 static const char riv_component_dat
[] =
1136 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1137 "s72\tS38\ts72\ti2\tS255\tS72\n"
1138 "Component\tComponent\n"
1139 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1141 static const char riv_ini_file_dat
[] =
1142 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1143 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1144 "IniFile\tIniFile\n"
1145 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1147 static const char riv_remove_ini_file_dat
[] =
1148 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1149 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1150 "RemoveIniFile\tRemoveIniFile\n"
1151 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1153 static const char riv_install_exec_seq_dat
[] =
1154 "Action\tCondition\tSequence\n"
1156 "InstallExecuteSequence\tAction\n"
1157 "LaunchConditions\t\t100\n"
1158 "CostInitialize\t\t800\n"
1160 "CostFinalize\t\t1000\n"
1161 "InstallValidate\t\t1400\n"
1162 "InstallInitialize\t\t1500\n"
1163 "ProcessComponents\t\t1600\n"
1164 "RemoveFiles\t\t1700\n"
1165 "InstallFiles\t\t2000\n"
1166 "RemoveIniValues\t\t3000\n"
1167 "RegisterProduct\t\t5000\n"
1168 "PublishFeatures\t\t5100\n"
1169 "PublishProduct\t\t5200\n"
1170 "InstallFinalize\t\t6000\n";
1172 static const char res_file_dat
[] =
1173 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1174 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1176 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1178 static const char res_feature_dat
[] =
1179 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1180 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1181 "Feature\tFeature\n"
1182 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1184 static const char res_feature_comp_dat
[] =
1185 "Feature_\tComponent_\n"
1187 "FeatureComponents\tFeature_\tComponent_\n"
1190 static const char res_component_dat
[] =
1191 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1192 "s72\tS38\ts72\ti2\tS255\tS72\n"
1193 "Component\tComponent\n"
1194 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1196 static const char res_environment_dat
[] =
1197 "Environment\tName\tValue\tComponent_\n"
1198 "s72\tl255\tL255\ts72\n"
1199 "Environment\tEnvironment\n"
1200 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1201 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1202 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1203 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1204 "var5\t=MSITESTVAR5\t\tenvvar\n";
1206 static const char res_install_exec_seq_dat
[] =
1207 "Action\tCondition\tSequence\n"
1209 "InstallExecuteSequence\tAction\n"
1210 "LaunchConditions\t\t100\n"
1211 "CostInitialize\t\t800\n"
1213 "CostFinalize\t\t1000\n"
1214 "InstallValidate\t\t1400\n"
1215 "InstallInitialize\t\t1500\n"
1216 "ProcessComponents\t\t1600\n"
1217 "RemoveFiles\t\t1700\n"
1218 "InstallFiles\t\t2000\n"
1219 "RemoveEnvironmentStrings\t\t3000\n"
1220 "RegisterProduct\t\t5000\n"
1221 "PublishFeatures\t\t5100\n"
1222 "PublishProduct\t\t5200\n"
1223 "InstallFinalize\t\t6000\n";
1225 static const char rci_file_dat
[] =
1226 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1227 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1229 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1231 static const char rci_feature_dat
[] =
1232 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1233 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1234 "Feature\tFeature\n"
1235 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1237 static const char rci_feature_comp_dat
[] =
1238 "Feature_\tComponent_\n"
1240 "FeatureComponents\tFeature_\tComponent_\n"
1243 static const char rci_component_dat
[] =
1244 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1245 "s72\tS38\ts72\ti2\tS255\tS72\n"
1246 "Component\tComponent\n"
1247 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1249 static const char rci_appid_dat
[] =
1250 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1251 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1253 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1255 static const char rci_class_dat
[] =
1256 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1257 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1258 "Class\tCLSID\tContext\tComponent_\n"
1259 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1261 static const char rci_install_exec_seq_dat
[] =
1262 "Action\tCondition\tSequence\n"
1264 "InstallExecuteSequence\tAction\n"
1265 "LaunchConditions\t\t100\n"
1266 "CostInitialize\t\t800\n"
1268 "CostFinalize\t\t1000\n"
1269 "InstallValidate\t\t1400\n"
1270 "InstallInitialize\t\t1500\n"
1271 "ProcessComponents\t\t1600\n"
1272 "RemoveFiles\t\t1700\n"
1273 "InstallFiles\t\t2000\n"
1274 "UnregisterClassInfo\t\t3000\n"
1275 "RegisterClassInfo\t\t4000\n"
1276 "RegisterProduct\t\t5000\n"
1277 "PublishFeatures\t\t5100\n"
1278 "PublishProduct\t\t5200\n"
1279 "InstallFinalize\t\t6000\n";
1281 static const char rei_file_dat
[] =
1282 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1283 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1285 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1287 static const char rei_feature_dat
[] =
1288 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1289 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1290 "Feature\tFeature\n"
1291 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1293 static const char rei_feature_comp_dat
[] =
1294 "Feature_\tComponent_\n"
1296 "FeatureComponents\tFeature_\tComponent_\n"
1297 "extension\textension\n";
1299 static const char rei_component_dat
[] =
1300 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1301 "s72\tS38\ts72\ti2\tS255\tS72\n"
1302 "Component\tComponent\n"
1303 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1305 static const char rei_extension_dat
[] =
1306 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1307 "s255\ts72\tS255\tS64\ts38\n"
1308 "Extension\tExtension\tComponent_\n"
1309 "extension\textension\tProg.Id.1\t\textension\n";
1311 static const char rei_verb_dat
[] =
1312 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1313 "s255\ts32\tI2\tL255\tL255\n"
1314 "Verb\tExtension_\tVerb\n"
1315 "extension\tOpen\t1\t&Open\t/argument\n";
1317 static const char rei_progid_dat
[] =
1318 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1319 "s255\tS255\tS38\tL255\tS72\tI2\n"
1321 "Prog.Id.1\t\t\tdescription\t\t\n";
1323 static const char rei_install_exec_seq_dat
[] =
1324 "Action\tCondition\tSequence\n"
1326 "InstallExecuteSequence\tAction\n"
1327 "LaunchConditions\t\t100\n"
1328 "CostInitialize\t\t800\n"
1330 "CostFinalize\t\t1000\n"
1331 "InstallValidate\t\t1400\n"
1332 "InstallInitialize\t\t1500\n"
1333 "ProcessComponents\t\t1600\n"
1334 "RemoveFiles\t\t1700\n"
1335 "InstallFiles\t\t2000\n"
1336 "UnregisterExtensionInfo\t\t3000\n"
1337 "RegisterExtensionInfo\t\t4000\n"
1338 "RegisterProduct\t\t5000\n"
1339 "PublishFeatures\t\t5100\n"
1340 "PublishProduct\t\t5200\n"
1341 "InstallFinalize\t\t6000\n";
1343 static const char rpi_file_dat
[] =
1344 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1345 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1347 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1349 static const char rpi_feature_dat
[] =
1350 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1351 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1352 "Feature\tFeature\n"
1353 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1355 static const char rpi_feature_comp_dat
[] =
1356 "Feature_\tComponent_\n"
1358 "FeatureComponents\tFeature_\tComponent_\n"
1361 static const char rpi_component_dat
[] =
1362 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1363 "s72\tS38\ts72\ti2\tS255\tS72\n"
1364 "Component\tComponent\n"
1365 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1367 static const char rpi_appid_dat
[] =
1368 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1369 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1371 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1373 static const char rpi_class_dat
[] =
1374 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1375 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1376 "Class\tCLSID\tContext\tComponent_\n"
1377 "{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"
1378 "{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"
1379 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1381 static const char rpi_extension_dat
[] =
1382 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1383 "s255\ts72\tS255\tS64\ts38\n"
1384 "Extension\tExtension\tComponent_\n"
1385 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1387 static const char rpi_verb_dat
[] =
1388 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1389 "s255\ts32\tI2\tL255\tL255\n"
1390 "Verb\tExtension_\tVerb\n"
1391 "winetest\tOpen\t1\t&Open\t/argument\n";
1393 static const char rpi_progid_dat
[] =
1394 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1395 "s255\tS255\tS38\tL255\tS72\tI2\n"
1397 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1398 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1399 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1400 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1401 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1402 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1403 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1404 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1405 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1406 "Winetest.Extension\t\t\tdescription\t\t\n";
1408 static const char rpi_install_exec_seq_dat
[] =
1409 "Action\tCondition\tSequence\n"
1411 "InstallExecuteSequence\tAction\n"
1412 "LaunchConditions\t\t100\n"
1413 "CostInitialize\t\t800\n"
1415 "CostFinalize\t\t1000\n"
1416 "InstallValidate\t\t1400\n"
1417 "InstallInitialize\t\t1500\n"
1418 "ProcessComponents\t\t1600\n"
1419 "RemoveFiles\t\t1700\n"
1420 "UnregisterClassInfo\t\t3000\n"
1421 "UnregisterExtensionInfo\t\t3200\n"
1422 "UnregisterProgIdInfo\t\t3400\n"
1423 "InstallFiles\t\t3600\n"
1424 "RegisterClassInfo\t\t4000\n"
1425 "RegisterExtensionInfo\t\t4200\n"
1426 "RegisterProgIdInfo\t\t4400\n"
1427 "RegisterProduct\t\t5000\n"
1428 "PublishFeatures\t\t5100\n"
1429 "PublishProduct\t\t5200\n"
1430 "InstallFinalize\t\t6000\n";
1432 static const char rmi_file_dat
[] =
1433 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1434 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1436 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1438 static const char rmi_feature_dat
[] =
1439 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1440 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1441 "Feature\tFeature\n"
1442 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1444 static const char rmi_feature_comp_dat
[] =
1445 "Feature_\tComponent_\n"
1447 "FeatureComponents\tFeature_\tComponent_\n"
1450 static const char rmi_component_dat
[] =
1451 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1452 "s72\tS38\ts72\ti2\tS255\tS72\n"
1453 "Component\tComponent\n"
1454 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1456 static const char rmi_extension_dat
[] =
1457 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1458 "s255\ts72\tS255\tS64\ts38\n"
1459 "Extension\tExtension\tComponent_\n"
1460 "mime\tmime\t\tmime/type\tmime\n";
1462 static const char rmi_verb_dat
[] =
1463 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1464 "s255\ts32\tI2\tL255\tL255\n"
1465 "Verb\tExtension_\tVerb\n"
1466 "mime\tOpen\t1\t&Open\t/argument\n";
1468 static const char rmi_mime_dat
[] =
1469 "ContentType\tExtension_\tCLSID\n"
1471 "MIME\tContentType\n"
1472 "mime/type\tmime\t\n";
1474 static const char rmi_install_exec_seq_dat
[] =
1475 "Action\tCondition\tSequence\n"
1477 "InstallExecuteSequence\tAction\n"
1478 "LaunchConditions\t\t100\n"
1479 "CostInitialize\t\t800\n"
1481 "CostFinalize\t\t1000\n"
1482 "InstallValidate\t\t1400\n"
1483 "InstallInitialize\t\t1500\n"
1484 "ProcessComponents\t\t1600\n"
1485 "RemoveFiles\t\t1700\n"
1486 "InstallFiles\t\t2000\n"
1487 "UnregisterExtensionInfo\t\t3000\n"
1488 "UnregisterMIMEInfo\t\t3500\n"
1489 "RegisterExtensionInfo\t\t4000\n"
1490 "RegisterMIMEInfo\t\t4500\n"
1491 "RegisterProduct\t\t5000\n"
1492 "PublishFeatures\t\t5100\n"
1493 "PublishProduct\t\t5200\n"
1494 "InstallFinalize\t\t6000\n";
1496 static const char pa_file_dat
[] =
1497 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1498 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1500 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1501 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1502 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1503 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1504 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1505 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1506 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1507 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1509 static const char pa_feature_dat
[] =
1510 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1511 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1512 "Feature\tFeature\n"
1513 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1515 static const char pa_feature_comp_dat
[] =
1516 "Feature_\tComponent_\n"
1518 "FeatureComponents\tFeature_\tComponent_\n"
1520 "assembly\twin32_local\n"
1521 "assembly\tdotnet\n"
1522 "assembly\tdotnet_local\n";
1524 static const char pa_component_dat
[] =
1525 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1526 "s72\tS38\ts72\ti2\tS255\tS72\n"
1527 "Component\tComponent\n"
1528 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1529 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1530 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1531 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1533 static const char pa_msi_assembly_dat
[] =
1534 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1535 "s72\ts38\tS72\tS72\tI2\n"
1536 "MsiAssembly\tComponent_\n"
1537 "win32\tassembly\tmanifest.txt\t\t1\n"
1538 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1539 "dotnet\tassembly\t\t\t0\n"
1540 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1542 static const char pa_msi_assembly_name_dat
[] =
1543 "Component_\tName\tValue\n"
1545 "MsiAssemblyName\tComponent_\tName\n"
1546 "win32\tName\tWine.Win32.Assembly\n"
1547 "win32\tprocessorArchitecture\tx86\n"
1548 "win32\tpublicKeyToken\tabcdef0123456789\n"
1549 "win32\ttype\twin32\n"
1550 "win32\tversion\t1.0.0.0\n"
1551 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1552 "win32_local\tprocessorArchitecture\tx86\n"
1553 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1554 "win32_local\ttype\twin32\n"
1555 "win32_local\tversion\t1.0.0.0\n"
1556 "dotnet\tName\tWine.Dotnet.Assembly\n"
1557 "dotnet\tprocessorArchitecture\tMSIL\n"
1558 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1559 "dotnet\tculture\tneutral\n"
1560 "dotnet\tversion\t1.0.0.0\n"
1561 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1562 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1563 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1564 "dotnet_local\tculture\tneutral\n"
1565 "dotnet_local\tversion\t1.0.0.0\n";
1567 static const char pa_install_exec_seq_dat
[] =
1568 "Action\tCondition\tSequence\n"
1570 "InstallExecuteSequence\tAction\n"
1571 "LaunchConditions\t\t100\n"
1572 "CostInitialize\t\t800\n"
1574 "CostFinalize\t\t1000\n"
1575 "InstallValidate\t\t1400\n"
1576 "InstallInitialize\t\t1500\n"
1577 "ProcessComponents\t\t1600\n"
1578 "MsiPublishAssemblies\t\t3000\n"
1579 "MsiUnpublishAssemblies\t\t4000\n"
1580 "RegisterProduct\t\t5000\n"
1581 "PublishFeatures\t\t5100\n"
1582 "PublishProduct\t\t5200\n"
1583 "InstallFinalize\t\t6000\n";
1585 static const char rep_file_dat
[] =
1586 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1587 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1589 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1591 static const char rep_feature_dat
[] =
1592 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1593 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1594 "Feature\tFeature\n"
1595 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1597 static const char rep_feature_comp_dat
[] =
1598 "Feature_\tComponent_\n"
1600 "FeatureComponents\tFeature_\tComponent_\n"
1603 static const char rep_component_dat
[] =
1604 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1605 "s72\tS38\ts72\ti2\tS255\tS72\n"
1606 "Component\tComponent\n"
1607 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1609 static const char rep_upgrade_dat
[] =
1610 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1611 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1612 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1613 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1615 static const char rep_property_dat
[] =
1618 "Property\tProperty\n"
1621 "InstallMode\tTypical\n"
1622 "Manufacturer\tWine\n"
1623 "PIDTemplate\t###-#######\n"
1624 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1625 "ProductLanguage\t1033\n"
1626 "ProductName\tMSITEST\n"
1627 "ProductVersion\t1.1.1\n"
1628 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1629 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1630 "MSIFASTINSTALL\t1\n";
1632 static const char rep_install_exec_seq_dat
[] =
1633 "Action\tCondition\tSequence\n"
1635 "InstallExecuteSequence\tAction\n"
1636 "FindRelatedProducts\t\t100\n"
1637 "CostInitialize\t\t800\n"
1639 "CostFinalize\t\t1000\n"
1640 "InstallValidate\t\t1400\n"
1641 "RemoveExistingProducts\t\t1499\n"
1642 "InstallInitialize\t\t1500\n"
1643 "ProcessComponents\t\t1600\n"
1644 "RemoveFiles\t\t1700\n"
1645 "InstallFiles\t\t2000\n"
1646 "UnregisterExtensionInfo\t\t3000\n"
1647 "UnregisterMIMEInfo\t\t3500\n"
1648 "RegisterExtensionInfo\t\t4000\n"
1649 "RegisterMIMEInfo\t\t4500\n"
1650 "RegisterProduct\t\t5000\n"
1651 "PublishFeatures\t\t5100\n"
1652 "PublishProduct\t\t5200\n"
1653 "InstallFinalize\t\t6000\n";
1655 typedef struct _msi_table
1657 const char *filename
;
1662 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1664 static const msi_table env_tables
[] =
1666 ADD_TABLE(component
),
1667 ADD_TABLE(directory
),
1669 ADD_TABLE(feature_comp
),
1671 ADD_TABLE(install_exec_seq
),
1673 ADD_TABLE(property
),
1674 ADD_TABLE(environment
)
1677 static const msi_table pp_tables
[] =
1679 ADD_TABLE(pp_component
),
1680 ADD_TABLE(directory
),
1681 ADD_TABLE(rof_feature
),
1682 ADD_TABLE(rof_feature_comp
),
1683 ADD_TABLE(rof_file
),
1684 ADD_TABLE(pp_install_exec_seq
),
1685 ADD_TABLE(rof_media
),
1686 ADD_TABLE(property
),
1689 static const msi_table ppc_tables
[] =
1691 ADD_TABLE(ppc_component
),
1692 ADD_TABLE(directory
),
1693 ADD_TABLE(rof_feature
),
1694 ADD_TABLE(ppc_feature_comp
),
1695 ADD_TABLE(ppc_file
),
1696 ADD_TABLE(pp_install_exec_seq
),
1697 ADD_TABLE(ppc_media
),
1698 ADD_TABLE(property
),
1701 static const msi_table rem_tables
[] =
1703 ADD_TABLE(rem_component
),
1704 ADD_TABLE(directory
),
1705 ADD_TABLE(rof_feature
),
1706 ADD_TABLE(rem_feature_comp
),
1707 ADD_TABLE(rem_file
),
1708 ADD_TABLE(rem_install_exec_seq
),
1709 ADD_TABLE(rof_media
),
1710 ADD_TABLE(property
),
1711 ADD_TABLE(rem_remove_files
),
1714 static const msi_table mov_tables
[] =
1716 ADD_TABLE(cwd_component
),
1717 ADD_TABLE(directory
),
1718 ADD_TABLE(rof_feature
),
1719 ADD_TABLE(ci2_feature_comp
),
1720 ADD_TABLE(ci2_file
),
1721 ADD_TABLE(install_exec_seq
),
1722 ADD_TABLE(rof_media
),
1723 ADD_TABLE(property
),
1724 ADD_TABLE(mov_move_file
),
1727 static const msi_table df_tables
[] =
1729 ADD_TABLE(rof_component
),
1730 ADD_TABLE(df_directory
),
1731 ADD_TABLE(rof_feature
),
1732 ADD_TABLE(rof_feature_comp
),
1733 ADD_TABLE(rof_file
),
1734 ADD_TABLE(install_exec_seq
),
1735 ADD_TABLE(rof_media
),
1736 ADD_TABLE(property
),
1737 ADD_TABLE(df_duplicate_file
),
1740 static const msi_table wrv_tables
[] =
1742 ADD_TABLE(wrv_component
),
1743 ADD_TABLE(directory
),
1744 ADD_TABLE(rof_feature
),
1745 ADD_TABLE(ci2_feature_comp
),
1746 ADD_TABLE(ci2_file
),
1747 ADD_TABLE(install_exec_seq
),
1748 ADD_TABLE(rof_media
),
1749 ADD_TABLE(property
),
1750 ADD_TABLE(wrv_registry
),
1753 static const msi_table cf_tables
[] =
1755 ADD_TABLE(cf_component
),
1756 ADD_TABLE(cf_directory
),
1757 ADD_TABLE(cf_feature
),
1758 ADD_TABLE(cf_feature_comp
),
1760 ADD_TABLE(cf_create_folders
),
1761 ADD_TABLE(cf_install_exec_seq
),
1766 static const msi_table sss_tables
[] =
1768 ADD_TABLE(component
),
1769 ADD_TABLE(directory
),
1771 ADD_TABLE(feature_comp
),
1773 ADD_TABLE(sss_install_exec_seq
),
1774 ADD_TABLE(sss_service_control
),
1779 static const msi_table sds_tables
[] =
1781 ADD_TABLE(component
),
1782 ADD_TABLE(directory
),
1784 ADD_TABLE(feature_comp
),
1786 ADD_TABLE(sds_install_exec_seq
),
1787 ADD_TABLE(service_control
),
1788 ADD_TABLE(service_install
),
1793 static const msi_table sis_tables
[] =
1795 ADD_TABLE(component
),
1796 ADD_TABLE(directory
),
1798 ADD_TABLE(feature_comp
),
1800 ADD_TABLE(sds_install_exec_seq
),
1801 ADD_TABLE(service_install2
),
1806 static const msi_table sr_tables
[] =
1808 ADD_TABLE(component
),
1809 ADD_TABLE(directory
),
1811 ADD_TABLE(feature_comp
),
1813 ADD_TABLE(sr_selfreg
),
1814 ADD_TABLE(sr_install_exec_seq
),
1819 static const msi_table font_tables
[] =
1821 ADD_TABLE(font_component
),
1822 ADD_TABLE(directory
),
1823 ADD_TABLE(font_feature
),
1824 ADD_TABLE(font_feature_comp
),
1825 ADD_TABLE(font_file
),
1827 ADD_TABLE(font_install_exec_seq
),
1828 ADD_TABLE(font_media
),
1832 static const msi_table vp_tables
[] =
1834 ADD_TABLE(component
),
1835 ADD_TABLE(directory
),
1837 ADD_TABLE(feature_comp
),
1839 ADD_TABLE(vp_custom_action
),
1840 ADD_TABLE(vp_install_exec_seq
),
1842 ADD_TABLE(vp_property
)
1845 static const msi_table odbc_tables
[] =
1847 ADD_TABLE(odbc_component
),
1848 ADD_TABLE(directory
),
1849 ADD_TABLE(odbc_feature
),
1850 ADD_TABLE(odbc_feature_comp
),
1851 ADD_TABLE(odbc_file
),
1852 ADD_TABLE(odbc_driver
),
1853 ADD_TABLE(odbc_translator
),
1854 ADD_TABLE(odbc_datasource
),
1855 ADD_TABLE(odbc_install_exec_seq
),
1856 ADD_TABLE(odbc_media
),
1860 static const msi_table tl_tables
[] =
1862 ADD_TABLE(tl_component
),
1863 ADD_TABLE(directory
),
1864 ADD_TABLE(tl_feature
),
1865 ADD_TABLE(tl_feature_comp
),
1867 ADD_TABLE(tl_typelib
),
1868 ADD_TABLE(tl_install_exec_seq
),
1873 static const msi_table crs_tables
[] =
1875 ADD_TABLE(crs_component
),
1876 ADD_TABLE(directory
),
1877 ADD_TABLE(crs_feature
),
1878 ADD_TABLE(crs_feature_comp
),
1879 ADD_TABLE(crs_file
),
1880 ADD_TABLE(crs_shortcut
),
1881 ADD_TABLE(crs_install_exec_seq
),
1886 static const msi_table pub_tables
[] =
1888 ADD_TABLE(directory
),
1889 ADD_TABLE(pub_component
),
1890 ADD_TABLE(pub_feature
),
1891 ADD_TABLE(pub_feature_comp
),
1892 ADD_TABLE(pub_file
),
1893 ADD_TABLE(pub_publish_component
),
1894 ADD_TABLE(pub_install_exec_seq
),
1899 static const msi_table rd_tables
[] =
1901 ADD_TABLE(directory
),
1902 ADD_TABLE(rd_component
),
1903 ADD_TABLE(rd_feature
),
1904 ADD_TABLE(rd_feature_comp
),
1906 ADD_TABLE(rd_duplicate_file
),
1907 ADD_TABLE(rd_install_exec_seq
),
1912 static const msi_table rrv_tables
[] =
1914 ADD_TABLE(directory
),
1915 ADD_TABLE(rrv_component
),
1916 ADD_TABLE(rrv_feature
),
1917 ADD_TABLE(rrv_feature_comp
),
1918 ADD_TABLE(rrv_file
),
1919 ADD_TABLE(rrv_registry
),
1920 ADD_TABLE(rrv_remove_registry
),
1921 ADD_TABLE(rrv_install_exec_seq
),
1926 static const msi_table frp_tables
[] =
1928 ADD_TABLE(directory
),
1929 ADD_TABLE(frp_component
),
1930 ADD_TABLE(frp_feature
),
1931 ADD_TABLE(frp_feature_comp
),
1932 ADD_TABLE(frp_file
),
1933 ADD_TABLE(frp_upgrade
),
1934 ADD_TABLE(frp_custom_action
),
1935 ADD_TABLE(frp_install_exec_seq
),
1940 static const msi_table riv_tables
[] =
1942 ADD_TABLE(directory
),
1943 ADD_TABLE(riv_component
),
1944 ADD_TABLE(riv_feature
),
1945 ADD_TABLE(riv_feature_comp
),
1946 ADD_TABLE(riv_file
),
1947 ADD_TABLE(riv_ini_file
),
1948 ADD_TABLE(riv_remove_ini_file
),
1949 ADD_TABLE(riv_install_exec_seq
),
1954 static const msi_table res_tables
[] =
1956 ADD_TABLE(directory
),
1957 ADD_TABLE(res_component
),
1958 ADD_TABLE(res_feature
),
1959 ADD_TABLE(res_feature_comp
),
1960 ADD_TABLE(res_file
),
1961 ADD_TABLE(res_environment
),
1962 ADD_TABLE(res_install_exec_seq
),
1967 static const msi_table rci_tables
[] =
1969 ADD_TABLE(directory
),
1970 ADD_TABLE(rci_component
),
1971 ADD_TABLE(rci_feature
),
1972 ADD_TABLE(rci_feature_comp
),
1973 ADD_TABLE(rci_file
),
1974 ADD_TABLE(rci_appid
),
1975 ADD_TABLE(rci_class
),
1976 ADD_TABLE(rci_install_exec_seq
),
1981 static const msi_table rei_tables
[] =
1983 ADD_TABLE(directory
),
1984 ADD_TABLE(rei_component
),
1985 ADD_TABLE(rei_feature
),
1986 ADD_TABLE(rei_feature_comp
),
1987 ADD_TABLE(rei_file
),
1988 ADD_TABLE(rei_extension
),
1989 ADD_TABLE(rei_verb
),
1990 ADD_TABLE(rei_progid
),
1991 ADD_TABLE(rei_install_exec_seq
),
1996 static const msi_table rpi_tables
[] =
1998 ADD_TABLE(directory
),
1999 ADD_TABLE(rpi_component
),
2000 ADD_TABLE(rpi_feature
),
2001 ADD_TABLE(rpi_feature_comp
),
2002 ADD_TABLE(rpi_file
),
2003 ADD_TABLE(rpi_appid
),
2004 ADD_TABLE(rpi_class
),
2005 ADD_TABLE(rpi_extension
),
2006 ADD_TABLE(rpi_verb
),
2007 ADD_TABLE(rpi_progid
),
2008 ADD_TABLE(rpi_install_exec_seq
),
2013 static const msi_table rmi_tables
[] =
2015 ADD_TABLE(directory
),
2016 ADD_TABLE(rmi_component
),
2017 ADD_TABLE(rmi_feature
),
2018 ADD_TABLE(rmi_feature_comp
),
2019 ADD_TABLE(rmi_file
),
2020 ADD_TABLE(rmi_extension
),
2021 ADD_TABLE(rmi_verb
),
2022 ADD_TABLE(rmi_mime
),
2023 ADD_TABLE(rmi_install_exec_seq
),
2028 static const msi_table pa_tables
[] =
2030 ADD_TABLE(directory
),
2031 ADD_TABLE(pa_component
),
2032 ADD_TABLE(pa_feature
),
2033 ADD_TABLE(pa_feature_comp
),
2035 ADD_TABLE(pa_msi_assembly
),
2036 ADD_TABLE(pa_msi_assembly_name
),
2037 ADD_TABLE(pa_install_exec_seq
),
2042 static const msi_table rep_tables
[] =
2044 ADD_TABLE(directory
),
2045 ADD_TABLE(rep_component
),
2046 ADD_TABLE(rep_feature
),
2047 ADD_TABLE(rep_feature_comp
),
2048 ADD_TABLE(rep_file
),
2049 ADD_TABLE(rep_upgrade
),
2050 ADD_TABLE(rep_property
),
2051 ADD_TABLE(rep_install_exec_seq
),
2055 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2056 static LSTATUS
action_RegDeleteTreeA(HKEY hKey
, LPCSTR lpszSubKey
, REGSAM access
)
2059 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
2060 DWORD dwMaxLen
, dwSize
;
2061 char szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
2062 HKEY hSubKey
= hKey
;
2066 ret
= RegOpenKeyExA(hKey
, lpszSubKey
, 0, access
, &hSubKey
);
2067 if (ret
) return ret
;
2070 ret
= RegQueryInfoKeyA(hSubKey
, NULL
, NULL
, NULL
, NULL
,
2071 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
2072 if (ret
) goto cleanup
;
2076 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
2077 if (dwMaxLen
> sizeof(szNameBuf
))
2079 /* Name too big: alloc a buffer for it */
2080 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
)))
2082 ret
= ERROR_NOT_ENOUGH_MEMORY
;
2087 /* Recursively delete all the subkeys */
2091 if (RegEnumKeyExA(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
2092 NULL
, NULL
, NULL
)) break;
2094 ret
= action_RegDeleteTreeA(hSubKey
, lpszName
, access
);
2095 if (ret
) goto cleanup
;
2100 if (pRegDeleteKeyExA
)
2101 ret
= pRegDeleteKeyExA(hKey
, lpszSubKey
, access
, 0);
2103 ret
= RegDeleteKeyA(hKey
, lpszSubKey
);
2109 if (RegEnumValueA(hKey
, 0, lpszName
, &dwSize
,
2110 NULL
, NULL
, NULL
, NULL
)) break;
2112 ret
= RegDeleteValueA(hKey
, lpszName
);
2113 if (ret
) goto cleanup
;
2117 if (lpszName
!= szNameBuf
)
2118 HeapFree(GetProcessHeap(), 0, lpszName
);
2120 RegCloseKey(hSubKey
);
2124 /* cabinet definitions */
2126 /* make the max size large so there is only one cab file */
2127 #define MEDIA_SIZE 0x7FFFFFFF
2128 #define FOLDER_THRESHOLD 900000
2130 /* the FCI callbacks */
2132 static void * CDECL
mem_alloc(ULONG cb
)
2134 return HeapAlloc(GetProcessHeap(), 0, cb
);
2137 static void CDECL
mem_free(void *memory
)
2139 HeapFree(GetProcessHeap(), 0, memory
);
2142 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
2144 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
2148 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
2153 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
2154 BOOL fContinuation
, void *pv
)
2159 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
2163 DWORD dwShareMode
= 0;
2164 DWORD dwCreateDisposition
= OPEN_EXISTING
;
2166 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
2167 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
;
2169 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
2170 dwCreateDisposition
= OPEN_EXISTING
;
2172 dwCreateDisposition
= CREATE_NEW
;
2174 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
2175 dwCreateDisposition
, 0, NULL
);
2177 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
2179 return (INT_PTR
)handle
;
2182 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2184 HANDLE handle
= (HANDLE
)hf
;
2188 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
2189 ok(res
, "Failed to ReadFile\n");
2194 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2196 HANDLE handle
= (HANDLE
)hf
;
2200 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
2201 ok(res
, "Failed to WriteFile\n");
2206 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
2208 HANDLE handle
= (HANDLE
)hf
;
2209 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
2214 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
2216 HANDLE handle
= (HANDLE
)hf
;
2219 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
2220 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
2225 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
2227 BOOL ret
= DeleteFileA(pszFile
);
2228 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
2233 static void init_functionpointers(void)
2235 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2236 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2237 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2239 #define GET_PROC(mod, func) \
2240 p ## func = (void*)GetProcAddress(mod, #func); \
2242 trace("GetProcAddress(%s) failed\n", #func);
2244 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2245 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2246 GET_PROC(hmsi
, MsiSourceListGetInfoA
);
2247 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2248 GET_PROC(hmsi
, MsiQueryFeatureStateExA
);
2250 GET_PROC(hadvapi32
, CheckTokenMembership
);
2251 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
2252 GET_PROC(hadvapi32
, OpenProcessToken
);
2253 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2254 GET_PROC(hkernel32
, IsWow64Process
)
2256 hsrclient
= LoadLibraryA("srclient.dll");
2257 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2258 GET_PROC(hsrclient
, SRSetRestorePointA
);
2263 static BOOL
is_process_limited(void)
2265 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2270 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2272 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2273 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0, &Group
) ||
2274 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2276 trace("Could not check if the current user is an administrator\n");
2284 /* Only administrators have enough privileges for these tests */
2288 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2291 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2294 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2296 return (ret
&& type
== TokenElevationTypeLimited
);
2301 static char *get_user_sid(void)
2306 char *usersid
= NULL
;
2308 if (!pConvertSidToStringSidA
)
2310 win_skip("ConvertSidToStringSidA is not available\n");
2313 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
2314 GetTokenInformation(token
, TokenUser
, NULL
, size
, &size
);
2316 user
= HeapAlloc(GetProcessHeap(), 0, size
);
2317 GetTokenInformation(token
, TokenUser
, user
, size
, &size
);
2318 pConvertSidToStringSidA(user
->User
.Sid
, &usersid
);
2319 HeapFree(GetProcessHeap(), 0, user
);
2325 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2329 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2330 GetTempFileNameA(".", "xx", 0, tempname
);
2332 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2334 lstrcpyA(pszTempName
, tempname
);
2335 HeapFree(GetProcessHeap(), 0, tempname
);
2339 HeapFree(GetProcessHeap(), 0, tempname
);
2344 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2345 USHORT
*pattribs
, int *err
, void *pv
)
2347 BY_HANDLE_FILE_INFORMATION finfo
;
2353 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2354 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2356 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2358 res
= GetFileInformationByHandle(handle
, &finfo
);
2359 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2361 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2362 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2364 attrs
= GetFileAttributesA(pszName
);
2365 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2367 return (INT_PTR
)handle
;
2370 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2372 char path
[MAX_PATH
];
2373 char filename
[MAX_PATH
];
2375 lstrcpyA(path
, CURR_DIR
);
2376 lstrcatA(path
, "\\");
2377 lstrcatA(path
, file
);
2379 lstrcpyA(filename
, file
);
2381 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2382 progress
, get_open_info
, compress
);
2385 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2387 ZeroMemory(pCabParams
, sizeof(CCAB
));
2389 pCabParams
->cb
= max_size
;
2390 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2391 pCabParams
->setID
= 0xbeef;
2392 pCabParams
->iCab
= 1;
2393 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2394 lstrcatA(pCabParams
->szCabPath
, "\\");
2395 lstrcpyA(pCabParams
->szCab
, name
);
2398 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2406 set_cab_parameters(&cabParams
, name
, max_size
);
2408 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2409 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2410 get_temp_file
, &cabParams
, NULL
);
2412 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2417 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2418 ok(res
, "Failed to add file: %s\n", ptr
);
2419 ptr
+= lstrlenA(ptr
) + 1;
2422 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2423 ok(res
, "Failed to flush the cabinet\n");
2425 res
= FCIDestroy(hfci
);
2426 ok(res
, "Failed to destroy the cabinet\n");
2429 static BOOL
get_user_dirs(void)
2434 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2435 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2439 if (RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
))
2449 static BOOL
get_system_dirs(void)
2454 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
,
2455 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2459 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2460 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
))
2467 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2468 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
))
2476 if (!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2482 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2487 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2488 if (file
== INVALID_HANDLE_VALUE
)
2491 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2495 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2502 #define create_file(name, size) create_file_data(name, name, size)
2504 static void create_test_files(void)
2506 CreateDirectoryA("msitest", NULL
);
2507 create_file("msitest\\one.txt", 100);
2508 CreateDirectoryA("msitest\\first", NULL
);
2509 create_file("msitest\\first\\two.txt", 100);
2510 CreateDirectoryA("msitest\\second", NULL
);
2511 create_file("msitest\\second\\three.txt", 100);
2513 create_file("four.txt", 100);
2514 create_file("five.txt", 100);
2515 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2517 create_file("msitest\\filename", 100);
2518 create_file("msitest\\service.exe", 100);
2519 create_file("msitest\\service2.exe", 100);
2521 DeleteFileA("four.txt");
2522 DeleteFileA("five.txt");
2525 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2527 CHAR path
[MAX_PATH
];
2529 lstrcpyA(path
, PROG_FILES_DIR
);
2530 lstrcatA(path
, "\\");
2531 lstrcatA(path
, rel_path
);
2534 return DeleteFileA(path
);
2536 return RemoveDirectoryA(path
);
2539 static void delete_test_files(void)
2541 DeleteFileA("msitest.msi");
2542 DeleteFileA("msitest.cab");
2543 DeleteFileA("msitest\\second\\three.txt");
2544 DeleteFileA("msitest\\first\\two.txt");
2545 DeleteFileA("msitest\\one.txt");
2546 DeleteFileA("msitest\\service.exe");
2547 DeleteFileA("msitest\\service2.exe");
2548 DeleteFileA("msitest\\filename");
2549 RemoveDirectoryA("msitest\\second");
2550 RemoveDirectoryA("msitest\\first");
2551 RemoveDirectoryA("msitest");
2554 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2557 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2558 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2562 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
, const char *template)
2567 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2568 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2570 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2571 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2573 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
2574 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2575 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2577 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2580 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2581 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2583 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2584 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2586 /* write the summary changes back to the stream */
2587 r
= MsiSummaryInfoPersist(summary
);
2588 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2590 MsiCloseHandle(summary
);
2593 #define create_database(name, tables, num_tables) \
2594 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2596 #define create_database_template(name, tables, num_tables, version, template) \
2597 create_database_wordcount(name, tables, num_tables, version, 0, template);
2599 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2600 int num_tables
, INT version
, INT wordcount
,
2601 const char *template)
2608 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2609 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2610 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2612 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2613 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2615 /* import the tables into the database */
2616 for (j
= 0; j
< num_tables
; j
++)
2618 const msi_table
*table
= &tables
[j
];
2620 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2622 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2623 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2625 DeleteFileA(table
->filename
);
2628 write_msi_summary_info(db
, version
, wordcount
, template);
2630 r
= MsiDatabaseCommit(db
);
2631 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2634 HeapFree( GetProcessHeap(), 0, nameW
);
2637 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2639 RESTOREPOINTINFOA spec
;
2641 spec
.dwEventType
= event_type
;
2642 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2643 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2644 lstrcpyA(spec
.szDescription
, "msitest restore point");
2646 return pSRSetRestorePointA(&spec
, status
);
2649 static void remove_restore_point(DWORD seq_number
)
2653 res
= pSRRemoveRestorePoint(seq_number
);
2654 if (res
!= ERROR_SUCCESS
)
2655 trace("Failed to remove the restore point : %08x\n", res
);
2658 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2660 if (pRegDeleteKeyExA
)
2661 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2662 return RegDeleteKeyA( key
, subkey
);
2665 static BOOL
file_exists(LPCSTR file
)
2667 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
2670 static BOOL
pf_exists(LPCSTR file
)
2672 CHAR path
[MAX_PATH
];
2674 lstrcpyA(path
, PROG_FILES_DIR
);
2675 lstrcatA(path
, "\\");
2676 lstrcatA(path
, file
);
2678 return file_exists(path
);
2681 static void delete_pfmsitest_files(void)
2683 SHFILEOPSTRUCTA shfl
;
2684 CHAR path
[MAX_PATH
+11];
2686 lstrcpyA(path
, PROG_FILES_DIR
);
2687 lstrcatA(path
, "\\msitest\\*");
2688 path
[strlen(path
) + 1] = '\0';
2691 shfl
.wFunc
= FO_DELETE
;
2694 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
2696 SHFileOperationA(&shfl
);
2698 lstrcpyA(path
, PROG_FILES_DIR
);
2699 lstrcatA(path
, "\\msitest");
2700 RemoveDirectoryA(path
);
2703 static void check_reg_str(HKEY prodkey
, LPCSTR name
, LPCSTR expected
, BOOL bcase
, DWORD line
)
2711 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)val
, &size
);
2713 if (res
!= ERROR_SUCCESS
||
2714 (type
!= REG_SZ
&& type
!= REG_EXPAND_SZ
&& type
!= REG_MULTI_SZ
))
2716 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2721 ok_(__FILE__
, line
)(!val
[0], "Expected empty string, got %s\n", val
);
2725 ok_(__FILE__
, line
)(!lstrcmpA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2727 ok_(__FILE__
, line
)(!lstrcmpiA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2731 static void check_reg_dword(HKEY prodkey
, LPCSTR name
, DWORD expected
, DWORD line
)
2733 DWORD val
, size
, type
;
2736 size
= sizeof(DWORD
);
2737 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2739 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2741 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2745 ok_(__FILE__
, line
)(val
== expected
, "Expected %d, got %d\n", expected
, val
);
2748 static void check_reg_dword4(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2749 DWORD expected4
, DWORD line
)
2751 DWORD val
, size
, type
;
2754 size
= sizeof(DWORD
);
2755 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2757 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2759 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2763 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
,
2764 "Expected %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, val
);
2767 static void check_reg_dword5(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2768 DWORD expected4
, DWORD expected5
, DWORD line
)
2770 DWORD val
, size
, type
;
2773 size
= sizeof(DWORD
);
2774 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2776 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2778 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2782 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
||
2784 "Expected %d, %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, expected5
, val
);
2787 #define CHECK_REG_STR(prodkey, name, expected) \
2788 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2790 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2792 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2793 RegDeleteValueA(prodkey, name); \
2796 #define CHECK_REG_ISTR(prodkey, name, expected) \
2797 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2799 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2801 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2802 RegDeleteValueA(prodkey, name); \
2805 #define CHECK_REG_DWORD(prodkey, name, expected) \
2806 check_reg_dword(prodkey, name, expected, __LINE__);
2808 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2810 check_reg_dword(prodkey, name, expected, __LINE__); \
2811 RegDeleteValueA(prodkey, name); \
2814 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
2815 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
2817 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
2819 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
2820 RegDeleteValueA(prodkey, name); \
2823 #define CHECK_REG_DWORD4(prodkey, name, expected1, expected2, expected3, expected4) \
2824 check_reg_dword4(prodkey, name, expected1, expected2, expected3, expected4, __LINE__);
2826 #define CHECK_DEL_REG_DWORD5(prodkey, name, expected1, expected2, expected3, expected4 ,expected5) \
2828 check_reg_dword5(prodkey, name, expected1, expected2, expected3, expected4, expected5, __LINE__); \
2829 RegDeleteValueA(prodkey, name); \
2832 static void get_date_str(LPSTR date
)
2836 static const char date_fmt
[] = "%d%02d%02d";
2837 GetLocalTime(&systime
);
2838 sprintf(date
, date_fmt
, systime
.wYear
, systime
.wMonth
, systime
.wDay
);
2841 static void test_register_product(void)
2845 HKEY hkey
, props
, usage
;
2847 char date
[MAX_PATH
], temp
[MAX_PATH
], keypath
[MAX_PATH
], path
[MAX_PATH
];
2849 REGSAM access
= KEY_ALL_ACCESS
;
2851 static const CHAR uninstall
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2852 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2853 static const CHAR uninstall_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2854 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2855 static const CHAR userdata
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2856 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2857 static const CHAR ugkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2858 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2859 static const CHAR userugkey
[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2860 "\\51AAE0C44620A5E4788506E91F249BD2";
2862 if (is_process_limited())
2864 skip("process is limited\n");
2868 if (!(usersid
= get_user_sid()))
2872 GetTempPathA(MAX_PATH
, temp
);
2874 CreateDirectoryA("msitest", NULL
);
2875 create_file("msitest\\maximus", 500);
2877 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
2880 access
|= KEY_WOW64_64KEY
;
2882 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
2884 /* RegisterProduct */
2885 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
2886 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2888 skip("Not enough rights to perform tests\n");
2891 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2892 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2893 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2895 res
= RegOpenKeyA(HKEY_CURRENT_USER
, userugkey
, &hkey
);
2896 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2900 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
2901 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2905 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
2906 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2909 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
2910 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
2911 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
2912 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
2913 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2914 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
2915 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2916 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
2917 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
2918 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
2919 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
2920 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
2921 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
2922 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
2923 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
2924 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
2925 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
2926 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
2927 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
2928 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
2929 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
2930 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
2933 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
2936 delete_key(hkey
, "", access
);
2939 sprintf(keypath
, userdata
, usersid
);
2940 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
2941 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2943 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
2944 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2946 size
= sizeof(path
);
2947 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
2949 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
2951 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
2952 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
2953 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
2954 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
2955 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2956 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
2957 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2958 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
2959 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
2960 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
2961 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
2962 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
2963 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
2964 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
2965 CHECK_DEL_REG_STR(props
, "Size", NULL
);
2966 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
2967 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
2968 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
2969 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
2970 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
2971 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
2972 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
2975 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
2978 delete_key(props
, "", access
);
2981 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
2984 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2987 delete_key(usage
, "", access
);
2989 delete_key(hkey
, "", access
);
2992 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
2993 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2995 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
2997 delete_key(hkey
, "", access
);
3000 /* RegisterProduct, machine */
3001 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 ALLUSERS=1");
3002 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3003 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3004 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3006 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, userugkey
, 0, access
, &hkey
);
3007 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3011 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
3012 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3016 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
3017 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3020 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
3021 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
3022 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
3023 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
3024 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3025 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
3026 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3027 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
3028 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
3029 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
3030 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
3031 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
3032 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
3033 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
3034 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
3035 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
3036 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
3037 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3038 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3039 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
3040 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
3041 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
3044 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
3047 delete_key(hkey
, "", access
);
3050 sprintf(keypath
, userdata
, "S-1-5-18");
3051 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3052 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3054 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3055 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3057 size
= sizeof(path
);
3058 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
3060 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
3062 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
3063 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
3064 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
3065 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
3066 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3067 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
3068 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3069 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
3070 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
3071 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
3072 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
3073 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
3074 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
3075 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
3076 CHECK_DEL_REG_STR(props
, "Size", NULL
);
3077 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
3078 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
3079 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
3080 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
3081 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
3082 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
3083 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
3086 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
3089 delete_key(props
, "", access
);
3092 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
3095 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3098 delete_key(usage
, "", access
);
3100 delete_key(hkey
, "", access
);
3103 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
3104 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3106 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3108 delete_key(hkey
, "", access
);
3112 DeleteFileA(msifile
);
3113 DeleteFileA("msitest\\maximus");
3114 RemoveDirectoryA("msitest");
3115 HeapFree(GetProcessHeap(), 0, usersid
);
3118 static void test_publish_product(void)
3120 static const char prodpath
[] =
3121 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3122 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3123 static const char cuprodpath
[] =
3124 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3125 static const char cuupgrades
[] =
3126 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3127 static const char badprod
[] =
3128 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
3129 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3130 static const char machprod
[] =
3131 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3132 static const char machup
[] =
3133 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3137 HKEY sourcelist
, net
, props
;
3138 HKEY hkey
, patches
, media
;
3139 CHAR keypath
[MAX_PATH
];
3140 CHAR temp
[MAX_PATH
];
3141 CHAR path
[MAX_PATH
];
3142 BOOL old_installer
= FALSE
;
3143 REGSAM access
= KEY_ALL_ACCESS
;
3145 if (is_process_limited())
3147 skip("process is limited\n");
3151 if (!(usersid
= get_user_sid()))
3154 GetTempPathA(MAX_PATH
, temp
);
3156 CreateDirectoryA("msitest", NULL
);
3157 create_file("msitest\\maximus", 500);
3159 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3162 access
|= KEY_WOW64_64KEY
;
3164 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3166 /* PublishProduct, current user */
3167 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
3168 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3170 skip("Not enough rights to perform tests\n");
3173 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3174 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3175 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3177 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3178 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3180 sprintf(keypath
, prodpath
, usersid
);
3181 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3182 if (res
== ERROR_FILE_NOT_FOUND
)
3184 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3185 if (res
== ERROR_SUCCESS
)
3187 win_skip("Windows Installer < 3.0 detected\n");
3189 old_installer
= TRUE
;
3194 win_skip("Install failed, no need to continue\n");
3198 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3200 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3201 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3203 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3206 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3207 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3210 delete_key(patches
, "", access
);
3211 RegCloseKey(patches
);
3212 delete_key(hkey
, "", access
);
3216 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3217 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3219 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3220 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3221 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3222 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3224 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3225 CHECK_DEL_REG_DWORD(hkey
, "Assignment", 0);
3226 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3227 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3228 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3230 res
= RegOpenKeyA(hkey
, "SourceList", &sourcelist
);
3231 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3233 lstrcpyA(path
, "n;1;");
3234 lstrcatA(path
, temp
);
3235 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3236 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3238 res
= RegOpenKeyA(sourcelist
, "Net", &net
);
3239 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3241 CHECK_DEL_REG_STR(net
, "1", temp
);
3243 RegDeleteKeyA(net
, "");
3246 res
= RegOpenKeyA(sourcelist
, "Media", &media
);
3247 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3249 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3251 RegDeleteKeyA(media
, "");
3253 RegDeleteKeyA(sourcelist
, "");
3254 RegCloseKey(sourcelist
);
3255 RegDeleteKeyA(hkey
, "");
3258 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuupgrades
, &hkey
);
3259 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3261 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3263 RegDeleteKeyA(hkey
, "");
3266 /* PublishProduct, machine */
3267 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3270 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3271 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3272 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3274 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3275 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3277 sprintf(keypath
, prodpath
, "S-1-5-18");
3278 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3279 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3281 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3282 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3284 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3287 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3288 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3291 delete_key(patches
, "", access
);
3292 RegCloseKey(patches
);
3293 delete_key(hkey
, "", access
);
3297 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machprod
, 0, access
, &hkey
);
3298 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3300 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3301 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3302 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3303 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3305 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3306 todo_wine
CHECK_DEL_REG_DWORD(hkey
, "Assignment", 1);
3307 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3308 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3309 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3311 res
= RegOpenKeyExA(hkey
, "SourceList", 0, access
, &sourcelist
);
3312 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3314 lstrcpyA(path
, "n;1;");
3315 lstrcatA(path
, temp
);
3316 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3317 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3319 res
= RegOpenKeyExA(sourcelist
, "Net", 0, access
, &net
);
3320 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3322 CHECK_DEL_REG_STR(net
, "1", temp
);
3324 res
= delete_key(net
, "", access
);
3325 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3328 res
= RegOpenKeyExA(sourcelist
, "Media", 0, access
, &media
);
3329 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3331 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3333 res
= delete_key(media
, "", access
);
3334 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3336 res
= delete_key(sourcelist
, "", access
);
3337 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3338 RegCloseKey(sourcelist
);
3339 res
= delete_key(hkey
, "", access
);
3340 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3343 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machup
, 0, access
, &hkey
);
3344 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3346 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3348 res
= delete_key(hkey
, "", access
);
3349 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3353 DeleteFileA(msifile
);
3354 DeleteFileA("msitest\\maximus");
3355 RemoveDirectoryA("msitest");
3356 HeapFree(GetProcessHeap(), 0, usersid
);
3359 static void test_publish_features(void)
3361 static const char cupath
[] =
3362 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3363 static const char udfeatpath
[] =
3364 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3365 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3366 static const char udpridpath
[] =
3367 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3368 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3369 static const char featkey
[] =
3370 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3371 static const char classfeat
[] =
3372 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3377 CHAR keypath
[MAX_PATH
];
3378 REGSAM access
= KEY_ALL_ACCESS
;
3380 if (is_process_limited())
3382 skip("process is limited\n");
3386 if (!(usersid
= get_user_sid()))
3389 CreateDirectoryA("msitest", NULL
);
3390 create_file("msitest\\maximus", 500);
3392 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3395 access
|= KEY_WOW64_64KEY
;
3397 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3399 /* PublishFeatures, current user */
3400 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
3401 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3403 skip("Not enough rights to perform tests\n");
3406 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3407 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3408 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3410 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3411 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3413 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3414 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3416 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3417 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3419 CHECK_REG_STR(hkey
, "feature", "");
3420 CHECK_REG_STR(hkey
, "montecristo", "");
3422 RegDeleteValueA(hkey
, "feature");
3423 RegDeleteValueA(hkey
, "montecristo");
3424 delete_key(hkey
, "", access
);
3427 sprintf(keypath
, udfeatpath
, usersid
);
3428 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3429 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3431 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3432 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3434 RegDeleteValueA(hkey
, "feature");
3435 RegDeleteValueA(hkey
, "montecristo");
3436 delete_key(hkey
, "", access
);
3438 sprintf(keypath
, udpridpath
, usersid
);
3439 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3441 /* PublishFeatures, machine */
3442 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1 ALLUSERS=1");
3443 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3444 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3445 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3447 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3448 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3450 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3451 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3452 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3453 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3455 CHECK_REG_STR(hkey
, "feature", "");
3456 CHECK_REG_STR(hkey
, "montecristo", "");
3458 RegDeleteValueA(hkey
, "feature");
3459 RegDeleteValueA(hkey
, "montecristo");
3460 delete_key(hkey
, "", access
);
3463 sprintf(keypath
, udfeatpath
, "S-1-5-18");
3464 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3465 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3467 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3468 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3470 RegDeleteValueA(hkey
, "feature");
3471 RegDeleteValueA(hkey
, "montecristo");
3472 delete_key(hkey
, "", access
);
3474 sprintf(keypath
, udpridpath
, "S-1-5-18");
3475 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3478 DeleteFileA(msifile
);
3479 DeleteFileA("msitest\\maximus");
3480 RemoveDirectoryA("msitest");
3481 HeapFree(GetProcessHeap(), 0, usersid
);
3484 static LPSTR
reg_get_val_str(HKEY hkey
, LPCSTR name
)
3490 r
= RegQueryValueExA(hkey
, name
, NULL
, NULL
, NULL
, &len
);
3491 if (r
!= ERROR_SUCCESS
)
3494 len
+= sizeof (WCHAR
);
3495 val
= HeapAlloc(GetProcessHeap(), 0, len
);
3496 if (!val
) return NULL
;
3498 RegQueryValueExA(hkey
, name
, NULL
, NULL
, (LPBYTE
)val
, &len
);
3502 static void get_owner_company(LPSTR
*owner
, LPSTR
*company
)
3506 REGSAM access
= KEY_ALL_ACCESS
;
3508 *owner
= *company
= NULL
;
3511 access
|= KEY_WOW64_64KEY
;
3513 res
= RegOpenKeyA(HKEY_CURRENT_USER
,
3514 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey
);
3515 if (res
== ERROR_SUCCESS
)
3517 *owner
= reg_get_val_str(hkey
, "DefName");
3518 *company
= reg_get_val_str(hkey
, "DefCompany");
3522 if (!*owner
|| !*company
)
3524 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3525 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access
, &hkey
);
3526 if (res
== ERROR_SUCCESS
)
3528 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3529 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3534 if (!*owner
|| !*company
)
3536 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3537 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey
);
3538 if (res
== ERROR_SUCCESS
)
3540 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3541 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3547 static void test_register_user(void)
3553 LPSTR owner
, company
;
3554 CHAR keypath
[MAX_PATH
];
3555 REGSAM access
= KEY_ALL_ACCESS
;
3557 static const CHAR keypropsfmt
[] =
3558 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3559 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3560 static const CHAR keypridfmt
[] =
3561 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3562 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3564 if (is_process_limited())
3566 skip("process is limited\n");
3570 if (!(usersid
= get_user_sid()))
3573 get_owner_company(&owner
, &company
);
3575 CreateDirectoryA("msitest", NULL
);
3576 create_file("msitest\\maximus", 500);
3578 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3581 access
|= KEY_WOW64_64KEY
;
3583 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3585 /* RegisterUser, per-user */
3586 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1");
3587 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3589 skip("Not enough rights to perform tests\n");
3592 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3593 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3594 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3596 sprintf(keypath
, keypropsfmt
, usersid
);
3597 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3598 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3600 CHECK_REG_STR(props
, "ProductID", "none");
3601 CHECK_REG_STR(props
, "RegCompany", company
);
3602 CHECK_REG_STR(props
, "RegOwner", owner
);
3604 RegDeleteValueA(props
, "ProductID");
3605 RegDeleteValueA(props
, "RegCompany");
3606 RegDeleteValueA(props
, "RegOwner");
3607 delete_key(props
, "", access
);
3609 sprintf(keypath
, keypridfmt
, usersid
);
3610 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3612 /* RegisterUser, machine */
3613 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1 ALLUSERS=1");
3614 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3615 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3616 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3618 sprintf(keypath
, keypropsfmt
, "S-1-5-18");
3619 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3620 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3622 CHECK_REG_STR(props
, "ProductID", "none");
3623 CHECK_REG_STR(props
, "RegCompany", company
);
3624 CHECK_REG_STR(props
, "RegOwner", owner
);
3626 RegDeleteValueA(props
, "ProductID");
3627 RegDeleteValueA(props
, "RegCompany");
3628 RegDeleteValueA(props
, "RegOwner");
3629 delete_key(props
, "", access
);
3631 sprintf(keypath
, keypridfmt
, "S-1-5-18");
3632 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3635 HeapFree(GetProcessHeap(), 0, company
);
3636 HeapFree(GetProcessHeap(), 0, owner
);
3638 DeleteFileA(msifile
);
3639 DeleteFileA("msitest\\maximus");
3640 RemoveDirectoryA("msitest");
3644 static void test_process_components(void)
3646 static const char keyfmt
[] =
3647 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3648 static const char compkey
[] =
3649 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3656 CHAR keypath
[MAX_PATH
];
3657 CHAR program_files_maximus
[MAX_PATH
];
3658 REGSAM access
= KEY_ALL_ACCESS
;
3660 if (is_process_limited())
3662 skip("process is limited\n");
3666 if (!(usersid
= get_user_sid()))
3669 CreateDirectoryA("msitest", NULL
);
3670 create_file("msitest\\maximus", 500);
3672 create_database(msifile
, ppc_tables
, sizeof(ppc_tables
) / sizeof(msi_table
));
3675 access
|= KEY_WOW64_64KEY
;
3677 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3679 /* ProcessComponents, per-user */
3680 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
3681 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3683 skip("Not enough rights to perform tests\n");
3686 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3687 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3688 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3690 sprintf(keypath
, keyfmt
, usersid
, "CBABC2FDCCB35E749A8944D8C1C098B5");
3691 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3692 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3695 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3696 NULL
, NULL
, (LPBYTE
)val
, &size
);
3697 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3699 lstrcpyA(program_files_maximus
,PROG_FILES_DIR
);
3700 lstrcatA(program_files_maximus
,"\\msitest\\maximus");
3702 ok(!lstrcmpiA(val
, program_files_maximus
),
3703 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3705 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3706 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3708 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3709 delete_key(comp
, "", access
);
3712 sprintf(keypath
, keyfmt
, usersid
, "241C3DA58FECD0945B9687D408766058");
3713 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3714 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3717 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3718 NULL
, NULL
, (LPBYTE
)val
, &size
);
3719 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3720 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3721 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3723 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3724 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3726 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3727 delete_key(comp
, "", access
);
3730 /* ProcessComponents, machine */
3731 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3732 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3733 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3734 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3736 sprintf(keypath
, keyfmt
, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3737 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3738 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3741 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3742 NULL
, NULL
, (LPBYTE
)val
, &size
);
3743 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3744 ok(!lstrcmpiA(val
, program_files_maximus
),
3745 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3747 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3748 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3750 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3751 delete_key(comp
, "", access
);
3754 sprintf(keypath
, keyfmt
, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3755 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3756 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3759 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3760 NULL
, NULL
, (LPBYTE
)val
, &size
);
3761 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3762 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3763 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3765 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3766 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3768 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3769 delete_key(comp
, "", access
);
3773 DeleteFileA(msifile
);
3774 DeleteFileA("msitest\\maximus");
3775 RemoveDirectoryA("msitest");
3779 static void test_publish(void)
3781 static const char subkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3782 static const char subkey_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3785 HKEY uninstall
, prodkey
, uninstall_32node
= NULL
;
3787 char date
[MAX_PATH
], temp
[MAX_PATH
], prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3788 REGSAM access
= KEY_ALL_ACCESS
;
3791 if (!pMsiQueryFeatureStateExA
)
3793 win_skip("MsiQueryFeatureStateExA is not available\n");
3796 if (is_process_limited())
3798 skip("process is limited\n");
3803 GetTempPathA(MAX_PATH
, temp
);
3806 access
|= KEY_WOW64_64KEY
;
3808 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey
, 0, KEY_ALL_ACCESS
, &uninstall
);
3809 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3813 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey_32node
, 0, KEY_ALL_ACCESS
, &uninstall_32node
);
3814 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3817 CreateDirectoryA("msitest", NULL
);
3818 create_file("msitest\\maximus", 500);
3820 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3822 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3824 state
= MsiQueryProductStateA(prodcode
);
3825 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3827 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3828 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3831 SetLastError(0xdeadbeef);
3832 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3833 error
= GetLastError();
3834 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3835 ok(state
== 0xdead, "got %d\n", state
);
3836 ok(error
== 0xdeadbeef, "got %u\n", error
);
3839 SetLastError(0xdeadbeef);
3840 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
3841 error
= GetLastError();
3842 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3843 ok(state
== 0xdead, "got %d\n", state
);
3844 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3847 SetLastError(0xdeadbeef);
3848 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
3849 error
= GetLastError();
3850 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3851 ok(state
== 0xdead, "got %d\n", state
);
3852 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3854 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3855 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3857 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3858 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3860 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3861 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3862 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3863 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3865 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3866 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3868 /* nothing published */
3869 r
= MsiInstallProductA(msifile
, NULL
);
3870 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3872 skip("Not enough rights to perform tests\n");
3875 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3876 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3877 ok(pf_exists("msitest"), "File not installed\n");
3879 state
= MsiQueryProductStateA(prodcode
);
3880 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3882 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3883 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3885 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3886 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3888 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3889 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3890 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3891 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3893 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3894 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3896 /* PublishProduct and RegisterProduct */
3897 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3898 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3899 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3900 ok(pf_exists("msitest"), "File not installed\n");
3902 state
= MsiQueryProductStateA(prodcode
);
3903 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3905 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3906 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3908 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3909 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3911 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3912 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3913 ok(r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3914 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3918 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3919 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3923 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3924 if (is_wow64
&& res
== ERROR_FILE_NOT_FOUND
) /* XP - Vista, Wow64 */
3925 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3926 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3929 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
3930 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
3931 CHECK_REG_STR(prodkey
, "InstallDate", date
);
3932 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
3933 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3934 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
3935 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3936 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
3937 CHECK_REG_STR(prodkey
, "Comments", NULL
);
3938 CHECK_REG_STR(prodkey
, "Contact", NULL
);
3939 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
3940 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
3941 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
3942 CHECK_REG_STR(prodkey
, "Readme", NULL
);
3943 CHECK_REG_STR(prodkey
, "Size", NULL
);
3944 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
3945 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
3946 CHECK_REG_DWORD(prodkey
, "Language", 1033);
3947 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
3948 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
3949 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
3950 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
3953 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
3956 RegCloseKey(prodkey
);
3958 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
3959 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3960 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3961 ok(pf_exists("msitest"), "File deleted\n");
3963 state
= MsiQueryProductStateA(prodcode
);
3964 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3966 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3967 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3969 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3970 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3972 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3973 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3974 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3975 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3977 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3978 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3980 /* complete install */
3981 r
= MsiInstallProductA(msifile
, "FULL=1");
3982 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3983 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3984 ok(pf_exists("msitest"), "File not installed\n");
3986 state
= MsiQueryProductStateA(prodcode
);
3987 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3989 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3990 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3993 SetLastError(0xdeadbeef);
3994 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3995 error
= GetLastError();
3996 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3997 ok(state
== 0xdead, "got %d\n", state
);
3998 ok(error
== 0xdeadbeef, "got %u\n", error
);
4001 SetLastError(0xdeadbeef);
4002 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
4003 error
= GetLastError();
4004 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
4005 ok(state
== 0xdead, "got %d\n", state
);
4006 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
4009 SetLastError(0xdeadbeef);
4010 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
4011 error
= GetLastError();
4012 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
4013 ok(state
== INSTALLSTATE_LOCAL
, "got %d\n", state
);
4014 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
4016 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4017 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4019 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4020 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4021 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4022 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4026 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4027 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4031 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4032 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4035 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4036 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4037 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4038 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4039 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4040 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4041 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4042 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4043 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4044 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4045 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4046 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4047 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4048 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4049 CHECK_REG_STR(prodkey
, "Size", NULL
);
4050 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4051 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4052 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4053 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4054 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4055 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4056 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4059 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4062 RegCloseKey(prodkey
);
4064 /* no UnpublishFeatures */
4065 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4066 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4067 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4068 ok(!pf_exists("msitest"), "Directory not deleted\n");
4070 state
= MsiQueryProductStateA(prodcode
);
4071 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4073 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4074 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4076 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4077 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4079 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4080 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4081 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4082 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4084 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4085 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4087 /* complete install */
4088 r
= MsiInstallProductA(msifile
, "FULL=1");
4089 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4090 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4091 ok(pf_exists("msitest"), "File not installed\n");
4093 state
= MsiQueryProductStateA(prodcode
);
4094 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4096 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4097 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4099 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4100 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4102 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4103 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4104 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4105 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4109 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4110 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4114 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4115 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4118 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4119 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4120 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4121 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4122 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4123 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4124 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4125 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4126 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4127 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4128 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4129 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4130 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4131 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4132 CHECK_REG_STR(prodkey
, "Size", NULL
);
4133 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4134 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4135 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4136 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4137 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4138 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4139 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4142 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4145 RegCloseKey(prodkey
);
4147 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4148 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4149 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4150 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4151 ok(pf_exists("msitest"), "Directory deleted\n");
4153 state
= MsiQueryProductStateA(prodcode
);
4154 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4156 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4157 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4159 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4160 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4162 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4163 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4164 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4165 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4169 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4170 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4174 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4175 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4178 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4179 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4180 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4181 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4182 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4183 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4184 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4185 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4186 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4187 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4188 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4189 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4190 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4191 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4192 CHECK_REG_STR(prodkey
, "Size", NULL
);
4193 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4194 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4195 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4196 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4197 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4198 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4199 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4202 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4205 RegCloseKey(prodkey
);
4207 /* complete install */
4208 r
= MsiInstallProductA(msifile
, "FULL=1");
4209 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4210 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4211 ok(pf_exists("msitest"), "File not installed\n");
4213 state
= MsiQueryProductStateA(prodcode
);
4214 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4216 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4217 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4219 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4220 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4222 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4223 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4224 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4225 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4229 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4230 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4234 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4235 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4238 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4239 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4240 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4241 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4242 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4243 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4244 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4245 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4246 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4247 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4248 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4249 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4250 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4251 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4252 CHECK_REG_STR(prodkey
, "Size", NULL
);
4253 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4254 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4255 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4256 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4257 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4258 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4259 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4262 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -20, 10, 24);
4265 RegCloseKey(prodkey
);
4267 /* UnpublishFeatures, both features removed */
4268 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4269 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4270 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4271 ok(!pf_exists("msitest"), "Directory not deleted\n");
4273 state
= MsiQueryProductStateA(prodcode
);
4274 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4276 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4277 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4279 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4280 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4282 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4283 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4284 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4285 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4287 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4288 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4290 /* complete install */
4291 r
= MsiInstallProductA(msifile
, "FULL=1");
4292 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4293 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4294 ok(pf_exists("msitest"), "File not installed\n");
4296 state
= MsiQueryProductStateA(prodcode
);
4297 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4299 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4300 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4302 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4303 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4305 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4306 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4307 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4308 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4312 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4313 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4317 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4318 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4321 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4322 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4323 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4324 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4325 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4326 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4327 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4328 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4329 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4330 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4331 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4332 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4333 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4334 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4335 CHECK_REG_STR(prodkey
, "Size", NULL
);
4336 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4337 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4338 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4339 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4340 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4341 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4342 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4345 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4348 RegCloseKey(prodkey
);
4350 /* complete uninstall */
4351 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4352 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4353 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4354 ok(!pf_exists("msitest"), "Directory not deleted\n");
4356 state
= MsiQueryProductStateA(prodcode
);
4357 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4359 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4360 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4362 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4363 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4365 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4366 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4367 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4368 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4370 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4371 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4373 /* make sure 'Program Files\msitest' is removed */
4374 delete_pfmsitest_files();
4377 RegCloseKey(uninstall
);
4378 RegCloseKey(uninstall_32node
);
4379 DeleteFileA(msifile
);
4380 DeleteFileA("msitest\\maximus");
4381 RemoveDirectoryA("msitest");
4384 static void test_publish_sourcelist(void)
4388 CHAR value
[MAX_PATH
];
4389 CHAR path
[MAX_PATH
];
4390 CHAR prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4392 if (!pMsiSourceListEnumSourcesA
|| !pMsiSourceListGetInfoA
)
4394 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4397 if (is_process_limited())
4399 skip("process is limited\n");
4403 CreateDirectoryA("msitest", NULL
);
4404 create_file("msitest\\maximus", 500);
4406 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
4408 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4410 r
= MsiInstallProductA(msifile
, NULL
);
4411 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4413 skip("Not enough rights to perform tests\n");
4416 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4417 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4418 ok(pf_exists("msitest"), "File not installed\n");
4420 /* nothing published */
4422 lstrcpyA(value
, "aaa");
4423 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4424 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4425 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4426 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4427 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4430 lstrcpyA(value
, "aaa");
4431 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4432 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4433 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4434 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4435 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4437 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
4438 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4439 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4440 ok(pf_exists("msitest"), "File not installed\n");
4442 /* after RegisterProduct */
4444 lstrcpyA(value
, "aaa");
4445 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4446 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4447 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4448 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4449 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4452 lstrcpyA(value
, "aaa");
4453 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4454 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4455 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4456 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4457 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4459 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
4460 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4461 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4462 ok(pf_exists("msitest"), "File not installed\n");
4464 /* after ProcessComponents */
4466 lstrcpyA(value
, "aaa");
4467 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4468 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4469 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4470 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4471 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4474 lstrcpyA(value
, "aaa");
4475 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4476 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4477 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4478 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4479 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4481 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
4482 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4483 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4484 ok(pf_exists("msitest"), "File not installed\n");
4486 /* after PublishFeatures */
4488 lstrcpyA(value
, "aaa");
4489 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4490 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4491 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4492 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4493 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4496 lstrcpyA(value
, "aaa");
4497 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4498 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4499 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4500 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4501 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4503 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
4504 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4505 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4506 ok(pf_exists("msitest"), "File not installed\n");
4508 /* after PublishProduct */
4510 lstrcpyA(value
, "aaa");
4511 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4512 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4513 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4514 ok(!lstrcmpA(value
, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value
);
4515 ok(size
== 11, "Expected 11, got %d\n", size
);
4518 lstrcpyA(value
, "aaa");
4519 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4520 MSICODE_PRODUCT
, INSTALLPROPERTY_MEDIAPACKAGEPATHA
, value
, &size
);
4521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4522 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4523 ok(size
== 0, "Expected 0, got %d\n", size
);
4526 lstrcpyA(value
, "aaa");
4527 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4528 MSICODE_PRODUCT
, INSTALLPROPERTY_DISKPROMPTA
, value
, &size
);
4529 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4530 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4531 ok(size
== 0, "Expected 0, got %d\n", size
);
4533 lstrcpyA(path
, CURR_DIR
);
4534 lstrcatA(path
, "\\");
4537 lstrcpyA(value
, "aaa");
4538 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4539 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCEA
, value
, &size
);
4540 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4541 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4542 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4545 lstrcpyA(value
, "aaa");
4546 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4547 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDTYPEA
, value
, &size
);
4548 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4549 ok(!lstrcmpA(value
, "n"), "Expected \"n\", got \"%s\"\n", value
);
4550 ok(size
== 1, "Expected 1, got %d\n", size
);
4553 lstrcpyA(value
, "aaa");
4554 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4555 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4556 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4557 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4558 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4561 lstrcpyA(value
, "aaa");
4562 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4563 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 0, value
, &size
);
4564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4565 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4566 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4569 lstrcpyA(value
, "aaa");
4570 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4571 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 1, value
, &size
);
4572 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4573 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4574 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4576 /* complete uninstall */
4577 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4579 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4580 ok(!pf_exists("msitest"), "Directory not deleted\n");
4582 /* make sure 'Program Files\msitest' is removed */
4583 delete_pfmsitest_files();
4586 DeleteFileA(msifile
);
4587 DeleteFileA("msitest\\maximus");
4588 RemoveDirectoryA("msitest");
4591 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
4593 CHAR path
[MAX_PATH
];
4595 lstrcpyA(path
, PROG_FILES_DIR
);
4596 lstrcatA(path
, "\\");
4597 lstrcatA(path
, file
);
4600 create_file_data(path
, data
, 500);
4602 CreateDirectoryA(path
, NULL
);
4605 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
4607 static void test_remove_files(void)
4611 if (is_process_limited())
4613 skip("process is limited\n");
4617 CreateDirectoryA("msitest", NULL
);
4618 create_file("msitest\\hydrogen", 500);
4619 create_file("msitest\\helium", 500);
4620 create_file("msitest\\lithium", 500);
4622 create_database(msifile
, rem_tables
, sizeof(rem_tables
) / sizeof(msi_table
));
4624 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4626 r
= MsiInstallProductA(msifile
, NULL
);
4627 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4629 skip("Not enough rights to perform tests\n");
4632 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4633 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4634 ok(!pf_exists("msitest\\helium"), "File installed\n");
4635 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4636 ok(pf_exists("msitest"), "File not installed\n");
4638 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4639 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4640 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4641 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4642 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4643 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4645 create_pf("msitest", FALSE
);
4646 create_pf("msitest\\hydrogen", TRUE
);
4647 create_pf("msitest\\helium", TRUE
);
4648 create_pf("msitest\\lithium", TRUE
);
4650 r
= MsiInstallProductA(msifile
, NULL
);
4651 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4652 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4653 ok(pf_exists("msitest\\helium"), "File not installed\n");
4654 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4655 ok(pf_exists("msitest"), "File not installed\n");
4657 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4659 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4660 ok(delete_pf("msitest\\helium", TRUE
), "File deleted\n");
4661 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4662 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4664 create_pf("msitest", FALSE
);
4665 create_pf("msitest\\furlong", TRUE
);
4666 create_pf("msitest\\firkin", TRUE
);
4667 create_pf("msitest\\fortnight", TRUE
);
4668 create_pf("msitest\\becquerel", TRUE
);
4669 create_pf("msitest\\dioptre", TRUE
);
4670 create_pf("msitest\\attoparsec", TRUE
);
4671 create_pf("msitest\\storeys", TRUE
);
4672 create_pf("msitest\\block", TRUE
);
4673 create_pf("msitest\\siriometer", TRUE
);
4674 create_pf("msitest\\cabout", FALSE
);
4675 create_pf("msitest\\cabout\\blocker", TRUE
);
4677 r
= MsiInstallProductA(msifile
, NULL
);
4678 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4679 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4680 ok(!pf_exists("msitest\\helium"), "File installed\n");
4681 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4682 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4683 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4684 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4685 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4686 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4687 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4688 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4689 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4690 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4691 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4692 ok(pf_exists("msitest"), "File not installed\n");
4694 create_pf("msitest\\furlong", TRUE
);
4695 create_pf("msitest\\firkin", TRUE
);
4696 create_pf("msitest\\fortnight", TRUE
);
4697 create_pf("msitest\\storeys", TRUE
);
4698 create_pf("msitest\\block", TRUE
);
4699 create_pf("msitest\\siriometer", TRUE
);
4701 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4702 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4703 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not deleted\n");
4704 ok(!delete_pf("msitest\\helium", TRUE
), "File not deleted\n");
4705 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4706 ok(delete_pf("msitest\\furlong", TRUE
), "File deleted\n");
4707 ok(delete_pf("msitest\\firkin", TRUE
), "File deleted\n");
4708 ok(delete_pf("msitest\\fortnight", TRUE
), "File deleted\n");
4709 ok(!delete_pf("msitest\\becquerel", TRUE
), "File not deleted\n");
4710 ok(!delete_pf("msitest\\dioptre", TRUE
), "File not deleted\n");
4711 ok(delete_pf("msitest\\attoparsec", TRUE
), "File deleted\n");
4712 ok(!delete_pf("msitest\\storeys", TRUE
), "File not deleted\n");
4713 ok(!delete_pf("msitest\\block", TRUE
), "File not deleted\n");
4714 ok(delete_pf("msitest\\siriometer", TRUE
), "File deleted\n");
4715 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4716 ok(pf_exists("msitest"), "Directory deleted\n");
4718 r
= MsiInstallProductA(msifile
, NULL
);
4719 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4720 ok(delete_pf("msitest\\hydrogen", TRUE
), "File not installed\n");
4721 ok(!delete_pf("msitest\\helium", TRUE
), "File installed\n");
4722 ok(delete_pf("msitest\\lithium", TRUE
), "File not installed\n");
4723 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4724 ok(pf_exists("msitest"), "Directory deleted\n");
4726 delete_pf("msitest\\cabout\\blocker", TRUE
);
4728 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4729 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4730 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory not deleted\n");
4731 delete_pf("msitest", FALSE
);
4734 DeleteFileA(msifile
);
4735 DeleteFileA("msitest\\hydrogen");
4736 DeleteFileA("msitest\\helium");
4737 DeleteFileA("msitest\\lithium");
4738 RemoveDirectoryA("msitest");
4741 static void test_move_files(void)
4744 char props
[MAX_PATH
];
4746 if (is_process_limited())
4748 skip("process is limited\n");
4752 CreateDirectoryA("msitest", NULL
);
4753 create_file("msitest\\augustus", 100);
4754 create_file("cameroon", 100);
4755 create_file("djibouti", 100);
4756 create_file("egypt", 100);
4757 create_file("finland", 100);
4758 create_file("gambai", 100);
4759 create_file("honduras", 100);
4760 create_file("msitest\\india", 100);
4761 create_file("japan", 100);
4762 create_file("kenya", 100);
4763 CreateDirectoryA("latvia", NULL
);
4764 create_file("nauru", 100);
4765 create_file("peru", 100);
4766 create_file("apple", 100);
4767 create_file("application", 100);
4768 create_file("ape", 100);
4769 create_file("foo", 100);
4770 create_file("fao", 100);
4771 create_file("fbod", 100);
4772 create_file("budding", 100);
4773 create_file("buddy", 100);
4774 create_file("bud", 100);
4775 create_file("bar", 100);
4776 create_file("bur", 100);
4777 create_file("bird", 100);
4779 create_database(msifile
, mov_tables
, sizeof(mov_tables
) / sizeof(msi_table
));
4781 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4783 /* if the source or dest property is not a full path,
4784 * windows tries to access it as a network resource
4787 sprintf(props
, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4788 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4789 CURR_DIR
, PROG_FILES_DIR
, CURR_DIR
, CURR_DIR
);
4791 r
= MsiInstallProductA(msifile
, props
);
4792 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4794 skip("Not enough rights to perform tests\n");
4797 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4798 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4799 ok(!delete_pf("msitest\\dest", TRUE
), "File copied\n");
4800 ok(delete_pf("msitest\\canada", TRUE
), "File not copied\n");
4801 ok(delete_pf("msitest\\dominica", TRUE
), "File not moved\n");
4802 ok(!delete_pf("msitest\\elsalvador", TRUE
), "File moved\n");
4803 ok(!delete_pf("msitest\\france", TRUE
), "File moved\n");
4804 ok(!delete_pf("msitest\\georgia", TRUE
), "File moved\n");
4805 ok(delete_pf("msitest\\hungary", TRUE
), "File not moved\n");
4806 ok(!delete_pf("msitest\\indonesia", TRUE
), "File moved\n");
4807 ok(!delete_pf("msitest\\jordan", TRUE
), "File moved\n");
4808 ok(delete_pf("msitest\\kiribati", TRUE
), "File not moved\n");
4809 ok(!delete_pf("msitest\\lebanon", TRUE
), "File moved\n");
4810 ok(!delete_pf("msitest\\lebanon", FALSE
), "Directory moved\n");
4811 ok(delete_pf("msitest\\poland", TRUE
), "File not moved\n");
4812 /* either apple or application will be moved depending on directory order */
4813 if (!delete_pf("msitest\\apple", TRUE
))
4814 ok(delete_pf("msitest\\application", TRUE
), "File not moved\n");
4816 ok(!delete_pf("msitest\\application", TRUE
), "File should not exist\n");
4817 ok(delete_pf("msitest\\wildcard", TRUE
), "File not moved\n");
4818 ok(!delete_pf("msitest\\ape", TRUE
), "File moved\n");
4819 /* either fao or foo will be moved depending on directory order */
4820 if (delete_pf("msitest\\foo", TRUE
))
4821 ok(!delete_pf("msitest\\fao", TRUE
), "File should not exist\n");
4823 ok(delete_pf("msitest\\fao", TRUE
), "File not moved\n");
4824 ok(delete_pf("msitest\\single", TRUE
), "File not moved\n");
4825 ok(!delete_pf("msitest\\fbod", TRUE
), "File moved\n");
4826 ok(delete_pf("msitest\\budding", TRUE
), "File not moved\n");
4827 ok(delete_pf("msitest\\buddy", TRUE
), "File not moved\n");
4828 ok(!delete_pf("msitest\\bud", TRUE
), "File moved\n");
4829 ok(delete_pf("msitest\\bar", TRUE
), "File not moved\n");
4830 ok(delete_pf("msitest\\bur", TRUE
), "File not moved\n");
4831 ok(!delete_pf("msitest\\bird", TRUE
), "File moved\n");
4832 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4833 ok(DeleteFileA("cameroon"), "File moved\n");
4834 ok(!DeleteFileA("djibouti"), "File not moved\n");
4835 ok(DeleteFileA("egypt"), "File moved\n");
4836 ok(DeleteFileA("finland"), "File moved\n");
4837 ok(DeleteFileA("gambai"), "File moved\n");
4838 ok(!DeleteFileA("honduras"), "File not moved\n");
4839 ok(DeleteFileA("msitest\\india"), "File moved\n");
4840 ok(DeleteFileA("japan"), "File moved\n");
4841 ok(!DeleteFileA("kenya"), "File not moved\n");
4842 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4843 ok(!DeleteFileA("nauru"), "File not moved\n");
4844 ok(!DeleteFileA("peru"), "File not moved\n");
4845 ok(!DeleteFileA("apple"), "File not moved\n");
4846 ok(!DeleteFileA("application"), "File not moved\n");
4847 ok(DeleteFileA("ape"), "File moved\n");
4848 ok(!DeleteFileA("foo"), "File not moved\n");
4849 ok(!DeleteFileA("fao"), "File not moved\n");
4850 ok(DeleteFileA("fbod"), "File moved\n");
4851 ok(!DeleteFileA("budding"), "File not moved\n");
4852 ok(!DeleteFileA("buddy"), "File not moved\n");
4853 ok(DeleteFileA("bud"), "File moved\n");
4854 ok(!DeleteFileA("bar"), "File not moved\n");
4855 ok(!DeleteFileA("bur"), "File not moved\n");
4856 ok(DeleteFileA("bird"), "File moved\n");
4859 DeleteFileA("cameroon");
4860 DeleteFileA("djibouti");
4861 DeleteFileA("egypt");
4862 DeleteFileA("finland");
4863 DeleteFileA("gambai");
4864 DeleteFileA("honduras");
4865 DeleteFileA("japan");
4866 DeleteFileA("kenya");
4867 DeleteFileA("nauru");
4868 DeleteFileA("peru");
4869 DeleteFileA("apple");
4870 DeleteFileA("application");
4874 DeleteFileA("fbod");
4875 DeleteFileA("budding");
4876 DeleteFileA("buddy");
4880 DeleteFileA("bird");
4881 DeleteFileA("msitest\\india");
4882 DeleteFileA("msitest\\augustus");
4883 RemoveDirectoryA("latvia");
4884 RemoveDirectoryA("msitest");
4885 DeleteFileA(msifile
);
4888 static void test_duplicate_files(void)
4892 if (is_process_limited())
4894 skip("process is limited\n");
4898 CreateDirectoryA("msitest", NULL
);
4899 create_file("msitest\\maximus", 500);
4900 create_database(msifile
, df_tables
, sizeof(df_tables
) / sizeof(msi_table
));
4902 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4904 /* fails if the destination folder is not a valid property */
4906 r
= MsiInstallProductA(msifile
, NULL
);
4907 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4909 skip("Not enough rights to perform tests\n");
4912 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4913 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
4914 ok(delete_pf("msitest\\augustus", TRUE
), "File not duplicated\n");
4915 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE
), "File not duplicated\n");
4916 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE
), "Directory not created\n");
4917 ok(delete_pf("msitest\\this\\doesnot", FALSE
), "Directory not created\n");
4918 ok(delete_pf("msitest\\this", FALSE
), "Directory not created\n");
4919 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4922 DeleteFileA("msitest\\maximus");
4923 RemoveDirectoryA("msitest");
4924 DeleteFileA(msifile
);
4927 static void test_write_registry_values(void)
4933 CHAR path
[MAX_PATH
];
4936 if (is_process_limited())
4938 skip("process is limited\n");
4942 CreateDirectoryA("msitest", NULL
);
4943 create_file("msitest\\augustus", 500);
4945 create_database(msifile
, wrv_tables
, sizeof(wrv_tables
) / sizeof(msi_table
));
4947 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4950 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL
, 0,
4951 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
4953 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, NULL
, 0, KEY_ALL_ACCESS
,
4955 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4957 res
= RegSetValueExA(hkey
, "Value1", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4958 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4959 res
= RegSetValueExA(hkey
, "Value2", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4960 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4961 res
= RegSetValueExA(hkey
, "Value3", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4962 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4963 res
= RegSetValueExA(hkey
, "Value4", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4964 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4965 res
= RegSetValueExA(hkey
, "Value5", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0two\0", 9);
4966 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4967 res
= RegSetValueExA(hkey
, "Value6", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4968 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4969 res
= RegSetValueExA(hkey
, "Value7", 0, REG_SZ
, (const BYTE
*)"one", 4);
4970 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4973 r
= MsiInstallProductA(msifile
, NULL
);
4974 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4976 skip("Not enough rights to perform tests\n");
4979 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4980 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4981 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4984 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4986 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4987 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4991 memset(path
, 'a', MAX_PATH
);
4992 res
= RegQueryValueExA(hkey
, "Value", NULL
, &type
, (LPBYTE
)path
, &size
);
4993 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4994 ok(!memcmp(path
, "one\0two\0three\0\0", size
), "Wrong multi-sz data\n");
4995 ok(size
== 15, "Expected 15, got %d\n", size
);
4996 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
4998 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, NULL
, NULL
);
4999 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5001 res
= action_RegDeleteTreeA(hkey
, "VisualStudio", KEY_ALL_ACCESS
);
5002 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5006 memset(path
, 'a', MAX_PATH
);
5007 res
= RegQueryValueExA(hkey
, "Value1", NULL
, &type
, (LPBYTE
)path
, &size
);
5008 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5009 ok(!memcmp(path
, "one\0", size
), "Wrong multi-sz data\n");
5010 ok(size
== 5, "Expected 5, got %d\n", size
);
5011 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5015 memset(path
, 'a', MAX_PATH
);
5016 res
= RegQueryValueExA(hkey
, "Value2", NULL
, &type
, (LPBYTE
)path
, &size
);
5017 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5018 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5019 ok(size
== 9, "Expected 9, got %d\n", size
);
5020 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5024 memset(path
, 'a', MAX_PATH
);
5025 res
= RegQueryValueExA(hkey
, "Value3", NULL
, &type
, (LPBYTE
)path
, &size
);
5026 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5027 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5028 ok(size
== 9, "Expected 9, got %d\n", size
);
5029 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5033 memset(path
, 'a', MAX_PATH
);
5034 res
= RegQueryValueExA(hkey
, "Value4", NULL
, &type
, (LPBYTE
)path
, &size
);
5035 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5036 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5037 ok(size
== 9, "Expected 9, got %d\n", size
);
5038 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5042 memset(path
, 'a', MAX_PATH
);
5043 res
= RegQueryValueExA(hkey
, "Value5", NULL
, &type
, (LPBYTE
)path
, &size
);
5044 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5045 ok(!memcmp(path
, "one\0two\0three\0", size
), "Wrong multi-sz data\n");
5046 ok(size
== 15, "Expected 15, got %d\n", size
);
5047 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5051 memset(path
, 'a', MAX_PATH
);
5052 res
= RegQueryValueExA(hkey
, "Value6", NULL
, &type
, (LPBYTE
)path
, &size
);
5053 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5054 ok(!memcmp(path
, "", size
), "Wrong multi-sz data\n");
5055 ok(size
== 1, "Expected 1, got %d\n", size
);
5056 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5060 memset(path
, 'a', MAX_PATH
);
5061 res
= RegQueryValueExA(hkey
, "Value7", NULL
, &type
, (LPBYTE
)path
, &size
);
5062 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5063 ok(!memcmp(path
, "two\0", size
), "Wrong multi-sz data\n");
5064 ok(size
== 5, "Expected 5, got %d\n", size
);
5065 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5069 memset(buf
, 0, size
);
5070 res
= RegQueryValueExA(hkey
, "Value8", NULL
, &type
, buf
, &size
);
5071 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5072 ok(*(DWORD
*)buf
== 1, "got %u\n", *(DWORD
*)buf
);
5073 ok(size
== 4, "got %u\n", size
);
5074 ok(type
== REG_DWORD
, "got %u\n", type
);
5078 memset(buf
, 0, size
);
5079 res
= RegQueryValueExA(hkey
, "Value9", NULL
, &type
, buf
, &size
);
5080 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5081 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5082 ok(size
== 1, "got %u\n", size
);
5083 ok(type
== REG_BINARY
, "got %u\n", type
);
5087 memset(buf
, 0, size
);
5088 res
= RegQueryValueExA(hkey
, "Value10", NULL
, &type
, buf
, &size
);
5089 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5090 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5091 ok(size
== 1, "got %u\n", size
);
5092 ok(type
== REG_BINARY
, "got %u\n", type
);
5096 memset(buf
, 0, size
);
5097 res
= RegQueryValueExA(hkey
, "Value11", NULL
, &type
, buf
, &size
);
5098 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5099 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5100 ok(size
== 1, "got %u\n", size
);
5101 ok(type
== REG_BINARY
, "got %u\n", type
);
5103 RegDeleteValueA(hkey
, "Value");
5104 RegDeleteValueA(hkey
, "Value1");
5105 RegDeleteValueA(hkey
, "Value2");
5106 RegDeleteValueA(hkey
, "Value3");
5107 RegDeleteValueA(hkey
, "Value4");
5108 RegDeleteValueA(hkey
, "Value5");
5109 RegDeleteValueA(hkey
, "Value6");
5110 RegDeleteValueA(hkey
, "Value7");
5111 RegDeleteValueA(hkey
, "Value8");
5112 RegDeleteValueA(hkey
, "Value9");
5113 RegDeleteValueA(hkey
, "Value10");
5114 RegDeleteValueA(hkey
, "Value11");
5116 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
5119 DeleteFileA(msifile
);
5120 DeleteFileA("msitest\\augustus");
5121 RemoveDirectoryA("msitest");
5124 static void test_envvar(void)
5126 static const char *results
[] =
5128 "1;2", /* MSITESTVAR11 */
5129 "1", /* MSITESTVAR12 */
5130 "1;2", /* MSITESTVAR13 */
5131 ";1;", /* MSITESTVAR14 */
5132 ";;1;;", /* MSITESTVAR15 */
5133 " 1 ", /* MSITESTVAR16 */
5134 ";;2;;1", /* MSITESTVAR17 */
5135 "1;;2;;", /* MSITESTVAR18 */
5136 "1", /* MSITESTVAR19 */
5137 "1", /* MSITESTVAR20 */
5147 if (is_process_limited())
5149 skip("process is limited\n");
5153 create_test_files();
5154 create_database(msifile
, env_tables
, sizeof(env_tables
) / sizeof(msi_table
));
5156 res
= RegCreateKeyExA(HKEY_CURRENT_USER
, "Environment", 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &env
, NULL
);
5157 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5159 res
= RegSetValueExA(env
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"0", 2);
5160 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5162 res
= RegSetValueExA(env
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"0", 2);
5163 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5165 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5167 r
= MsiInstallProductA(msifile
, NULL
);
5168 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5170 skip("Not enough rights to perform tests\n");
5173 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5176 size
= sizeof(buffer
);
5178 res
= RegQueryValueExA(env
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5179 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5180 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5181 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5183 res
= RegDeleteValueA(env
, "MSITESTVAR1");
5184 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5187 size
= sizeof(buffer
);
5189 res
= RegQueryValueExA(env
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5190 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5191 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5192 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5194 res
= RegDeleteValueA(env
, "MSITESTVAR2");
5195 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5197 res
= RegDeleteValueA(env
, "MSITESTVAR3");
5198 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5200 res
= RegDeleteValueA(env
, "MSITESTVAR4");
5201 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5203 res
= RegDeleteValueA(env
, "MSITESTVAR5");
5204 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5206 res
= RegDeleteValueA(env
, "MSITESTVAR6");
5207 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5209 res
= RegDeleteValueA(env
, "MSITESTVAR7");
5210 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5212 res
= RegDeleteValueA(env
, "MSITESTVAR8");
5213 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5215 res
= RegDeleteValueA(env
, "MSITESTVAR9");
5216 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5218 res
= RegDeleteValueA(env
, "MSITESTVAR10");
5219 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5222 while (results
[i
- 11])
5225 sprintf(name
, "MSITESTVAR%d", i
);
5228 size
= sizeof(buffer
);
5230 res
= RegQueryValueExA(env
, name
, NULL
, &type
, (LPBYTE
)buffer
, &size
);
5231 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5232 ok(type
== REG_SZ
, "%d: Expected REG_SZ, got %u\n", i
, type
);
5233 ok(!lstrcmpA(buffer
, results
[i
- 11]), "%d: Expected %s, got %s\n", i
, results
[i
- 11], buffer
);
5235 res
= RegDeleteValueA(env
, name
);
5236 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5240 delete_pf("msitest\\cabout\\new\\five.txt", TRUE
);
5241 delete_pf("msitest\\cabout\\new", FALSE
);
5242 delete_pf("msitest\\cabout\\four.txt", TRUE
);
5243 delete_pf("msitest\\cabout", FALSE
);
5244 delete_pf("msitest\\changed\\three.txt", TRUE
);
5245 delete_pf("msitest\\changed", FALSE
);
5246 delete_pf("msitest\\first\\two.txt", TRUE
);
5247 delete_pf("msitest\\first", FALSE
);
5248 delete_pf("msitest\\filename", TRUE
);
5249 delete_pf("msitest\\one.txt", TRUE
);
5250 delete_pf("msitest\\service.exe", TRUE
);
5251 delete_pf("msitest\\service2.exe", TRUE
);
5252 delete_pf("msitest", FALSE
);
5255 RegDeleteValueA(env
, "MSITESTVAR1");
5256 RegDeleteValueA(env
, "MSITESTVAR2");
5259 delete_test_files();
5260 DeleteFileA(msifile
);
5263 static void test_create_remove_folder(void)
5267 if (is_process_limited())
5269 skip("process is limited\n");
5273 CreateDirectoryA("msitest", NULL
);
5274 CreateDirectoryA("msitest\\first", NULL
);
5275 CreateDirectoryA("msitest\\second", NULL
);
5276 create_file("msitest\\first\\one.txt", 1000);
5277 create_file("msitest\\second\\two.txt", 1000);
5278 create_database(msifile
, cf_tables
, sizeof(cf_tables
) / sizeof(msi_table
));
5280 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5282 r
= MsiInstallProductA(msifile
, NULL
);
5283 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5285 skip("Not enough rights to perform tests\n");
5288 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5290 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5291 ok(pf_exists("msitest\\first"), "directory not created\n");
5292 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5293 ok(pf_exists("msitest\\second"), "directory not created\n");
5294 ok(pf_exists("msitest\\third"), "directory not created\n");
5295 ok(pf_exists("msitest"), "directory not created\n");
5297 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5298 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5300 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5301 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5302 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5303 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5304 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5305 todo_wine
ok(!pf_exists("msitest"), "directory not removed\n");
5308 DeleteFileA("msitest\\first\\one.txt");
5309 DeleteFileA("msitest\\second\\two.txt");
5310 RemoveDirectoryA("msitest\\first");
5311 RemoveDirectoryA("msitest\\second");
5312 RemoveDirectoryA("msitest");
5313 DeleteFileA(msifile
);
5316 static void test_start_stop_services(void)
5319 SC_HANDLE scm
, service
;
5321 DWORD error
= ERROR_SUCCESS
;
5323 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5324 if (!scm
&& GetLastError() == ERROR_ACCESS_DENIED
)
5326 skip("Not enough rights to perform tests\n");
5329 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
5332 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5333 if (!service
&& GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST
)
5335 win_skip("The 'Spooler' service does not exist\n");
5336 CloseServiceHandle(scm
);
5339 ok(service
!= NULL
, "Failed to open Spooler, error %d\n", GetLastError());
5341 CloseServiceHandle(scm
);
5345 ret
= StartServiceA(service
, 0, NULL
);
5346 if (!ret
&& (error
= GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING
)
5348 skip("Spooler service not available, skipping test\n");
5349 CloseServiceHandle(service
);
5350 CloseServiceHandle(scm
);
5354 CloseServiceHandle(service
);
5355 CloseServiceHandle(scm
);
5357 create_test_files();
5358 create_database(msifile
, sss_tables
, sizeof(sss_tables
) / sizeof(msi_table
));
5360 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5362 r
= MsiInstallProductA(msifile
, NULL
);
5363 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5365 if (error
== ERROR_SUCCESS
)
5367 SERVICE_STATUS status
;
5369 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5370 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5372 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5373 ok(ret
, "ControlService failed %u\n", GetLastError());
5375 CloseServiceHandle(service
);
5376 CloseServiceHandle(scm
);
5379 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5380 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5382 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5383 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5384 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5385 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5386 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5387 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5388 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5389 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5390 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5391 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5392 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5393 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5394 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5396 if (error
== ERROR_SUCCESS
)
5398 SERVICE_STATUS status
;
5400 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5401 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5403 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5404 ok(ret
, "ControlService failed %u\n", GetLastError());
5406 CloseServiceHandle(service
);
5407 CloseServiceHandle(scm
);
5410 delete_test_files();
5411 DeleteFileA(msifile
);
5414 static void test_delete_services(void)
5417 SC_HANDLE manager
, service
;
5420 if (is_process_limited())
5422 skip("process is limited\n");
5426 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5427 ok(manager
!= NULL
, "can't open service manager %u\n", GetLastError());
5428 if (!manager
) return;
5430 service
= CreateServiceA(manager
, "TestService3", "TestService3",
5431 SERVICE_ALL_ACCESS
, SERVICE_WIN32_OWN_PROCESS
, SERVICE_DEMAND_START
,
5432 SERVICE_ERROR_NORMAL
, "C:\\doesnt_exist.exe", NULL
, NULL
, NULL
, NULL
, NULL
);
5433 ok(service
!= NULL
, "can't create service %u\n", GetLastError());
5434 CloseServiceHandle(service
);
5435 CloseServiceHandle(manager
);
5436 if (!service
) goto error
;
5438 create_test_files();
5439 create_database(msifile
, sds_tables
, sizeof(sds_tables
) / sizeof(msi_table
));
5441 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5443 r
= MsiInstallProductA(msifile
, NULL
);
5444 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5446 skip("Not enough rights to perform tests\n");
5449 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5451 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5452 ok(manager
!= NULL
, "can't open service manager\n");
5453 if (!manager
) goto error
;
5455 service
= OpenServiceA(manager
, "TestService3", GENERIC_ALL
);
5456 error
= GetLastError();
5457 ok(service
== NULL
, "TestService3 not deleted\n");
5458 ok(error
== ERROR_SERVICE_DOES_NOT_EXIST
, "wrong error %u\n", error
);
5459 CloseServiceHandle(manager
);
5461 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5462 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5464 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5465 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5466 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5467 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5468 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5469 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5470 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5471 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5472 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5473 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5474 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5475 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5476 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5479 delete_test_files();
5480 DeleteFileA(msifile
);
5483 static void test_install_services(void)
5486 SC_HANDLE manager
, service
;
5489 if (is_process_limited())
5491 skip("process is limited\n");
5495 create_test_files();
5496 create_database(msifile
, sis_tables
, sizeof(sis_tables
) / sizeof(msi_table
));
5498 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5500 r
= MsiInstallProductA(msifile
, NULL
);
5501 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5503 skip("Not enough rights to perform tests\n");
5506 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5508 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5509 ok(manager
!= NULL
, "can't open service manager\n");
5510 if (!manager
) goto error
;
5512 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5513 ok(service
!= NULL
, "TestService not installed\n");
5514 CloseServiceHandle(service
);
5516 service
= OpenServiceA(manager
, "TestService4", GENERIC_ALL
);
5517 ok(service
== NULL
, "TestService4 installed\n");
5518 CloseServiceHandle(manager
);
5520 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5523 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5524 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5525 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5526 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5527 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5528 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5529 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5530 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5531 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5532 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5533 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5534 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5535 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5537 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5538 ok(manager
!= NULL
, "can't open service manager\n");
5539 if (!manager
) goto error
;
5541 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5542 ok(service
!= NULL
, "TestService doesn't exist\n");
5544 ret
= DeleteService( service
);
5545 ok( ret
, "failed to delete service %u\n", GetLastError() );
5547 CloseServiceHandle(service
);
5548 CloseServiceHandle(manager
);
5551 delete_test_files();
5552 DeleteFileA(msifile
);
5555 static void test_self_registration(void)
5559 if (is_process_limited())
5561 skip("process is limited\n");
5565 create_test_files();
5566 create_database(msifile
, sr_tables
, sizeof(sr_tables
) / sizeof(msi_table
));
5568 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5570 r
= MsiInstallProductA(msifile
, NULL
);
5571 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5573 skip("Not enough rights to perform tests\n");
5576 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5578 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5579 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5580 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5581 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5582 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5583 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5584 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5585 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5586 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5587 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5588 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5589 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5590 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5593 delete_test_files();
5594 DeleteFileA(msifile
);
5597 static void test_register_font(void)
5599 static const char regfont1
[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5600 static const char regfont2
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5604 REGSAM access
= KEY_ALL_ACCESS
;
5606 if (is_process_limited())
5608 skip("process is limited\n");
5612 create_test_files();
5613 create_file("msitest\\font.ttf", 1000);
5614 create_database(msifile
, font_tables
, sizeof(font_tables
) / sizeof(msi_table
));
5617 access
|= KEY_WOW64_64KEY
;
5619 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5621 r
= MsiInstallProductA(msifile
, NULL
);
5622 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5624 skip("Not enough rights to perform tests\n");
5627 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5629 ret
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont1
, 0, access
, &key
);
5631 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont2
, 0, access
, &key
);
5633 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5634 ok(ret
!= ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5636 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5637 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5639 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5641 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5642 ok(ret
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5644 RegDeleteValueA(key
, "msi test font");
5648 DeleteFileA("msitest\\font.ttf");
5649 delete_test_files();
5650 DeleteFileA(msifile
);
5653 static void test_validate_product_id(void)
5657 if (is_process_limited())
5659 skip("process is limited\n");
5663 create_test_files();
5664 create_database(msifile
, vp_tables
, sizeof(vp_tables
) / sizeof(msi_table
));
5666 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5668 r
= MsiInstallProductA(msifile
, NULL
);
5669 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5671 skip("Not enough rights to perform tests\n");
5674 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5676 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=1");
5677 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5679 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=2");
5680 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5682 r
= MsiInstallProductA(msifile
, "PIDKEY=123-1234567");
5683 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5685 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5686 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5687 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5688 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5689 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5690 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5691 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5692 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5693 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5694 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5695 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5696 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5697 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5700 delete_test_files();
5701 DeleteFileA(msifile
);
5704 static void test_install_remove_odbc(void)
5708 if (is_process_limited())
5710 skip("process is limited\n");
5714 create_test_files();
5715 create_file("msitest\\ODBCdriver.dll", 1000);
5716 create_file("msitest\\ODBCdriver2.dll", 1000);
5717 create_file("msitest\\ODBCtranslator.dll", 1000);
5718 create_file("msitest\\ODBCtranslator2.dll", 1000);
5719 create_file("msitest\\ODBCsetup.dll", 1000);
5720 create_database(msifile
, odbc_tables
, sizeof(odbc_tables
) / sizeof(msi_table
));
5722 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5724 r
= MsiInstallProductA(msifile
, NULL
);
5725 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5727 skip("Not enough rights to perform tests\n");
5730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5732 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5733 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5734 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5735 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5736 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5738 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5739 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5741 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE
), "file not removed\n");
5742 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE
), "file not removed\n");
5743 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE
), "file not removed\n");
5744 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE
), "file not removed\n");
5745 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE
), "file not removed\n");
5746 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5749 DeleteFileA("msitest\\ODBCdriver.dll");
5750 DeleteFileA("msitest\\ODBCdriver2.dll");
5751 DeleteFileA("msitest\\ODBCtranslator.dll");
5752 DeleteFileA("msitest\\ODBCtranslator2.dll");
5753 DeleteFileA("msitest\\ODBCsetup.dll");
5754 delete_test_files();
5755 DeleteFileA(msifile
);
5758 static void test_register_typelib(void)
5762 if (is_process_limited())
5764 skip("process is limited\n");
5768 create_test_files();
5769 create_file("msitest\\typelib.dll", 1000);
5770 create_database(msifile
, tl_tables
, sizeof(tl_tables
) / sizeof(msi_table
));
5772 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5774 r
= MsiInstallProductA(msifile
, "REGISTER_TYPELIB=1");
5775 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5777 skip("Not enough rights to perform tests\n");
5780 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5782 r
= MsiInstallProductA(msifile
, NULL
);
5783 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5785 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5786 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5788 ok(!delete_pf("msitest\\typelib.dll", TRUE
), "file not removed\n");
5789 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5792 DeleteFileA("msitest\\typelib.dll");
5793 delete_test_files();
5794 DeleteFileA(msifile
);
5797 static void test_create_remove_shortcut(void)
5801 if (is_process_limited())
5803 skip("process is limited\n");
5807 create_test_files();
5808 create_file("msitest\\target.txt", 1000);
5809 create_database(msifile
, crs_tables
, sizeof(crs_tables
) / sizeof(msi_table
));
5811 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5813 r
= MsiInstallProductA(msifile
, NULL
);
5814 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5816 skip("Not enough rights to perform tests\n");
5819 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5821 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5822 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5824 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5825 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5827 ok(!delete_pf("msitest\\shortcut.lnk", TRUE
), "file not removed\n");
5828 ok(!delete_pf("msitest\\target.txt", TRUE
), "file not removed\n");
5829 todo_wine
ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5832 DeleteFileA("msitest\\target.txt");
5833 delete_test_files();
5834 DeleteFileA(msifile
);
5837 static void test_publish_components(void)
5839 static const char keypath
[] =
5840 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5846 if (is_process_limited())
5848 skip("process is limited\n");
5852 create_test_files();
5853 create_file("msitest\\english.txt", 1000);
5854 create_database(msifile
, pub_tables
, sizeof(pub_tables
) / sizeof(msi_table
));
5856 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5858 r
= MsiInstallProductA(msifile
, NULL
);
5859 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5861 skip("Not enough rights to perform tests\n");
5864 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5866 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5867 ok(res
== ERROR_SUCCESS
, "components key not created %d\n", res
);
5869 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, NULL
, NULL
);
5870 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5873 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5874 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5876 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5877 ok(res
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", res
);
5879 ok(!delete_pf("msitest\\english.txt", TRUE
), "file not removed\n");
5880 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5883 DeleteFileA("msitest\\english.txt");
5884 delete_test_files();
5885 DeleteFileA(msifile
);
5888 static void test_remove_duplicate_files(void)
5892 if (is_process_limited())
5894 skip("process is limited\n");
5898 create_test_files();
5899 create_file("msitest\\original.txt", 1000);
5900 create_file("msitest\\original2.txt", 1000);
5901 create_file("msitest\\original3.txt", 1000);
5902 create_database(msifile
, rd_tables
, sizeof(rd_tables
) / sizeof(msi_table
));
5904 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5906 r
= MsiInstallProductA(msifile
, NULL
);
5907 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5909 skip("Not enough rights to perform tests\n");
5912 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5914 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5915 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5916 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5917 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5918 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5920 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5921 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5923 ok(delete_pf("msitest\\original.txt", TRUE
), "file removed\n");
5924 ok(!delete_pf("msitest\\original2.txt", TRUE
), "file not removed\n");
5925 ok(!delete_pf("msitest\\original3.txt", TRUE
), "file not removed\n");
5926 ok(!delete_pf("msitest\\duplicate.txt", TRUE
), "file not removed\n");
5927 ok(!delete_pf("msitest\\duplicate2.txt", TRUE
), "file not removed\n");
5928 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5931 DeleteFileA("msitest\\original.txt");
5932 DeleteFileA("msitest\\original2.txt");
5933 DeleteFileA("msitest\\original3.txt");
5934 delete_test_files();
5935 DeleteFileA(msifile
);
5938 static void test_remove_registry_values(void)
5943 REGSAM access
= KEY_ALL_ACCESS
;
5945 if (is_process_limited())
5947 skip("process is limited\n");
5951 create_test_files();
5952 create_file("msitest\\registry.txt", 1000);
5953 create_database(msifile
, rrv_tables
, sizeof(rrv_tables
) / sizeof(msi_table
));
5956 access
|= KEY_WOW64_64KEY
;
5958 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5960 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5961 RegSetValueExA(key
, "value1", 0, REG_SZ
, (const BYTE
*)"1", 2);
5964 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5965 RegSetValueExA(key
, "value2", 0, REG_SZ
, (const BYTE
*)"2", 2);
5968 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5969 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
5970 RegSetValueExA(key
, "valueA", 0, REG_SZ
, (const BYTE
*)"A", 2);
5971 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
5974 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5975 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
5976 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
5979 r
= MsiInstallProductA(msifile
, NULL
);
5980 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5982 skip("Not enough rights to perform tests\n");
5985 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5987 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, access
, &key
);
5988 ok(res
== ERROR_SUCCESS
, "key removed\n");
5993 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
5994 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
5998 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
5999 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6002 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6003 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6006 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6007 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6011 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
6012 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6016 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
6017 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6020 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, access
, &key
);
6021 ok(res
== ERROR_SUCCESS
, "key removed\n");
6024 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, access
, &key
);
6025 ok(res
== ERROR_SUCCESS
, "key removed\n");
6030 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
6031 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6035 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
6036 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6039 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
6040 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
6041 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine", access
);
6043 ok(!delete_pf("msitest\\registry.txt", TRUE
), "file not removed\n");
6044 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6047 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", access
);
6048 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
6049 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
6050 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", access
);
6052 DeleteFileA("msitest\\registry.txt");
6053 delete_test_files();
6054 DeleteFileA(msifile
);
6057 static void test_find_related_products(void)
6061 if (is_process_limited())
6063 skip("process is limited\n");
6067 create_test_files();
6068 create_file("msitest\\product.txt", 1000);
6069 create_database(msifile
, frp_tables
, sizeof(frp_tables
) / sizeof(msi_table
));
6071 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6073 r
= MsiInstallProductA(msifile
, NULL
);
6074 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6076 skip("Not enough rights to perform tests\n");
6079 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6081 /* install again, so it finds the upgrade code */
6082 r
= MsiInstallProductA(msifile
, NULL
);
6083 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6085 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6086 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6088 ok(!delete_pf("msitest\\product.txt", TRUE
), "file not removed\n");
6089 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6092 DeleteFileA("msitest\\product.txt");
6093 delete_test_files();
6094 DeleteFileA(msifile
);
6097 static void test_remove_ini_values(void)
6101 char inifile
[MAX_PATH
], buf
[0x10];
6105 if (is_process_limited())
6107 skip("process is limited\n");
6111 create_test_files();
6112 create_file("msitest\\inifile.txt", 1000);
6113 create_database(msifile
, riv_tables
, sizeof(riv_tables
) / sizeof(msi_table
));
6115 lstrcpyA(inifile
, PROG_FILES_DIR
);
6116 lstrcatA(inifile
, "\\msitest");
6117 ret
= CreateDirectoryA(inifile
, NULL
);
6118 if (!ret
&& GetLastError() == ERROR_ACCESS_DENIED
)
6120 skip("Not enough rights to perform tests\n");
6123 lstrcatA(inifile
, "\\test.ini");
6124 file
= CreateFileA(inifile
, GENERIC_WRITE
|GENERIC_READ
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
6127 ret
= WritePrivateProfileStringA("section1", "key1", "value1", inifile
);
6128 ok(ret
, "failed to write profile string %u\n", GetLastError());
6130 ret
= WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile
);
6131 ok(ret
, "failed to write profile string %u\n", GetLastError());
6133 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6135 r
= MsiInstallProductA(msifile
, NULL
);
6136 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6138 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6139 ok(len
== 6, "got %u expected 6\n", len
);
6141 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6142 ok(!len
, "got %u expected 0\n", len
);
6144 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6145 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6147 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6148 ok(!len
, "got %u expected 0\n", len
);
6150 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6151 ok(!len
, "got %u expected 0\n", len
);
6153 todo_wine
ok(!delete_pf("msitest\\test.ini", TRUE
), "file removed\n");
6154 ok(!delete_pf("msitest\\inifile.txt", TRUE
), "file not removed\n");
6155 ok(delete_pf("msitest", FALSE
), "directory removed\n");
6158 DeleteFileA("msitest\\inifile.txt");
6159 delete_test_files();
6160 DeleteFileA(msifile
);
6163 static void test_remove_env_strings(void)
6171 if (is_process_limited())
6173 skip("process is limited\n");
6177 create_test_files();
6178 create_file("msitest\\envvar.txt", 1000);
6179 create_database(msifile
, res_tables
, sizeof(res_tables
) / sizeof(msi_table
));
6181 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6183 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6184 ok(!res
, "failed to open environment key %d\n", res
);
6186 RegSetValueExA(key
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"1", 2);
6187 RegSetValueExA(key
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"1", 2);
6188 RegSetValueExA(key
, "MSITESTVAR3", 0, REG_SZ
, (const BYTE
*)"1", 2);
6189 RegSetValueExA(key
, "MSITESTVAR4", 0, REG_SZ
, (const BYTE
*)"1", 2);
6190 RegSetValueExA(key
, "MSITESTVAR5", 0, REG_SZ
, (const BYTE
*)"1", 2);
6194 r
= MsiInstallProductA(msifile
, NULL
);
6195 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6197 skip("Not enough rights to perform tests\n");
6200 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6202 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6203 ok(!res
, "failed to open environment key %d\n", res
);
6207 size
= sizeof(buffer
);
6208 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6209 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6210 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6211 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6215 size
= sizeof(buffer
);
6216 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6217 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6218 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6219 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6223 size
= sizeof(buffer
);
6224 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6225 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6226 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6227 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6231 size
= sizeof(buffer
);
6232 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6233 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6234 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6235 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6239 size
= sizeof(buffer
);
6240 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6241 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6242 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6243 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6247 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6248 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6250 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6251 ok(!res
, "failed to open environment key %d\n", res
);
6253 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, NULL
, NULL
, NULL
);
6254 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6256 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, NULL
, NULL
, NULL
);
6257 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6261 size
= sizeof(buffer
);
6262 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6263 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6264 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6265 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6266 RegDeleteValueA(key
, "MSITESTVAR3");
6268 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, NULL
, NULL
, NULL
);
6269 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6273 size
= sizeof(buffer
);
6274 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6275 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6276 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6277 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6278 RegDeleteValueA(key
, "MSITESTVAR5");
6280 ok(!delete_pf("msitest\\envvar.txt", TRUE
), "file not removed\n");
6281 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6284 RegDeleteValueA(key
, "MSITESTVAR1");
6285 RegDeleteValueA(key
, "MSITESTVAR2");
6286 RegDeleteValueA(key
, "MSITESTVAR3");
6287 RegDeleteValueA(key
, "MSITESTVAR4");
6288 RegDeleteValueA(key
, "MSITESTVAR5");
6291 DeleteFileA("msitest\\envvar.txt");
6292 delete_test_files();
6293 DeleteFileA(msifile
);
6296 static void test_register_class_info(void)
6302 if (is_process_limited())
6304 skip("process is limited\n");
6308 create_test_files();
6309 create_file("msitest\\class.txt", 1000);
6310 create_database(msifile
, rci_tables
, sizeof(rci_tables
) / sizeof(msi_table
));
6312 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6314 r
= MsiInstallProductA(msifile
, NULL
);
6315 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6317 skip("Not enough rights to perform tests\n");
6320 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6323 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6325 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6326 ok(res
== ERROR_SUCCESS
, "key not created\n");
6329 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6330 ok(res
== ERROR_SUCCESS
, "key not created\n");
6333 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6334 ok(res
== ERROR_SUCCESS
, "key not created\n");
6337 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6338 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6341 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6343 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6344 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6346 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6347 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6349 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6350 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6352 ok(!delete_pf("msitest\\class.txt", TRUE
), "file not removed\n");
6353 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6356 DeleteFileA("msitest\\class.txt");
6357 delete_test_files();
6358 DeleteFileA(msifile
);
6361 static void test_register_extension_info(void)
6367 if (is_process_limited())
6369 skip("process is limited\n");
6373 create_test_files();
6374 create_file("msitest\\extension.txt", 1000);
6375 create_database(msifile
, rei_tables
, sizeof(rei_tables
) / sizeof(msi_table
));
6377 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6379 r
= MsiInstallProductA(msifile
, NULL
);
6380 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6382 skip("Not enough rights to perform tests\n");
6385 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6387 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6388 ok(res
== ERROR_SUCCESS
, "key not created\n");
6391 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1\\shell\\Open\\command", &hkey
);
6392 ok(res
== ERROR_SUCCESS
, "key not created\n");
6395 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6396 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6398 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6399 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6401 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1", &hkey
);
6402 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6404 ok(!delete_pf("msitest\\extension.txt", TRUE
), "file not removed\n");
6405 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6408 DeleteFileA("msitest\\extension.txt");
6409 delete_test_files();
6410 DeleteFileA(msifile
);
6413 static void test_register_progid_info(void)
6419 if (is_process_limited())
6421 skip("process is limited\n");
6425 create_test_files();
6426 create_file("msitest\\progid.txt", 1000);
6427 create_database(msifile
, rpi_tables
, sizeof(rpi_tables
) / sizeof(msi_table
));
6429 res
= RegCreateKeyExA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", 0, NULL
, 0,
6430 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
6431 ok(res
== ERROR_SUCCESS
, "key not created\n");
6434 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6436 r
= MsiInstallProductA(msifile
, NULL
);
6437 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6439 skip("Not enough rights to perform tests\n");
6442 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6445 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6447 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6448 ok(res
== ERROR_SUCCESS
, "key not created\n");
6451 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6452 ok(res
== ERROR_SUCCESS
, "key not created\n");
6455 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6456 ok(res
== ERROR_SUCCESS
, "key not created\n");
6459 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6460 ok(res
== ERROR_SUCCESS
, "key not created\n");
6463 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6464 ok(res
== ERROR_SUCCESS
, "key not created\n");
6467 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6468 ok(res
== ERROR_SUCCESS
, "key not created\n");
6471 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6472 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6473 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6475 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6476 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6478 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6479 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6480 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6482 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6483 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6485 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6486 ok(res
== ERROR_SUCCESS
, "key not created\n");
6489 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6490 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6493 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6495 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6496 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6498 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6499 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6501 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6502 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6504 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6505 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6507 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6508 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6510 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6511 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6513 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6514 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6516 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6517 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6519 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6520 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6521 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6523 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6524 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6526 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6527 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6529 ok(!delete_pf("msitest\\progid.txt", TRUE
), "file not removed\n");
6530 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6533 DeleteFileA("msitest\\progid.txt");
6534 delete_test_files();
6535 DeleteFileA(msifile
);
6536 RegDeleteKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned");
6539 static void test_register_mime_info(void)
6545 if (is_process_limited())
6547 skip("process is limited\n");
6551 create_test_files();
6552 create_file("msitest\\mime.txt", 1000);
6553 create_database(msifile
, rmi_tables
, sizeof(rmi_tables
) / sizeof(msi_table
));
6555 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6557 r
= MsiInstallProductA(msifile
, NULL
);
6558 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6560 skip("Not enough rights to perform tests\n");
6563 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6565 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6566 ok(res
== ERROR_SUCCESS
, "key not created\n");
6569 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6570 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6572 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6573 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6575 ok(!delete_pf("msitest\\mime.txt", TRUE
), "file not removed\n");
6576 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6579 DeleteFileA("msitest\\mime.txt");
6580 delete_test_files();
6581 DeleteFileA(msifile
);
6584 static void test_publish_assemblies(void)
6586 static const char manifest
[] =
6587 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6588 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6589 "processorArchitecture=\"x86\"/>";
6590 static const char manifest_local
[] =
6591 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6592 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6593 "processorArchitecture=\"x86\"/>";
6594 static const char classes_path_dotnet
[] =
6595 "Installer\\Assemblies\\Global";
6596 static const char classes_path_dotnet_local
[] =
6597 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6598 static const char classes_path_dotnet_local_wow64
[] =
6599 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6600 static const char classes_path_win32
[] =
6601 "Installer\\Win32Assemblies\\Global";
6602 static const char classes_path_win32_local
[] =
6603 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6604 static const char classes_path_win32_local_wow64
[] =
6605 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6606 static const char path_dotnet
[] =
6607 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6608 static const char path_dotnet_local
[] =
6609 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6610 static const char path_dotnet_local_wow64
[] =
6611 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6612 static const char path_win32
[] =
6613 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6614 static const char path_win32_local
[] =
6615 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6616 static const char path_win32_local_wow64
[] =
6617 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6618 static const char name_dotnet
[] =
6619 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6620 "version=\"1.0.0.0\",culture=\"neutral\"";
6621 static const char name_dotnet_local
[] =
6622 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6623 "version=\"1.0.0.0\",culture=\"neutral\"";
6624 static const char name_win32
[] =
6625 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6626 "type=\"win32\",version=\"1.0.0.0\"";
6627 static const char name_win32_local
[] =
6628 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6629 "type=\"win32\",version=\"1.0.0.0\"";
6636 if (is_process_limited())
6638 skip("process is limited\n");
6642 create_test_files();
6643 create_file("msitest\\win32.txt", 1000);
6644 create_file("msitest\\win32_local.txt", 1000);
6645 create_file("msitest\\dotnet.txt", 1000);
6646 create_file("msitest\\dotnet_local.txt", 1000);
6647 create_file_data("msitest\\manifest.txt", manifest
, 0);
6648 create_file_data("msitest\\manifest_local.txt", manifest_local
, 0);
6649 create_file("msitest\\application_win32.txt", 1000);
6650 create_file("msitest\\application_dotnet.txt", 1000);
6651 create_database(msifile
, pa_tables
, sizeof(pa_tables
) / sizeof(msi_table
));
6653 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6655 r
= MsiInstallProductA(msifile
, NULL
);
6656 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6658 skip("Not enough rights to perform tests\n");
6661 if (r
== ERROR_INSTALL_FAILURE
)
6663 skip("No support for installing side-by-side assemblies\n");
6666 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6668 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6669 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6670 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6673 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6674 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6675 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6676 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6679 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6680 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6681 "Expected ERROR_SUCCESS, got %d\n", res
);
6682 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6685 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6686 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6687 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6688 "Expected ERROR_SUCCESS, got %d\n", res
);
6689 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6692 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6693 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6695 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6696 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6697 if (res
== ERROR_SUCCESS
)
6699 res
= RegDeleteValueA(hkey
, name_dotnet
);
6700 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6704 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6705 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6706 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6708 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6709 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6710 if (res
== ERROR_SUCCESS
)
6712 res
= RegDeleteValueA(hkey
, name_win32
);
6713 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6717 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6718 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6719 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6721 r
= MsiInstallProductA(msifile
, "ALLUSERS=1");
6722 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6724 access
= KEY_QUERY_VALUE
;
6725 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6726 if (res
== ERROR_FILE_NOT_FOUND
&& is_wow64
) /* Vista WOW64 */
6728 trace("Using 64-bit registry view for HKCR\\Installer\n");
6729 access
= KEY_QUERY_VALUE
| KEY_WOW64_64KEY
;
6730 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6732 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6733 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6736 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6737 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6738 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6739 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6742 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_win32
, 0, access
, &hkey
);
6743 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6744 "Expected ERROR_SUCCESS, got %d\n", res
);
6745 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6748 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6749 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6750 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6751 "Expected ERROR_SUCCESS, got %d\n", res
);
6752 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6755 r
= MsiInstallProductA(msifile
, "REMOVE=ALL ALLUSERS=1");
6756 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6758 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, &hkey
);
6759 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6760 if (res
== ERROR_SUCCESS
)
6762 res
= RegDeleteValueA(hkey
, name_dotnet
);
6763 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6767 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6768 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6769 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6771 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_win32
, &hkey
);
6772 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6773 if (res
== ERROR_SUCCESS
)
6775 res
= RegDeleteValueA(hkey
, name_win32
);
6776 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6780 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6781 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6782 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6785 DeleteFileA("msitest\\win32.txt");
6786 DeleteFileA("msitest\\win32_local.txt");
6787 DeleteFileA("msitest\\dotnet.txt");
6788 DeleteFileA("msitest\\dotnet_local.txt");
6789 DeleteFileA("msitest\\manifest.txt");
6790 DeleteFileA("msitest\\manifest_local.txt");
6791 DeleteFileA("msitest\\application_win32.txt");
6792 DeleteFileA("msitest\\application_dotnet.txt");
6793 delete_test_files();
6794 DeleteFileA(msifile
);
6797 static void test_remove_existing_products(void)
6801 if (is_process_limited())
6803 skip("process is limited\n");
6807 create_test_files();
6808 create_file("msitest\\rep.txt", 1000);
6809 create_database(msifile
, rep_tables
, sizeof(rep_tables
) / sizeof(msi_table
));
6811 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6813 r
= MsiInstallProductA(msifile
, NULL
);
6814 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6816 skip("Not enough rights to perform tests\n");
6819 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6821 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6822 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6824 ok(!delete_pf("msitest\\rep.txt", TRUE
), "file not removed\n");
6825 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6828 DeleteFileA("msitest\\rep.txt");
6829 delete_test_files();
6830 DeleteFileA(msifile
);
6836 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6837 STATEMGRSTATUS status
;
6840 init_functionpointers();
6842 if (pIsWow64Process
)
6843 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
6845 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6846 GetTempPathA(MAX_PATH
, temp_path
);
6847 SetCurrentDirectoryA(temp_path
);
6849 lstrcpyA(CURR_DIR
, temp_path
);
6850 len
= lstrlenA(CURR_DIR
);
6852 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
6853 CURR_DIR
[len
- 1] = 0;
6855 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6856 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6858 /* Create a restore point ourselves so we circumvent the multitude of restore points
6859 * that would have been created by all the installation and removal tests.
6861 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6862 * creation of restore points.
6864 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
6866 memset(&status
, 0, sizeof(status
));
6867 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
6870 /* Create only one log file and don't append. We have to pass something
6871 * for the log mode for this to work. The logfile needs to have an absolute
6872 * path otherwise we still end up with some extra logfiles as some tests
6873 * change the current directory.
6875 lstrcpyA(log_file
, temp_path
);
6876 lstrcatA(log_file
, "\\msitest.log");
6877 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
6879 test_register_product();
6880 test_publish_product();
6881 test_publish_features();
6882 test_register_user();
6883 test_process_components();
6885 test_publish_sourcelist();
6886 test_remove_files();
6888 test_duplicate_files();
6889 test_write_registry_values();
6891 test_create_remove_folder();
6892 test_start_stop_services();
6893 test_delete_services();
6894 test_install_services();
6895 test_self_registration();
6896 test_register_font();
6897 test_validate_product_id();
6898 test_install_remove_odbc();
6899 test_register_typelib();
6900 test_create_remove_shortcut();
6901 test_publish_components();
6902 test_remove_duplicate_files();
6903 test_remove_registry_values();
6904 test_find_related_products();
6905 test_remove_ini_values();
6906 test_remove_env_strings();
6907 test_register_class_info();
6908 test_register_extension_info();
6909 test_register_progid_info();
6910 test_register_mime_info();
6911 test_publish_assemblies();
6912 test_remove_existing_products();
6914 DeleteFileA(log_file
);
6916 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
6918 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
6920 remove_restore_point(status
.llSequenceNumber
);
6922 FreeLibrary(hsrclient
);
6924 SetCurrentDirectoryA(prev_path
);