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";
187 static const char environment_dat
[] =
188 "Environment\tName\tValue\tComponent_\n"
189 "s72\tl255\tL255\ts72\n"
190 "Environment\tEnvironment\n"
191 "Var1\t=-MSITESTVAR1\t1\tOne\n"
192 "Var2\tMSITESTVAR2\t1\tOne\n"
193 "Var3\t=-MSITESTVAR3\t1\tOne\n"
194 "Var4\tMSITESTVAR4\t1\tOne\n"
195 "Var5\t-MSITESTVAR5\t\tOne\n"
196 "Var6\tMSITESTVAR6\t\tOne\n"
197 "Var7\t!-MSITESTVAR7\t\tOne\n"
198 "Var8\t!-*MSITESTVAR8\t\tOne\n"
199 "Var9\t=-MSITESTVAR9\t\tOne\n"
200 "Var10\t=MSITESTVAR10\t\tOne\n"
201 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
202 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
203 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
204 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
205 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
206 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
207 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
208 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
209 "Var19\t+-MSITESTVAR17\t1\tOne\n"
210 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
211 "Var21\t+-MSITESTVAR18\t1\tOne\n"
212 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
213 "Var23\t+-MSITESTVAR19\t1\tOne\n"
214 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
215 "Var25\t+-MSITESTVAR20\t1\tOne\n"
216 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n";
218 static const char service_install_dat
[] =
219 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
220 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
221 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
222 "ServiceInstall\tServiceInstall\n"
223 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
224 "TestService2\tSERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription";
226 static const char service_install2_dat
[] =
227 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
228 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
229 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
230 "ServiceInstall\tServiceInstall\n"
231 "TestService\tTestService\tTestService\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\n"
232 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
234 static const char service_control_dat
[] =
235 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
236 "s72\tl255\ti2\tL255\tI2\ts72\n"
237 "ServiceControl\tServiceControl\n"
238 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
239 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
241 static const char sss_service_control_dat
[] =
242 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
243 "s72\tl255\ti2\tL255\tI2\ts72\n"
244 "ServiceControl\tServiceControl\n"
245 "ServiceControl\tSpooler\t1\t\t0\tservice_comp";
247 static const char sss_install_exec_seq_dat
[] =
248 "Action\tCondition\tSequence\n"
250 "InstallExecuteSequence\tAction\n"
251 "LaunchConditions\t\t100\n"
252 "CostInitialize\t\t800\n"
254 "ResolveSource\t\t950\n"
255 "CostFinalize\t\t1000\n"
256 "InstallValidate\t\t1400\n"
257 "InstallInitialize\t\t1500\n"
258 "DeleteServices\t\t5000\n"
259 "MoveFiles\t\t5100\n"
260 "InstallFiles\t\t5200\n"
261 "DuplicateFiles\t\t5300\n"
262 "StartServices\t\t5400\n"
263 "InstallFinalize\t\t6000\n";
265 static const char sds_install_exec_seq_dat
[] =
266 "Action\tCondition\tSequence\n"
268 "InstallExecuteSequence\tAction\n"
269 "LaunchConditions\t\t100\n"
270 "CostInitialize\t\t800\n"
272 "ResolveSource\t\t950\n"
273 "CostFinalize\t\t1000\n"
274 "InstallValidate\t\t1400\n"
275 "InstallInitialize\t\t1500\n"
276 "StopServices\t\t5000\n"
277 "DeleteServices\t\t5050\n"
278 "MoveFiles\t\t5100\n"
279 "InstallFiles\t\t5200\n"
280 "DuplicateFiles\t\t5300\n"
281 "InstallServices\t\t5400\n"
282 "StartServices\t\t5450\n"
283 "RegisterProduct\t\t5500\n"
284 "PublishFeatures\t\t5600\n"
285 "PublishProduct\t\t5700\n"
286 "InstallFinalize\t\t6000\n";
288 static const char rof_component_dat
[] =
289 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
290 "s72\tS38\ts72\ti2\tS255\tS72\n"
291 "Component\tComponent\n"
292 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
294 static const char rof_feature_dat
[] =
295 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
296 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
298 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
299 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
301 static const char rof_feature_comp_dat
[] =
302 "Feature_\tComponent_\n"
304 "FeatureComponents\tFeature_\tComponent_\n"
306 "montecristo\tmaximus";
308 static const char rof_file_dat
[] =
309 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
310 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
312 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
314 static const char rof_media_dat
[] =
315 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
316 "i2\ti4\tL64\tS255\tS32\tS72\n"
318 "1\t1\t\t\tDISK1\t\n";
320 static const char ci2_feature_comp_dat
[] =
321 "Feature_\tComponent_\n"
323 "FeatureComponents\tFeature_\tComponent_\n"
326 static const char ci2_file_dat
[] =
327 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
328 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
330 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
332 static const char pp_install_exec_seq_dat
[] =
333 "Action\tCondition\tSequence\n"
335 "InstallExecuteSequence\tAction\n"
336 "ValidateProductID\t\t700\n"
337 "CostInitialize\t\t800\n"
339 "CostFinalize\t\t1000\n"
340 "InstallValidate\t\t1400\n"
341 "InstallInitialize\t\t1500\n"
342 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
343 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
344 "RemoveFiles\t\t3500\n"
345 "InstallFiles\t\t4000\n"
346 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
347 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
348 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
349 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
350 "InstallFinalize\t\t6600";
352 static const char pp_component_dat
[] =
353 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
354 "s72\tS38\ts72\ti2\tS255\tS72\n"
355 "Component\tComponent\n"
356 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
358 static const char ppc_component_dat
[] =
359 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
360 "s72\tS38\ts72\ti2\tS255\tS72\n"
361 "Component\tComponent\n"
362 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
363 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
365 static const char ppc_file_dat
[] =
366 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
367 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
369 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
370 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
372 static const char ppc_media_dat
[] =
373 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
374 "i2\ti4\tL64\tS255\tS32\tS72\n"
376 "1\t2\t\t\tDISK1\t\n";
378 static const char ppc_feature_comp_dat
[] =
379 "Feature_\tComponent_\n"
381 "FeatureComponents\tFeature_\tComponent_\n"
383 "feature\taugustus\n"
384 "montecristo\tmaximus";
386 static const char cwd_component_dat
[] =
387 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
388 "s72\tS38\ts72\ti2\tS255\tS72\n"
389 "Component\tComponent\n"
390 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
392 static const char rem_component_dat
[] =
393 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
394 "s72\tS38\ts72\ti2\tS255\tS72\n"
395 "Component\tComponent\n"
396 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
397 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
398 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
400 static const char rem_feature_comp_dat
[] =
401 "Feature_\tComponent_\n"
403 "FeatureComponents\tFeature_\tComponent_\n"
404 "feature\thydrogen\n"
408 static const char rem_file_dat
[] =
409 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
410 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
412 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
413 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
414 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
416 static const char rem_install_exec_seq_dat
[] =
417 "Action\tCondition\tSequence\n"
419 "InstallExecuteSequence\tAction\n"
420 "ValidateProductID\t\t700\n"
421 "CostInitialize\t\t800\n"
423 "CostFinalize\t\t1000\n"
424 "InstallValidate\t\t1400\n"
425 "InstallInitialize\t\t1500\n"
426 "ProcessComponents\t\t1600\n"
427 "UnpublishFeatures\t\t1800\n"
428 "RemoveFiles\t\t3500\n"
429 "InstallFiles\t\t4000\n"
430 "RegisterProduct\t\t6100\n"
431 "PublishFeatures\t\t6300\n"
432 "PublishProduct\t\t6400\n"
433 "InstallFinalize\t\t6600";
435 static const char rem_remove_files_dat
[] =
436 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
437 "s72\ts72\tS255\ts72\tI2\n"
438 "RemoveFile\tFileKey\n"
439 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
440 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
441 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
442 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
443 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
444 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
445 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
446 "block\thelium\tblock\tMSITESTDIR\t3\n"
447 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
448 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
450 static const char mov_move_file_dat
[] =
451 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
452 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
453 "MoveFile\tFileKey\n"
454 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
455 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
456 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
457 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
458 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
459 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
460 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
461 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
462 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
463 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
464 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
465 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
466 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
467 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
468 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
469 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
470 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
471 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
473 static const char df_directory_dat
[] =
474 "Directory\tDirectory_Parent\tDefaultDir\n"
476 "Directory\tDirectory\n"
477 "THIS\tMSITESTDIR\tthis\n"
478 "DOESNOT\tTHIS\tdoesnot\n"
479 "NONEXISTENT\tDOESNOT\texist\n"
480 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
481 "ProgramFilesFolder\tTARGETDIR\t.\n"
482 "TARGETDIR\t\tSourceDir";
484 static const char df_duplicate_file_dat
[] =
485 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
486 "s72\ts72\ts72\tS255\tS72\n"
487 "DuplicateFile\tFileKey\n"
488 "maximus\tmaximus\tmaximus\taugustus\t\n"
489 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
490 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
492 static const char wrv_component_dat
[] =
493 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
494 "s72\tS38\ts72\ti2\tS255\tS72\n"
495 "Component\tComponent\n"
496 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
498 static const char wrv_registry_dat
[] =
499 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
500 "s72\ti2\tl255\tL255\tL0\ts72\n"
501 "Registry\tRegistry\n"
502 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
503 "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
504 "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
505 "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
506 "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"
507 "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
508 "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
509 "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
510 "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
511 "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
512 "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
513 "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n";
515 static const char cf_directory_dat
[] =
516 "Directory\tDirectory_Parent\tDefaultDir\n"
518 "Directory\tDirectory\n"
519 "FIRSTDIR\tMSITESTDIR\tfirst\n"
520 "SECONDDIR\tMSITESTDIR\tsecond\n"
521 "THIRDDIR\tMSITESTDIR\tthird\n"
522 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
523 "ProgramFilesFolder\tTARGETDIR\t.\n"
524 "TARGETDIR\t\tSourceDir";
526 static const char cf_component_dat
[] =
527 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
528 "s72\tS38\ts72\ti2\tS255\tS72\n"
529 "Component\tComponent\n"
530 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
531 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
533 static const char cf_feature_dat
[] =
534 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
535 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
537 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
538 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
540 static const char cf_feature_comp_dat
[] =
541 "Feature_\tComponent_\n"
543 "FeatureComponents\tFeature_\tComponent_\n"
547 static const char cf_file_dat
[] =
548 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
549 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
551 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
552 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
554 static const char cf_create_folders_dat
[] =
555 "Directory_\tComponent_\n"
557 "CreateFolder\tDirectory_\tComponent_\n"
562 static const char cf_install_exec_seq_dat
[] =
563 "Action\tCondition\tSequence\n"
565 "InstallExecuteSequence\tAction\n"
566 "CostFinalize\t\t1000\n"
567 "ValidateProductID\t\t700\n"
568 "CostInitialize\t\t800\n"
570 "RemoveFiles\t\t3500\n"
571 "CreateFolders\t\t3700\n"
572 "RemoveFolders\t\t3800\n"
573 "InstallFiles\t\t4000\n"
574 "RegisterUser\t\t6000\n"
575 "RegisterProduct\t\t6100\n"
576 "PublishFeatures\t\t6300\n"
577 "PublishProduct\t\t6400\n"
578 "InstallFinalize\t\t6600\n"
579 "InstallInitialize\t\t1500\n"
580 "ProcessComponents\t\t1600\n"
581 "UnpublishFeatures\t\t1800\n"
582 "InstallValidate\t\t1400\n"
583 "LaunchConditions\t\t100\n";
585 static const char sr_selfreg_dat
[] =
591 static const char sr_install_exec_seq_dat
[] =
592 "Action\tCondition\tSequence\n"
594 "InstallExecuteSequence\tAction\n"
595 "CostFinalize\t\t1000\n"
596 "CostInitialize\t\t800\n"
598 "ResolveSource\t\t950\n"
599 "MoveFiles\t\t1700\n"
600 "SelfUnregModules\t\t3900\n"
601 "InstallFiles\t\t4000\n"
602 "DuplicateFiles\t\t4500\n"
603 "WriteEnvironmentStrings\t\t4550\n"
604 "CreateShortcuts\t\t4600\n"
605 "InstallFinalize\t\t6600\n"
606 "InstallInitialize\t\t1500\n"
607 "InstallValidate\t\t1400\n"
608 "LaunchConditions\t\t100\n";
610 static const char font_media_dat
[] =
611 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
612 "i2\ti4\tL64\tS255\tS32\tS72\n"
614 "1\t3\t\t\tDISK1\t\n";
616 static const char font_file_dat
[] =
617 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
618 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
620 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
622 static const char font_feature_dat
[] =
623 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
624 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
626 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
628 static const char font_component_dat
[] =
629 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
630 "s72\tS38\ts72\ti2\tS255\tS72\n"
631 "Component\tComponent\n"
632 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
634 static const char font_feature_comp_dat
[] =
635 "Feature_\tComponent_\n"
637 "FeatureComponents\tFeature_\tComponent_\n"
640 static const char font_dat
[] =
644 "font.ttf\tmsi test font\n";
646 static const char font_install_exec_seq_dat
[] =
647 "Action\tCondition\tSequence\n"
649 "InstallExecuteSequence\tAction\n"
650 "ValidateProductID\t\t700\n"
651 "CostInitialize\t\t800\n"
653 "CostFinalize\t\t1000\n"
654 "InstallValidate\t\t1400\n"
655 "InstallInitialize\t\t1500\n"
656 "ProcessComponents\t\t1600\n"
657 "UnpublishFeatures\t\t1800\n"
658 "RemoveFiles\t\t3500\n"
659 "InstallFiles\t\t4000\n"
660 "RegisterFonts\t\t4100\n"
661 "UnregisterFonts\t\t4200\n"
662 "RegisterUser\t\t6000\n"
663 "RegisterProduct\t\t6100\n"
664 "PublishFeatures\t\t6300\n"
665 "PublishProduct\t\t6400\n"
666 "InstallFinalize\t\t6600";
668 static const char vp_property_dat
[] =
671 "Property\tProperty\n"
674 "InstallMode\tTypical\n"
675 "Manufacturer\tWine\n"
676 "PIDTemplate\t###-#######\n"
677 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
678 "ProductLanguage\t1033\n"
679 "ProductName\tMSITEST\n"
680 "ProductVersion\t1.1.1\n"
681 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
682 "MSIFASTINSTALL\t1\n";
684 static const char vp_custom_action_dat
[] =
685 "Action\tType\tSource\tTarget\tISComments\n"
686 "s72\ti2\tS64\tS0\tS255\n"
687 "CustomAction\tAction\n"
688 "SetProductID1\t51\tProductID\t1\t\n"
689 "SetProductID2\t51\tProductID\t2\t\n"
690 "TestProductID1\t19\t\t\tHalts installation\n"
691 "TestProductID2\t19\t\t\tHalts installation\n";
693 static const char vp_install_exec_seq_dat
[] =
694 "Action\tCondition\tSequence\n"
696 "InstallExecuteSequence\tAction\n"
697 "LaunchConditions\t\t100\n"
698 "CostInitialize\t\t800\n"
700 "CostFinalize\t\t1000\n"
701 "InstallValidate\t\t1400\n"
702 "InstallInitialize\t\t1500\n"
703 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
704 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
705 "ValidateProductID\t\t3200\n"
706 "InstallExecute\t\t3300\n"
707 "TestProductID1\tProductID=1\t3400\n"
708 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
709 "InstallFiles\t\t4000\n"
710 "InstallFinalize\t\t6000\n";
712 static const char odbc_file_dat
[] =
713 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
714 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
716 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
717 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
718 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
719 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
720 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
722 static const char odbc_feature_dat
[] =
723 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
724 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
726 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
728 static const char odbc_feature_comp_dat
[] =
729 "Feature_\tComponent_\n"
731 "FeatureComponents\tFeature_\tComponent_\n"
734 static const char odbc_component_dat
[] =
735 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
736 "s72\tS38\ts72\ti2\tS255\tS72\n"
737 "Component\tComponent\n"
738 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
740 static const char odbc_driver_dat
[] =
741 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
742 "s72\ts72\ts255\ts72\tS72\n"
743 "ODBCDriver\tDriver\n"
744 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
745 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
747 static const char odbc_translator_dat
[] =
748 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
749 "s72\ts72\ts255\ts72\tS72\n"
750 "ODBCTranslator\tTranslator\n"
751 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
752 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
754 static const char odbc_datasource_dat
[] =
755 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
756 "s72\ts72\ts255\ts255\ti2\n"
757 "ODBCDataSource\tDataSource\n"
758 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
760 static const char odbc_install_exec_seq_dat
[] =
761 "Action\tCondition\tSequence\n"
763 "InstallExecuteSequence\tAction\n"
764 "LaunchConditions\t\t100\n"
765 "CostInitialize\t\t800\n"
767 "CostFinalize\t\t1000\n"
768 "InstallValidate\t\t1400\n"
769 "InstallInitialize\t\t1500\n"
770 "ProcessComponents\t\t1600\n"
771 "InstallODBC\t\t3000\n"
772 "RemoveODBC\t\t3100\n"
773 "RemoveFiles\t\t3900\n"
774 "InstallFiles\t\t4000\n"
775 "RegisterProduct\t\t5000\n"
776 "PublishFeatures\t\t5100\n"
777 "PublishProduct\t\t5200\n"
778 "InstallFinalize\t\t6000\n";
780 static const char odbc_media_dat
[] =
781 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
782 "i2\ti4\tL64\tS255\tS32\tS72\n"
784 "1\t5\t\t\tDISK1\t\n";
786 static const char tl_file_dat
[] =
787 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
788 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
790 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
792 static const char tl_feature_dat
[] =
793 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
794 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
796 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
798 static const char tl_feature_comp_dat
[] =
799 "Feature_\tComponent_\n"
801 "FeatureComponents\tFeature_\tComponent_\n"
802 "typelib\ttypelib\n";
804 static const char tl_component_dat
[] =
805 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
806 "s72\tS38\ts72\ti2\tS255\tS72\n"
807 "Component\tComponent\n"
808 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
810 static const char tl_typelib_dat
[] =
811 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
812 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
813 "TypeLib\tLibID\tLanguage\tComponent_\n"
814 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
816 static const char tl_install_exec_seq_dat
[] =
817 "Action\tCondition\tSequence\n"
819 "InstallExecuteSequence\tAction\n"
820 "LaunchConditions\t\t100\n"
821 "CostInitialize\t\t800\n"
823 "CostFinalize\t\t1000\n"
824 "InstallValidate\t\t1400\n"
825 "InstallInitialize\t\t1500\n"
826 "ProcessComponents\t\t1600\n"
827 "RemoveFiles\t\t1700\n"
828 "InstallFiles\t\t2000\n"
829 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
830 "UnregisterTypeLibraries\t\t3100\n"
831 "RegisterProduct\t\t5100\n"
832 "PublishFeatures\t\t5200\n"
833 "PublishProduct\t\t5300\n"
834 "InstallFinalize\t\t6000\n";
836 static const char crs_file_dat
[] =
837 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
838 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
840 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
842 static const char crs_feature_dat
[] =
843 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
844 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
846 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
848 static const char crs_feature_comp_dat
[] =
849 "Feature_\tComponent_\n"
851 "FeatureComponents\tFeature_\tComponent_\n"
852 "shortcut\tshortcut\n";
854 static const char crs_component_dat
[] =
855 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
856 "s72\tS38\ts72\ti2\tS255\tS72\n"
857 "Component\tComponent\n"
858 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
860 static const char crs_shortcut_dat
[] =
861 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
862 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
863 "Shortcut\tShortcut\n"
864 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
866 static const char crs_install_exec_seq_dat
[] =
867 "Action\tCondition\tSequence\n"
869 "InstallExecuteSequence\tAction\n"
870 "LaunchConditions\t\t100\n"
871 "CostInitialize\t\t800\n"
873 "CostFinalize\t\t1000\n"
874 "InstallValidate\t\t1400\n"
875 "InstallInitialize\t\t1500\n"
876 "ProcessComponents\t\t1600\n"
877 "RemoveFiles\t\t1700\n"
878 "InstallFiles\t\t2000\n"
879 "RemoveShortcuts\t\t3000\n"
880 "CreateShortcuts\t\t3100\n"
881 "RegisterProduct\t\t5000\n"
882 "PublishFeatures\t\t5100\n"
883 "PublishProduct\t\t5200\n"
884 "InstallFinalize\t\t6000\n";
886 static const char pub_file_dat
[] =
887 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
888 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
890 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
892 static const char pub_feature_dat
[] =
893 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
894 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
896 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
898 static const char pub_feature_comp_dat
[] =
899 "Feature_\tComponent_\n"
901 "FeatureComponents\tFeature_\tComponent_\n"
902 "publish\tpublish\n";
904 static const char pub_component_dat
[] =
905 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
906 "s72\tS38\ts72\ti2\tS255\tS72\n"
907 "Component\tComponent\n"
908 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
910 static const char pub_publish_component_dat
[] =
911 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
912 "s38\ts255\ts72\tL255\ts38\n"
913 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
914 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
916 static const char pub_install_exec_seq_dat
[] =
917 "Action\tCondition\tSequence\n"
919 "InstallExecuteSequence\tAction\n"
920 "LaunchConditions\t\t100\n"
921 "CostInitialize\t\t800\n"
923 "CostFinalize\t\t1000\n"
924 "InstallValidate\t\t1400\n"
925 "InstallInitialize\t\t1500\n"
926 "ProcessComponents\t\t1600\n"
927 "RemoveFiles\t\t1700\n"
928 "InstallFiles\t\t2000\n"
929 "PublishComponents\t\t3000\n"
930 "UnpublishComponents\t\t3100\n"
931 "RegisterProduct\t\t5000\n"
932 "PublishFeatures\t\t5100\n"
933 "PublishProduct\t\t5200\n"
934 "InstallFinalize\t\t6000\n";
936 static const char rd_file_dat
[] =
937 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
938 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
940 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
941 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
942 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
944 static const char rd_feature_dat
[] =
945 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
946 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
948 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
950 static const char rd_feature_comp_dat
[] =
951 "Feature_\tComponent_\n"
953 "FeatureComponents\tFeature_\tComponent_\n"
954 "duplicate\tduplicate\n";
956 static const char rd_component_dat
[] =
957 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
958 "s72\tS38\ts72\ti2\tS255\tS72\n"
959 "Component\tComponent\n"
960 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
961 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
963 static const char rd_duplicate_file_dat
[] =
964 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
965 "s72\ts72\ts72\tS255\tS72\n"
966 "DuplicateFile\tFileKey\n"
967 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
968 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
969 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
971 static const char rd_install_exec_seq_dat
[] =
972 "Action\tCondition\tSequence\n"
974 "InstallExecuteSequence\tAction\n"
975 "LaunchConditions\t\t100\n"
976 "CostInitialize\t\t800\n"
978 "CostFinalize\t\t1000\n"
979 "InstallValidate\t\t1400\n"
980 "InstallInitialize\t\t1500\n"
981 "ProcessComponents\t\t1600\n"
982 "RemoveDuplicateFiles\t\t1900\n"
983 "InstallFiles\t\t2000\n"
984 "DuplicateFiles\t\t2100\n"
985 "RegisterProduct\t\t5000\n"
986 "PublishFeatures\t\t5100\n"
987 "PublishProduct\t\t5200\n"
988 "InstallFinalize\t\t6000\n";
990 static const char rrv_file_dat
[] =
991 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
992 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
994 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
996 static const char rrv_feature_dat
[] =
997 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
998 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1000 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1002 static const char rrv_feature_comp_dat
[] =
1003 "Feature_\tComponent_\n"
1005 "FeatureComponents\tFeature_\tComponent_\n"
1006 "registry\tregistry\n";
1008 static const char rrv_component_dat
[] =
1009 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1010 "s72\tS38\ts72\ti2\tS255\tS72\n"
1011 "Component\tComponent\n"
1012 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1014 static const char rrv_registry_dat
[] =
1015 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1016 "s72\ti2\tl255\tL255\tL0\ts72\n"
1017 "Registry\tRegistry\n"
1018 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1019 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1020 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1022 static const char rrv_remove_registry_dat
[] =
1023 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1024 "s72\ti2\tl255\tL255\ts72\n"
1025 "RemoveRegistry\tRemoveRegistry\n"
1026 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1027 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1028 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1030 static const char rrv_install_exec_seq_dat
[] =
1031 "Action\tCondition\tSequence\n"
1033 "InstallExecuteSequence\tAction\n"
1034 "LaunchConditions\t\t100\n"
1035 "CostInitialize\t\t800\n"
1037 "CostFinalize\t\t1000\n"
1038 "InstallValidate\t\t1400\n"
1039 "InstallInitialize\t\t1500\n"
1040 "ProcessComponents\t\t1600\n"
1041 "RemoveFiles\t\t1700\n"
1042 "InstallFiles\t\t2000\n"
1043 "RemoveRegistryValues\t\t3000\n"
1044 "RegisterProduct\t\t5000\n"
1045 "PublishFeatures\t\t5100\n"
1046 "PublishProduct\t\t5200\n"
1047 "InstallFinalize\t\t6000\n";
1049 static const char frp_file_dat
[] =
1050 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1051 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1053 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1055 static const char frp_feature_dat
[] =
1056 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1057 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1058 "Feature\tFeature\n"
1059 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1061 static const char frp_feature_comp_dat
[] =
1062 "Feature_\tComponent_\n"
1064 "FeatureComponents\tFeature_\tComponent_\n"
1065 "product\tproduct\n";
1067 static const char frp_component_dat
[] =
1068 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1069 "s72\tS38\ts72\ti2\tS255\tS72\n"
1070 "Component\tComponent\n"
1071 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1073 static const char frp_custom_action_dat
[] =
1074 "Action\tType\tSource\tTarget\tISComments\n"
1075 "s72\ti2\tS64\tS0\tS255\n"
1076 "CustomAction\tAction\n"
1077 "TestProp\t19\t\t\tPROP set\n";
1079 static const char frp_upgrade_dat
[] =
1080 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1081 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1082 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1083 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1085 static const char frp_install_exec_seq_dat
[] =
1086 "Action\tCondition\tSequence\n"
1088 "InstallExecuteSequence\tAction\n"
1089 "FindRelatedProducts\t\t50\n"
1090 "TestProp\tPROP AND NOT REMOVE\t51\n"
1091 "LaunchConditions\t\t100\n"
1092 "CostInitialize\t\t800\n"
1094 "CostFinalize\t\t1000\n"
1095 "InstallValidate\t\t1400\n"
1096 "InstallInitialize\t\t1500\n"
1097 "ProcessComponents\t\t1600\n"
1098 "RemoveFiles\t\t1700\n"
1099 "InstallFiles\t\t2000\n"
1100 "RegisterProduct\t\t5000\n"
1101 "PublishFeatures\t\t5100\n"
1102 "PublishProduct\t\t5200\n"
1103 "InstallFinalize\t\t6000\n";
1105 static const char riv_file_dat
[] =
1106 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1107 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1109 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1111 static const char riv_feature_dat
[] =
1112 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1113 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1114 "Feature\tFeature\n"
1115 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1117 static const char riv_feature_comp_dat
[] =
1118 "Feature_\tComponent_\n"
1120 "FeatureComponents\tFeature_\tComponent_\n"
1121 "inifile\tinifile\n";
1123 static const char riv_component_dat
[] =
1124 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1125 "s72\tS38\ts72\ti2\tS255\tS72\n"
1126 "Component\tComponent\n"
1127 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1129 static const char riv_ini_file_dat
[] =
1130 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1131 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1132 "IniFile\tIniFile\n"
1133 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1135 static const char riv_remove_ini_file_dat
[] =
1136 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1137 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1138 "RemoveIniFile\tRemoveIniFile\n"
1139 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1141 static const char riv_install_exec_seq_dat
[] =
1142 "Action\tCondition\tSequence\n"
1144 "InstallExecuteSequence\tAction\n"
1145 "LaunchConditions\t\t100\n"
1146 "CostInitialize\t\t800\n"
1148 "CostFinalize\t\t1000\n"
1149 "InstallValidate\t\t1400\n"
1150 "InstallInitialize\t\t1500\n"
1151 "ProcessComponents\t\t1600\n"
1152 "RemoveFiles\t\t1700\n"
1153 "InstallFiles\t\t2000\n"
1154 "RemoveIniValues\t\t3000\n"
1155 "RegisterProduct\t\t5000\n"
1156 "PublishFeatures\t\t5100\n"
1157 "PublishProduct\t\t5200\n"
1158 "InstallFinalize\t\t6000\n";
1160 static const char res_file_dat
[] =
1161 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1162 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1164 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1166 static const char res_feature_dat
[] =
1167 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1168 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1169 "Feature\tFeature\n"
1170 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1172 static const char res_feature_comp_dat
[] =
1173 "Feature_\tComponent_\n"
1175 "FeatureComponents\tFeature_\tComponent_\n"
1178 static const char res_component_dat
[] =
1179 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1180 "s72\tS38\ts72\ti2\tS255\tS72\n"
1181 "Component\tComponent\n"
1182 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1184 static const char res_environment_dat
[] =
1185 "Environment\tName\tValue\tComponent_\n"
1186 "s72\tl255\tL255\ts72\n"
1187 "Environment\tEnvironment\n"
1188 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1189 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1190 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1191 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1192 "var5\t=MSITESTVAR5\t\tenvvar\n";
1194 static const char res_install_exec_seq_dat
[] =
1195 "Action\tCondition\tSequence\n"
1197 "InstallExecuteSequence\tAction\n"
1198 "LaunchConditions\t\t100\n"
1199 "CostInitialize\t\t800\n"
1201 "CostFinalize\t\t1000\n"
1202 "InstallValidate\t\t1400\n"
1203 "InstallInitialize\t\t1500\n"
1204 "ProcessComponents\t\t1600\n"
1205 "RemoveFiles\t\t1700\n"
1206 "InstallFiles\t\t2000\n"
1207 "RemoveEnvironmentStrings\t\t3000\n"
1208 "RegisterProduct\t\t5000\n"
1209 "PublishFeatures\t\t5100\n"
1210 "PublishProduct\t\t5200\n"
1211 "InstallFinalize\t\t6000\n";
1213 static const char rci_file_dat
[] =
1214 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1215 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1217 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1219 static const char rci_feature_dat
[] =
1220 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1221 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1222 "Feature\tFeature\n"
1223 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1225 static const char rci_feature_comp_dat
[] =
1226 "Feature_\tComponent_\n"
1228 "FeatureComponents\tFeature_\tComponent_\n"
1231 static const char rci_component_dat
[] =
1232 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1233 "s72\tS38\ts72\ti2\tS255\tS72\n"
1234 "Component\tComponent\n"
1235 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1237 static const char rci_appid_dat
[] =
1238 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1239 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1241 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1243 static const char rci_class_dat
[] =
1244 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1245 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1246 "Class\tCLSID\tContext\tComponent_\n"
1247 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1249 static const char rci_install_exec_seq_dat
[] =
1250 "Action\tCondition\tSequence\n"
1252 "InstallExecuteSequence\tAction\n"
1253 "LaunchConditions\t\t100\n"
1254 "CostInitialize\t\t800\n"
1256 "CostFinalize\t\t1000\n"
1257 "InstallValidate\t\t1400\n"
1258 "InstallInitialize\t\t1500\n"
1259 "ProcessComponents\t\t1600\n"
1260 "RemoveFiles\t\t1700\n"
1261 "InstallFiles\t\t2000\n"
1262 "UnregisterClassInfo\t\t3000\n"
1263 "RegisterClassInfo\t\t4000\n"
1264 "RegisterProduct\t\t5000\n"
1265 "PublishFeatures\t\t5100\n"
1266 "PublishProduct\t\t5200\n"
1267 "InstallFinalize\t\t6000\n";
1269 static const char rei_file_dat
[] =
1270 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1271 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1273 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1275 static const char rei_feature_dat
[] =
1276 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1277 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1278 "Feature\tFeature\n"
1279 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1281 static const char rei_feature_comp_dat
[] =
1282 "Feature_\tComponent_\n"
1284 "FeatureComponents\tFeature_\tComponent_\n"
1285 "extension\textension\n";
1287 static const char rei_component_dat
[] =
1288 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1289 "s72\tS38\ts72\ti2\tS255\tS72\n"
1290 "Component\tComponent\n"
1291 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1293 static const char rei_extension_dat
[] =
1294 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1295 "s255\ts72\tS255\tS64\ts38\n"
1296 "Extension\tExtension\tComponent_\n"
1297 "extension\textension\tProg.Id.1\t\textension\n";
1299 static const char rei_verb_dat
[] =
1300 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1301 "s255\ts32\tI2\tL255\tL255\n"
1302 "Verb\tExtension_\tVerb\n"
1303 "extension\tOpen\t1\t&Open\t/argument\n";
1305 static const char rei_progid_dat
[] =
1306 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1307 "s255\tS255\tS38\tL255\tS72\tI2\n"
1309 "Prog.Id.1\t\t\tdescription\t\t\n";
1311 static const char rei_install_exec_seq_dat
[] =
1312 "Action\tCondition\tSequence\n"
1314 "InstallExecuteSequence\tAction\n"
1315 "LaunchConditions\t\t100\n"
1316 "CostInitialize\t\t800\n"
1318 "CostFinalize\t\t1000\n"
1319 "InstallValidate\t\t1400\n"
1320 "InstallInitialize\t\t1500\n"
1321 "ProcessComponents\t\t1600\n"
1322 "RemoveFiles\t\t1700\n"
1323 "InstallFiles\t\t2000\n"
1324 "UnregisterExtensionInfo\t\t3000\n"
1325 "RegisterExtensionInfo\t\t4000\n"
1326 "RegisterProduct\t\t5000\n"
1327 "PublishFeatures\t\t5100\n"
1328 "PublishProduct\t\t5200\n"
1329 "InstallFinalize\t\t6000\n";
1331 static const char rpi_file_dat
[] =
1332 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1333 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1335 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1337 static const char rpi_feature_dat
[] =
1338 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1339 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1340 "Feature\tFeature\n"
1341 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1343 static const char rpi_feature_comp_dat
[] =
1344 "Feature_\tComponent_\n"
1346 "FeatureComponents\tFeature_\tComponent_\n"
1349 static const char rpi_component_dat
[] =
1350 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1351 "s72\tS38\ts72\ti2\tS255\tS72\n"
1352 "Component\tComponent\n"
1353 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1355 static const char rpi_appid_dat
[] =
1356 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1357 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1359 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1361 static const char rpi_class_dat
[] =
1362 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1363 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1364 "Class\tCLSID\tContext\tComponent_\n"
1365 "{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"
1366 "{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"
1367 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1369 static const char rpi_extension_dat
[] =
1370 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1371 "s255\ts72\tS255\tS64\ts38\n"
1372 "Extension\tExtension\tComponent_\n"
1373 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1375 static const char rpi_verb_dat
[] =
1376 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1377 "s255\ts32\tI2\tL255\tL255\n"
1378 "Verb\tExtension_\tVerb\n"
1379 "winetest\tOpen\t1\t&Open\t/argument\n";
1381 static const char rpi_progid_dat
[] =
1382 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1383 "s255\tS255\tS38\tL255\tS72\tI2\n"
1385 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1386 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1387 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1388 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1389 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1390 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1391 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1392 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1393 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1394 "Winetest.Extension\t\t\tdescription\t\t\n";
1396 static const char rpi_install_exec_seq_dat
[] =
1397 "Action\tCondition\tSequence\n"
1399 "InstallExecuteSequence\tAction\n"
1400 "LaunchConditions\t\t100\n"
1401 "CostInitialize\t\t800\n"
1403 "CostFinalize\t\t1000\n"
1404 "InstallValidate\t\t1400\n"
1405 "InstallInitialize\t\t1500\n"
1406 "ProcessComponents\t\t1600\n"
1407 "RemoveFiles\t\t1700\n"
1408 "UnregisterClassInfo\t\t3000\n"
1409 "UnregisterExtensionInfo\t\t3200\n"
1410 "UnregisterProgIdInfo\t\t3400\n"
1411 "InstallFiles\t\t3600\n"
1412 "RegisterClassInfo\t\t4000\n"
1413 "RegisterExtensionInfo\t\t4200\n"
1414 "RegisterProgIdInfo\t\t4400\n"
1415 "RegisterProduct\t\t5000\n"
1416 "PublishFeatures\t\t5100\n"
1417 "PublishProduct\t\t5200\n"
1418 "InstallFinalize\t\t6000\n";
1420 static const char rmi_file_dat
[] =
1421 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1422 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1424 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1426 static const char rmi_feature_dat
[] =
1427 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1428 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1429 "Feature\tFeature\n"
1430 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1432 static const char rmi_feature_comp_dat
[] =
1433 "Feature_\tComponent_\n"
1435 "FeatureComponents\tFeature_\tComponent_\n"
1438 static const char rmi_component_dat
[] =
1439 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1440 "s72\tS38\ts72\ti2\tS255\tS72\n"
1441 "Component\tComponent\n"
1442 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1444 static const char rmi_extension_dat
[] =
1445 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1446 "s255\ts72\tS255\tS64\ts38\n"
1447 "Extension\tExtension\tComponent_\n"
1448 "mime\tmime\t\tmime/type\tmime\n";
1450 static const char rmi_verb_dat
[] =
1451 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1452 "s255\ts32\tI2\tL255\tL255\n"
1453 "Verb\tExtension_\tVerb\n"
1454 "mime\tOpen\t1\t&Open\t/argument\n";
1456 static const char rmi_mime_dat
[] =
1457 "ContentType\tExtension_\tCLSID\n"
1459 "MIME\tContentType\n"
1460 "mime/type\tmime\t\n";
1462 static const char rmi_install_exec_seq_dat
[] =
1463 "Action\tCondition\tSequence\n"
1465 "InstallExecuteSequence\tAction\n"
1466 "LaunchConditions\t\t100\n"
1467 "CostInitialize\t\t800\n"
1469 "CostFinalize\t\t1000\n"
1470 "InstallValidate\t\t1400\n"
1471 "InstallInitialize\t\t1500\n"
1472 "ProcessComponents\t\t1600\n"
1473 "RemoveFiles\t\t1700\n"
1474 "InstallFiles\t\t2000\n"
1475 "UnregisterExtensionInfo\t\t3000\n"
1476 "UnregisterMIMEInfo\t\t3500\n"
1477 "RegisterExtensionInfo\t\t4000\n"
1478 "RegisterMIMEInfo\t\t4500\n"
1479 "RegisterProduct\t\t5000\n"
1480 "PublishFeatures\t\t5100\n"
1481 "PublishProduct\t\t5200\n"
1482 "InstallFinalize\t\t6000\n";
1484 static const char pa_file_dat
[] =
1485 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1486 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1488 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1489 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1490 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1491 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1492 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1493 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1494 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1495 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1497 static const char pa_feature_dat
[] =
1498 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1499 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1500 "Feature\tFeature\n"
1501 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1503 static const char pa_feature_comp_dat
[] =
1504 "Feature_\tComponent_\n"
1506 "FeatureComponents\tFeature_\tComponent_\n"
1508 "assembly\twin32_local\n"
1509 "assembly\tdotnet\n"
1510 "assembly\tdotnet_local\n";
1512 static const char pa_component_dat
[] =
1513 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1514 "s72\tS38\ts72\ti2\tS255\tS72\n"
1515 "Component\tComponent\n"
1516 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1517 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1518 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1519 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1521 static const char pa_msi_assembly_dat
[] =
1522 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1523 "s72\ts38\tS72\tS72\tI2\n"
1524 "MsiAssembly\tComponent_\n"
1525 "win32\tassembly\tmanifest.txt\t\t1\n"
1526 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1527 "dotnet\tassembly\t\t\t0\n"
1528 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1530 static const char pa_msi_assembly_name_dat
[] =
1531 "Component_\tName\tValue\n"
1533 "MsiAssemblyName\tComponent_\tName\n"
1534 "win32\tName\tWine.Win32.Assembly\n"
1535 "win32\tprocessorArchitecture\tx86\n"
1536 "win32\tpublicKeyToken\tabcdef0123456789\n"
1537 "win32\ttype\twin32\n"
1538 "win32\tversion\t1.0.0.0\n"
1539 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1540 "win32_local\tprocessorArchitecture\tx86\n"
1541 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1542 "win32_local\ttype\twin32\n"
1543 "win32_local\tversion\t1.0.0.0\n"
1544 "dotnet\tName\tWine.Dotnet.Assembly\n"
1545 "dotnet\tprocessorArchitecture\tMSIL\n"
1546 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1547 "dotnet\tculture\tneutral\n"
1548 "dotnet\tversion\t1.0.0.0\n"
1549 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1550 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1551 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1552 "dotnet_local\tculture\tneutral\n"
1553 "dotnet_local\tversion\t1.0.0.0\n";
1555 static const char pa_install_exec_seq_dat
[] =
1556 "Action\tCondition\tSequence\n"
1558 "InstallExecuteSequence\tAction\n"
1559 "LaunchConditions\t\t100\n"
1560 "CostInitialize\t\t800\n"
1562 "CostFinalize\t\t1000\n"
1563 "InstallValidate\t\t1400\n"
1564 "InstallInitialize\t\t1500\n"
1565 "ProcessComponents\t\t1600\n"
1566 "MsiPublishAssemblies\t\t3000\n"
1567 "MsiUnpublishAssemblies\t\t4000\n"
1568 "RegisterProduct\t\t5000\n"
1569 "PublishFeatures\t\t5100\n"
1570 "PublishProduct\t\t5200\n"
1571 "InstallFinalize\t\t6000\n";
1573 static const char rep_file_dat
[] =
1574 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1575 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1577 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1579 static const char rep_feature_dat
[] =
1580 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1581 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1582 "Feature\tFeature\n"
1583 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1585 static const char rep_feature_comp_dat
[] =
1586 "Feature_\tComponent_\n"
1588 "FeatureComponents\tFeature_\tComponent_\n"
1591 static const char rep_component_dat
[] =
1592 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1593 "s72\tS38\ts72\ti2\tS255\tS72\n"
1594 "Component\tComponent\n"
1595 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1597 static const char rep_upgrade_dat
[] =
1598 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1599 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1600 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1601 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1603 static const char rep_property_dat
[] =
1606 "Property\tProperty\n"
1609 "InstallMode\tTypical\n"
1610 "Manufacturer\tWine\n"
1611 "PIDTemplate\t###-#######\n"
1612 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1613 "ProductLanguage\t1033\n"
1614 "ProductName\tMSITEST\n"
1615 "ProductVersion\t1.1.1\n"
1616 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1617 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1618 "MSIFASTINSTALL\t1\n";
1620 static const char rep_install_exec_seq_dat
[] =
1621 "Action\tCondition\tSequence\n"
1623 "InstallExecuteSequence\tAction\n"
1624 "FindRelatedProducts\t\t100\n"
1625 "CostInitialize\t\t800\n"
1627 "CostFinalize\t\t1000\n"
1628 "InstallValidate\t\t1400\n"
1629 "RemoveExistingProducts\t\t1499\n"
1630 "InstallInitialize\t\t1500\n"
1631 "ProcessComponents\t\t1600\n"
1632 "RemoveFiles\t\t1700\n"
1633 "InstallFiles\t\t2000\n"
1634 "UnregisterExtensionInfo\t\t3000\n"
1635 "UnregisterMIMEInfo\t\t3500\n"
1636 "RegisterExtensionInfo\t\t4000\n"
1637 "RegisterMIMEInfo\t\t4500\n"
1638 "RegisterProduct\t\t5000\n"
1639 "PublishFeatures\t\t5100\n"
1640 "PublishProduct\t\t5200\n"
1641 "InstallFinalize\t\t6000\n";
1643 typedef struct _msi_table
1645 const char *filename
;
1650 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1652 static const msi_table env_tables
[] =
1654 ADD_TABLE(component
),
1655 ADD_TABLE(directory
),
1657 ADD_TABLE(feature_comp
),
1659 ADD_TABLE(install_exec_seq
),
1661 ADD_TABLE(property
),
1662 ADD_TABLE(environment
)
1665 static const msi_table pp_tables
[] =
1667 ADD_TABLE(pp_component
),
1668 ADD_TABLE(directory
),
1669 ADD_TABLE(rof_feature
),
1670 ADD_TABLE(rof_feature_comp
),
1671 ADD_TABLE(rof_file
),
1672 ADD_TABLE(pp_install_exec_seq
),
1673 ADD_TABLE(rof_media
),
1674 ADD_TABLE(property
),
1677 static const msi_table ppc_tables
[] =
1679 ADD_TABLE(ppc_component
),
1680 ADD_TABLE(directory
),
1681 ADD_TABLE(rof_feature
),
1682 ADD_TABLE(ppc_feature_comp
),
1683 ADD_TABLE(ppc_file
),
1684 ADD_TABLE(pp_install_exec_seq
),
1685 ADD_TABLE(ppc_media
),
1686 ADD_TABLE(property
),
1689 static const msi_table rem_tables
[] =
1691 ADD_TABLE(rem_component
),
1692 ADD_TABLE(directory
),
1693 ADD_TABLE(rof_feature
),
1694 ADD_TABLE(rem_feature_comp
),
1695 ADD_TABLE(rem_file
),
1696 ADD_TABLE(rem_install_exec_seq
),
1697 ADD_TABLE(rof_media
),
1698 ADD_TABLE(property
),
1699 ADD_TABLE(rem_remove_files
),
1702 static const msi_table mov_tables
[] =
1704 ADD_TABLE(cwd_component
),
1705 ADD_TABLE(directory
),
1706 ADD_TABLE(rof_feature
),
1707 ADD_TABLE(ci2_feature_comp
),
1708 ADD_TABLE(ci2_file
),
1709 ADD_TABLE(install_exec_seq
),
1710 ADD_TABLE(rof_media
),
1711 ADD_TABLE(property
),
1712 ADD_TABLE(mov_move_file
),
1715 static const msi_table df_tables
[] =
1717 ADD_TABLE(rof_component
),
1718 ADD_TABLE(df_directory
),
1719 ADD_TABLE(rof_feature
),
1720 ADD_TABLE(rof_feature_comp
),
1721 ADD_TABLE(rof_file
),
1722 ADD_TABLE(install_exec_seq
),
1723 ADD_TABLE(rof_media
),
1724 ADD_TABLE(property
),
1725 ADD_TABLE(df_duplicate_file
),
1728 static const msi_table wrv_tables
[] =
1730 ADD_TABLE(wrv_component
),
1731 ADD_TABLE(directory
),
1732 ADD_TABLE(rof_feature
),
1733 ADD_TABLE(ci2_feature_comp
),
1734 ADD_TABLE(ci2_file
),
1735 ADD_TABLE(install_exec_seq
),
1736 ADD_TABLE(rof_media
),
1737 ADD_TABLE(property
),
1738 ADD_TABLE(wrv_registry
),
1741 static const msi_table cf_tables
[] =
1743 ADD_TABLE(cf_component
),
1744 ADD_TABLE(cf_directory
),
1745 ADD_TABLE(cf_feature
),
1746 ADD_TABLE(cf_feature_comp
),
1748 ADD_TABLE(cf_create_folders
),
1749 ADD_TABLE(cf_install_exec_seq
),
1754 static const msi_table sss_tables
[] =
1756 ADD_TABLE(component
),
1757 ADD_TABLE(directory
),
1759 ADD_TABLE(feature_comp
),
1761 ADD_TABLE(sss_install_exec_seq
),
1762 ADD_TABLE(sss_service_control
),
1767 static const msi_table sds_tables
[] =
1769 ADD_TABLE(component
),
1770 ADD_TABLE(directory
),
1772 ADD_TABLE(feature_comp
),
1774 ADD_TABLE(sds_install_exec_seq
),
1775 ADD_TABLE(service_control
),
1776 ADD_TABLE(service_install
),
1781 static const msi_table sis_tables
[] =
1783 ADD_TABLE(component
),
1784 ADD_TABLE(directory
),
1786 ADD_TABLE(feature_comp
),
1788 ADD_TABLE(sds_install_exec_seq
),
1789 ADD_TABLE(service_install2
),
1794 static const msi_table sr_tables
[] =
1796 ADD_TABLE(component
),
1797 ADD_TABLE(directory
),
1799 ADD_TABLE(feature_comp
),
1801 ADD_TABLE(sr_selfreg
),
1802 ADD_TABLE(sr_install_exec_seq
),
1807 static const msi_table font_tables
[] =
1809 ADD_TABLE(font_component
),
1810 ADD_TABLE(directory
),
1811 ADD_TABLE(font_feature
),
1812 ADD_TABLE(font_feature_comp
),
1813 ADD_TABLE(font_file
),
1815 ADD_TABLE(font_install_exec_seq
),
1816 ADD_TABLE(font_media
),
1820 static const msi_table vp_tables
[] =
1822 ADD_TABLE(component
),
1823 ADD_TABLE(directory
),
1825 ADD_TABLE(feature_comp
),
1827 ADD_TABLE(vp_custom_action
),
1828 ADD_TABLE(vp_install_exec_seq
),
1830 ADD_TABLE(vp_property
)
1833 static const msi_table odbc_tables
[] =
1835 ADD_TABLE(odbc_component
),
1836 ADD_TABLE(directory
),
1837 ADD_TABLE(odbc_feature
),
1838 ADD_TABLE(odbc_feature_comp
),
1839 ADD_TABLE(odbc_file
),
1840 ADD_TABLE(odbc_driver
),
1841 ADD_TABLE(odbc_translator
),
1842 ADD_TABLE(odbc_datasource
),
1843 ADD_TABLE(odbc_install_exec_seq
),
1844 ADD_TABLE(odbc_media
),
1848 static const msi_table tl_tables
[] =
1850 ADD_TABLE(tl_component
),
1851 ADD_TABLE(directory
),
1852 ADD_TABLE(tl_feature
),
1853 ADD_TABLE(tl_feature_comp
),
1855 ADD_TABLE(tl_typelib
),
1856 ADD_TABLE(tl_install_exec_seq
),
1861 static const msi_table crs_tables
[] =
1863 ADD_TABLE(crs_component
),
1864 ADD_TABLE(directory
),
1865 ADD_TABLE(crs_feature
),
1866 ADD_TABLE(crs_feature_comp
),
1867 ADD_TABLE(crs_file
),
1868 ADD_TABLE(crs_shortcut
),
1869 ADD_TABLE(crs_install_exec_seq
),
1874 static const msi_table pub_tables
[] =
1876 ADD_TABLE(directory
),
1877 ADD_TABLE(pub_component
),
1878 ADD_TABLE(pub_feature
),
1879 ADD_TABLE(pub_feature_comp
),
1880 ADD_TABLE(pub_file
),
1881 ADD_TABLE(pub_publish_component
),
1882 ADD_TABLE(pub_install_exec_seq
),
1887 static const msi_table rd_tables
[] =
1889 ADD_TABLE(directory
),
1890 ADD_TABLE(rd_component
),
1891 ADD_TABLE(rd_feature
),
1892 ADD_TABLE(rd_feature_comp
),
1894 ADD_TABLE(rd_duplicate_file
),
1895 ADD_TABLE(rd_install_exec_seq
),
1900 static const msi_table rrv_tables
[] =
1902 ADD_TABLE(directory
),
1903 ADD_TABLE(rrv_component
),
1904 ADD_TABLE(rrv_feature
),
1905 ADD_TABLE(rrv_feature_comp
),
1906 ADD_TABLE(rrv_file
),
1907 ADD_TABLE(rrv_registry
),
1908 ADD_TABLE(rrv_remove_registry
),
1909 ADD_TABLE(rrv_install_exec_seq
),
1914 static const msi_table frp_tables
[] =
1916 ADD_TABLE(directory
),
1917 ADD_TABLE(frp_component
),
1918 ADD_TABLE(frp_feature
),
1919 ADD_TABLE(frp_feature_comp
),
1920 ADD_TABLE(frp_file
),
1921 ADD_TABLE(frp_upgrade
),
1922 ADD_TABLE(frp_custom_action
),
1923 ADD_TABLE(frp_install_exec_seq
),
1928 static const msi_table riv_tables
[] =
1930 ADD_TABLE(directory
),
1931 ADD_TABLE(riv_component
),
1932 ADD_TABLE(riv_feature
),
1933 ADD_TABLE(riv_feature_comp
),
1934 ADD_TABLE(riv_file
),
1935 ADD_TABLE(riv_ini_file
),
1936 ADD_TABLE(riv_remove_ini_file
),
1937 ADD_TABLE(riv_install_exec_seq
),
1942 static const msi_table res_tables
[] =
1944 ADD_TABLE(directory
),
1945 ADD_TABLE(res_component
),
1946 ADD_TABLE(res_feature
),
1947 ADD_TABLE(res_feature_comp
),
1948 ADD_TABLE(res_file
),
1949 ADD_TABLE(res_environment
),
1950 ADD_TABLE(res_install_exec_seq
),
1955 static const msi_table rci_tables
[] =
1957 ADD_TABLE(directory
),
1958 ADD_TABLE(rci_component
),
1959 ADD_TABLE(rci_feature
),
1960 ADD_TABLE(rci_feature_comp
),
1961 ADD_TABLE(rci_file
),
1962 ADD_TABLE(rci_appid
),
1963 ADD_TABLE(rci_class
),
1964 ADD_TABLE(rci_install_exec_seq
),
1969 static const msi_table rei_tables
[] =
1971 ADD_TABLE(directory
),
1972 ADD_TABLE(rei_component
),
1973 ADD_TABLE(rei_feature
),
1974 ADD_TABLE(rei_feature_comp
),
1975 ADD_TABLE(rei_file
),
1976 ADD_TABLE(rei_extension
),
1977 ADD_TABLE(rei_verb
),
1978 ADD_TABLE(rei_progid
),
1979 ADD_TABLE(rei_install_exec_seq
),
1984 static const msi_table rpi_tables
[] =
1986 ADD_TABLE(directory
),
1987 ADD_TABLE(rpi_component
),
1988 ADD_TABLE(rpi_feature
),
1989 ADD_TABLE(rpi_feature_comp
),
1990 ADD_TABLE(rpi_file
),
1991 ADD_TABLE(rpi_appid
),
1992 ADD_TABLE(rpi_class
),
1993 ADD_TABLE(rpi_extension
),
1994 ADD_TABLE(rpi_verb
),
1995 ADD_TABLE(rpi_progid
),
1996 ADD_TABLE(rpi_install_exec_seq
),
2001 static const msi_table rmi_tables
[] =
2003 ADD_TABLE(directory
),
2004 ADD_TABLE(rmi_component
),
2005 ADD_TABLE(rmi_feature
),
2006 ADD_TABLE(rmi_feature_comp
),
2007 ADD_TABLE(rmi_file
),
2008 ADD_TABLE(rmi_extension
),
2009 ADD_TABLE(rmi_verb
),
2010 ADD_TABLE(rmi_mime
),
2011 ADD_TABLE(rmi_install_exec_seq
),
2016 static const msi_table pa_tables
[] =
2018 ADD_TABLE(directory
),
2019 ADD_TABLE(pa_component
),
2020 ADD_TABLE(pa_feature
),
2021 ADD_TABLE(pa_feature_comp
),
2023 ADD_TABLE(pa_msi_assembly
),
2024 ADD_TABLE(pa_msi_assembly_name
),
2025 ADD_TABLE(pa_install_exec_seq
),
2030 static const msi_table rep_tables
[] =
2032 ADD_TABLE(directory
),
2033 ADD_TABLE(rep_component
),
2034 ADD_TABLE(rep_feature
),
2035 ADD_TABLE(rep_feature_comp
),
2036 ADD_TABLE(rep_file
),
2037 ADD_TABLE(rep_upgrade
),
2038 ADD_TABLE(rep_property
),
2039 ADD_TABLE(rep_install_exec_seq
),
2043 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2044 static LSTATUS
action_RegDeleteTreeA(HKEY hKey
, LPCSTR lpszSubKey
, REGSAM access
)
2047 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
2048 DWORD dwMaxLen
, dwSize
;
2049 char szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
2050 HKEY hSubKey
= hKey
;
2054 ret
= RegOpenKeyExA(hKey
, lpszSubKey
, 0, access
, &hSubKey
);
2055 if (ret
) return ret
;
2058 ret
= RegQueryInfoKeyA(hSubKey
, NULL
, NULL
, NULL
, NULL
,
2059 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
2060 if (ret
) goto cleanup
;
2064 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
2065 if (dwMaxLen
> sizeof(szNameBuf
))
2067 /* Name too big: alloc a buffer for it */
2068 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
)))
2070 ret
= ERROR_NOT_ENOUGH_MEMORY
;
2075 /* Recursively delete all the subkeys */
2079 if (RegEnumKeyExA(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
2080 NULL
, NULL
, NULL
)) break;
2082 ret
= action_RegDeleteTreeA(hSubKey
, lpszName
, access
);
2083 if (ret
) goto cleanup
;
2088 if (pRegDeleteKeyExA
)
2089 ret
= pRegDeleteKeyExA(hKey
, lpszSubKey
, access
, 0);
2091 ret
= RegDeleteKeyA(hKey
, lpszSubKey
);
2097 if (RegEnumValueA(hKey
, 0, lpszName
, &dwSize
,
2098 NULL
, NULL
, NULL
, NULL
)) break;
2100 ret
= RegDeleteValueA(hKey
, lpszName
);
2101 if (ret
) goto cleanup
;
2105 if (lpszName
!= szNameBuf
)
2106 HeapFree(GetProcessHeap(), 0, lpszName
);
2108 RegCloseKey(hSubKey
);
2112 /* cabinet definitions */
2114 /* make the max size large so there is only one cab file */
2115 #define MEDIA_SIZE 0x7FFFFFFF
2116 #define FOLDER_THRESHOLD 900000
2118 /* the FCI callbacks */
2120 static void * CDECL
mem_alloc(ULONG cb
)
2122 return HeapAlloc(GetProcessHeap(), 0, cb
);
2125 static void CDECL
mem_free(void *memory
)
2127 HeapFree(GetProcessHeap(), 0, memory
);
2130 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
2132 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
2136 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
2141 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
2142 BOOL fContinuation
, void *pv
)
2147 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
2151 DWORD dwShareMode
= 0;
2152 DWORD dwCreateDisposition
= OPEN_EXISTING
;
2154 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
2155 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
;
2157 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
2158 dwCreateDisposition
= OPEN_EXISTING
;
2160 dwCreateDisposition
= CREATE_NEW
;
2162 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
2163 dwCreateDisposition
, 0, NULL
);
2165 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
2167 return (INT_PTR
)handle
;
2170 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2172 HANDLE handle
= (HANDLE
)hf
;
2176 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
2177 ok(res
, "Failed to ReadFile\n");
2182 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2184 HANDLE handle
= (HANDLE
)hf
;
2188 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
2189 ok(res
, "Failed to WriteFile\n");
2194 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
2196 HANDLE handle
= (HANDLE
)hf
;
2197 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
2202 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
2204 HANDLE handle
= (HANDLE
)hf
;
2207 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
2208 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
2213 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
2215 BOOL ret
= DeleteFileA(pszFile
);
2216 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
2221 static void init_functionpointers(void)
2223 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2224 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2225 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2227 #define GET_PROC(mod, func) \
2228 p ## func = (void*)GetProcAddress(mod, #func); \
2230 trace("GetProcAddress(%s) failed\n", #func);
2232 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2233 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2234 GET_PROC(hmsi
, MsiSourceListGetInfoA
);
2235 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2236 GET_PROC(hmsi
, MsiQueryFeatureStateExA
);
2238 GET_PROC(hadvapi32
, CheckTokenMembership
);
2239 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
2240 GET_PROC(hadvapi32
, OpenProcessToken
);
2241 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2242 GET_PROC(hkernel32
, IsWow64Process
)
2244 hsrclient
= LoadLibraryA("srclient.dll");
2245 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2246 GET_PROC(hsrclient
, SRSetRestorePointA
);
2251 static BOOL
is_process_limited(void)
2253 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2258 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2260 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2261 DOMAIN_ALIAS_RID_ADMINS
,
2262 0, 0, 0, 0, 0, 0, &Group
) ||
2263 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2265 trace("Could not check if the current user is an administrator\n");
2270 /* Only administrators have enough privileges for these tests */
2274 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2277 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2280 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2282 return (ret
&& type
== TokenElevationTypeLimited
);
2287 static char *get_user_sid(void)
2292 char *usersid
= NULL
;
2294 if (!pConvertSidToStringSidA
)
2296 win_skip("ConvertSidToStringSidA is not available\n");
2299 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
2300 GetTokenInformation(token
, TokenUser
, NULL
, size
, &size
);
2302 user
= HeapAlloc(GetProcessHeap(), 0, size
);
2303 GetTokenInformation(token
, TokenUser
, user
, size
, &size
);
2304 pConvertSidToStringSidA(user
->User
.Sid
, &usersid
);
2305 HeapFree(GetProcessHeap(), 0, user
);
2311 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2315 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2316 GetTempFileNameA(".", "xx", 0, tempname
);
2318 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2320 lstrcpyA(pszTempName
, tempname
);
2321 HeapFree(GetProcessHeap(), 0, tempname
);
2325 HeapFree(GetProcessHeap(), 0, tempname
);
2330 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2331 USHORT
*pattribs
, int *err
, void *pv
)
2333 BY_HANDLE_FILE_INFORMATION finfo
;
2339 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2340 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2342 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2344 res
= GetFileInformationByHandle(handle
, &finfo
);
2345 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2347 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2348 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2350 attrs
= GetFileAttributesA(pszName
);
2351 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2353 return (INT_PTR
)handle
;
2356 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2358 char path
[MAX_PATH
];
2359 char filename
[MAX_PATH
];
2361 lstrcpyA(path
, CURR_DIR
);
2362 lstrcatA(path
, "\\");
2363 lstrcatA(path
, file
);
2365 lstrcpyA(filename
, file
);
2367 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2368 progress
, get_open_info
, compress
);
2371 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2373 ZeroMemory(pCabParams
, sizeof(CCAB
));
2375 pCabParams
->cb
= max_size
;
2376 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2377 pCabParams
->setID
= 0xbeef;
2378 pCabParams
->iCab
= 1;
2379 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2380 lstrcatA(pCabParams
->szCabPath
, "\\");
2381 lstrcpyA(pCabParams
->szCab
, name
);
2384 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2392 set_cab_parameters(&cabParams
, name
, max_size
);
2394 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2395 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2396 get_temp_file
, &cabParams
, NULL
);
2398 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2403 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2404 ok(res
, "Failed to add file: %s\n", ptr
);
2405 ptr
+= lstrlenA(ptr
) + 1;
2408 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2409 ok(res
, "Failed to flush the cabinet\n");
2411 res
= FCIDestroy(hfci
);
2412 ok(res
, "Failed to destroy the cabinet\n");
2415 static BOOL
get_user_dirs(void)
2420 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2421 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2425 if (RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
))
2435 static BOOL
get_system_dirs(void)
2440 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
,
2441 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2445 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2446 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
))
2453 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2454 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
))
2462 if (!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2468 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2473 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2474 if (file
== INVALID_HANDLE_VALUE
)
2477 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2481 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2488 #define create_file(name, size) create_file_data(name, name, size)
2490 static void create_test_files(void)
2492 CreateDirectoryA("msitest", NULL
);
2493 create_file("msitest\\one.txt", 100);
2494 CreateDirectoryA("msitest\\first", NULL
);
2495 create_file("msitest\\first\\two.txt", 100);
2496 CreateDirectoryA("msitest\\second", NULL
);
2497 create_file("msitest\\second\\three.txt", 100);
2499 create_file("four.txt", 100);
2500 create_file("five.txt", 100);
2501 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2503 create_file("msitest\\filename", 100);
2504 create_file("msitest\\service.exe", 100);
2505 create_file("msitest\\service2.exe", 100);
2507 DeleteFileA("four.txt");
2508 DeleteFileA("five.txt");
2511 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2513 CHAR path
[MAX_PATH
];
2515 lstrcpyA(path
, PROG_FILES_DIR
);
2516 lstrcatA(path
, "\\");
2517 lstrcatA(path
, rel_path
);
2520 return DeleteFileA(path
);
2522 return RemoveDirectoryA(path
);
2525 static void delete_test_files(void)
2527 DeleteFileA("msitest.msi");
2528 DeleteFileA("msitest.cab");
2529 DeleteFileA("msitest\\second\\three.txt");
2530 DeleteFileA("msitest\\first\\two.txt");
2531 DeleteFileA("msitest\\one.txt");
2532 DeleteFileA("msitest\\service.exe");
2533 DeleteFileA("msitest\\service2.exe");
2534 DeleteFileA("msitest\\filename");
2535 RemoveDirectoryA("msitest\\second");
2536 RemoveDirectoryA("msitest\\first");
2537 RemoveDirectoryA("msitest");
2540 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2543 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2544 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2548 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
, const char *template)
2553 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2554 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2556 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2557 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2559 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
2560 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2561 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2563 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2566 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2567 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2569 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2570 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2572 /* write the summary changes back to the stream */
2573 r
= MsiSummaryInfoPersist(summary
);
2574 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2576 MsiCloseHandle(summary
);
2579 #define create_database(name, tables, num_tables) \
2580 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2582 #define create_database_template(name, tables, num_tables, version, template) \
2583 create_database_wordcount(name, tables, num_tables, version, 0, template);
2585 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2586 int num_tables
, INT version
, INT wordcount
,
2587 const char *template)
2594 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2595 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2596 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2598 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2599 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2601 /* import the tables into the database */
2602 for (j
= 0; j
< num_tables
; j
++)
2604 const msi_table
*table
= &tables
[j
];
2606 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2608 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2609 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2611 DeleteFileA(table
->filename
);
2614 write_msi_summary_info(db
, version
, wordcount
, template);
2616 r
= MsiDatabaseCommit(db
);
2617 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2620 HeapFree( GetProcessHeap(), 0, nameW
);
2623 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2625 RESTOREPOINTINFOA spec
;
2627 spec
.dwEventType
= event_type
;
2628 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2629 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2630 lstrcpyA(spec
.szDescription
, "msitest restore point");
2632 return pSRSetRestorePointA(&spec
, status
);
2635 static void remove_restore_point(DWORD seq_number
)
2639 res
= pSRRemoveRestorePoint(seq_number
);
2640 if (res
!= ERROR_SUCCESS
)
2641 trace("Failed to remove the restore point : %08x\n", res
);
2644 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2646 if (pRegDeleteKeyExA
)
2647 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2648 return RegDeleteKeyA( key
, subkey
);
2651 static BOOL
file_exists(LPCSTR file
)
2653 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
2656 static BOOL
pf_exists(LPCSTR file
)
2658 CHAR path
[MAX_PATH
];
2660 lstrcpyA(path
, PROG_FILES_DIR
);
2661 lstrcatA(path
, "\\");
2662 lstrcatA(path
, file
);
2664 return file_exists(path
);
2667 static void delete_pfmsitest_files(void)
2669 SHFILEOPSTRUCTA shfl
;
2670 CHAR path
[MAX_PATH
+11];
2672 lstrcpyA(path
, PROG_FILES_DIR
);
2673 lstrcatA(path
, "\\msitest\\*");
2674 path
[strlen(path
) + 1] = '\0';
2677 shfl
.wFunc
= FO_DELETE
;
2680 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
2682 SHFileOperationA(&shfl
);
2684 lstrcpyA(path
, PROG_FILES_DIR
);
2685 lstrcatA(path
, "\\msitest");
2686 RemoveDirectoryA(path
);
2689 static void check_reg_str(HKEY prodkey
, LPCSTR name
, LPCSTR expected
, BOOL bcase
, DWORD line
)
2697 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)val
, &size
);
2699 if (res
!= ERROR_SUCCESS
||
2700 (type
!= REG_SZ
&& type
!= REG_EXPAND_SZ
&& type
!= REG_MULTI_SZ
))
2702 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2707 ok_(__FILE__
, line
)(lstrlenA(val
) == 0, "Expected empty string, got %s\n", val
);
2711 ok_(__FILE__
, line
)(!lstrcmpA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2713 ok_(__FILE__
, line
)(!lstrcmpiA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2717 static void check_reg_dword(HKEY prodkey
, LPCSTR name
, DWORD expected
, DWORD line
)
2719 DWORD val
, size
, type
;
2722 size
= sizeof(DWORD
);
2723 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2725 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2727 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2731 ok_(__FILE__
, line
)(val
== expected
, "Expected %d, got %d\n", expected
, val
);
2734 static void check_reg_dword4(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2735 DWORD expected4
, DWORD line
)
2737 DWORD val
, size
, type
;
2740 size
= sizeof(DWORD
);
2741 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2743 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2745 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2749 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
,
2750 "Expected %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, val
);
2753 static void check_reg_dword5(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2754 DWORD expected4
, DWORD expected5
, DWORD line
)
2756 DWORD val
, size
, type
;
2759 size
= sizeof(DWORD
);
2760 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2762 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2764 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2768 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
||
2770 "Expected %d, %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, expected5
, val
);
2773 #define CHECK_REG_STR(prodkey, name, expected) \
2774 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2776 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2778 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2779 RegDeleteValueA(prodkey, name); \
2782 #define CHECK_REG_ISTR(prodkey, name, expected) \
2783 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2785 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2787 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2788 RegDeleteValueA(prodkey, name); \
2791 #define CHECK_REG_DWORD(prodkey, name, expected) \
2792 check_reg_dword(prodkey, name, expected, __LINE__);
2794 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2796 check_reg_dword(prodkey, name, expected, __LINE__); \
2797 RegDeleteValueA(prodkey, name); \
2800 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
2801 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
2803 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
2805 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
2806 RegDeleteValueA(prodkey, name); \
2809 #define CHECK_REG_DWORD4(prodkey, name, expected1, expected2, expected3, expected4) \
2810 check_reg_dword4(prodkey, name, expected1, expected2, expected3, expected4, __LINE__);
2812 #define CHECK_DEL_REG_DWORD5(prodkey, name, expected1, expected2, expected3, expected4 ,expected5) \
2814 check_reg_dword5(prodkey, name, expected1, expected2, expected3, expected4, expected5, __LINE__); \
2815 RegDeleteValueA(prodkey, name); \
2818 static void get_date_str(LPSTR date
)
2822 static const char date_fmt
[] = "%d%02d%02d";
2823 GetLocalTime(&systime
);
2824 sprintf(date
, date_fmt
, systime
.wYear
, systime
.wMonth
, systime
.wDay
);
2827 static void test_register_product(void)
2831 HKEY hkey
, props
, usage
;
2833 char date
[MAX_PATH
], temp
[MAX_PATH
], keypath
[MAX_PATH
], path
[MAX_PATH
];
2835 REGSAM access
= KEY_ALL_ACCESS
;
2837 static const CHAR uninstall
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2838 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2839 static const CHAR uninstall_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2840 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2841 static const CHAR userdata
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2842 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2843 static const CHAR ugkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2844 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2845 static const CHAR userugkey
[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2846 "\\51AAE0C44620A5E4788506E91F249BD2";
2848 if (is_process_limited())
2850 skip("process is limited\n");
2854 if (!(usersid
= get_user_sid()))
2858 GetTempPathA(MAX_PATH
, temp
);
2860 CreateDirectoryA("msitest", NULL
);
2861 create_file("msitest\\maximus", 500);
2863 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
2866 access
|= KEY_WOW64_64KEY
;
2868 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
2870 /* RegisterProduct */
2871 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
2872 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2874 skip("Not enough rights to perform tests\n");
2877 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2878 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2879 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2881 res
= RegOpenKeyA(HKEY_CURRENT_USER
, userugkey
, &hkey
);
2882 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2886 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
2887 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2891 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
2892 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2895 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
2896 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
2897 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
2898 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
2899 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2900 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
2901 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2902 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
2903 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
2904 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
2905 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
2906 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
2907 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
2908 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
2909 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
2910 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
2911 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
2912 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
2913 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
2914 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
2915 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
2916 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
2919 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
2922 delete_key(hkey
, "", access
);
2925 sprintf(keypath
, userdata
, usersid
);
2926 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
2927 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2929 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
2930 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2932 size
= sizeof(path
);
2933 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
2935 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
2937 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
2938 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
2939 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
2940 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
2941 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2942 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
2943 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2944 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
2945 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
2946 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
2947 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
2948 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
2949 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
2950 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
2951 CHECK_DEL_REG_STR(props
, "Size", NULL
);
2952 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
2953 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
2954 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
2955 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
2956 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
2957 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
2958 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
2961 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
2964 delete_key(props
, "", access
);
2967 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
2970 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2973 delete_key(usage
, "", access
);
2975 delete_key(hkey
, "", access
);
2978 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
2979 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2981 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
2983 delete_key(hkey
, "", access
);
2986 /* RegisterProduct, machine */
2987 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 ALLUSERS=1");
2988 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2989 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2990 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2992 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, userugkey
, 0, access
, &hkey
);
2993 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2997 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
2998 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3002 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
3003 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3006 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
3007 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
3008 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
3009 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
3010 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3011 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
3012 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3013 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
3014 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
3015 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
3016 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
3017 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
3018 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
3019 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
3020 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
3021 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
3022 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
3023 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3024 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3025 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
3026 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
3027 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
3030 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
3033 delete_key(hkey
, "", access
);
3036 sprintf(keypath
, userdata
, "S-1-5-18");
3037 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3038 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3040 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3041 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3043 size
= sizeof(path
);
3044 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
3046 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
3048 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
3049 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
3050 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
3051 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
3052 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3053 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
3054 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3055 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
3056 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
3057 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
3058 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
3059 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
3060 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
3061 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
3062 CHECK_DEL_REG_STR(props
, "Size", NULL
);
3063 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
3064 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
3065 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
3066 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
3067 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
3068 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
3069 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
3072 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
3075 delete_key(props
, "", access
);
3078 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
3081 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3084 delete_key(usage
, "", access
);
3086 delete_key(hkey
, "", access
);
3089 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
3090 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3092 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3094 delete_key(hkey
, "", access
);
3098 DeleteFileA(msifile
);
3099 DeleteFileA("msitest\\maximus");
3100 RemoveDirectoryA("msitest");
3101 HeapFree(GetProcessHeap(), 0, usersid
);
3104 static void test_publish_product(void)
3106 static const char prodpath
[] =
3107 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3108 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3109 static const char cuprodpath
[] =
3110 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3111 static const char cuupgrades
[] =
3112 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3113 static const char badprod
[] =
3114 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
3115 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3116 static const char machprod
[] =
3117 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3118 static const char machup
[] =
3119 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3123 HKEY sourcelist
, net
, props
;
3124 HKEY hkey
, patches
, media
;
3125 CHAR keypath
[MAX_PATH
];
3126 CHAR temp
[MAX_PATH
];
3127 CHAR path
[MAX_PATH
];
3128 BOOL old_installer
= FALSE
;
3129 REGSAM access
= KEY_ALL_ACCESS
;
3131 if (is_process_limited())
3133 skip("process is limited\n");
3137 if (!(usersid
= get_user_sid()))
3140 GetTempPathA(MAX_PATH
, temp
);
3142 CreateDirectoryA("msitest", NULL
);
3143 create_file("msitest\\maximus", 500);
3145 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3148 access
|= KEY_WOW64_64KEY
;
3150 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3152 /* PublishProduct, current user */
3153 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
3154 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3156 skip("Not enough rights to perform tests\n");
3159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3160 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3161 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3163 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3164 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3166 sprintf(keypath
, prodpath
, usersid
);
3167 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3168 if (res
== ERROR_FILE_NOT_FOUND
)
3170 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3171 if (res
== ERROR_SUCCESS
)
3173 win_skip("Windows Installer < 3.0 detected\n");
3175 old_installer
= TRUE
;
3180 win_skip("Install failed, no need to continue\n");
3184 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3186 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3187 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3189 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3192 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3193 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3196 delete_key(patches
, "", access
);
3197 RegCloseKey(patches
);
3198 delete_key(hkey
, "", access
);
3202 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3203 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3205 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3206 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3207 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3208 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3210 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3211 CHECK_DEL_REG_DWORD(hkey
, "Assignment", 0);
3212 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3213 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3214 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3216 res
= RegOpenKeyA(hkey
, "SourceList", &sourcelist
);
3217 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3219 lstrcpyA(path
, "n;1;");
3220 lstrcatA(path
, temp
);
3221 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3222 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3224 res
= RegOpenKeyA(sourcelist
, "Net", &net
);
3225 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3227 CHECK_DEL_REG_STR(net
, "1", temp
);
3229 RegDeleteKeyA(net
, "");
3232 res
= RegOpenKeyA(sourcelist
, "Media", &media
);
3233 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3235 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3237 RegDeleteKeyA(media
, "");
3239 RegDeleteKeyA(sourcelist
, "");
3240 RegCloseKey(sourcelist
);
3241 RegDeleteKeyA(hkey
, "");
3244 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuupgrades
, &hkey
);
3245 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3247 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3249 RegDeleteKeyA(hkey
, "");
3252 /* PublishProduct, machine */
3253 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3256 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3257 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3258 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3260 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3261 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3263 sprintf(keypath
, prodpath
, "S-1-5-18");
3264 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3265 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3267 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3268 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3270 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3273 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3274 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3277 delete_key(patches
, "", access
);
3278 RegCloseKey(patches
);
3279 delete_key(hkey
, "", access
);
3283 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machprod
, 0, access
, &hkey
);
3284 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3286 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3287 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3288 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3289 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3291 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3292 todo_wine
CHECK_DEL_REG_DWORD(hkey
, "Assignment", 1);
3293 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3294 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3295 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3297 res
= RegOpenKeyExA(hkey
, "SourceList", 0, access
, &sourcelist
);
3298 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3300 lstrcpyA(path
, "n;1;");
3301 lstrcatA(path
, temp
);
3302 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3303 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3305 res
= RegOpenKeyExA(sourcelist
, "Net", 0, access
, &net
);
3306 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3308 CHECK_DEL_REG_STR(net
, "1", temp
);
3310 res
= delete_key(net
, "", access
);
3311 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3314 res
= RegOpenKeyExA(sourcelist
, "Media", 0, access
, &media
);
3315 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3317 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3319 res
= delete_key(media
, "", access
);
3320 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3322 res
= delete_key(sourcelist
, "", access
);
3323 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3324 RegCloseKey(sourcelist
);
3325 res
= delete_key(hkey
, "", access
);
3326 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3329 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machup
, 0, access
, &hkey
);
3330 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3332 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3334 res
= delete_key(hkey
, "", access
);
3335 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3339 DeleteFileA(msifile
);
3340 DeleteFileA("msitest\\maximus");
3341 RemoveDirectoryA("msitest");
3342 HeapFree(GetProcessHeap(), 0, usersid
);
3345 static void test_publish_features(void)
3347 static const char cupath
[] =
3348 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3349 static const char udfeatpath
[] =
3350 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3351 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3352 static const char udpridpath
[] =
3353 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3354 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3355 static const char featkey
[] =
3356 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3357 static const char classfeat
[] =
3358 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3363 CHAR keypath
[MAX_PATH
];
3364 REGSAM access
= KEY_ALL_ACCESS
;
3366 if (is_process_limited())
3368 skip("process is limited\n");
3372 if (!(usersid
= get_user_sid()))
3375 CreateDirectoryA("msitest", NULL
);
3376 create_file("msitest\\maximus", 500);
3378 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3381 access
|= KEY_WOW64_64KEY
;
3383 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3385 /* PublishFeatures, current user */
3386 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
3387 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3389 skip("Not enough rights to perform tests\n");
3392 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3393 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3394 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3396 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3397 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3399 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3400 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3402 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3403 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3405 CHECK_REG_STR(hkey
, "feature", "");
3406 CHECK_REG_STR(hkey
, "montecristo", "");
3408 RegDeleteValueA(hkey
, "feature");
3409 RegDeleteValueA(hkey
, "montecristo");
3410 delete_key(hkey
, "", access
);
3413 sprintf(keypath
, udfeatpath
, usersid
);
3414 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3415 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3417 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3418 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3420 RegDeleteValueA(hkey
, "feature");
3421 RegDeleteValueA(hkey
, "montecristo");
3422 delete_key(hkey
, "", access
);
3424 sprintf(keypath
, udpridpath
, usersid
);
3425 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3427 /* PublishFeatures, machine */
3428 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1 ALLUSERS=1");
3429 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3430 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3431 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3433 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3434 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3436 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3437 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3438 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3439 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3441 CHECK_REG_STR(hkey
, "feature", "");
3442 CHECK_REG_STR(hkey
, "montecristo", "");
3444 RegDeleteValueA(hkey
, "feature");
3445 RegDeleteValueA(hkey
, "montecristo");
3446 delete_key(hkey
, "", access
);
3449 sprintf(keypath
, udfeatpath
, "S-1-5-18");
3450 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3451 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3453 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3454 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3456 RegDeleteValueA(hkey
, "feature");
3457 RegDeleteValueA(hkey
, "montecristo");
3458 delete_key(hkey
, "", access
);
3460 sprintf(keypath
, udpridpath
, "S-1-5-18");
3461 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3464 DeleteFileA(msifile
);
3465 DeleteFileA("msitest\\maximus");
3466 RemoveDirectoryA("msitest");
3467 HeapFree(GetProcessHeap(), 0, usersid
);
3470 static LPSTR
reg_get_val_str(HKEY hkey
, LPCSTR name
)
3476 r
= RegQueryValueExA(hkey
, name
, NULL
, NULL
, NULL
, &len
);
3477 if (r
!= ERROR_SUCCESS
)
3480 len
+= sizeof (WCHAR
);
3481 val
= HeapAlloc(GetProcessHeap(), 0, len
);
3482 if (!val
) return NULL
;
3484 RegQueryValueExA(hkey
, name
, NULL
, NULL
, (LPBYTE
)val
, &len
);
3488 static void get_owner_company(LPSTR
*owner
, LPSTR
*company
)
3492 REGSAM access
= KEY_ALL_ACCESS
;
3494 *owner
= *company
= NULL
;
3497 access
|= KEY_WOW64_64KEY
;
3499 res
= RegOpenKeyA(HKEY_CURRENT_USER
,
3500 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey
);
3501 if (res
== ERROR_SUCCESS
)
3503 *owner
= reg_get_val_str(hkey
, "DefName");
3504 *company
= reg_get_val_str(hkey
, "DefCompany");
3508 if (!*owner
|| !*company
)
3510 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3511 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access
, &hkey
);
3512 if (res
== ERROR_SUCCESS
)
3514 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3515 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3520 if (!*owner
|| !*company
)
3522 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3523 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey
);
3524 if (res
== ERROR_SUCCESS
)
3526 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3527 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3533 static void test_register_user(void)
3539 LPSTR owner
, company
;
3540 CHAR keypath
[MAX_PATH
];
3541 REGSAM access
= KEY_ALL_ACCESS
;
3543 static const CHAR keypropsfmt
[] =
3544 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3545 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3546 static const CHAR keypridfmt
[] =
3547 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3548 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3550 if (is_process_limited())
3552 skip("process is limited\n");
3556 if (!(usersid
= get_user_sid()))
3559 get_owner_company(&owner
, &company
);
3561 CreateDirectoryA("msitest", NULL
);
3562 create_file("msitest\\maximus", 500);
3564 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3567 access
|= KEY_WOW64_64KEY
;
3569 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3571 /* RegisterUser, per-user */
3572 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1");
3573 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3575 skip("Not enough rights to perform tests\n");
3578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3579 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3580 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3582 sprintf(keypath
, keypropsfmt
, usersid
);
3583 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3584 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3586 CHECK_REG_STR(props
, "ProductID", "none");
3587 CHECK_REG_STR(props
, "RegCompany", company
);
3588 CHECK_REG_STR(props
, "RegOwner", owner
);
3590 RegDeleteValueA(props
, "ProductID");
3591 RegDeleteValueA(props
, "RegCompany");
3592 RegDeleteValueA(props
, "RegOwner");
3593 delete_key(props
, "", access
);
3595 sprintf(keypath
, keypridfmt
, usersid
);
3596 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3598 /* RegisterUser, machine */
3599 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1 ALLUSERS=1");
3600 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3601 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3602 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3604 sprintf(keypath
, keypropsfmt
, "S-1-5-18");
3605 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3606 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3608 CHECK_REG_STR(props
, "ProductID", "none");
3609 CHECK_REG_STR(props
, "RegCompany", company
);
3610 CHECK_REG_STR(props
, "RegOwner", owner
);
3612 RegDeleteValueA(props
, "ProductID");
3613 RegDeleteValueA(props
, "RegCompany");
3614 RegDeleteValueA(props
, "RegOwner");
3615 delete_key(props
, "", access
);
3617 sprintf(keypath
, keypridfmt
, "S-1-5-18");
3618 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3621 HeapFree(GetProcessHeap(), 0, company
);
3622 HeapFree(GetProcessHeap(), 0, owner
);
3624 DeleteFileA(msifile
);
3625 DeleteFileA("msitest\\maximus");
3626 RemoveDirectoryA("msitest");
3630 static void test_process_components(void)
3632 static const char keyfmt
[] =
3633 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3634 static const char compkey
[] =
3635 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3642 CHAR keypath
[MAX_PATH
];
3643 CHAR program_files_maximus
[MAX_PATH
];
3644 REGSAM access
= KEY_ALL_ACCESS
;
3646 if (is_process_limited())
3648 skip("process is limited\n");
3652 if (!(usersid
= get_user_sid()))
3655 CreateDirectoryA("msitest", NULL
);
3656 create_file("msitest\\maximus", 500);
3658 create_database(msifile
, ppc_tables
, sizeof(ppc_tables
) / sizeof(msi_table
));
3661 access
|= KEY_WOW64_64KEY
;
3663 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3665 /* ProcessComponents, per-user */
3666 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
3667 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3669 skip("Not enough rights to perform tests\n");
3672 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3673 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3674 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3676 sprintf(keypath
, keyfmt
, usersid
, "CBABC2FDCCB35E749A8944D8C1C098B5");
3677 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3678 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3681 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3682 NULL
, NULL
, (LPBYTE
)val
, &size
);
3683 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3685 lstrcpyA(program_files_maximus
,PROG_FILES_DIR
);
3686 lstrcatA(program_files_maximus
,"\\msitest\\maximus");
3688 ok(!lstrcmpiA(val
, program_files_maximus
),
3689 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3691 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3692 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3694 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3695 delete_key(comp
, "", access
);
3698 sprintf(keypath
, keyfmt
, usersid
, "241C3DA58FECD0945B9687D408766058");
3699 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3700 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3703 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3704 NULL
, NULL
, (LPBYTE
)val
, &size
);
3705 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3706 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3707 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3709 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3710 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3712 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3713 delete_key(comp
, "", access
);
3716 /* ProcessComponents, machine */
3717 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3718 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3719 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3720 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3722 sprintf(keypath
, keyfmt
, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3723 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3724 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3727 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3728 NULL
, NULL
, (LPBYTE
)val
, &size
);
3729 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3730 ok(!lstrcmpiA(val
, program_files_maximus
),
3731 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3733 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3734 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3736 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3737 delete_key(comp
, "", access
);
3740 sprintf(keypath
, keyfmt
, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3741 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3742 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3745 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3746 NULL
, NULL
, (LPBYTE
)val
, &size
);
3747 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3748 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3749 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3751 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3752 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3754 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3755 delete_key(comp
, "", access
);
3759 DeleteFileA(msifile
);
3760 DeleteFileA("msitest\\maximus");
3761 RemoveDirectoryA("msitest");
3765 static void test_publish(void)
3767 static const char subkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3768 static const char subkey_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3771 HKEY uninstall
, prodkey
, uninstall_32node
= NULL
;
3773 char date
[MAX_PATH
], temp
[MAX_PATH
], prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3774 REGSAM access
= KEY_ALL_ACCESS
;
3777 if (!pMsiQueryFeatureStateExA
)
3779 win_skip("MsiQueryFeatureStateExA is not available\n");
3782 if (is_process_limited())
3784 skip("process is limited\n");
3789 GetTempPathA(MAX_PATH
, temp
);
3792 access
|= KEY_WOW64_64KEY
;
3794 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey
, 0, KEY_ALL_ACCESS
, &uninstall
);
3795 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3799 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey_32node
, 0, KEY_ALL_ACCESS
, &uninstall_32node
);
3800 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3803 CreateDirectoryA("msitest", NULL
);
3804 create_file("msitest\\maximus", 500);
3806 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3808 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3810 state
= MsiQueryProductStateA(prodcode
);
3811 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3813 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3814 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3817 SetLastError(0xdeadbeef);
3818 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3819 error
= GetLastError();
3820 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3821 ok(state
== 0xdead, "got %d\n", state
);
3822 ok(error
== 0xdeadbeef, "got %u\n", error
);
3825 SetLastError(0xdeadbeef);
3826 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
3827 error
= GetLastError();
3828 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3829 ok(state
== 0xdead, "got %d\n", state
);
3830 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3833 SetLastError(0xdeadbeef);
3834 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
3835 error
= GetLastError();
3836 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3837 ok(state
== 0xdead, "got %d\n", state
);
3838 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3840 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3841 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3843 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3844 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3846 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3847 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3848 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3849 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3851 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3852 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3854 /* nothing published */
3855 r
= MsiInstallProductA(msifile
, NULL
);
3856 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3858 skip("Not enough rights to perform tests\n");
3861 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3862 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3863 ok(pf_exists("msitest"), "File not installed\n");
3865 state
= MsiQueryProductStateA(prodcode
);
3866 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3868 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3869 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3871 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3872 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3874 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3875 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3876 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3877 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3879 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3880 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3882 /* PublishProduct and RegisterProduct */
3883 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3884 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3885 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3886 ok(pf_exists("msitest"), "File not installed\n");
3888 state
= MsiQueryProductStateA(prodcode
);
3889 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3891 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3892 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3894 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3895 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3897 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3898 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3899 ok(r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3900 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3904 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3905 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3909 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3910 if (is_wow64
&& res
== ERROR_FILE_NOT_FOUND
) /* XP - Vista, Wow64 */
3911 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3912 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3915 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
3916 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
3917 CHECK_REG_STR(prodkey
, "InstallDate", date
);
3918 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
3919 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3920 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
3921 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3922 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
3923 CHECK_REG_STR(prodkey
, "Comments", NULL
);
3924 CHECK_REG_STR(prodkey
, "Contact", NULL
);
3925 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
3926 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
3927 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
3928 CHECK_REG_STR(prodkey
, "Readme", NULL
);
3929 CHECK_REG_STR(prodkey
, "Size", NULL
);
3930 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
3931 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
3932 CHECK_REG_DWORD(prodkey
, "Language", 1033);
3933 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
3934 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
3935 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
3936 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
3939 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
3942 RegCloseKey(prodkey
);
3944 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
3945 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3946 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3947 ok(pf_exists("msitest"), "File deleted\n");
3949 state
= MsiQueryProductStateA(prodcode
);
3950 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3952 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3953 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3955 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3956 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3958 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3959 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3960 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3961 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3963 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3964 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3966 /* complete install */
3967 r
= MsiInstallProductA(msifile
, "FULL=1");
3968 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3969 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3970 ok(pf_exists("msitest"), "File not installed\n");
3972 state
= MsiQueryProductStateA(prodcode
);
3973 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3975 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3976 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3979 SetLastError(0xdeadbeef);
3980 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3981 error
= GetLastError();
3982 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3983 ok(state
== 0xdead, "got %d\n", state
);
3984 ok(error
== 0xdeadbeef, "got %u\n", error
);
3987 SetLastError(0xdeadbeef);
3988 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
3989 error
= GetLastError();
3990 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3991 ok(state
== 0xdead, "got %d\n", state
);
3992 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3995 SetLastError(0xdeadbeef);
3996 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
3997 error
= GetLastError();
3998 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
3999 ok(state
== INSTALLSTATE_LOCAL
, "got %d\n", state
);
4000 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
4002 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4003 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4005 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4006 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4007 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4008 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4012 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4013 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4017 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4018 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4021 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4022 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4023 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4024 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4025 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4026 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4027 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4028 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4029 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4030 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4031 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4032 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4033 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4034 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4035 CHECK_REG_STR(prodkey
, "Size", NULL
);
4036 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4037 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4038 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4039 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4040 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4041 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4042 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4045 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4048 RegCloseKey(prodkey
);
4050 /* no UnpublishFeatures */
4051 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4052 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4053 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4054 ok(!pf_exists("msitest"), "Directory not deleted\n");
4056 state
= MsiQueryProductStateA(prodcode
);
4057 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4059 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4060 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4062 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4063 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4065 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4066 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4067 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4068 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4070 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4071 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4073 /* complete install */
4074 r
= MsiInstallProductA(msifile
, "FULL=1");
4075 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4076 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4077 ok(pf_exists("msitest"), "File not installed\n");
4079 state
= MsiQueryProductStateA(prodcode
);
4080 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4082 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4083 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4085 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4086 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4088 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4089 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4090 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4091 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4095 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4096 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4100 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4101 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4104 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4105 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4106 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4107 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4108 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4109 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4110 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4111 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4112 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4113 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4114 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4115 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4116 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4117 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4118 CHECK_REG_STR(prodkey
, "Size", NULL
);
4119 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4120 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4121 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4122 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4123 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4124 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4125 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4128 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4131 RegCloseKey(prodkey
);
4133 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4134 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4135 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4136 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4137 ok(pf_exists("msitest"), "Directory deleted\n");
4139 state
= MsiQueryProductStateA(prodcode
);
4140 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4142 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4143 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4145 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4146 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4148 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4149 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4150 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4151 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4155 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4156 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4160 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4161 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4164 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4165 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4166 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4167 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4168 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4169 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4170 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4171 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4172 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4173 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4174 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4175 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4176 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4177 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4178 CHECK_REG_STR(prodkey
, "Size", NULL
);
4179 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4180 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4181 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4182 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4183 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4184 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4185 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4188 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4191 RegCloseKey(prodkey
);
4193 /* complete install */
4194 r
= MsiInstallProductA(msifile
, "FULL=1");
4195 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4196 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4197 ok(pf_exists("msitest"), "File not installed\n");
4199 state
= MsiQueryProductStateA(prodcode
);
4200 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4202 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4203 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4205 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4206 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4208 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4209 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4210 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4211 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4215 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4216 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4220 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4221 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4224 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4225 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4226 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4227 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4228 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4229 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4230 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4231 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4232 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4233 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4234 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4235 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4236 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4237 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4238 CHECK_REG_STR(prodkey
, "Size", NULL
);
4239 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4240 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4241 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4242 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4243 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4244 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4245 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4248 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -20, 10, 24);
4251 RegCloseKey(prodkey
);
4253 /* UnpublishFeatures, both features removed */
4254 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4255 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4256 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4257 ok(!pf_exists("msitest"), "Directory not deleted\n");
4259 state
= MsiQueryProductStateA(prodcode
);
4260 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4262 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4263 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4265 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4266 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4268 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4269 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4270 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4271 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4273 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4274 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4276 /* complete install */
4277 r
= MsiInstallProductA(msifile
, "FULL=1");
4278 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4279 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4280 ok(pf_exists("msitest"), "File not installed\n");
4282 state
= MsiQueryProductStateA(prodcode
);
4283 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4285 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4286 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4288 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4289 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4291 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4292 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4293 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4294 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4298 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4299 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4303 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4304 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4307 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4308 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4309 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4310 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4311 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4312 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4313 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4314 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4315 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4316 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4317 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4318 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4319 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4320 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4321 CHECK_REG_STR(prodkey
, "Size", NULL
);
4322 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4323 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4324 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4325 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4326 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4327 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4328 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4331 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4334 RegCloseKey(prodkey
);
4336 /* complete uninstall */
4337 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4338 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4339 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4340 ok(!pf_exists("msitest"), "Directory not deleted\n");
4342 state
= MsiQueryProductStateA(prodcode
);
4343 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4345 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4346 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4348 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4349 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4351 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4352 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4353 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4354 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4356 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4357 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4359 /* make sure 'Program Files\msitest' is removed */
4360 delete_pfmsitest_files();
4363 RegCloseKey(uninstall
);
4364 RegCloseKey(uninstall_32node
);
4365 DeleteFileA(msifile
);
4366 DeleteFileA("msitest\\maximus");
4367 RemoveDirectoryA("msitest");
4370 static void test_publish_sourcelist(void)
4374 CHAR value
[MAX_PATH
];
4375 CHAR path
[MAX_PATH
];
4376 CHAR prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4378 if (!pMsiSourceListEnumSourcesA
|| !pMsiSourceListGetInfoA
)
4380 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4383 if (is_process_limited())
4385 skip("process is limited\n");
4389 CreateDirectoryA("msitest", NULL
);
4390 create_file("msitest\\maximus", 500);
4392 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
4394 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4396 r
= MsiInstallProductA(msifile
, NULL
);
4397 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4399 skip("Not enough rights to perform tests\n");
4402 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4403 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4404 ok(pf_exists("msitest"), "File not installed\n");
4406 /* nothing published */
4408 lstrcpyA(value
, "aaa");
4409 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4410 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4411 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4412 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4413 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4416 lstrcpyA(value
, "aaa");
4417 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4418 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4419 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4420 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4421 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4423 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
4424 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4425 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4426 ok(pf_exists("msitest"), "File not installed\n");
4428 /* after RegisterProduct */
4430 lstrcpyA(value
, "aaa");
4431 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4432 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, 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
);
4438 lstrcpyA(value
, "aaa");
4439 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4440 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4441 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4442 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4443 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4445 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
4446 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4447 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4448 ok(pf_exists("msitest"), "File not installed\n");
4450 /* after ProcessComponents */
4452 lstrcpyA(value
, "aaa");
4453 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4454 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, 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
);
4460 lstrcpyA(value
, "aaa");
4461 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4462 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4463 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4464 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4465 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4467 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
4468 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4469 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4470 ok(pf_exists("msitest"), "File not installed\n");
4472 /* after PublishFeatures */
4474 lstrcpyA(value
, "aaa");
4475 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4476 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, 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
);
4482 lstrcpyA(value
, "aaa");
4483 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4484 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4485 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4486 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4487 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4489 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
4490 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4491 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4492 ok(pf_exists("msitest"), "File not installed\n");
4494 /* after PublishProduct */
4496 lstrcpyA(value
, "aaa");
4497 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4498 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4499 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4500 ok(!lstrcmpA(value
, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value
);
4501 ok(size
== 11, "Expected 11, got %d\n", size
);
4504 lstrcpyA(value
, "aaa");
4505 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4506 MSICODE_PRODUCT
, INSTALLPROPERTY_MEDIAPACKAGEPATHA
, value
, &size
);
4507 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4508 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4509 ok(size
== 0, "Expected 0, got %d\n", size
);
4512 lstrcpyA(value
, "aaa");
4513 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4514 MSICODE_PRODUCT
, INSTALLPROPERTY_DISKPROMPTA
, value
, &size
);
4515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4516 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4517 ok(size
== 0, "Expected 0, got %d\n", size
);
4519 lstrcpyA(path
, CURR_DIR
);
4520 lstrcatA(path
, "\\");
4523 lstrcpyA(value
, "aaa");
4524 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4525 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCEA
, value
, &size
);
4526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4527 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4528 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4531 lstrcpyA(value
, "aaa");
4532 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4533 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDTYPEA
, value
, &size
);
4534 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4535 ok(!lstrcmpA(value
, "n"), "Expected \"n\", got \"%s\"\n", value
);
4536 ok(size
== 1, "Expected 1, got %d\n", size
);
4539 lstrcpyA(value
, "aaa");
4540 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4541 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4542 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4543 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4544 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4547 lstrcpyA(value
, "aaa");
4548 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4549 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 0, value
, &size
);
4550 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4551 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4552 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4555 lstrcpyA(value
, "aaa");
4556 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4557 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 1, value
, &size
);
4558 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4559 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4560 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4562 /* complete uninstall */
4563 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4564 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4565 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4566 ok(!pf_exists("msitest"), "Directory not deleted\n");
4568 /* make sure 'Program Files\msitest' is removed */
4569 delete_pfmsitest_files();
4572 DeleteFileA(msifile
);
4573 DeleteFileA("msitest\\maximus");
4574 RemoveDirectoryA("msitest");
4577 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
4579 CHAR path
[MAX_PATH
];
4581 lstrcpyA(path
, PROG_FILES_DIR
);
4582 lstrcatA(path
, "\\");
4583 lstrcatA(path
, file
);
4586 create_file_data(path
, data
, 500);
4588 CreateDirectoryA(path
, NULL
);
4591 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
4593 static void test_remove_files(void)
4597 if (is_process_limited())
4599 skip("process is limited\n");
4603 CreateDirectoryA("msitest", NULL
);
4604 create_file("msitest\\hydrogen", 500);
4605 create_file("msitest\\helium", 500);
4606 create_file("msitest\\lithium", 500);
4608 create_database(msifile
, rem_tables
, sizeof(rem_tables
) / sizeof(msi_table
));
4610 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4612 r
= MsiInstallProductA(msifile
, NULL
);
4613 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4615 skip("Not enough rights to perform tests\n");
4618 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4619 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4620 ok(!pf_exists("msitest\\helium"), "File installed\n");
4621 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4622 ok(pf_exists("msitest"), "File not installed\n");
4624 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4625 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4626 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4627 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4628 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4629 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4631 create_pf("msitest", FALSE
);
4632 create_pf("msitest\\hydrogen", TRUE
);
4633 create_pf("msitest\\helium", TRUE
);
4634 create_pf("msitest\\lithium", TRUE
);
4636 r
= MsiInstallProductA(msifile
, NULL
);
4637 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4638 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4639 ok(pf_exists("msitest\\helium"), "File not installed\n");
4640 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4641 ok(pf_exists("msitest"), "File not installed\n");
4643 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4644 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4645 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4646 ok(delete_pf("msitest\\helium", TRUE
), "File deleted\n");
4647 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4648 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4650 create_pf("msitest", FALSE
);
4651 create_pf("msitest\\furlong", TRUE
);
4652 create_pf("msitest\\firkin", TRUE
);
4653 create_pf("msitest\\fortnight", TRUE
);
4654 create_pf("msitest\\becquerel", TRUE
);
4655 create_pf("msitest\\dioptre", TRUE
);
4656 create_pf("msitest\\attoparsec", TRUE
);
4657 create_pf("msitest\\storeys", TRUE
);
4658 create_pf("msitest\\block", TRUE
);
4659 create_pf("msitest\\siriometer", TRUE
);
4660 create_pf("msitest\\cabout", FALSE
);
4661 create_pf("msitest\\cabout\\blocker", TRUE
);
4663 r
= MsiInstallProductA(msifile
, NULL
);
4664 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4665 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4666 ok(!pf_exists("msitest\\helium"), "File installed\n");
4667 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4668 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4669 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4670 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4671 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4672 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4673 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4674 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4675 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4676 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4677 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4678 ok(pf_exists("msitest"), "File not installed\n");
4680 create_pf("msitest\\furlong", TRUE
);
4681 create_pf("msitest\\firkin", TRUE
);
4682 create_pf("msitest\\fortnight", TRUE
);
4683 create_pf("msitest\\storeys", TRUE
);
4684 create_pf("msitest\\block", TRUE
);
4685 create_pf("msitest\\siriometer", TRUE
);
4687 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4688 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4689 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not deleted\n");
4690 ok(!delete_pf("msitest\\helium", TRUE
), "File not deleted\n");
4691 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4692 ok(delete_pf("msitest\\furlong", TRUE
), "File deleted\n");
4693 ok(delete_pf("msitest\\firkin", TRUE
), "File deleted\n");
4694 ok(delete_pf("msitest\\fortnight", TRUE
), "File deleted\n");
4695 ok(!delete_pf("msitest\\becquerel", TRUE
), "File not deleted\n");
4696 ok(!delete_pf("msitest\\dioptre", TRUE
), "File not deleted\n");
4697 ok(delete_pf("msitest\\attoparsec", TRUE
), "File deleted\n");
4698 ok(!delete_pf("msitest\\storeys", TRUE
), "File not deleted\n");
4699 ok(!delete_pf("msitest\\block", TRUE
), "File not deleted\n");
4700 ok(delete_pf("msitest\\siriometer", TRUE
), "File deleted\n");
4701 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4702 ok(pf_exists("msitest"), "Directory deleted\n");
4704 r
= MsiInstallProductA(msifile
, NULL
);
4705 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4706 ok(delete_pf("msitest\\hydrogen", TRUE
), "File not installed\n");
4707 ok(!delete_pf("msitest\\helium", TRUE
), "File installed\n");
4708 ok(delete_pf("msitest\\lithium", TRUE
), "File not installed\n");
4709 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4710 ok(pf_exists("msitest"), "Directory deleted\n");
4712 delete_pf("msitest\\cabout\\blocker", TRUE
);
4714 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4715 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4716 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory not deleted\n");
4717 delete_pf("msitest", FALSE
);
4720 DeleteFileA(msifile
);
4721 DeleteFileA("msitest\\hydrogen");
4722 DeleteFileA("msitest\\helium");
4723 DeleteFileA("msitest\\lithium");
4724 RemoveDirectoryA("msitest");
4727 static void test_move_files(void)
4730 char props
[MAX_PATH
];
4732 if (is_process_limited())
4734 skip("process is limited\n");
4738 CreateDirectoryA("msitest", NULL
);
4739 create_file("msitest\\augustus", 100);
4740 create_file("cameroon", 100);
4741 create_file("djibouti", 100);
4742 create_file("egypt", 100);
4743 create_file("finland", 100);
4744 create_file("gambai", 100);
4745 create_file("honduras", 100);
4746 create_file("msitest\\india", 100);
4747 create_file("japan", 100);
4748 create_file("kenya", 100);
4749 CreateDirectoryA("latvia", NULL
);
4750 create_file("nauru", 100);
4751 create_file("peru", 100);
4752 create_file("apple", 100);
4753 create_file("application", 100);
4754 create_file("ape", 100);
4755 create_file("foo", 100);
4756 create_file("fao", 100);
4757 create_file("fbod", 100);
4758 create_file("budding", 100);
4759 create_file("buddy", 100);
4760 create_file("bud", 100);
4761 create_file("bar", 100);
4762 create_file("bur", 100);
4763 create_file("bird", 100);
4765 create_database(msifile
, mov_tables
, sizeof(mov_tables
) / sizeof(msi_table
));
4767 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4769 /* if the source or dest property is not a full path,
4770 * windows tries to access it as a network resource
4773 sprintf(props
, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4774 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4775 CURR_DIR
, PROG_FILES_DIR
, CURR_DIR
, CURR_DIR
);
4777 r
= MsiInstallProductA(msifile
, props
);
4778 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4780 skip("Not enough rights to perform tests\n");
4783 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4784 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4785 ok(!delete_pf("msitest\\dest", TRUE
), "File copied\n");
4786 ok(delete_pf("msitest\\canada", TRUE
), "File not copied\n");
4787 ok(delete_pf("msitest\\dominica", TRUE
), "File not moved\n");
4788 ok(!delete_pf("msitest\\elsalvador", TRUE
), "File moved\n");
4789 ok(!delete_pf("msitest\\france", TRUE
), "File moved\n");
4790 ok(!delete_pf("msitest\\georgia", TRUE
), "File moved\n");
4791 ok(delete_pf("msitest\\hungary", TRUE
), "File not moved\n");
4792 ok(!delete_pf("msitest\\indonesia", TRUE
), "File moved\n");
4793 ok(!delete_pf("msitest\\jordan", TRUE
), "File moved\n");
4794 ok(delete_pf("msitest\\kiribati", TRUE
), "File not moved\n");
4795 ok(!delete_pf("msitest\\lebanon", TRUE
), "File moved\n");
4796 ok(!delete_pf("msitest\\lebanon", FALSE
), "Directory moved\n");
4797 ok(delete_pf("msitest\\poland", TRUE
), "File not moved\n");
4798 /* either apple or application will be moved depending on directory order */
4799 if (!delete_pf("msitest\\apple", TRUE
))
4800 ok(delete_pf("msitest\\application", TRUE
), "File not moved\n");
4802 ok(!delete_pf("msitest\\application", TRUE
), "File should not exist\n");
4803 ok(delete_pf("msitest\\wildcard", TRUE
), "File not moved\n");
4804 ok(!delete_pf("msitest\\ape", TRUE
), "File moved\n");
4805 /* either fao or foo will be moved depending on directory order */
4806 if (delete_pf("msitest\\foo", TRUE
))
4807 ok(!delete_pf("msitest\\fao", TRUE
), "File should not exist\n");
4809 ok(delete_pf("msitest\\fao", TRUE
), "File not moved\n");
4810 ok(delete_pf("msitest\\single", TRUE
), "File not moved\n");
4811 ok(!delete_pf("msitest\\fbod", TRUE
), "File moved\n");
4812 ok(delete_pf("msitest\\budding", TRUE
), "File not moved\n");
4813 ok(delete_pf("msitest\\buddy", TRUE
), "File not moved\n");
4814 ok(!delete_pf("msitest\\bud", TRUE
), "File moved\n");
4815 ok(delete_pf("msitest\\bar", TRUE
), "File not moved\n");
4816 ok(delete_pf("msitest\\bur", TRUE
), "File not moved\n");
4817 ok(!delete_pf("msitest\\bird", TRUE
), "File moved\n");
4818 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4819 ok(DeleteFileA("cameroon"), "File moved\n");
4820 ok(!DeleteFileA("djibouti"), "File not moved\n");
4821 ok(DeleteFileA("egypt"), "File moved\n");
4822 ok(DeleteFileA("finland"), "File moved\n");
4823 ok(DeleteFileA("gambai"), "File moved\n");
4824 ok(!DeleteFileA("honduras"), "File not moved\n");
4825 ok(DeleteFileA("msitest\\india"), "File moved\n");
4826 ok(DeleteFileA("japan"), "File moved\n");
4827 ok(!DeleteFileA("kenya"), "File not moved\n");
4828 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4829 ok(!DeleteFileA("nauru"), "File not moved\n");
4830 ok(!DeleteFileA("peru"), "File not moved\n");
4831 ok(!DeleteFileA("apple"), "File not moved\n");
4832 ok(!DeleteFileA("application"), "File not moved\n");
4833 ok(DeleteFileA("ape"), "File moved\n");
4834 ok(!DeleteFileA("foo"), "File not moved\n");
4835 ok(!DeleteFileA("fao"), "File not moved\n");
4836 ok(DeleteFileA("fbod"), "File moved\n");
4837 ok(!DeleteFileA("budding"), "File not moved\n");
4838 ok(!DeleteFileA("buddy"), "File not moved\n");
4839 ok(DeleteFileA("bud"), "File moved\n");
4840 ok(!DeleteFileA("bar"), "File not moved\n");
4841 ok(!DeleteFileA("bur"), "File not moved\n");
4842 ok(DeleteFileA("bird"), "File moved\n");
4845 DeleteFileA("cameroon");
4846 DeleteFileA("djibouti");
4847 DeleteFileA("egypt");
4848 DeleteFileA("finland");
4849 DeleteFileA("gambai");
4850 DeleteFileA("honduras");
4851 DeleteFileA("japan");
4852 DeleteFileA("kenya");
4853 DeleteFileA("nauru");
4854 DeleteFileA("peru");
4855 DeleteFileA("apple");
4856 DeleteFileA("application");
4860 DeleteFileA("fbod");
4861 DeleteFileA("budding");
4862 DeleteFileA("buddy");
4866 DeleteFileA("bird");
4867 DeleteFileA("msitest\\india");
4868 DeleteFileA("msitest\\augustus");
4869 RemoveDirectoryA("latvia");
4870 RemoveDirectoryA("msitest");
4871 DeleteFileA(msifile
);
4874 static void test_duplicate_files(void)
4878 if (is_process_limited())
4880 skip("process is limited\n");
4884 CreateDirectoryA("msitest", NULL
);
4885 create_file("msitest\\maximus", 500);
4886 create_database(msifile
, df_tables
, sizeof(df_tables
) / sizeof(msi_table
));
4888 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4890 /* fails if the destination folder is not a valid property */
4892 r
= MsiInstallProductA(msifile
, NULL
);
4893 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4895 skip("Not enough rights to perform tests\n");
4898 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4899 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
4900 ok(delete_pf("msitest\\augustus", TRUE
), "File not duplicated\n");
4901 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE
), "File not duplicated\n");
4902 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE
), "Directory not created\n");
4903 ok(delete_pf("msitest\\this\\doesnot", FALSE
), "Directory not created\n");
4904 ok(delete_pf("msitest\\this", FALSE
), "Directory not created\n");
4905 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4908 DeleteFileA("msitest\\maximus");
4909 RemoveDirectoryA("msitest");
4910 DeleteFileA(msifile
);
4913 static void test_write_registry_values(void)
4919 CHAR path
[MAX_PATH
];
4921 if (is_process_limited())
4923 skip("process is limited\n");
4927 CreateDirectoryA("msitest", NULL
);
4928 create_file("msitest\\augustus", 500);
4930 create_database(msifile
, wrv_tables
, sizeof(wrv_tables
) / sizeof(msi_table
));
4932 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4935 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL
, 0,
4936 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
4938 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, NULL
, 0, KEY_ALL_ACCESS
,
4940 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4942 res
= RegSetValueExA(hkey
, "Value1", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4943 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4944 res
= RegSetValueExA(hkey
, "Value2", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4945 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4946 res
= RegSetValueExA(hkey
, "Value3", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4947 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4948 res
= RegSetValueExA(hkey
, "Value4", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4949 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4950 res
= RegSetValueExA(hkey
, "Value5", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0two\0", 9);
4951 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4952 res
= RegSetValueExA(hkey
, "Value6", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4953 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4954 res
= RegSetValueExA(hkey
, "Value7", 0, REG_SZ
, (const BYTE
*)"one", 4);
4955 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4958 r
= MsiInstallProductA(msifile
, NULL
);
4959 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4961 skip("Not enough rights to perform tests\n");
4964 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4965 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4966 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4969 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4971 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4972 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4976 memset(path
, 'a', MAX_PATH
);
4977 res
= RegQueryValueExA(hkey
, "Value", NULL
, &type
, (LPBYTE
)path
, &size
);
4978 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4979 ok(!memcmp(path
, "one\0two\0three\0\0", size
), "Wrong multi-sz data\n");
4980 ok(size
== 15, "Expected 15, got %d\n", size
);
4981 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
4983 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, NULL
, NULL
);
4984 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4986 res
= action_RegDeleteTreeA(hkey
, "VisualStudio", KEY_ALL_ACCESS
);
4987 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4991 memset(path
, 'a', MAX_PATH
);
4992 res
= RegQueryValueExA(hkey
, "Value1", NULL
, &type
, (LPBYTE
)path
, &size
);
4993 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4994 ok(!memcmp(path
, "one\0", size
), "Wrong multi-sz data\n");
4995 ok(size
== 5, "Expected 5, got %d\n", size
);
4996 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5000 memset(path
, 'a', MAX_PATH
);
5001 res
= RegQueryValueExA(hkey
, "Value2", NULL
, &type
, (LPBYTE
)path
, &size
);
5002 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5003 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5004 ok(size
== 9, "Expected 9, got %d\n", size
);
5005 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5009 memset(path
, 'a', MAX_PATH
);
5010 res
= RegQueryValueExA(hkey
, "Value3", NULL
, &type
, (LPBYTE
)path
, &size
);
5011 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5012 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5013 ok(size
== 9, "Expected 9, got %d\n", size
);
5014 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5018 memset(path
, 'a', MAX_PATH
);
5019 res
= RegQueryValueExA(hkey
, "Value4", NULL
, &type
, (LPBYTE
)path
, &size
);
5020 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5021 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5022 ok(size
== 9, "Expected 9, got %d\n", size
);
5023 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5027 memset(path
, 'a', MAX_PATH
);
5028 res
= RegQueryValueExA(hkey
, "Value5", NULL
, &type
, (LPBYTE
)path
, &size
);
5029 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5030 ok(!memcmp(path
, "one\0two\0three\0", size
), "Wrong multi-sz data\n");
5031 ok(size
== 15, "Expected 15, got %d\n", size
);
5032 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5036 memset(path
, 'a', MAX_PATH
);
5037 res
= RegQueryValueExA(hkey
, "Value6", NULL
, &type
, (LPBYTE
)path
, &size
);
5038 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5039 ok(!memcmp(path
, "", size
), "Wrong multi-sz data\n");
5040 ok(size
== 1, "Expected 1, got %d\n", size
);
5041 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5045 memset(path
, 'a', MAX_PATH
);
5046 res
= RegQueryValueExA(hkey
, "Value7", NULL
, &type
, (LPBYTE
)path
, &size
);
5047 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5048 ok(!memcmp(path
, "two\0", size
), "Wrong multi-sz data\n");
5049 ok(size
== 5, "Expected 5, got %d\n", size
);
5050 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5052 RegDeleteValueA(hkey
, "Value");
5053 RegDeleteValueA(hkey
, "Value1");
5054 RegDeleteValueA(hkey
, "Value2");
5055 RegDeleteValueA(hkey
, "Value3");
5056 RegDeleteValueA(hkey
, "Value4");
5057 RegDeleteValueA(hkey
, "Value5");
5058 RegDeleteValueA(hkey
, "Value6");
5059 RegDeleteValueA(hkey
, "Value7");
5061 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
5064 DeleteFileA(msifile
);
5065 DeleteFileA("msitest\\augustus");
5066 RemoveDirectoryA("msitest");
5069 static void test_envvar(void)
5071 static const char *results
[] =
5073 "1;2", /* MSITESTVAR11 */
5074 "1", /* MSITESTVAR12 */
5075 "1;2", /* MSITESTVAR13 */
5076 ";1;", /* MSITESTVAR14 */
5077 ";;1;;", /* MSITESTVAR15 */
5078 " 1 ", /* MSITESTVAR16 */
5079 ";;2;;1", /* MSITESTVAR17 */
5080 "1;;2;;", /* MSITESTVAR18 */
5081 "1", /* MSITESTVAR19 */
5082 "1", /* MSITESTVAR20 */
5092 if (is_process_limited())
5094 skip("process is limited\n");
5098 create_test_files();
5099 create_database(msifile
, env_tables
, sizeof(env_tables
) / sizeof(msi_table
));
5101 res
= RegCreateKeyExA(HKEY_CURRENT_USER
, "Environment", 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &env
, NULL
);
5102 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5104 res
= RegSetValueExA(env
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"0", 2);
5105 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5107 res
= RegSetValueExA(env
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"0", 2);
5108 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5110 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5112 r
= MsiInstallProductA(msifile
, NULL
);
5113 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5115 skip("Not enough rights to perform tests\n");
5118 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5121 size
= sizeof(buffer
);
5123 res
= RegQueryValueExA(env
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5124 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5125 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5126 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5128 res
= RegDeleteValueA(env
, "MSITESTVAR1");
5129 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5132 size
= sizeof(buffer
);
5134 res
= RegQueryValueExA(env
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5135 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5136 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5137 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5139 res
= RegDeleteValueA(env
, "MSITESTVAR2");
5140 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5142 res
= RegDeleteValueA(env
, "MSITESTVAR3");
5143 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5145 res
= RegDeleteValueA(env
, "MSITESTVAR4");
5146 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5148 res
= RegDeleteValueA(env
, "MSITESTVAR5");
5149 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5151 res
= RegDeleteValueA(env
, "MSITESTVAR6");
5152 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5154 res
= RegDeleteValueA(env
, "MSITESTVAR7");
5155 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5157 res
= RegDeleteValueA(env
, "MSITESTVAR8");
5158 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5160 res
= RegDeleteValueA(env
, "MSITESTVAR9");
5161 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5163 res
= RegDeleteValueA(env
, "MSITESTVAR10");
5164 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5167 while (results
[i
- 11])
5170 sprintf(name
, "MSITESTVAR%d", i
);
5173 size
= sizeof(buffer
);
5175 res
= RegQueryValueExA(env
, name
, NULL
, &type
, (LPBYTE
)buffer
, &size
);
5176 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5177 ok(type
== REG_SZ
, "%d: Expected REG_SZ, got %u\n", i
, type
);
5178 ok(!lstrcmpA(buffer
, results
[i
- 11]), "%d: Expected %s, got %s\n", i
, results
[i
- 11], buffer
);
5180 res
= RegDeleteValueA(env
, name
);
5181 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5185 delete_pf("msitest\\cabout\\new\\five.txt", TRUE
);
5186 delete_pf("msitest\\cabout\\new", FALSE
);
5187 delete_pf("msitest\\cabout\\four.txt", TRUE
);
5188 delete_pf("msitest\\cabout", FALSE
);
5189 delete_pf("msitest\\changed\\three.txt", TRUE
);
5190 delete_pf("msitest\\changed", FALSE
);
5191 delete_pf("msitest\\first\\two.txt", TRUE
);
5192 delete_pf("msitest\\first", FALSE
);
5193 delete_pf("msitest\\filename", TRUE
);
5194 delete_pf("msitest\\one.txt", TRUE
);
5195 delete_pf("msitest\\service.exe", TRUE
);
5196 delete_pf("msitest\\service2.exe", TRUE
);
5197 delete_pf("msitest", FALSE
);
5200 RegDeleteValueA(env
, "MSITESTVAR1");
5201 RegDeleteValueA(env
, "MSITESTVAR2");
5204 delete_test_files();
5205 DeleteFileA(msifile
);
5208 static void test_create_remove_folder(void)
5212 if (is_process_limited())
5214 skip("process is limited\n");
5218 CreateDirectoryA("msitest", NULL
);
5219 CreateDirectoryA("msitest\\first", NULL
);
5220 CreateDirectoryA("msitest\\second", NULL
);
5221 create_file("msitest\\first\\one.txt", 1000);
5222 create_file("msitest\\second\\two.txt", 1000);
5223 create_database(msifile
, cf_tables
, sizeof(cf_tables
) / sizeof(msi_table
));
5225 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5227 r
= MsiInstallProductA(msifile
, NULL
);
5228 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5230 skip("Not enough rights to perform tests\n");
5233 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5235 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5236 ok(pf_exists("msitest\\first"), "directory not created\n");
5237 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5238 ok(pf_exists("msitest\\second"), "directory not created\n");
5239 ok(pf_exists("msitest\\third"), "directory not created\n");
5240 ok(pf_exists("msitest"), "directory not created\n");
5242 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5243 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5245 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5246 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5247 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5248 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5249 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5250 todo_wine
ok(!pf_exists("msitest"), "directory not removed\n");
5253 DeleteFileA("msitest\\first\\one.txt");
5254 DeleteFileA("msitest\\second\\two.txt");
5255 RemoveDirectoryA("msitest\\first");
5256 RemoveDirectoryA("msitest\\second");
5257 RemoveDirectoryA("msitest");
5258 DeleteFileA(msifile
);
5261 static void test_start_services(void)
5264 SC_HANDLE scm
, service
;
5266 DWORD error
= ERROR_SUCCESS
;
5268 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5269 if (!scm
&& GetLastError() == ERROR_ACCESS_DENIED
)
5271 skip("Not enough rights to perform tests\n");
5274 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
5277 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5278 if (!service
&& GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST
)
5280 win_skip("The 'Spooler' service does not exist\n");
5281 CloseServiceHandle(scm
);
5284 ok(service
!= NULL
, "Failed to open Spooler, error %d\n", GetLastError());
5286 CloseServiceHandle(scm
);
5290 ret
= StartServiceA(service
, 0, NULL
);
5291 if (!ret
&& (error
= GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING
)
5293 skip("Spooler service not available, skipping test\n");
5294 CloseServiceHandle(service
);
5295 CloseServiceHandle(scm
);
5299 CloseServiceHandle(service
);
5300 CloseServiceHandle(scm
);
5302 create_test_files();
5303 create_database(msifile
, sss_tables
, sizeof(sss_tables
) / sizeof(msi_table
));
5305 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5307 r
= MsiInstallProductA(msifile
, NULL
);
5308 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5310 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5311 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5312 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5313 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5314 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5315 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5316 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5317 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5318 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5319 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5320 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5321 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5322 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5324 delete_test_files();
5325 DeleteFileA(msifile
);
5327 if (error
== ERROR_SUCCESS
)
5329 SERVICE_STATUS status
;
5331 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5332 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5334 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5335 ok(ret
, "ControlService failed %u\n", GetLastError());
5337 CloseServiceHandle(service
);
5338 CloseServiceHandle(scm
);
5342 static void test_delete_services(void)
5345 SC_HANDLE manager
, service
;
5348 if (is_process_limited())
5350 skip("process is limited\n");
5354 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5355 ok(manager
!= NULL
, "can't open service manager %u\n", GetLastError());
5356 if (!manager
) return;
5358 service
= CreateServiceA(manager
, "TestService3", "TestService3",
5359 SERVICE_ALL_ACCESS
, SERVICE_WIN32_OWN_PROCESS
, SERVICE_DEMAND_START
,
5360 SERVICE_ERROR_NORMAL
, "C:\\doesnt_exist.exe", NULL
, NULL
, NULL
, NULL
, NULL
);
5361 ok(service
!= NULL
, "can't create service %u\n", GetLastError());
5362 CloseServiceHandle(service
);
5363 CloseServiceHandle(manager
);
5364 if (!service
) goto error
;
5366 create_test_files();
5367 create_database(msifile
, sds_tables
, sizeof(sds_tables
) / sizeof(msi_table
));
5369 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5371 r
= MsiInstallProductA(msifile
, NULL
);
5372 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5374 skip("Not enough rights to perform tests\n");
5377 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5379 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5380 ok(manager
!= NULL
, "can't open service manager\n");
5381 if (!manager
) goto error
;
5383 service
= OpenServiceA(manager
, "TestService3", GENERIC_ALL
);
5384 error
= GetLastError();
5385 ok(service
== NULL
, "TestService3 not deleted\n");
5386 ok(error
== ERROR_SERVICE_DOES_NOT_EXIST
, "wrong error %u\n", error
);
5387 CloseServiceHandle(manager
);
5389 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5390 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5392 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5393 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5394 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5395 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5396 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5397 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5398 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5399 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5400 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5401 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5402 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5403 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5404 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5407 delete_test_files();
5408 DeleteFileA(msifile
);
5411 static void test_install_services(void)
5414 SC_HANDLE manager
, service
;
5417 if (is_process_limited())
5419 skip("process is limited\n");
5423 create_test_files();
5424 create_database(msifile
, sis_tables
, sizeof(sis_tables
) / sizeof(msi_table
));
5426 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5428 r
= MsiInstallProductA(msifile
, NULL
);
5429 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5431 skip("Not enough rights to perform tests\n");
5434 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5436 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5437 ok(manager
!= NULL
, "can't open service manager\n");
5438 if (!manager
) goto error
;
5440 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5441 ok(service
!= NULL
, "TestService not installed\n");
5442 CloseServiceHandle(service
);
5444 service
= OpenServiceA(manager
, "TestService4", GENERIC_ALL
);
5445 ok(service
== NULL
, "TestService4 installed\n");
5446 CloseServiceHandle(manager
);
5448 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5449 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5451 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5452 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5453 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5454 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5455 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5456 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5457 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5458 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5459 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5460 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5461 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5462 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5463 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5465 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5466 ok(manager
!= NULL
, "can't open service manager\n");
5467 if (!manager
) goto error
;
5469 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5470 ok(service
!= NULL
, "TestService doesn't exist\n");
5472 ret
= DeleteService( service
);
5473 ok( ret
, "failed to delete service %u\n", GetLastError() );
5475 CloseServiceHandle(service
);
5476 CloseServiceHandle(manager
);
5479 delete_test_files();
5480 DeleteFileA(msifile
);
5483 static void test_self_registration(void)
5487 if (is_process_limited())
5489 skip("process is limited\n");
5493 create_test_files();
5494 create_database(msifile
, sr_tables
, sizeof(sr_tables
) / sizeof(msi_table
));
5496 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5498 r
= MsiInstallProductA(msifile
, NULL
);
5499 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5501 skip("Not enough rights to perform tests\n");
5504 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5506 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5507 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5508 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5509 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5510 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5511 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5512 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5513 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5514 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5515 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5516 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5517 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5518 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5521 delete_test_files();
5522 DeleteFileA(msifile
);
5525 static void test_register_font(void)
5527 static const char regfont1
[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5528 static const char regfont2
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5532 REGSAM access
= KEY_ALL_ACCESS
;
5534 if (is_process_limited())
5536 skip("process is limited\n");
5540 create_test_files();
5541 create_file("msitest\\font.ttf", 1000);
5542 create_database(msifile
, font_tables
, sizeof(font_tables
) / sizeof(msi_table
));
5545 access
|= KEY_WOW64_64KEY
;
5547 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5549 r
= MsiInstallProductA(msifile
, NULL
);
5550 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5552 skip("Not enough rights to perform tests\n");
5555 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5557 ret
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont1
, 0, access
, &key
);
5559 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont2
, 0, access
, &key
);
5561 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5562 ok(ret
!= ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5564 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5565 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5567 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5569 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5570 ok(ret
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5572 RegDeleteValueA(key
, "msi test font");
5576 DeleteFileA("msitest\\font.ttf");
5577 delete_test_files();
5578 DeleteFileA(msifile
);
5581 static void test_validate_product_id(void)
5585 if (is_process_limited())
5587 skip("process is limited\n");
5591 create_test_files();
5592 create_database(msifile
, vp_tables
, sizeof(vp_tables
) / sizeof(msi_table
));
5594 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5596 r
= MsiInstallProductA(msifile
, NULL
);
5597 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5599 skip("Not enough rights to perform tests\n");
5602 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5604 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=1");
5605 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5607 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=2");
5608 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5610 r
= MsiInstallProductA(msifile
, "PIDKEY=123-1234567");
5611 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5613 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5614 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5615 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5616 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5617 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5618 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5619 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5620 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5621 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5622 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5623 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5624 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5625 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5628 delete_test_files();
5629 DeleteFileA(msifile
);
5632 static void test_install_remove_odbc(void)
5636 if (is_process_limited())
5638 skip("process is limited\n");
5642 create_test_files();
5643 create_file("msitest\\ODBCdriver.dll", 1000);
5644 create_file("msitest\\ODBCdriver2.dll", 1000);
5645 create_file("msitest\\ODBCtranslator.dll", 1000);
5646 create_file("msitest\\ODBCtranslator2.dll", 1000);
5647 create_file("msitest\\ODBCsetup.dll", 1000);
5648 create_database(msifile
, odbc_tables
, sizeof(odbc_tables
) / sizeof(msi_table
));
5650 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5652 r
= MsiInstallProductA(msifile
, NULL
);
5653 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5655 skip("Not enough rights to perform tests\n");
5658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5660 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5661 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5662 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5663 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5664 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5666 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5667 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5669 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE
), "file not removed\n");
5670 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE
), "file not removed\n");
5671 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE
), "file not removed\n");
5672 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE
), "file not removed\n");
5673 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE
), "file not removed\n");
5674 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5677 DeleteFileA("msitest\\ODBCdriver.dll");
5678 DeleteFileA("msitest\\ODBCdriver2.dll");
5679 DeleteFileA("msitest\\ODBCtranslator.dll");
5680 DeleteFileA("msitest\\ODBCtranslator2.dll");
5681 DeleteFileA("msitest\\ODBCsetup.dll");
5682 delete_test_files();
5683 DeleteFileA(msifile
);
5686 static void test_register_typelib(void)
5690 if (is_process_limited())
5692 skip("process is limited\n");
5696 create_test_files();
5697 create_file("msitest\\typelib.dll", 1000);
5698 create_database(msifile
, tl_tables
, sizeof(tl_tables
) / sizeof(msi_table
));
5700 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5702 r
= MsiInstallProductA(msifile
, "REGISTER_TYPELIB=1");
5703 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5705 skip("Not enough rights to perform tests\n");
5708 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5710 r
= MsiInstallProductA(msifile
, NULL
);
5711 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5713 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5714 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5716 ok(!delete_pf("msitest\\typelib.dll", TRUE
), "file not removed\n");
5717 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5720 DeleteFileA("msitest\\typelib.dll");
5721 delete_test_files();
5722 DeleteFileA(msifile
);
5725 static void test_create_remove_shortcut(void)
5729 if (is_process_limited())
5731 skip("process is limited\n");
5735 create_test_files();
5736 create_file("msitest\\target.txt", 1000);
5737 create_database(msifile
, crs_tables
, sizeof(crs_tables
) / sizeof(msi_table
));
5739 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5741 r
= MsiInstallProductA(msifile
, NULL
);
5742 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5744 skip("Not enough rights to perform tests\n");
5747 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5749 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5750 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5752 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5753 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5755 ok(!delete_pf("msitest\\shortcut.lnk", TRUE
), "file not removed\n");
5756 ok(!delete_pf("msitest\\target.txt", TRUE
), "file not removed\n");
5757 todo_wine
ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5760 DeleteFileA("msitest\\target.txt");
5761 delete_test_files();
5762 DeleteFileA(msifile
);
5765 static void test_publish_components(void)
5767 static const char keypath
[] =
5768 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5774 if (is_process_limited())
5776 skip("process is limited\n");
5780 create_test_files();
5781 create_file("msitest\\english.txt", 1000);
5782 create_database(msifile
, pub_tables
, sizeof(pub_tables
) / sizeof(msi_table
));
5784 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5786 r
= MsiInstallProductA(msifile
, NULL
);
5787 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5789 skip("Not enough rights to perform tests\n");
5792 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5794 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5795 ok(res
== ERROR_SUCCESS
, "components key not created %d\n", res
);
5797 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, NULL
, NULL
);
5798 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5801 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5802 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5804 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5805 ok(res
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", res
);
5807 ok(!delete_pf("msitest\\english.txt", TRUE
), "file not removed\n");
5808 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5811 DeleteFileA("msitest\\english.txt");
5812 delete_test_files();
5813 DeleteFileA(msifile
);
5816 static void test_remove_duplicate_files(void)
5820 if (is_process_limited())
5822 skip("process is limited\n");
5826 create_test_files();
5827 create_file("msitest\\original.txt", 1000);
5828 create_file("msitest\\original2.txt", 1000);
5829 create_file("msitest\\original3.txt", 1000);
5830 create_database(msifile
, rd_tables
, sizeof(rd_tables
) / sizeof(msi_table
));
5832 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5834 r
= MsiInstallProductA(msifile
, NULL
);
5835 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5837 skip("Not enough rights to perform tests\n");
5840 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5842 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5843 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5844 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5845 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5846 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5848 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5849 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5851 ok(delete_pf("msitest\\original.txt", TRUE
), "file removed\n");
5852 ok(!delete_pf("msitest\\original2.txt", TRUE
), "file not removed\n");
5853 ok(!delete_pf("msitest\\original3.txt", TRUE
), "file not removed\n");
5854 ok(!delete_pf("msitest\\duplicate.txt", TRUE
), "file not removed\n");
5855 ok(!delete_pf("msitest\\duplicate2.txt", TRUE
), "file not removed\n");
5856 ok(delete_pf("msitest", FALSE
), "directory removed\n");
5859 DeleteFileA("msitest\\original.txt");
5860 DeleteFileA("msitest\\original2.txt");
5861 DeleteFileA("msitest\\original3.txt");
5862 delete_test_files();
5863 DeleteFileA(msifile
);
5866 static void test_remove_registry_values(void)
5871 REGSAM access
= KEY_ALL_ACCESS
;
5873 if (is_process_limited())
5875 skip("process is limited\n");
5879 create_test_files();
5880 create_file("msitest\\registry.txt", 1000);
5881 create_database(msifile
, rrv_tables
, sizeof(rrv_tables
) / sizeof(msi_table
));
5884 access
|= KEY_WOW64_64KEY
;
5886 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5888 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5889 RegSetValueExA(key
, "value1", 0, REG_SZ
, (const BYTE
*)"1", 2);
5892 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5893 RegSetValueExA(key
, "value2", 0, REG_SZ
, (const BYTE
*)"2", 2);
5896 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5897 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
5898 RegSetValueExA(key
, "valueA", 0, REG_SZ
, (const BYTE
*)"A", 2);
5899 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
5902 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5903 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
5904 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
5907 r
= MsiInstallProductA(msifile
, NULL
);
5908 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5910 skip("Not enough rights to perform tests\n");
5913 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5915 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, access
, &key
);
5916 ok(res
== ERROR_SUCCESS
, "key removed\n");
5921 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
5922 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
5926 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
5927 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
5930 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
5931 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5934 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5935 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5939 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
5940 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
5944 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
5945 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
5948 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, access
, &key
);
5949 ok(res
== ERROR_SUCCESS
, "key removed\n");
5952 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, access
, &key
);
5953 ok(res
== ERROR_SUCCESS
, "key removed\n");
5958 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
5959 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
5963 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
5964 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
5967 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
5968 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
5969 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine", access
);
5971 ok(!delete_pf("msitest\\registry.txt", TRUE
), "file not removed\n");
5972 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5975 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", access
);
5976 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
5977 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
5978 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", access
);
5980 DeleteFileA("msitest\\registry.txt");
5981 delete_test_files();
5982 DeleteFileA(msifile
);
5985 static void test_find_related_products(void)
5989 if (is_process_limited())
5991 skip("process is limited\n");
5995 create_test_files();
5996 create_file("msitest\\product.txt", 1000);
5997 create_database(msifile
, frp_tables
, sizeof(frp_tables
) / sizeof(msi_table
));
5999 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6001 r
= MsiInstallProductA(msifile
, NULL
);
6002 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6004 skip("Not enough rights to perform tests\n");
6007 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6009 /* install again, so it finds the upgrade code */
6010 r
= MsiInstallProductA(msifile
, NULL
);
6011 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6013 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6014 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6016 ok(!delete_pf("msitest\\product.txt", TRUE
), "file not removed\n");
6017 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6020 DeleteFileA("msitest\\product.txt");
6021 delete_test_files();
6022 DeleteFileA(msifile
);
6025 static void test_remove_ini_values(void)
6029 char inifile
[MAX_PATH
], buf
[0x10];
6033 if (is_process_limited())
6035 skip("process is limited\n");
6039 create_test_files();
6040 create_file("msitest\\inifile.txt", 1000);
6041 create_database(msifile
, riv_tables
, sizeof(riv_tables
) / sizeof(msi_table
));
6043 lstrcpyA(inifile
, PROG_FILES_DIR
);
6044 lstrcatA(inifile
, "\\msitest");
6045 ret
= CreateDirectoryA(inifile
, NULL
);
6046 if (!ret
&& GetLastError() == ERROR_ACCESS_DENIED
)
6048 skip("Not enough rights to perform tests\n");
6051 lstrcatA(inifile
, "\\test.ini");
6052 file
= CreateFileA(inifile
, GENERIC_WRITE
|GENERIC_READ
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
6055 ret
= WritePrivateProfileStringA("section1", "key1", "value1", inifile
);
6056 ok(ret
, "failed to write profile string %u\n", GetLastError());
6058 ret
= WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile
);
6059 ok(ret
, "failed to write profile string %u\n", GetLastError());
6061 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6063 r
= MsiInstallProductA(msifile
, NULL
);
6064 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6066 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6067 ok(len
== 6, "got %u expected 6\n", len
);
6069 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6070 ok(!len
, "got %u expected 0\n", len
);
6072 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6073 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6075 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6076 ok(!len
, "got %u expected 0\n", len
);
6078 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6079 ok(!len
, "got %u expected 0\n", len
);
6081 todo_wine
ok(!delete_pf("msitest\\test.ini", TRUE
), "file removed\n");
6082 ok(!delete_pf("msitest\\inifile.txt", TRUE
), "file not removed\n");
6083 ok(delete_pf("msitest", FALSE
), "directory removed\n");
6086 DeleteFileA("msitest\\inifile.txt");
6087 delete_test_files();
6088 DeleteFileA(msifile
);
6091 static void test_remove_env_strings(void)
6099 if (is_process_limited())
6101 skip("process is limited\n");
6105 create_test_files();
6106 create_file("msitest\\envvar.txt", 1000);
6107 create_database(msifile
, res_tables
, sizeof(res_tables
) / sizeof(msi_table
));
6109 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6111 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6112 ok(!res
, "failed to open environment key %d\n", res
);
6114 RegSetValueExA(key
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"1", 2);
6115 RegSetValueExA(key
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"1", 2);
6116 RegSetValueExA(key
, "MSITESTVAR3", 0, REG_SZ
, (const BYTE
*)"1", 2);
6117 RegSetValueExA(key
, "MSITESTVAR4", 0, REG_SZ
, (const BYTE
*)"1", 2);
6118 RegSetValueExA(key
, "MSITESTVAR5", 0, REG_SZ
, (const BYTE
*)"1", 2);
6122 r
= MsiInstallProductA(msifile
, NULL
);
6123 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6125 skip("Not enough rights to perform tests\n");
6128 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6130 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6131 ok(!res
, "failed to open environment key %d\n", res
);
6135 size
= sizeof(buffer
);
6136 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6137 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6138 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6139 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6143 size
= sizeof(buffer
);
6144 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6145 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6146 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6147 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6151 size
= sizeof(buffer
);
6152 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6153 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6154 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6155 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6159 size
= sizeof(buffer
);
6160 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6161 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6162 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6163 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6167 size
= sizeof(buffer
);
6168 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6169 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6170 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6171 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6175 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6176 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6178 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6179 ok(!res
, "failed to open environment key %d\n", res
);
6181 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, NULL
, NULL
, NULL
);
6182 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6184 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, NULL
, NULL
, NULL
);
6185 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6189 size
= sizeof(buffer
);
6190 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6191 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6192 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6193 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6194 RegDeleteValueA(key
, "MSITESTVAR3");
6196 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, NULL
, NULL
, NULL
);
6197 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6201 size
= sizeof(buffer
);
6202 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6203 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6204 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6205 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6206 RegDeleteValueA(key
, "MSITESTVAR5");
6208 ok(!delete_pf("msitest\\envvar.txt", TRUE
), "file not removed\n");
6209 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6212 RegDeleteValueA(key
, "MSITESTVAR1");
6213 RegDeleteValueA(key
, "MSITESTVAR2");
6214 RegDeleteValueA(key
, "MSITESTVAR3");
6215 RegDeleteValueA(key
, "MSITESTVAR4");
6216 RegDeleteValueA(key
, "MSITESTVAR5");
6219 DeleteFileA("msitest\\envvar.txt");
6220 delete_test_files();
6221 DeleteFileA(msifile
);
6224 static void test_register_class_info(void)
6230 if (is_process_limited())
6232 skip("process is limited\n");
6236 create_test_files();
6237 create_file("msitest\\class.txt", 1000);
6238 create_database(msifile
, rci_tables
, sizeof(rci_tables
) / sizeof(msi_table
));
6240 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6242 r
= MsiInstallProductA(msifile
, NULL
);
6243 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6245 skip("Not enough rights to perform tests\n");
6248 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6251 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6253 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6254 ok(res
== ERROR_SUCCESS
, "key not created\n");
6257 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6258 ok(res
== ERROR_SUCCESS
, "key not created\n");
6261 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6262 ok(res
== ERROR_SUCCESS
, "key not created\n");
6265 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6266 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6269 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6271 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6272 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6274 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6275 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6277 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6278 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6280 ok(!delete_pf("msitest\\class.txt", TRUE
), "file not removed\n");
6281 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6284 DeleteFileA("msitest\\class.txt");
6285 delete_test_files();
6286 DeleteFileA(msifile
);
6289 static void test_register_extension_info(void)
6295 if (is_process_limited())
6297 skip("process is limited\n");
6301 create_test_files();
6302 create_file("msitest\\extension.txt", 1000);
6303 create_database(msifile
, rei_tables
, sizeof(rei_tables
) / sizeof(msi_table
));
6305 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6307 r
= MsiInstallProductA(msifile
, NULL
);
6308 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6310 skip("Not enough rights to perform tests\n");
6313 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6315 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6316 ok(res
== ERROR_SUCCESS
, "key not created\n");
6319 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1\\shell\\Open\\command", &hkey
);
6320 ok(res
== ERROR_SUCCESS
, "key not created\n");
6323 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6324 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6326 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6327 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6329 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1", &hkey
);
6330 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6332 ok(!delete_pf("msitest\\extension.txt", TRUE
), "file not removed\n");
6333 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6336 DeleteFileA("msitest\\extension.txt");
6337 delete_test_files();
6338 DeleteFileA(msifile
);
6341 static void test_register_progid_info(void)
6347 if (is_process_limited())
6349 skip("process is limited\n");
6353 create_test_files();
6354 create_file("msitest\\progid.txt", 1000);
6355 create_database(msifile
, rpi_tables
, sizeof(rpi_tables
) / sizeof(msi_table
));
6357 res
= RegCreateKeyExA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", 0, NULL
, 0,
6358 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
6359 ok(res
== ERROR_SUCCESS
, "key not created\n");
6362 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6364 r
= MsiInstallProductA(msifile
, NULL
);
6365 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6367 skip("Not enough rights to perform tests\n");
6370 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6373 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6375 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6376 ok(res
== ERROR_SUCCESS
, "key not created\n");
6379 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6380 ok(res
== ERROR_SUCCESS
, "key not created\n");
6383 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6384 ok(res
== ERROR_SUCCESS
, "key not created\n");
6387 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6388 ok(res
== ERROR_SUCCESS
, "key not created\n");
6391 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6392 ok(res
== ERROR_SUCCESS
, "key not created\n");
6395 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6396 ok(res
== ERROR_SUCCESS
, "key not created\n");
6399 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6400 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6401 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6403 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6404 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6406 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6407 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6408 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6410 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6411 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6413 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6414 ok(res
== ERROR_SUCCESS
, "key not created\n");
6417 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6418 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6421 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6423 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6424 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6426 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6427 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6429 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6430 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6432 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6433 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6435 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6436 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6438 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6439 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6441 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6442 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6444 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6445 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6447 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6448 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6449 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6451 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6452 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6454 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6455 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6457 ok(!delete_pf("msitest\\progid.txt", TRUE
), "file not removed\n");
6458 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6461 DeleteFileA("msitest\\progid.txt");
6462 delete_test_files();
6463 DeleteFileA(msifile
);
6464 RegDeleteKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned");
6467 static void test_register_mime_info(void)
6473 if (is_process_limited())
6475 skip("process is limited\n");
6479 create_test_files();
6480 create_file("msitest\\mime.txt", 1000);
6481 create_database(msifile
, rmi_tables
, sizeof(rmi_tables
) / sizeof(msi_table
));
6483 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6485 r
= MsiInstallProductA(msifile
, NULL
);
6486 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6488 skip("Not enough rights to perform tests\n");
6491 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6493 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6494 ok(res
== ERROR_SUCCESS
, "key not created\n");
6497 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6498 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6500 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6501 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6503 ok(!delete_pf("msitest\\mime.txt", TRUE
), "file not removed\n");
6504 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6507 DeleteFileA("msitest\\mime.txt");
6508 delete_test_files();
6509 DeleteFileA(msifile
);
6512 static void test_publish_assemblies(void)
6514 static const char manifest
[] =
6515 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6516 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6517 "processorArchitecture=\"x86\"/>";
6518 static const char manifest_local
[] =
6519 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6520 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6521 "processorArchitecture=\"x86\"/>";
6522 static const char classes_path_dotnet
[] =
6523 "Installer\\Assemblies\\Global";
6524 static const char classes_path_dotnet_local
[] =
6525 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6526 static const char classes_path_dotnet_local_wow64
[] =
6527 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6528 static const char classes_path_win32
[] =
6529 "Installer\\Win32Assemblies\\Global";
6530 static const char classes_path_win32_local
[] =
6531 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6532 static const char classes_path_win32_local_wow64
[] =
6533 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6534 static const char path_dotnet
[] =
6535 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6536 static const char path_dotnet_local
[] =
6537 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6538 static const char path_dotnet_local_wow64
[] =
6539 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6540 static const char path_win32
[] =
6541 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6542 static const char path_win32_local
[] =
6543 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6544 static const char path_win32_local_wow64
[] =
6545 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6546 static const char name_dotnet
[] =
6547 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6548 "version=\"1.0.0.0\",culture=\"neutral\"";
6549 static const char name_dotnet_local
[] =
6550 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6551 "version=\"1.0.0.0\",culture=\"neutral\"";
6552 static const char name_win32
[] =
6553 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6554 "type=\"win32\",version=\"1.0.0.0\"";
6555 static const char name_win32_local
[] =
6556 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6557 "type=\"win32\",version=\"1.0.0.0\"";
6564 if (is_process_limited())
6566 skip("process is limited\n");
6570 create_test_files();
6571 create_file("msitest\\win32.txt", 1000);
6572 create_file("msitest\\win32_local.txt", 1000);
6573 create_file("msitest\\dotnet.txt", 1000);
6574 create_file("msitest\\dotnet_local.txt", 1000);
6575 create_file_data("msitest\\manifest.txt", manifest
, 0);
6576 create_file_data("msitest\\manifest_local.txt", manifest_local
, 0);
6577 create_file("msitest\\application_win32.txt", 1000);
6578 create_file("msitest\\application_dotnet.txt", 1000);
6579 create_database(msifile
, pa_tables
, sizeof(pa_tables
) / sizeof(msi_table
));
6581 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6583 r
= MsiInstallProductA(msifile
, NULL
);
6584 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6586 skip("Not enough rights to perform tests\n");
6589 if (r
== ERROR_INSTALL_FAILURE
)
6591 skip("No support for installing side-by-side assemblies\n");
6594 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6596 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6597 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6598 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6601 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6602 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6603 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6604 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6607 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6608 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6609 "Expected ERROR_SUCCESS, got %d\n", res
);
6610 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6613 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6614 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6615 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6616 "Expected ERROR_SUCCESS, got %d\n", res
);
6617 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6620 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6621 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6623 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6624 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6625 if (res
== ERROR_SUCCESS
)
6627 res
= RegDeleteValueA(hkey
, name_dotnet
);
6628 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6632 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6633 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6634 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6636 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6637 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6638 if (res
== ERROR_SUCCESS
)
6640 res
= RegDeleteValueA(hkey
, name_win32
);
6641 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6645 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6646 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6647 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6649 r
= MsiInstallProductA(msifile
, "ALLUSERS=1");
6650 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6652 access
= KEY_QUERY_VALUE
;
6653 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6654 if (res
== ERROR_FILE_NOT_FOUND
&& is_wow64
) /* Vista WOW64 */
6656 trace("Using 64-bit registry view for HKCR\\Installer\n");
6657 access
= KEY_QUERY_VALUE
| KEY_WOW64_64KEY
;
6658 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6660 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6661 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6664 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6665 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6666 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6667 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6670 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_win32
, 0, access
, &hkey
);
6671 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6672 "Expected ERROR_SUCCESS, got %d\n", res
);
6673 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6676 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6677 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6678 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6679 "Expected ERROR_SUCCESS, got %d\n", res
);
6680 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6683 r
= MsiInstallProductA(msifile
, "REMOVE=ALL ALLUSERS=1");
6684 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6686 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, &hkey
);
6687 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6688 if (res
== ERROR_SUCCESS
)
6690 res
= RegDeleteValueA(hkey
, name_dotnet
);
6691 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6695 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6696 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6697 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6699 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_win32
, &hkey
);
6700 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6701 if (res
== ERROR_SUCCESS
)
6703 res
= RegDeleteValueA(hkey
, name_win32
);
6704 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6708 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6709 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6710 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6713 DeleteFileA("msitest\\win32.txt");
6714 DeleteFileA("msitest\\win32_local.txt");
6715 DeleteFileA("msitest\\dotnet.txt");
6716 DeleteFileA("msitest\\dotnet_local.txt");
6717 DeleteFileA("msitest\\manifest.txt");
6718 DeleteFileA("msitest\\manifest_local.txt");
6719 DeleteFileA("msitest\\application_win32.txt");
6720 DeleteFileA("msitest\\application_dotnet.txt");
6721 delete_test_files();
6722 DeleteFileA(msifile
);
6725 static void test_remove_existing_products(void)
6729 if (is_process_limited())
6731 skip("process is limited\n");
6735 create_test_files();
6736 create_file("msitest\\rep.txt", 1000);
6737 create_database(msifile
, rep_tables
, sizeof(rep_tables
) / sizeof(msi_table
));
6739 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6741 r
= MsiInstallProductA(msifile
, NULL
);
6742 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6744 skip("Not enough rights to perform tests\n");
6747 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6749 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6750 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6752 ok(!delete_pf("msitest\\rep.txt", TRUE
), "file not removed\n");
6753 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6756 DeleteFileA("msitest\\rep.txt");
6757 delete_test_files();
6758 DeleteFileA(msifile
);
6764 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6765 STATEMGRSTATUS status
;
6768 init_functionpointers();
6770 if (pIsWow64Process
)
6771 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
6773 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6774 GetTempPathA(MAX_PATH
, temp_path
);
6775 SetCurrentDirectoryA(temp_path
);
6777 lstrcpyA(CURR_DIR
, temp_path
);
6778 len
= lstrlenA(CURR_DIR
);
6780 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
6781 CURR_DIR
[len
- 1] = 0;
6783 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6784 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6786 /* Create a restore point ourselves so we circumvent the multitude of restore points
6787 * that would have been created by all the installation and removal tests.
6789 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6790 * creation of restore points.
6792 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
6794 memset(&status
, 0, sizeof(status
));
6795 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
6798 /* Create only one log file and don't append. We have to pass something
6799 * for the log mode for this to work. The logfile needs to have an absolute
6800 * path otherwise we still end up with some extra logfiles as some tests
6801 * change the current directory.
6803 lstrcpyA(log_file
, temp_path
);
6804 lstrcatA(log_file
, "\\msitest.log");
6805 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
6807 test_register_product();
6808 test_publish_product();
6809 test_publish_features();
6810 test_register_user();
6811 test_process_components();
6813 test_publish_sourcelist();
6814 test_remove_files();
6816 test_duplicate_files();
6817 test_write_registry_values();
6819 test_create_remove_folder();
6820 test_start_services();
6821 test_delete_services();
6822 test_install_services();
6823 test_self_registration();
6824 test_register_font();
6825 test_validate_product_id();
6826 test_install_remove_odbc();
6827 test_register_typelib();
6828 test_create_remove_shortcut();
6829 test_publish_components();
6830 test_remove_duplicate_files();
6831 test_remove_registry_values();
6832 test_find_related_products();
6833 test_remove_ini_values();
6834 test_remove_env_strings();
6835 test_register_class_info();
6836 test_register_extension_info();
6837 test_register_progid_info();
6838 test_register_mime_info();
6839 test_publish_assemblies();
6840 test_remove_existing_products();
6842 DeleteFileA(log_file
);
6844 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
6846 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
6848 remove_restore_point(status
.llSequenceNumber
);
6850 FreeLibrary(hsrclient
);
6852 SetCurrentDirectoryA(prev_path
);