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
31 #include <srrestoreptapi.h>
36 #include "wine/test.h"
38 static UINT (WINAPI
*pMsiQueryComponentStateA
)
39 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
40 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
41 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
42 static UINT (WINAPI
*pMsiSourceListGetInfoA
)
43 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, LPCSTR
, LPSTR
, LPDWORD
);
44 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
45 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
46 static UINT (WINAPI
*pMsiQueryFeatureStateExA
)
47 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
49 static BOOL (WINAPI
*pCheckTokenMembership
)(HANDLE
,PSID
,PBOOL
);
50 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
51 static BOOL (WINAPI
*pOpenProcessToken
)(HANDLE
, DWORD
, PHANDLE
);
52 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
53 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
55 static HMODULE hsrclient
;
56 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
57 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
60 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
62 static const char *msifile
= "msitest.msi";
63 static CHAR CURR_DIR
[MAX_PATH
];
64 static CHAR PROG_FILES_DIR
[MAX_PATH
];
65 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
66 static CHAR APP_DATA_DIR
[MAX_PATH
];
67 static CHAR WINDOWS_DIR
[MAX_PATH
];
69 /* msi database data */
71 static const char component_dat
[] =
72 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
73 "s72\tS38\ts72\ti2\tS255\tS72\n"
74 "Component\tComponent\n"
75 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
76 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
77 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
78 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
79 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
80 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
81 "component\t\tMSITESTDIR\t0\t1\tfile\n"
82 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
83 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
84 "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
86 static const char directory_dat
[] =
87 "Directory\tDirectory_Parent\tDefaultDir\n"
89 "Directory\tDirectory\n"
90 "CABOUTDIR\tMSITESTDIR\tcabout\n"
91 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
92 "FIRSTDIR\tMSITESTDIR\tfirst\n"
93 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
94 "NEWDIR\tCABOUTDIR\tnew\n"
95 "ProgramFilesFolder\tTARGETDIR\t.\n"
96 "TARGETDIR\t\tSourceDir";
98 static const char feature_dat
[] =
99 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
100 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
102 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
103 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
104 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
105 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
106 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
107 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
108 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
110 static const char feature_comp_dat
[] =
111 "Feature_\tComponent_\n"
113 "FeatureComponents\tFeature_\tComponent_\n"
119 "feature\tcomponent\n"
120 "service_feature\tservice_comp\n"
121 "service_feature\tservice_comp2\n"
122 "service_feature\tservice_comp3";
124 static const char file_dat
[] =
125 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
126 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
128 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
129 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
130 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
131 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
132 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
133 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
134 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
135 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
137 static const char install_exec_seq_dat
[] =
138 "Action\tCondition\tSequence\n"
140 "InstallExecuteSequence\tAction\n"
141 "AllocateRegistrySpace\tNOT Installed\t1550\n"
142 "CostFinalize\t\t1000\n"
143 "CostInitialize\t\t800\n"
145 "ResolveSource\t\t950\n"
146 "MoveFiles\t\t1700\n"
147 "InstallFiles\t\t4000\n"
148 "DuplicateFiles\t\t4500\n"
149 "WriteEnvironmentStrings\t\t4550\n"
150 "CreateShortcuts\t\t4600\n"
151 "InstallServices\t\t5000\n"
152 "InstallFinalize\t\t6600\n"
153 "InstallInitialize\t\t1500\n"
154 "InstallValidate\t\t1400\n"
155 "LaunchConditions\t\t100\n"
156 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
158 static const char media_dat
[] =
159 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
160 "i2\ti4\tL64\tS255\tS32\tS72\n"
162 "1\t3\t\t\tDISK1\t\n"
163 "2\t7\t\tmsitest.cab\tDISK2\t\n";
165 static const char property_dat
[] =
168 "Property\tProperty\n"
169 "DefaultUIFont\tDlgFont8\n"
172 "InstallMode\tTypical\n"
173 "Manufacturer\tWine\n"
174 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
175 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
177 "ProductLanguage\t1033\n"
178 "ProductName\tMSITEST\n"
179 "ProductVersion\t1.1.1\n"
180 "PROMPTROLLBACKCOST\tP\n"
182 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
183 "AdminProperties\tPOSTADMIN\n"
185 "SERVNAME\tTestService\n"
186 "SERVNAME2\tTestService2\n"
187 "SERVDISP\tTestServiceDisp\n"
188 "SERVDISP2\tTestServiceDisp2\n"
189 "MSIFASTINSTALL\t1\n"
192 static const char environment_dat
[] =
193 "Environment\tName\tValue\tComponent_\n"
194 "s72\tl255\tL255\ts72\n"
195 "Environment\tEnvironment\n"
196 "Var1\t=-MSITESTVAR1\t1\tOne\n"
197 "Var2\tMSITESTVAR2\t1\tOne\n"
198 "Var3\t=-MSITESTVAR3\t1\tOne\n"
199 "Var4\tMSITESTVAR4\t1\tOne\n"
200 "Var5\t-MSITESTVAR5\t\tOne\n"
201 "Var6\tMSITESTVAR6\t\tOne\n"
202 "Var7\t!-MSITESTVAR7\t\tOne\n"
203 "Var8\t!-*MSITESTVAR8\t\tOne\n"
204 "Var9\t=-MSITESTVAR9\t\tOne\n"
205 "Var10\t=MSITESTVAR10\t\tOne\n"
206 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
207 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
208 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
209 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
210 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
211 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
212 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
213 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
214 "Var19\t+-MSITESTVAR17\t1\tOne\n"
215 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
216 "Var21\t+-MSITESTVAR18\t1\tOne\n"
217 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
218 "Var23\t+-MSITESTVAR19\t1\tOne\n"
219 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
220 "Var25\t+-MSITESTVAR20\t1\tOne\n"
221 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"
222 "Var27\t+-MSITESTVAR21\t[~];1\tOne\n";
224 static const char service_install_dat
[] =
225 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
226 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
227 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
228 "ServiceInstall\tServiceInstall\n"
229 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
230 "TestService2\tSERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription";
232 static const char service_install2_dat
[] =
233 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
234 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
235 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
236 "ServiceInstall\tServiceInstall\n"
237 "TestService\tTestService\tTestService\t2\t3\t32768\t\t\tTestService\t\t\tservice_comp\t\n"
238 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
240 static const char service_control_dat
[] =
241 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
242 "s72\tl255\ti2\tL255\tI2\ts72\n"
243 "ServiceControl\tServiceControl\n"
244 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
245 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
247 static const char sss_service_control_dat
[] =
248 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
249 "s72\tl255\ti2\tL255\tI2\ts72\n"
250 "ServiceControl\tServiceControl\n"
251 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
252 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
253 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
254 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
256 static const char sss_install_exec_seq_dat
[] =
257 "Action\tCondition\tSequence\n"
259 "InstallExecuteSequence\tAction\n"
260 "LaunchConditions\t\t100\n"
261 "CostInitialize\t\t800\n"
263 "ResolveSource\t\t950\n"
264 "CostFinalize\t\t1000\n"
265 "InstallValidate\t\t1400\n"
266 "InstallInitialize\t\t1500\n"
267 "StopServices\t\t4000\n"
268 "DeleteServices\t\t5000\n"
269 "MoveFiles\t\t5100\n"
270 "InstallFiles\t\t5200\n"
271 "DuplicateFiles\t\t5300\n"
272 "StartServices\t\t5400\n"
273 "RegisterProduct\t\t5500\n"
274 "PublishFeatures\t\t5600\n"
275 "PublishProduct\t\t5700\n"
276 "InstallFinalize\t\t6000\n";
278 static const char sds_install_exec_seq_dat
[] =
279 "Action\tCondition\tSequence\n"
281 "InstallExecuteSequence\tAction\n"
282 "LaunchConditions\t\t100\n"
283 "CostInitialize\t\t800\n"
285 "ResolveSource\t\t950\n"
286 "CostFinalize\t\t1000\n"
287 "InstallValidate\t\t1400\n"
288 "InstallInitialize\t\t1500\n"
289 "StopServices\t\t5000\n"
290 "DeleteServices\t\t5050\n"
291 "MoveFiles\t\t5100\n"
292 "InstallFiles\t\t5200\n"
293 "DuplicateFiles\t\t5300\n"
294 "InstallServices\t\t5400\n"
295 "StartServices\t\t5450\n"
296 "RegisterProduct\t\t5500\n"
297 "PublishFeatures\t\t5600\n"
298 "PublishProduct\t\t5700\n"
299 "InstallFinalize\t\t6000\n";
301 static const char rof_component_dat
[] =
302 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
303 "s72\tS38\ts72\ti2\tS255\tS72\n"
304 "Component\tComponent\n"
305 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
307 static const char rof_feature_dat
[] =
308 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
309 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
311 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
312 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
314 static const char rof_feature_comp_dat
[] =
315 "Feature_\tComponent_\n"
317 "FeatureComponents\tFeature_\tComponent_\n"
319 "montecristo\tmaximus";
321 static const char rof_file_dat
[] =
322 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
323 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
325 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
327 static const char rof_media_dat
[] =
328 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
329 "i2\ti4\tL64\tS255\tS32\tS72\n"
331 "1\t1\t\t\tDISK1\t\n";
333 static const char ci2_feature_comp_dat
[] =
334 "Feature_\tComponent_\n"
336 "FeatureComponents\tFeature_\tComponent_\n"
339 static const char ci2_file_dat
[] =
340 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
341 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
343 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
345 static const char pp_install_exec_seq_dat
[] =
346 "Action\tCondition\tSequence\n"
348 "InstallExecuteSequence\tAction\n"
349 "ValidateProductID\t\t700\n"
350 "CostInitialize\t\t800\n"
352 "CostFinalize\t\t1000\n"
353 "InstallValidate\t\t1400\n"
354 "InstallInitialize\t\t1500\n"
355 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
356 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
357 "RemoveFiles\t\t3500\n"
358 "InstallFiles\t\t4000\n"
359 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
360 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
361 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
362 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
363 "InstallFinalize\t\t6600";
365 static const char pp_component_dat
[] =
366 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
367 "s72\tS38\ts72\ti2\tS255\tS72\n"
368 "Component\tComponent\n"
369 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
371 static const char ppc_component_dat
[] =
372 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
373 "s72\tS38\ts72\ti2\tS255\tS72\n"
374 "Component\tComponent\n"
375 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
376 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
378 static const char ppc_file_dat
[] =
379 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
380 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
382 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
383 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
385 static const char ppc_media_dat
[] =
386 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
387 "i2\ti4\tL64\tS255\tS32\tS72\n"
389 "1\t2\t\t\tDISK1\t\n";
391 static const char ppc_feature_comp_dat
[] =
392 "Feature_\tComponent_\n"
394 "FeatureComponents\tFeature_\tComponent_\n"
396 "feature\taugustus\n"
397 "montecristo\tmaximus";
399 static const char cwd_component_dat
[] =
400 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
401 "s72\tS38\ts72\ti2\tS255\tS72\n"
402 "Component\tComponent\n"
403 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
405 static const char rem_component_dat
[] =
406 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
407 "s72\tS38\ts72\ti2\tS255\tS72\n"
408 "Component\tComponent\n"
409 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
410 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
411 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
413 static const char rem_feature_comp_dat
[] =
414 "Feature_\tComponent_\n"
416 "FeatureComponents\tFeature_\tComponent_\n"
417 "feature\thydrogen\n"
421 static const char rem_file_dat
[] =
422 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
423 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
425 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
426 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
427 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
429 static const char rem_install_exec_seq_dat
[] =
430 "Action\tCondition\tSequence\n"
432 "InstallExecuteSequence\tAction\n"
433 "ValidateProductID\t\t700\n"
434 "CostInitialize\t\t800\n"
436 "CostFinalize\t\t1000\n"
437 "InstallValidate\t\t1400\n"
438 "InstallInitialize\t\t1500\n"
439 "ProcessComponents\t\t1600\n"
440 "UnpublishFeatures\t\t1800\n"
441 "RemoveFiles\t\t3500\n"
442 "InstallFiles\t\t4000\n"
443 "RegisterProduct\t\t6100\n"
444 "PublishFeatures\t\t6300\n"
445 "PublishProduct\t\t6400\n"
446 "InstallFinalize\t\t6600";
448 static const char rem_remove_files_dat
[] =
449 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
450 "s72\ts72\tS255\ts72\tI2\n"
451 "RemoveFile\tFileKey\n"
452 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
453 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
454 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
455 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
456 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
457 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
458 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
459 "block\thelium\tblock\tMSITESTDIR\t3\n"
460 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
461 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
463 static const char mov_move_file_dat
[] =
464 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
465 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
466 "MoveFile\tFileKey\n"
467 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
468 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
469 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
470 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
471 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
472 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
473 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
474 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
475 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
476 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
477 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
478 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
479 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
480 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
481 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
482 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
483 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
484 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
486 static const char df_directory_dat
[] =
487 "Directory\tDirectory_Parent\tDefaultDir\n"
489 "Directory\tDirectory\n"
490 "THIS\tMSITESTDIR\tthis\n"
491 "DOESNOT\tTHIS\tdoesnot\n"
492 "NONEXISTENT\tDOESNOT\texist\n"
493 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
494 "ProgramFilesFolder\tTARGETDIR\t.\n"
495 "TARGETDIR\t\tSourceDir";
497 static const char df_duplicate_file_dat
[] =
498 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
499 "s72\ts72\ts72\tS255\tS72\n"
500 "DuplicateFile\tFileKey\n"
501 "maximus\tmaximus\tmaximus\taugustus\t\n"
502 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
503 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
505 static const char wrv_component_dat
[] =
506 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
507 "s72\tS38\ts72\ti2\tS255\tS72\n"
508 "Component\tComponent\n"
509 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
511 static const char wrv_registry_dat
[] =
512 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
513 "s72\ti2\tl255\tL255\tL0\ts72\n"
514 "Registry\tRegistry\n"
515 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
516 "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
517 "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
518 "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
519 "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"
520 "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
521 "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
522 "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
523 "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
524 "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
525 "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
526 "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
527 "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
528 "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
529 "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
530 "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n";
532 static const char cf_directory_dat
[] =
533 "Directory\tDirectory_Parent\tDefaultDir\n"
535 "Directory\tDirectory\n"
536 "FIRSTDIR\tMSITESTDIR\tfirst\n"
537 "SECONDDIR\tMSITESTDIR\tsecond\n"
538 "THIRDDIR\tMSITESTDIR\tthird\n"
539 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
540 "ProgramFilesFolder\tTARGETDIR\t.\n"
541 "TARGETDIR\t\tSourceDir";
543 static const char cf_component_dat
[] =
544 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
545 "s72\tS38\ts72\ti2\tS255\tS72\n"
546 "Component\tComponent\n"
547 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
548 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
550 static const char cf_feature_dat
[] =
551 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
552 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
554 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
555 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
557 static const char cf_feature_comp_dat
[] =
558 "Feature_\tComponent_\n"
560 "FeatureComponents\tFeature_\tComponent_\n"
564 static const char cf_file_dat
[] =
565 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
566 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
568 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
569 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
571 static const char cf_create_folders_dat
[] =
572 "Directory_\tComponent_\n"
574 "CreateFolder\tDirectory_\tComponent_\n"
579 static const char cf_install_exec_seq_dat
[] =
580 "Action\tCondition\tSequence\n"
582 "InstallExecuteSequence\tAction\n"
583 "CostFinalize\t\t1000\n"
584 "ValidateProductID\t\t700\n"
585 "CostInitialize\t\t800\n"
587 "RemoveFiles\t\t3500\n"
588 "CreateFolders\t\t3700\n"
589 "RemoveFolders\t\t3800\n"
590 "InstallFiles\t\t4000\n"
591 "RegisterUser\t\t6000\n"
592 "RegisterProduct\t\t6100\n"
593 "PublishFeatures\t\t6300\n"
594 "PublishProduct\t\t6400\n"
595 "InstallFinalize\t\t6600\n"
596 "InstallInitialize\t\t1500\n"
597 "ProcessComponents\t\t1600\n"
598 "UnpublishFeatures\t\t1800\n"
599 "InstallValidate\t\t1400\n"
600 "LaunchConditions\t\t100\n";
602 static const char sr_selfreg_dat
[] =
608 static const char sr_install_exec_seq_dat
[] =
609 "Action\tCondition\tSequence\n"
611 "InstallExecuteSequence\tAction\n"
612 "CostFinalize\t\t1000\n"
613 "CostInitialize\t\t800\n"
615 "ResolveSource\t\t950\n"
616 "MoveFiles\t\t1700\n"
617 "SelfUnregModules\t\t3900\n"
618 "InstallFiles\t\t4000\n"
619 "DuplicateFiles\t\t4500\n"
620 "WriteEnvironmentStrings\t\t4550\n"
621 "CreateShortcuts\t\t4600\n"
622 "InstallFinalize\t\t6600\n"
623 "InstallInitialize\t\t1500\n"
624 "InstallValidate\t\t1400\n"
625 "LaunchConditions\t\t100\n";
627 static const char font_media_dat
[] =
628 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
629 "i2\ti4\tL64\tS255\tS32\tS72\n"
631 "1\t3\t\t\tDISK1\t\n";
633 static const char font_file_dat
[] =
634 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
635 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
637 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
639 static const char font_feature_dat
[] =
640 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
641 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
643 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
645 static const char font_component_dat
[] =
646 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
647 "s72\tS38\ts72\ti2\tS255\tS72\n"
648 "Component\tComponent\n"
649 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
651 static const char font_feature_comp_dat
[] =
652 "Feature_\tComponent_\n"
654 "FeatureComponents\tFeature_\tComponent_\n"
657 static const char font_dat
[] =
661 "font.ttf\tmsi test font\n";
663 static const char font_install_exec_seq_dat
[] =
664 "Action\tCondition\tSequence\n"
666 "InstallExecuteSequence\tAction\n"
667 "ValidateProductID\t\t700\n"
668 "CostInitialize\t\t800\n"
670 "CostFinalize\t\t1000\n"
671 "InstallValidate\t\t1400\n"
672 "InstallInitialize\t\t1500\n"
673 "ProcessComponents\t\t1600\n"
674 "UnpublishFeatures\t\t1800\n"
675 "RemoveFiles\t\t3500\n"
676 "InstallFiles\t\t4000\n"
677 "RegisterFonts\t\t4100\n"
678 "UnregisterFonts\t\t4200\n"
679 "RegisterUser\t\t6000\n"
680 "RegisterProduct\t\t6100\n"
681 "PublishFeatures\t\t6300\n"
682 "PublishProduct\t\t6400\n"
683 "InstallFinalize\t\t6600";
685 static const char vp_property_dat
[] =
688 "Property\tProperty\n"
691 "InstallMode\tTypical\n"
692 "Manufacturer\tWine\n"
693 "PIDTemplate\t###-#######\n"
694 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
695 "ProductLanguage\t1033\n"
696 "ProductName\tMSITEST\n"
697 "ProductVersion\t1.1.1\n"
698 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
699 "MSIFASTINSTALL\t1\n";
701 static const char vp_custom_action_dat
[] =
702 "Action\tType\tSource\tTarget\tISComments\n"
703 "s72\ti2\tS64\tS0\tS255\n"
704 "CustomAction\tAction\n"
705 "SetProductID1\t51\tProductID\t1\t\n"
706 "SetProductID2\t51\tProductID\t2\t\n"
707 "TestProductID1\t19\t\t\tHalts installation\n"
708 "TestProductID2\t19\t\t\tHalts installation\n";
710 static const char vp_install_exec_seq_dat
[] =
711 "Action\tCondition\tSequence\n"
713 "InstallExecuteSequence\tAction\n"
714 "LaunchConditions\t\t100\n"
715 "CostInitialize\t\t800\n"
717 "CostFinalize\t\t1000\n"
718 "InstallValidate\t\t1400\n"
719 "InstallInitialize\t\t1500\n"
720 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
721 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
722 "ValidateProductID\t\t3200\n"
723 "InstallExecute\t\t3300\n"
724 "TestProductID1\tProductID=1\t3400\n"
725 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
726 "InstallFiles\t\t4000\n"
727 "InstallFinalize\t\t6000\n";
729 static const char odbc_file_dat
[] =
730 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
731 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
733 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
734 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
735 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
736 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
737 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
739 static const char odbc_feature_dat
[] =
740 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
741 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
743 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
745 static const char odbc_feature_comp_dat
[] =
746 "Feature_\tComponent_\n"
748 "FeatureComponents\tFeature_\tComponent_\n"
751 static const char odbc_component_dat
[] =
752 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
753 "s72\tS38\ts72\ti2\tS255\tS72\n"
754 "Component\tComponent\n"
755 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
757 static const char odbc_driver_dat
[] =
758 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
759 "s72\ts72\ts255\ts72\tS72\n"
760 "ODBCDriver\tDriver\n"
761 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
762 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
764 static const char odbc_translator_dat
[] =
765 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
766 "s72\ts72\ts255\ts72\tS72\n"
767 "ODBCTranslator\tTranslator\n"
768 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
769 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
771 static const char odbc_datasource_dat
[] =
772 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
773 "s72\ts72\ts255\ts255\ti2\n"
774 "ODBCDataSource\tDataSource\n"
775 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
777 static const char odbc_install_exec_seq_dat
[] =
778 "Action\tCondition\tSequence\n"
780 "InstallExecuteSequence\tAction\n"
781 "LaunchConditions\t\t100\n"
782 "CostInitialize\t\t800\n"
784 "CostFinalize\t\t1000\n"
785 "InstallValidate\t\t1400\n"
786 "InstallInitialize\t\t1500\n"
787 "ProcessComponents\t\t1600\n"
788 "InstallODBC\t\t3000\n"
789 "RemoveODBC\t\t3100\n"
790 "RemoveFiles\t\t3900\n"
791 "InstallFiles\t\t4000\n"
792 "RegisterProduct\t\t5000\n"
793 "PublishFeatures\t\t5100\n"
794 "PublishProduct\t\t5200\n"
795 "InstallFinalize\t\t6000\n";
797 static const char odbc_media_dat
[] =
798 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
799 "i2\ti4\tL64\tS255\tS32\tS72\n"
801 "1\t5\t\t\tDISK1\t\n";
803 static const char tl_file_dat
[] =
804 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
805 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
807 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
809 static const char tl_feature_dat
[] =
810 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
811 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
813 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
815 static const char tl_feature_comp_dat
[] =
816 "Feature_\tComponent_\n"
818 "FeatureComponents\tFeature_\tComponent_\n"
819 "typelib\ttypelib\n";
821 static const char tl_component_dat
[] =
822 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
823 "s72\tS38\ts72\ti2\tS255\tS72\n"
824 "Component\tComponent\n"
825 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
827 static const char tl_typelib_dat
[] =
828 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
829 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
830 "TypeLib\tLibID\tLanguage\tComponent_\n"
831 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
833 static const char tl_install_exec_seq_dat
[] =
834 "Action\tCondition\tSequence\n"
836 "InstallExecuteSequence\tAction\n"
837 "LaunchConditions\t\t100\n"
838 "CostInitialize\t\t800\n"
840 "CostFinalize\t\t1000\n"
841 "InstallValidate\t\t1400\n"
842 "InstallInitialize\t\t1500\n"
843 "ProcessComponents\t\t1600\n"
844 "RemoveFiles\t\t1700\n"
845 "InstallFiles\t\t2000\n"
846 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
847 "UnregisterTypeLibraries\t\t3100\n"
848 "RegisterProduct\t\t5100\n"
849 "PublishFeatures\t\t5200\n"
850 "PublishProduct\t\t5300\n"
851 "InstallFinalize\t\t6000\n";
853 static const char crs_file_dat
[] =
854 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
855 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
857 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
859 static const char crs_feature_dat
[] =
860 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
861 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
863 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
865 static const char crs_feature_comp_dat
[] =
866 "Feature_\tComponent_\n"
868 "FeatureComponents\tFeature_\tComponent_\n"
869 "shortcut\tshortcut\n";
871 static const char crs_component_dat
[] =
872 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
873 "s72\tS38\ts72\ti2\tS255\tS72\n"
874 "Component\tComponent\n"
875 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
877 static const char crs_shortcut_dat
[] =
878 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
879 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
880 "Shortcut\tShortcut\n"
881 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
883 static const char crs_install_exec_seq_dat
[] =
884 "Action\tCondition\tSequence\n"
886 "InstallExecuteSequence\tAction\n"
887 "LaunchConditions\t\t100\n"
888 "CostInitialize\t\t800\n"
890 "CostFinalize\t\t1000\n"
891 "InstallValidate\t\t1400\n"
892 "InstallInitialize\t\t1500\n"
893 "ProcessComponents\t\t1600\n"
894 "RemoveFiles\t\t1700\n"
895 "InstallFiles\t\t2000\n"
896 "RemoveShortcuts\t\t3000\n"
897 "CreateShortcuts\t\t3100\n"
898 "RegisterProduct\t\t5000\n"
899 "PublishFeatures\t\t5100\n"
900 "PublishProduct\t\t5200\n"
901 "InstallFinalize\t\t6000\n";
903 static const char pub_file_dat
[] =
904 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
905 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
907 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
909 static const char pub_feature_dat
[] =
910 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
911 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
913 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
915 static const char pub_feature_comp_dat
[] =
916 "Feature_\tComponent_\n"
918 "FeatureComponents\tFeature_\tComponent_\n"
919 "publish\tpublish\n";
921 static const char pub_component_dat
[] =
922 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
923 "s72\tS38\ts72\ti2\tS255\tS72\n"
924 "Component\tComponent\n"
925 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
927 static const char pub_publish_component_dat
[] =
928 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
929 "s38\ts255\ts72\tL255\ts38\n"
930 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
931 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
933 static const char pub_install_exec_seq_dat
[] =
934 "Action\tCondition\tSequence\n"
936 "InstallExecuteSequence\tAction\n"
937 "LaunchConditions\t\t100\n"
938 "CostInitialize\t\t800\n"
940 "CostFinalize\t\t1000\n"
941 "InstallValidate\t\t1400\n"
942 "InstallInitialize\t\t1500\n"
943 "ProcessComponents\t\t1600\n"
944 "RemoveFiles\t\t1700\n"
945 "InstallFiles\t\t2000\n"
946 "PublishComponents\t\t3000\n"
947 "UnpublishComponents\t\t3100\n"
948 "RegisterProduct\t\t5000\n"
949 "PublishFeatures\t\t5100\n"
950 "PublishProduct\t\t5200\n"
951 "InstallFinalize\t\t6000\n";
953 static const char rd_file_dat
[] =
954 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
955 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
957 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
958 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
959 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
961 static const char rd_feature_dat
[] =
962 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
963 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
965 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
967 static const char rd_feature_comp_dat
[] =
968 "Feature_\tComponent_\n"
970 "FeatureComponents\tFeature_\tComponent_\n"
971 "duplicate\tduplicate\n";
973 static const char rd_component_dat
[] =
974 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
975 "s72\tS38\ts72\ti2\tS255\tS72\n"
976 "Component\tComponent\n"
977 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
978 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
980 static const char rd_duplicate_file_dat
[] =
981 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
982 "s72\ts72\ts72\tS255\tS72\n"
983 "DuplicateFile\tFileKey\n"
984 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
985 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
986 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
988 static const char rd_install_exec_seq_dat
[] =
989 "Action\tCondition\tSequence\n"
991 "InstallExecuteSequence\tAction\n"
992 "LaunchConditions\t\t100\n"
993 "CostInitialize\t\t800\n"
995 "CostFinalize\t\t1000\n"
996 "InstallValidate\t\t1400\n"
997 "InstallInitialize\t\t1500\n"
998 "ProcessComponents\t\t1600\n"
999 "RemoveDuplicateFiles\t\t1900\n"
1000 "InstallFiles\t\t2000\n"
1001 "DuplicateFiles\t\t2100\n"
1002 "RegisterProduct\t\t5000\n"
1003 "PublishFeatures\t\t5100\n"
1004 "PublishProduct\t\t5200\n"
1005 "InstallFinalize\t\t6000\n";
1007 static const char rrv_file_dat
[] =
1008 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1009 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1011 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1013 static const char rrv_feature_dat
[] =
1014 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1015 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1016 "Feature\tFeature\n"
1017 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1019 static const char rrv_feature_comp_dat
[] =
1020 "Feature_\tComponent_\n"
1022 "FeatureComponents\tFeature_\tComponent_\n"
1023 "registry\tregistry\n";
1025 static const char rrv_component_dat
[] =
1026 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1027 "s72\tS38\ts72\ti2\tS255\tS72\n"
1028 "Component\tComponent\n"
1029 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1031 static const char rrv_registry_dat
[] =
1032 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1033 "s72\ti2\tl255\tL255\tL0\ts72\n"
1034 "Registry\tRegistry\n"
1035 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1036 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1037 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1039 static const char rrv_remove_registry_dat
[] =
1040 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1041 "s72\ti2\tl255\tL255\ts72\n"
1042 "RemoveRegistry\tRemoveRegistry\n"
1043 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1044 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1045 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1047 static const char rrv_install_exec_seq_dat
[] =
1048 "Action\tCondition\tSequence\n"
1050 "InstallExecuteSequence\tAction\n"
1051 "LaunchConditions\t\t100\n"
1052 "CostInitialize\t\t800\n"
1054 "CostFinalize\t\t1000\n"
1055 "InstallValidate\t\t1400\n"
1056 "InstallInitialize\t\t1500\n"
1057 "ProcessComponents\t\t1600\n"
1058 "RemoveFiles\t\t1700\n"
1059 "InstallFiles\t\t2000\n"
1060 "RemoveRegistryValues\t\t3000\n"
1061 "RegisterProduct\t\t5000\n"
1062 "PublishFeatures\t\t5100\n"
1063 "PublishProduct\t\t5200\n"
1064 "InstallFinalize\t\t6000\n";
1066 static const char frp_file_dat
[] =
1067 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1068 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1070 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1072 static const char frp_feature_dat
[] =
1073 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1074 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1075 "Feature\tFeature\n"
1076 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1078 static const char frp_feature_comp_dat
[] =
1079 "Feature_\tComponent_\n"
1081 "FeatureComponents\tFeature_\tComponent_\n"
1082 "product\tproduct\n";
1084 static const char frp_component_dat
[] =
1085 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1086 "s72\tS38\ts72\ti2\tS255\tS72\n"
1087 "Component\tComponent\n"
1088 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1090 static const char frp_custom_action_dat
[] =
1091 "Action\tType\tSource\tTarget\tISComments\n"
1092 "s72\ti2\tS64\tS0\tS255\n"
1093 "CustomAction\tAction\n"
1094 "TestProp\t19\t\t\tPROP set\n";
1096 static const char frp_upgrade_dat
[] =
1097 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1098 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1099 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1100 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1102 static const char frp_install_exec_seq_dat
[] =
1103 "Action\tCondition\tSequence\n"
1105 "InstallExecuteSequence\tAction\n"
1106 "FindRelatedProducts\t\t50\n"
1107 "TestProp\tPROP AND NOT REMOVE\t51\n"
1108 "LaunchConditions\t\t100\n"
1109 "CostInitialize\t\t800\n"
1111 "CostFinalize\t\t1000\n"
1112 "InstallValidate\t\t1400\n"
1113 "InstallInitialize\t\t1500\n"
1114 "ProcessComponents\t\t1600\n"
1115 "RemoveFiles\t\t1700\n"
1116 "InstallFiles\t\t2000\n"
1117 "RegisterProduct\t\t5000\n"
1118 "PublishFeatures\t\t5100\n"
1119 "PublishProduct\t\t5200\n"
1120 "InstallFinalize\t\t6000\n";
1122 static const char riv_file_dat
[] =
1123 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1124 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1126 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1128 static const char riv_feature_dat
[] =
1129 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1130 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1131 "Feature\tFeature\n"
1132 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1134 static const char riv_feature_comp_dat
[] =
1135 "Feature_\tComponent_\n"
1137 "FeatureComponents\tFeature_\tComponent_\n"
1138 "inifile\tinifile\n";
1140 static const char riv_component_dat
[] =
1141 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1142 "s72\tS38\ts72\ti2\tS255\tS72\n"
1143 "Component\tComponent\n"
1144 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1146 static const char riv_ini_file_dat
[] =
1147 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1148 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1149 "IniFile\tIniFile\n"
1150 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1152 static const char riv_remove_ini_file_dat
[] =
1153 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1154 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1155 "RemoveIniFile\tRemoveIniFile\n"
1156 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1158 static const char riv_install_exec_seq_dat
[] =
1159 "Action\tCondition\tSequence\n"
1161 "InstallExecuteSequence\tAction\n"
1162 "LaunchConditions\t\t100\n"
1163 "CostInitialize\t\t800\n"
1165 "CostFinalize\t\t1000\n"
1166 "InstallValidate\t\t1400\n"
1167 "InstallInitialize\t\t1500\n"
1168 "ProcessComponents\t\t1600\n"
1169 "RemoveFiles\t\t1700\n"
1170 "InstallFiles\t\t2000\n"
1171 "RemoveIniValues\t\t3000\n"
1172 "RegisterProduct\t\t5000\n"
1173 "PublishFeatures\t\t5100\n"
1174 "PublishProduct\t\t5200\n"
1175 "InstallFinalize\t\t6000\n";
1177 static const char res_file_dat
[] =
1178 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1179 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1181 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1183 static const char res_feature_dat
[] =
1184 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1185 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1186 "Feature\tFeature\n"
1187 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1189 static const char res_feature_comp_dat
[] =
1190 "Feature_\tComponent_\n"
1192 "FeatureComponents\tFeature_\tComponent_\n"
1195 static const char res_component_dat
[] =
1196 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1197 "s72\tS38\ts72\ti2\tS255\tS72\n"
1198 "Component\tComponent\n"
1199 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1201 static const char res_environment_dat
[] =
1202 "Environment\tName\tValue\tComponent_\n"
1203 "s72\tl255\tL255\ts72\n"
1204 "Environment\tEnvironment\n"
1205 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1206 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1207 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1208 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1209 "var5\t=MSITESTVAR5\t\tenvvar\n"
1210 "Var6\t-MSITESTVAR6\t1;[~]\tenvvar\n"
1211 "Var7\t-MSITESTVAR7\t[~];1\tenvvar\n"
1212 "Var8\t-MSITESTVAR8\t1;[~]\tenvvar\n"
1213 "Var9\t-MSITESTVAR9\t[~];1\tenvvar\n"
1214 "Var10\t-MSITESTVAR10\t1\tenvvar\n"
1215 "Var11\t-MSITESTVAR11\t2\tenvvar\n";
1217 static const char res_install_exec_seq_dat
[] =
1218 "Action\tCondition\tSequence\n"
1220 "InstallExecuteSequence\tAction\n"
1221 "LaunchConditions\t\t100\n"
1222 "CostInitialize\t\t800\n"
1224 "CostFinalize\t\t1000\n"
1225 "InstallValidate\t\t1400\n"
1226 "InstallInitialize\t\t1500\n"
1227 "ProcessComponents\t\t1600\n"
1228 "RemoveFiles\t\t1700\n"
1229 "InstallFiles\t\t2000\n"
1230 "RemoveEnvironmentStrings\t\t3000\n"
1231 "RegisterProduct\t\t5000\n"
1232 "PublishFeatures\t\t5100\n"
1233 "PublishProduct\t\t5200\n"
1234 "InstallFinalize\t\t6000\n";
1236 static const char rci_file_dat
[] =
1237 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1238 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1240 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1242 static const char rci_feature_dat
[] =
1243 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1244 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1245 "Feature\tFeature\n"
1246 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1248 static const char rci_feature_comp_dat
[] =
1249 "Feature_\tComponent_\n"
1251 "FeatureComponents\tFeature_\tComponent_\n"
1254 static const char rci_component_dat
[] =
1255 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1256 "s72\tS38\ts72\ti2\tS255\tS72\n"
1257 "Component\tComponent\n"
1258 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1260 static const char rci_appid_dat
[] =
1261 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1262 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1264 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1266 static const char rci_class_dat
[] =
1267 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1268 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1269 "Class\tCLSID\tContext\tComponent_\n"
1270 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1272 static const char rci_install_exec_seq_dat
[] =
1273 "Action\tCondition\tSequence\n"
1275 "InstallExecuteSequence\tAction\n"
1276 "LaunchConditions\t\t100\n"
1277 "CostInitialize\t\t800\n"
1279 "CostFinalize\t\t1000\n"
1280 "InstallValidate\t\t1400\n"
1281 "InstallInitialize\t\t1500\n"
1282 "ProcessComponents\t\t1600\n"
1283 "RemoveFiles\t\t1700\n"
1284 "InstallFiles\t\t2000\n"
1285 "UnregisterClassInfo\t\t3000\n"
1286 "RegisterClassInfo\t\t4000\n"
1287 "RegisterProduct\t\t5000\n"
1288 "PublishFeatures\t\t5100\n"
1289 "PublishProduct\t\t5200\n"
1290 "InstallFinalize\t\t6000\n";
1292 static const char rei_file_dat
[] =
1293 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1294 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1296 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1298 static const char rei_feature_dat
[] =
1299 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1300 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1301 "Feature\tFeature\n"
1302 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1304 static const char rei_feature_comp_dat
[] =
1305 "Feature_\tComponent_\n"
1307 "FeatureComponents\tFeature_\tComponent_\n"
1308 "extension\textension\n";
1310 static const char rei_component_dat
[] =
1311 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1312 "s72\tS38\ts72\ti2\tS255\tS72\n"
1313 "Component\tComponent\n"
1314 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1316 static const char rei_extension_dat
[] =
1317 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1318 "s255\ts72\tS255\tS64\ts38\n"
1319 "Extension\tExtension\tComponent_\n"
1320 "extension\textension\tProg.Id.1\t\textension\n";
1322 static const char rei_verb_dat
[] =
1323 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1324 "s255\ts32\tI2\tL255\tL255\n"
1325 "Verb\tExtension_\tVerb\n"
1326 "extension\tOpen\t1\t&Open\t/argument\n";
1328 static const char rei_progid_dat
[] =
1329 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1330 "s255\tS255\tS38\tL255\tS72\tI2\n"
1332 "Prog.Id.1\t\t\tdescription\t\t\n";
1334 static const char rei_install_exec_seq_dat
[] =
1335 "Action\tCondition\tSequence\n"
1337 "InstallExecuteSequence\tAction\n"
1338 "LaunchConditions\t\t100\n"
1339 "CostInitialize\t\t800\n"
1341 "CostFinalize\t\t1000\n"
1342 "InstallValidate\t\t1400\n"
1343 "InstallInitialize\t\t1500\n"
1344 "ProcessComponents\t\t1600\n"
1345 "RemoveFiles\t\t1700\n"
1346 "InstallFiles\t\t2000\n"
1347 "UnregisterExtensionInfo\t\t3000\n"
1348 "RegisterExtensionInfo\t\t4000\n"
1349 "RegisterProduct\t\t5000\n"
1350 "PublishFeatures\t\t5100\n"
1351 "PublishProduct\t\t5200\n"
1352 "InstallFinalize\t\t6000\n";
1354 static const char rpi_file_dat
[] =
1355 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1356 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1358 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1360 static const char rpi_feature_dat
[] =
1361 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1362 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1363 "Feature\tFeature\n"
1364 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1366 static const char rpi_feature_comp_dat
[] =
1367 "Feature_\tComponent_\n"
1369 "FeatureComponents\tFeature_\tComponent_\n"
1372 static const char rpi_component_dat
[] =
1373 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1374 "s72\tS38\ts72\ti2\tS255\tS72\n"
1375 "Component\tComponent\n"
1376 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1378 static const char rpi_appid_dat
[] =
1379 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1380 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1382 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1384 static const char rpi_class_dat
[] =
1385 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1386 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1387 "Class\tCLSID\tContext\tComponent_\n"
1388 "{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"
1389 "{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"
1390 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1392 static const char rpi_extension_dat
[] =
1393 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1394 "s255\ts72\tS255\tS64\ts38\n"
1395 "Extension\tExtension\tComponent_\n"
1396 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1398 static const char rpi_verb_dat
[] =
1399 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1400 "s255\ts32\tI2\tL255\tL255\n"
1401 "Verb\tExtension_\tVerb\n"
1402 "winetest\tOpen\t1\t&Open\t/argument\n";
1404 static const char rpi_progid_dat
[] =
1405 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1406 "s255\tS255\tS38\tL255\tS72\tI2\n"
1408 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1409 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1410 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1411 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1412 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1413 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1414 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1415 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1416 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1417 "Winetest.Extension\t\t\tdescription\t\t\n";
1419 static const char rpi_install_exec_seq_dat
[] =
1420 "Action\tCondition\tSequence\n"
1422 "InstallExecuteSequence\tAction\n"
1423 "LaunchConditions\t\t100\n"
1424 "CostInitialize\t\t800\n"
1426 "CostFinalize\t\t1000\n"
1427 "InstallValidate\t\t1400\n"
1428 "InstallInitialize\t\t1500\n"
1429 "ProcessComponents\t\t1600\n"
1430 "RemoveFiles\t\t1700\n"
1431 "UnregisterClassInfo\t\t3000\n"
1432 "UnregisterExtensionInfo\t\t3200\n"
1433 "UnregisterProgIdInfo\t\t3400\n"
1434 "InstallFiles\t\t3600\n"
1435 "RegisterClassInfo\t\t4000\n"
1436 "RegisterExtensionInfo\t\t4200\n"
1437 "RegisterProgIdInfo\t\t4400\n"
1438 "RegisterProduct\t\t5000\n"
1439 "PublishFeatures\t\t5100\n"
1440 "PublishProduct\t\t5200\n"
1441 "InstallFinalize\t\t6000\n";
1443 static const char rmi_file_dat
[] =
1444 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1445 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1447 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1449 static const char rmi_feature_dat
[] =
1450 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1451 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1452 "Feature\tFeature\n"
1453 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1455 static const char rmi_feature_comp_dat
[] =
1456 "Feature_\tComponent_\n"
1458 "FeatureComponents\tFeature_\tComponent_\n"
1461 static const char rmi_component_dat
[] =
1462 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1463 "s72\tS38\ts72\ti2\tS255\tS72\n"
1464 "Component\tComponent\n"
1465 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1467 static const char rmi_extension_dat
[] =
1468 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1469 "s255\ts72\tS255\tS64\ts38\n"
1470 "Extension\tExtension\tComponent_\n"
1471 "mime\tmime\t\tmime/type\tmime\n";
1473 static const char rmi_verb_dat
[] =
1474 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1475 "s255\ts32\tI2\tL255\tL255\n"
1476 "Verb\tExtension_\tVerb\n"
1477 "mime\tOpen\t1\t&Open\t/argument\n";
1479 static const char rmi_mime_dat
[] =
1480 "ContentType\tExtension_\tCLSID\n"
1482 "MIME\tContentType\n"
1483 "mime/type\tmime\t\n";
1485 static const char rmi_install_exec_seq_dat
[] =
1486 "Action\tCondition\tSequence\n"
1488 "InstallExecuteSequence\tAction\n"
1489 "LaunchConditions\t\t100\n"
1490 "CostInitialize\t\t800\n"
1492 "CostFinalize\t\t1000\n"
1493 "InstallValidate\t\t1400\n"
1494 "InstallInitialize\t\t1500\n"
1495 "ProcessComponents\t\t1600\n"
1496 "RemoveFiles\t\t1700\n"
1497 "InstallFiles\t\t2000\n"
1498 "UnregisterExtensionInfo\t\t3000\n"
1499 "UnregisterMIMEInfo\t\t3500\n"
1500 "RegisterExtensionInfo\t\t4000\n"
1501 "RegisterMIMEInfo\t\t4500\n"
1502 "RegisterProduct\t\t5000\n"
1503 "PublishFeatures\t\t5100\n"
1504 "PublishProduct\t\t5200\n"
1505 "InstallFinalize\t\t6000\n";
1507 static const char pa_file_dat
[] =
1508 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1509 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1511 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1512 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1513 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1514 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1515 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1516 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1517 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1518 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1520 static const char pa_feature_dat
[] =
1521 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1522 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1523 "Feature\tFeature\n"
1524 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1526 static const char pa_feature_comp_dat
[] =
1527 "Feature_\tComponent_\n"
1529 "FeatureComponents\tFeature_\tComponent_\n"
1531 "assembly\twin32_local\n"
1532 "assembly\tdotnet\n"
1533 "assembly\tdotnet_local\n";
1535 static const char pa_component_dat
[] =
1536 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1537 "s72\tS38\ts72\ti2\tS255\tS72\n"
1538 "Component\tComponent\n"
1539 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1540 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1541 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1542 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1544 static const char pa_msi_assembly_dat
[] =
1545 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1546 "s72\ts38\tS72\tS72\tI2\n"
1547 "MsiAssembly\tComponent_\n"
1548 "win32\tassembly\tmanifest.txt\t\t1\n"
1549 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1550 "dotnet\tassembly\t\t\t0\n"
1551 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1553 static const char pa_msi_assembly_name_dat
[] =
1554 "Component_\tName\tValue\n"
1556 "MsiAssemblyName\tComponent_\tName\n"
1557 "win32\tName\tWine.Win32.Assembly\n"
1558 "win32\tprocessorArchitecture\tx86\n"
1559 "win32\tpublicKeyToken\tabcdef0123456789\n"
1560 "win32\ttype\twin32\n"
1561 "win32\tversion\t1.0.0.0\n"
1562 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1563 "win32_local\tprocessorArchitecture\tx86\n"
1564 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1565 "win32_local\ttype\twin32\n"
1566 "win32_local\tversion\t1.0.0.0\n"
1567 "dotnet\tName\tWine.Dotnet.Assembly\n"
1568 "dotnet\tprocessorArchitecture\tMSIL\n"
1569 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1570 "dotnet\tculture\tneutral\n"
1571 "dotnet\tversion\t1.0.0.0\n"
1572 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1573 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1574 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1575 "dotnet_local\tculture\tneutral\n"
1576 "dotnet_local\tversion\t1.0.0.0\n";
1578 static const char pa_install_exec_seq_dat
[] =
1579 "Action\tCondition\tSequence\n"
1581 "InstallExecuteSequence\tAction\n"
1582 "LaunchConditions\t\t100\n"
1583 "CostInitialize\t\t800\n"
1585 "CostFinalize\t\t1000\n"
1586 "InstallValidate\t\t1400\n"
1587 "InstallInitialize\t\t1500\n"
1588 "ProcessComponents\t\t1600\n"
1589 "MsiPublishAssemblies\t\t3000\n"
1590 "MsiUnpublishAssemblies\t\t4000\n"
1591 "RegisterProduct\t\t5000\n"
1592 "PublishFeatures\t\t5100\n"
1593 "PublishProduct\t\t5200\n"
1594 "InstallFinalize\t\t6000\n";
1596 static const char rep_file_dat
[] =
1597 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1598 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1600 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1602 static const char rep_feature_dat
[] =
1603 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1604 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1605 "Feature\tFeature\n"
1606 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1608 static const char rep_feature_comp_dat
[] =
1609 "Feature_\tComponent_\n"
1611 "FeatureComponents\tFeature_\tComponent_\n"
1614 static const char rep_component_dat
[] =
1615 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1616 "s72\tS38\ts72\ti2\tS255\tS72\n"
1617 "Component\tComponent\n"
1618 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1620 static const char rep_upgrade_dat
[] =
1621 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1622 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1623 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1624 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1626 static const char rep_property_dat
[] =
1629 "Property\tProperty\n"
1632 "InstallMode\tTypical\n"
1633 "Manufacturer\tWine\n"
1634 "PIDTemplate\t###-#######\n"
1635 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1636 "ProductLanguage\t1033\n"
1637 "ProductName\tMSITEST\n"
1638 "ProductVersion\t1.1.1\n"
1639 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1640 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1641 "MSIFASTINSTALL\t1\n";
1643 static const char rep_install_exec_seq_dat
[] =
1644 "Action\tCondition\tSequence\n"
1646 "InstallExecuteSequence\tAction\n"
1647 "FindRelatedProducts\t\t100\n"
1648 "CostInitialize\t\t800\n"
1650 "CostFinalize\t\t1000\n"
1651 "InstallValidate\t\t1400\n"
1652 "RemoveExistingProducts\t\t1499\n"
1653 "InstallInitialize\t\t1500\n"
1654 "ProcessComponents\t\t1600\n"
1655 "RemoveFiles\t\t1700\n"
1656 "InstallFiles\t\t2000\n"
1657 "UnregisterExtensionInfo\t\t3000\n"
1658 "UnregisterMIMEInfo\t\t3500\n"
1659 "RegisterExtensionInfo\t\t4000\n"
1660 "RegisterMIMEInfo\t\t4500\n"
1661 "RegisterProduct\t\t5000\n"
1662 "PublishFeatures\t\t5100\n"
1663 "PublishProduct\t\t5200\n"
1664 "InstallFinalize\t\t6000\n";
1666 typedef struct _msi_table
1668 const char *filename
;
1673 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1675 static const msi_table env_tables
[] =
1677 ADD_TABLE(component
),
1678 ADD_TABLE(directory
),
1680 ADD_TABLE(feature_comp
),
1682 ADD_TABLE(install_exec_seq
),
1684 ADD_TABLE(property
),
1685 ADD_TABLE(environment
)
1688 static const msi_table pp_tables
[] =
1690 ADD_TABLE(pp_component
),
1691 ADD_TABLE(directory
),
1692 ADD_TABLE(rof_feature
),
1693 ADD_TABLE(rof_feature_comp
),
1694 ADD_TABLE(rof_file
),
1695 ADD_TABLE(pp_install_exec_seq
),
1696 ADD_TABLE(rof_media
),
1697 ADD_TABLE(property
),
1700 static const msi_table ppc_tables
[] =
1702 ADD_TABLE(ppc_component
),
1703 ADD_TABLE(directory
),
1704 ADD_TABLE(rof_feature
),
1705 ADD_TABLE(ppc_feature_comp
),
1706 ADD_TABLE(ppc_file
),
1707 ADD_TABLE(pp_install_exec_seq
),
1708 ADD_TABLE(ppc_media
),
1709 ADD_TABLE(property
),
1712 static const msi_table rem_tables
[] =
1714 ADD_TABLE(rem_component
),
1715 ADD_TABLE(directory
),
1716 ADD_TABLE(rof_feature
),
1717 ADD_TABLE(rem_feature_comp
),
1718 ADD_TABLE(rem_file
),
1719 ADD_TABLE(rem_install_exec_seq
),
1720 ADD_TABLE(rof_media
),
1721 ADD_TABLE(property
),
1722 ADD_TABLE(rem_remove_files
),
1725 static const msi_table mov_tables
[] =
1727 ADD_TABLE(cwd_component
),
1728 ADD_TABLE(directory
),
1729 ADD_TABLE(rof_feature
),
1730 ADD_TABLE(ci2_feature_comp
),
1731 ADD_TABLE(ci2_file
),
1732 ADD_TABLE(install_exec_seq
),
1733 ADD_TABLE(rof_media
),
1734 ADD_TABLE(property
),
1735 ADD_TABLE(mov_move_file
),
1738 static const msi_table df_tables
[] =
1740 ADD_TABLE(rof_component
),
1741 ADD_TABLE(df_directory
),
1742 ADD_TABLE(rof_feature
),
1743 ADD_TABLE(rof_feature_comp
),
1744 ADD_TABLE(rof_file
),
1745 ADD_TABLE(install_exec_seq
),
1746 ADD_TABLE(rof_media
),
1747 ADD_TABLE(property
),
1748 ADD_TABLE(df_duplicate_file
),
1751 static const msi_table wrv_tables
[] =
1753 ADD_TABLE(wrv_component
),
1754 ADD_TABLE(directory
),
1755 ADD_TABLE(rof_feature
),
1756 ADD_TABLE(ci2_feature_comp
),
1757 ADD_TABLE(ci2_file
),
1758 ADD_TABLE(install_exec_seq
),
1759 ADD_TABLE(rof_media
),
1760 ADD_TABLE(property
),
1761 ADD_TABLE(wrv_registry
),
1764 static const msi_table cf_tables
[] =
1766 ADD_TABLE(cf_component
),
1767 ADD_TABLE(cf_directory
),
1768 ADD_TABLE(cf_feature
),
1769 ADD_TABLE(cf_feature_comp
),
1771 ADD_TABLE(cf_create_folders
),
1772 ADD_TABLE(cf_install_exec_seq
),
1777 static const msi_table sss_tables
[] =
1779 ADD_TABLE(component
),
1780 ADD_TABLE(directory
),
1782 ADD_TABLE(feature_comp
),
1784 ADD_TABLE(sss_install_exec_seq
),
1785 ADD_TABLE(sss_service_control
),
1790 static const msi_table sds_tables
[] =
1792 ADD_TABLE(component
),
1793 ADD_TABLE(directory
),
1795 ADD_TABLE(feature_comp
),
1797 ADD_TABLE(sds_install_exec_seq
),
1798 ADD_TABLE(service_control
),
1799 ADD_TABLE(service_install
),
1804 static const msi_table sis_tables
[] =
1806 ADD_TABLE(component
),
1807 ADD_TABLE(directory
),
1809 ADD_TABLE(feature_comp
),
1811 ADD_TABLE(sds_install_exec_seq
),
1812 ADD_TABLE(service_install2
),
1817 static const msi_table sr_tables
[] =
1819 ADD_TABLE(component
),
1820 ADD_TABLE(directory
),
1822 ADD_TABLE(feature_comp
),
1824 ADD_TABLE(sr_selfreg
),
1825 ADD_TABLE(sr_install_exec_seq
),
1830 static const msi_table font_tables
[] =
1832 ADD_TABLE(font_component
),
1833 ADD_TABLE(directory
),
1834 ADD_TABLE(font_feature
),
1835 ADD_TABLE(font_feature_comp
),
1836 ADD_TABLE(font_file
),
1838 ADD_TABLE(font_install_exec_seq
),
1839 ADD_TABLE(font_media
),
1843 static const msi_table vp_tables
[] =
1845 ADD_TABLE(component
),
1846 ADD_TABLE(directory
),
1848 ADD_TABLE(feature_comp
),
1850 ADD_TABLE(vp_custom_action
),
1851 ADD_TABLE(vp_install_exec_seq
),
1853 ADD_TABLE(vp_property
)
1856 static const msi_table odbc_tables
[] =
1858 ADD_TABLE(odbc_component
),
1859 ADD_TABLE(directory
),
1860 ADD_TABLE(odbc_feature
),
1861 ADD_TABLE(odbc_feature_comp
),
1862 ADD_TABLE(odbc_file
),
1863 ADD_TABLE(odbc_driver
),
1864 ADD_TABLE(odbc_translator
),
1865 ADD_TABLE(odbc_datasource
),
1866 ADD_TABLE(odbc_install_exec_seq
),
1867 ADD_TABLE(odbc_media
),
1871 static const msi_table tl_tables
[] =
1873 ADD_TABLE(tl_component
),
1874 ADD_TABLE(directory
),
1875 ADD_TABLE(tl_feature
),
1876 ADD_TABLE(tl_feature_comp
),
1878 ADD_TABLE(tl_typelib
),
1879 ADD_TABLE(tl_install_exec_seq
),
1884 static const msi_table crs_tables
[] =
1886 ADD_TABLE(crs_component
),
1887 ADD_TABLE(directory
),
1888 ADD_TABLE(crs_feature
),
1889 ADD_TABLE(crs_feature_comp
),
1890 ADD_TABLE(crs_file
),
1891 ADD_TABLE(crs_shortcut
),
1892 ADD_TABLE(crs_install_exec_seq
),
1897 static const msi_table pub_tables
[] =
1899 ADD_TABLE(directory
),
1900 ADD_TABLE(pub_component
),
1901 ADD_TABLE(pub_feature
),
1902 ADD_TABLE(pub_feature_comp
),
1903 ADD_TABLE(pub_file
),
1904 ADD_TABLE(pub_publish_component
),
1905 ADD_TABLE(pub_install_exec_seq
),
1910 static const msi_table rd_tables
[] =
1912 ADD_TABLE(directory
),
1913 ADD_TABLE(rd_component
),
1914 ADD_TABLE(rd_feature
),
1915 ADD_TABLE(rd_feature_comp
),
1917 ADD_TABLE(rd_duplicate_file
),
1918 ADD_TABLE(rd_install_exec_seq
),
1923 static const msi_table rrv_tables
[] =
1925 ADD_TABLE(directory
),
1926 ADD_TABLE(rrv_component
),
1927 ADD_TABLE(rrv_feature
),
1928 ADD_TABLE(rrv_feature_comp
),
1929 ADD_TABLE(rrv_file
),
1930 ADD_TABLE(rrv_registry
),
1931 ADD_TABLE(rrv_remove_registry
),
1932 ADD_TABLE(rrv_install_exec_seq
),
1937 static const msi_table frp_tables
[] =
1939 ADD_TABLE(directory
),
1940 ADD_TABLE(frp_component
),
1941 ADD_TABLE(frp_feature
),
1942 ADD_TABLE(frp_feature_comp
),
1943 ADD_TABLE(frp_file
),
1944 ADD_TABLE(frp_upgrade
),
1945 ADD_TABLE(frp_custom_action
),
1946 ADD_TABLE(frp_install_exec_seq
),
1951 static const msi_table riv_tables
[] =
1953 ADD_TABLE(directory
),
1954 ADD_TABLE(riv_component
),
1955 ADD_TABLE(riv_feature
),
1956 ADD_TABLE(riv_feature_comp
),
1957 ADD_TABLE(riv_file
),
1958 ADD_TABLE(riv_ini_file
),
1959 ADD_TABLE(riv_remove_ini_file
),
1960 ADD_TABLE(riv_install_exec_seq
),
1965 static const msi_table res_tables
[] =
1967 ADD_TABLE(directory
),
1968 ADD_TABLE(res_component
),
1969 ADD_TABLE(res_feature
),
1970 ADD_TABLE(res_feature_comp
),
1971 ADD_TABLE(res_file
),
1972 ADD_TABLE(res_environment
),
1973 ADD_TABLE(res_install_exec_seq
),
1978 static const msi_table rci_tables
[] =
1980 ADD_TABLE(directory
),
1981 ADD_TABLE(rci_component
),
1982 ADD_TABLE(rci_feature
),
1983 ADD_TABLE(rci_feature_comp
),
1984 ADD_TABLE(rci_file
),
1985 ADD_TABLE(rci_appid
),
1986 ADD_TABLE(rci_class
),
1987 ADD_TABLE(rci_install_exec_seq
),
1992 static const msi_table rei_tables
[] =
1994 ADD_TABLE(directory
),
1995 ADD_TABLE(rei_component
),
1996 ADD_TABLE(rei_feature
),
1997 ADD_TABLE(rei_feature_comp
),
1998 ADD_TABLE(rei_file
),
1999 ADD_TABLE(rei_extension
),
2000 ADD_TABLE(rei_verb
),
2001 ADD_TABLE(rei_progid
),
2002 ADD_TABLE(rei_install_exec_seq
),
2007 static const msi_table rpi_tables
[] =
2009 ADD_TABLE(directory
),
2010 ADD_TABLE(rpi_component
),
2011 ADD_TABLE(rpi_feature
),
2012 ADD_TABLE(rpi_feature_comp
),
2013 ADD_TABLE(rpi_file
),
2014 ADD_TABLE(rpi_appid
),
2015 ADD_TABLE(rpi_class
),
2016 ADD_TABLE(rpi_extension
),
2017 ADD_TABLE(rpi_verb
),
2018 ADD_TABLE(rpi_progid
),
2019 ADD_TABLE(rpi_install_exec_seq
),
2024 static const msi_table rmi_tables
[] =
2026 ADD_TABLE(directory
),
2027 ADD_TABLE(rmi_component
),
2028 ADD_TABLE(rmi_feature
),
2029 ADD_TABLE(rmi_feature_comp
),
2030 ADD_TABLE(rmi_file
),
2031 ADD_TABLE(rmi_extension
),
2032 ADD_TABLE(rmi_verb
),
2033 ADD_TABLE(rmi_mime
),
2034 ADD_TABLE(rmi_install_exec_seq
),
2039 static const msi_table pa_tables
[] =
2041 ADD_TABLE(directory
),
2042 ADD_TABLE(pa_component
),
2043 ADD_TABLE(pa_feature
),
2044 ADD_TABLE(pa_feature_comp
),
2046 ADD_TABLE(pa_msi_assembly
),
2047 ADD_TABLE(pa_msi_assembly_name
),
2048 ADD_TABLE(pa_install_exec_seq
),
2053 static const msi_table rep_tables
[] =
2055 ADD_TABLE(directory
),
2056 ADD_TABLE(rep_component
),
2057 ADD_TABLE(rep_feature
),
2058 ADD_TABLE(rep_feature_comp
),
2059 ADD_TABLE(rep_file
),
2060 ADD_TABLE(rep_upgrade
),
2061 ADD_TABLE(rep_property
),
2062 ADD_TABLE(rep_install_exec_seq
),
2066 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2067 static LSTATUS
action_RegDeleteTreeA(HKEY hKey
, LPCSTR lpszSubKey
, REGSAM access
)
2070 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
2071 DWORD dwMaxLen
, dwSize
;
2072 char szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
2073 HKEY hSubKey
= hKey
;
2077 ret
= RegOpenKeyExA(hKey
, lpszSubKey
, 0, access
, &hSubKey
);
2078 if (ret
) return ret
;
2081 ret
= RegQueryInfoKeyA(hSubKey
, NULL
, NULL
, NULL
, NULL
,
2082 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
2083 if (ret
) goto cleanup
;
2087 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
2088 if (dwMaxLen
> sizeof(szNameBuf
))
2090 /* Name too big: alloc a buffer for it */
2091 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
)))
2093 ret
= ERROR_NOT_ENOUGH_MEMORY
;
2098 /* Recursively delete all the subkeys */
2102 if (RegEnumKeyExA(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
2103 NULL
, NULL
, NULL
)) break;
2105 ret
= action_RegDeleteTreeA(hSubKey
, lpszName
, access
);
2106 if (ret
) goto cleanup
;
2111 if (pRegDeleteKeyExA
)
2112 ret
= pRegDeleteKeyExA(hKey
, lpszSubKey
, access
, 0);
2114 ret
= RegDeleteKeyA(hKey
, lpszSubKey
);
2120 if (RegEnumValueA(hKey
, 0, lpszName
, &dwSize
,
2121 NULL
, NULL
, NULL
, NULL
)) break;
2123 ret
= RegDeleteValueA(hKey
, lpszName
);
2124 if (ret
) goto cleanup
;
2128 if (lpszName
!= szNameBuf
)
2129 HeapFree(GetProcessHeap(), 0, lpszName
);
2131 RegCloseKey(hSubKey
);
2135 /* cabinet definitions */
2137 /* make the max size large so there is only one cab file */
2138 #define MEDIA_SIZE 0x7FFFFFFF
2139 #define FOLDER_THRESHOLD 900000
2141 /* the FCI callbacks */
2143 static void * CDECL
mem_alloc(ULONG cb
)
2145 return HeapAlloc(GetProcessHeap(), 0, cb
);
2148 static void CDECL
mem_free(void *memory
)
2150 HeapFree(GetProcessHeap(), 0, memory
);
2153 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
2155 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
2159 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
2164 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
2165 BOOL fContinuation
, void *pv
)
2170 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
2174 DWORD dwShareMode
= 0;
2175 DWORD dwCreateDisposition
= OPEN_EXISTING
;
2177 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
2178 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
;
2180 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
2181 dwCreateDisposition
= OPEN_EXISTING
;
2183 dwCreateDisposition
= CREATE_NEW
;
2185 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
2186 dwCreateDisposition
, 0, NULL
);
2188 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
2190 return (INT_PTR
)handle
;
2193 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2195 HANDLE handle
= (HANDLE
)hf
;
2199 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
2200 ok(res
, "Failed to ReadFile\n");
2205 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2207 HANDLE handle
= (HANDLE
)hf
;
2211 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
2212 ok(res
, "Failed to WriteFile\n");
2217 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
2219 HANDLE handle
= (HANDLE
)hf
;
2220 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
2225 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
2227 HANDLE handle
= (HANDLE
)hf
;
2230 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
2231 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
2236 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
2238 BOOL ret
= DeleteFileA(pszFile
);
2239 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
2244 static void init_functionpointers(void)
2246 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2247 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2248 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2250 #define GET_PROC(mod, func) \
2251 p ## func = (void*)GetProcAddress(mod, #func); \
2253 trace("GetProcAddress(%s) failed\n", #func);
2255 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2256 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2257 GET_PROC(hmsi
, MsiSourceListGetInfoA
);
2258 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2259 GET_PROC(hmsi
, MsiQueryFeatureStateExA
);
2261 GET_PROC(hadvapi32
, CheckTokenMembership
);
2262 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
2263 GET_PROC(hadvapi32
, OpenProcessToken
);
2264 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2265 GET_PROC(hkernel32
, IsWow64Process
)
2267 hsrclient
= LoadLibraryA("srclient.dll");
2268 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2269 GET_PROC(hsrclient
, SRSetRestorePointA
);
2274 static BOOL
is_process_limited(void)
2276 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2281 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2283 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2284 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0, &Group
) ||
2285 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2287 trace("Could not check if the current user is an administrator\n");
2295 /* Only administrators have enough privileges for these tests */
2299 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2302 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2305 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2307 return (ret
&& type
== TokenElevationTypeLimited
);
2312 static char *get_user_sid(void)
2317 char *usersid
= NULL
;
2319 if (!pConvertSidToStringSidA
)
2321 win_skip("ConvertSidToStringSidA is not available\n");
2324 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
2325 GetTokenInformation(token
, TokenUser
, NULL
, size
, &size
);
2327 user
= HeapAlloc(GetProcessHeap(), 0, size
);
2328 GetTokenInformation(token
, TokenUser
, user
, size
, &size
);
2329 pConvertSidToStringSidA(user
->User
.Sid
, &usersid
);
2330 HeapFree(GetProcessHeap(), 0, user
);
2336 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2340 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2341 GetTempFileNameA(".", "xx", 0, tempname
);
2343 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2345 lstrcpyA(pszTempName
, tempname
);
2346 HeapFree(GetProcessHeap(), 0, tempname
);
2350 HeapFree(GetProcessHeap(), 0, tempname
);
2355 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2356 USHORT
*pattribs
, int *err
, void *pv
)
2358 BY_HANDLE_FILE_INFORMATION finfo
;
2364 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2365 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2367 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2369 res
= GetFileInformationByHandle(handle
, &finfo
);
2370 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2372 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2373 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2375 attrs
= GetFileAttributesA(pszName
);
2376 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2378 return (INT_PTR
)handle
;
2381 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2383 char path
[MAX_PATH
];
2384 char filename
[MAX_PATH
];
2386 lstrcpyA(path
, CURR_DIR
);
2387 lstrcatA(path
, "\\");
2388 lstrcatA(path
, file
);
2390 lstrcpyA(filename
, file
);
2392 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2393 progress
, get_open_info
, compress
);
2396 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2398 ZeroMemory(pCabParams
, sizeof(CCAB
));
2400 pCabParams
->cb
= max_size
;
2401 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2402 pCabParams
->setID
= 0xbeef;
2403 pCabParams
->iCab
= 1;
2404 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2405 lstrcatA(pCabParams
->szCabPath
, "\\");
2406 lstrcpyA(pCabParams
->szCab
, name
);
2409 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2417 set_cab_parameters(&cabParams
, name
, max_size
);
2419 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2420 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2421 get_temp_file
, &cabParams
, NULL
);
2423 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2428 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2429 ok(res
, "Failed to add file: %s\n", ptr
);
2430 ptr
+= lstrlenA(ptr
) + 1;
2433 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2434 ok(res
, "Failed to flush the cabinet\n");
2436 res
= FCIDestroy(hfci
);
2437 ok(res
, "Failed to destroy the cabinet\n");
2440 static BOOL
get_user_dirs(void)
2445 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2446 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2450 if (RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
))
2460 static BOOL
get_system_dirs(void)
2465 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
,
2466 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2470 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2471 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
))
2478 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2479 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
))
2487 if (!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2493 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2498 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2499 if (file
== INVALID_HANDLE_VALUE
)
2502 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2506 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2513 #define create_file(name, size) create_file_data(name, name, size)
2515 static void create_test_files(void)
2517 CreateDirectoryA("msitest", NULL
);
2518 create_file("msitest\\one.txt", 100);
2519 CreateDirectoryA("msitest\\first", NULL
);
2520 create_file("msitest\\first\\two.txt", 100);
2521 CreateDirectoryA("msitest\\second", NULL
);
2522 create_file("msitest\\second\\three.txt", 100);
2524 create_file("four.txt", 100);
2525 create_file("five.txt", 100);
2526 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2528 create_file("msitest\\filename", 100);
2529 create_file("msitest\\service.exe", 100);
2530 create_file("msitest\\service2.exe", 100);
2532 DeleteFileA("four.txt");
2533 DeleteFileA("five.txt");
2536 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2538 CHAR path
[MAX_PATH
];
2540 lstrcpyA(path
, PROG_FILES_DIR
);
2541 lstrcatA(path
, "\\");
2542 lstrcatA(path
, rel_path
);
2545 return DeleteFileA(path
);
2547 return RemoveDirectoryA(path
);
2550 static void delete_test_files(void)
2552 DeleteFileA("msitest.msi");
2553 DeleteFileA("msitest.cab");
2554 DeleteFileA("msitest\\second\\three.txt");
2555 DeleteFileA("msitest\\first\\two.txt");
2556 DeleteFileA("msitest\\one.txt");
2557 DeleteFileA("msitest\\service.exe");
2558 DeleteFileA("msitest\\service2.exe");
2559 DeleteFileA("msitest\\filename");
2560 RemoveDirectoryA("msitest\\second");
2561 RemoveDirectoryA("msitest\\first");
2562 RemoveDirectoryA("msitest");
2565 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2568 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2569 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2573 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
, const char *template)
2578 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2579 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2581 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2582 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2584 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
2585 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2586 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2588 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2591 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2592 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2594 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2595 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2597 /* write the summary changes back to the stream */
2598 r
= MsiSummaryInfoPersist(summary
);
2599 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2601 MsiCloseHandle(summary
);
2604 #define create_database(name, tables, num_tables) \
2605 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2607 #define create_database_template(name, tables, num_tables, version, template) \
2608 create_database_wordcount(name, tables, num_tables, version, 0, template);
2610 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2611 int num_tables
, INT version
, INT wordcount
,
2612 const char *template)
2619 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2620 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2621 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2623 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2624 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2626 /* import the tables into the database */
2627 for (j
= 0; j
< num_tables
; j
++)
2629 const msi_table
*table
= &tables
[j
];
2631 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2633 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2634 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2636 DeleteFileA(table
->filename
);
2639 write_msi_summary_info(db
, version
, wordcount
, template);
2641 r
= MsiDatabaseCommit(db
);
2642 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2645 HeapFree( GetProcessHeap(), 0, nameW
);
2648 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2650 RESTOREPOINTINFOA spec
;
2652 spec
.dwEventType
= event_type
;
2653 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2654 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2655 lstrcpyA(spec
.szDescription
, "msitest restore point");
2657 return pSRSetRestorePointA(&spec
, status
);
2660 static void remove_restore_point(DWORD seq_number
)
2664 res
= pSRRemoveRestorePoint(seq_number
);
2665 if (res
!= ERROR_SUCCESS
)
2666 trace("Failed to remove the restore point : %08x\n", res
);
2669 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2671 if (pRegDeleteKeyExA
)
2672 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2673 return RegDeleteKeyA( key
, subkey
);
2676 static BOOL
file_exists(LPCSTR file
)
2678 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
2681 static BOOL
pf_exists(LPCSTR file
)
2683 CHAR path
[MAX_PATH
];
2685 lstrcpyA(path
, PROG_FILES_DIR
);
2686 lstrcatA(path
, "\\");
2687 lstrcatA(path
, file
);
2689 return file_exists(path
);
2692 static void delete_pfmsitest_files(void)
2694 SHFILEOPSTRUCTA shfl
;
2695 CHAR path
[MAX_PATH
+11];
2697 lstrcpyA(path
, PROG_FILES_DIR
);
2698 lstrcatA(path
, "\\msitest\\*");
2699 path
[strlen(path
) + 1] = '\0';
2702 shfl
.wFunc
= FO_DELETE
;
2705 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
2707 SHFileOperationA(&shfl
);
2709 lstrcpyA(path
, PROG_FILES_DIR
);
2710 lstrcatA(path
, "\\msitest");
2711 RemoveDirectoryA(path
);
2714 static void check_reg_str(HKEY prodkey
, LPCSTR name
, LPCSTR expected
, BOOL bcase
, DWORD line
)
2722 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)val
, &size
);
2724 if (res
!= ERROR_SUCCESS
||
2725 (type
!= REG_SZ
&& type
!= REG_EXPAND_SZ
&& type
!= REG_MULTI_SZ
))
2727 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2732 ok_(__FILE__
, line
)(!val
[0], "Expected empty string, got %s\n", val
);
2736 ok_(__FILE__
, line
)(!lstrcmpA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2738 ok_(__FILE__
, line
)(!lstrcmpiA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2742 static void check_reg_dword(HKEY prodkey
, LPCSTR name
, DWORD expected
, DWORD line
)
2744 DWORD val
, size
, type
;
2747 size
= sizeof(DWORD
);
2748 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2750 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2752 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2756 ok_(__FILE__
, line
)(val
== expected
, "Expected %d, got %d\n", expected
, val
);
2759 static void check_reg_dword4(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2760 DWORD expected4
, DWORD line
)
2762 DWORD val
, size
, type
;
2765 size
= sizeof(DWORD
);
2766 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2768 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2770 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2774 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
,
2775 "Expected %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, val
);
2778 static void check_reg_dword5(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2779 DWORD expected4
, DWORD expected5
, DWORD line
)
2781 DWORD val
, size
, type
;
2784 size
= sizeof(DWORD
);
2785 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2787 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2789 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2793 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
||
2795 "Expected %d, %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, expected5
, val
);
2798 #define CHECK_REG_STR(prodkey, name, expected) \
2799 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2801 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2803 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2804 RegDeleteValueA(prodkey, name); \
2807 #define CHECK_REG_ISTR(prodkey, name, expected) \
2808 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2810 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2812 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2813 RegDeleteValueA(prodkey, name); \
2816 #define CHECK_REG_DWORD(prodkey, name, expected) \
2817 check_reg_dword(prodkey, name, expected, __LINE__);
2819 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2821 check_reg_dword(prodkey, name, expected, __LINE__); \
2822 RegDeleteValueA(prodkey, name); \
2825 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
2826 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
2828 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
2830 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
2831 RegDeleteValueA(prodkey, name); \
2834 #define CHECK_REG_DWORD4(prodkey, name, expected1, expected2, expected3, expected4) \
2835 check_reg_dword4(prodkey, name, expected1, expected2, expected3, expected4, __LINE__);
2837 #define CHECK_DEL_REG_DWORD5(prodkey, name, expected1, expected2, expected3, expected4 ,expected5) \
2839 check_reg_dword5(prodkey, name, expected1, expected2, expected3, expected4, expected5, __LINE__); \
2840 RegDeleteValueA(prodkey, name); \
2843 static void get_date_str(LPSTR date
)
2847 static const char date_fmt
[] = "%d%02d%02d";
2848 GetLocalTime(&systime
);
2849 sprintf(date
, date_fmt
, systime
.wYear
, systime
.wMonth
, systime
.wDay
);
2852 static void test_register_product(void)
2856 HKEY hkey
, props
, usage
;
2858 char date
[MAX_PATH
], temp
[MAX_PATH
], keypath
[MAX_PATH
], path
[MAX_PATH
];
2860 REGSAM access
= KEY_ALL_ACCESS
;
2862 static const CHAR uninstall
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2863 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2864 static const CHAR uninstall_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2865 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2866 static const CHAR userdata
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2867 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2868 static const CHAR ugkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2869 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2870 static const CHAR userugkey
[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2871 "\\51AAE0C44620A5E4788506E91F249BD2";
2873 if (is_process_limited())
2875 skip("process is limited\n");
2879 if (!(usersid
= get_user_sid()))
2883 GetTempPathA(MAX_PATH
, temp
);
2885 CreateDirectoryA("msitest", NULL
);
2886 create_file("msitest\\maximus", 500);
2888 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
2891 access
|= KEY_WOW64_64KEY
;
2893 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
2895 /* RegisterProduct */
2896 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
2897 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2899 skip("Not enough rights to perform tests\n");
2902 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2903 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2904 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2906 res
= RegOpenKeyA(HKEY_CURRENT_USER
, userugkey
, &hkey
);
2907 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2911 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
2912 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2916 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
2917 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2920 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
2921 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
2922 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
2923 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
2924 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2925 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
2926 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2927 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
2928 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
2929 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
2930 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
2931 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
2932 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
2933 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
2934 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
2935 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
2936 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
2937 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
2938 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
2939 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
2940 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
2941 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
2944 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
2947 delete_key(hkey
, "", access
);
2950 sprintf(keypath
, userdata
, usersid
);
2951 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
2952 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2954 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
2955 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2957 size
= sizeof(path
);
2958 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
2960 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
2962 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
2963 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
2964 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
2965 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
2966 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2967 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
2968 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2969 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
2970 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
2971 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
2972 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
2973 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
2974 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
2975 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
2976 CHECK_DEL_REG_STR(props
, "Size", NULL
);
2977 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
2978 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
2979 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
2980 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
2981 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
2982 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
2983 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
2986 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
2989 delete_key(props
, "", access
);
2992 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
2995 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2998 delete_key(usage
, "", access
);
3000 delete_key(hkey
, "", access
);
3003 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
3004 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3006 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3008 delete_key(hkey
, "", access
);
3011 /* RegisterProduct, machine */
3012 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 ALLUSERS=1");
3013 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3014 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3015 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3017 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, userugkey
, 0, access
, &hkey
);
3018 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3022 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
3023 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3027 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
3028 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3031 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
3032 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
3033 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
3034 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
3035 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3036 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
3037 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3038 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
3039 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
3040 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
3041 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
3042 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
3043 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
3044 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
3045 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
3046 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
3047 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
3048 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3049 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3050 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
3051 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
3052 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
3055 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
3058 delete_key(hkey
, "", access
);
3061 sprintf(keypath
, userdata
, "S-1-5-18");
3062 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3063 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3065 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3066 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3068 size
= sizeof(path
);
3069 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
3071 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
3073 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
3074 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
3075 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
3076 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
3077 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3078 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
3079 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3080 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
3081 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
3082 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
3083 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
3084 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
3085 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
3086 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
3087 CHECK_DEL_REG_STR(props
, "Size", NULL
);
3088 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
3089 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
3090 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
3091 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
3092 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
3093 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
3094 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
3097 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
3100 delete_key(props
, "", access
);
3103 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
3106 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3109 delete_key(usage
, "", access
);
3111 delete_key(hkey
, "", access
);
3114 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
3115 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3117 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3119 delete_key(hkey
, "", access
);
3123 DeleteFileA(msifile
);
3124 DeleteFileA("msitest\\maximus");
3125 RemoveDirectoryA("msitest");
3126 HeapFree(GetProcessHeap(), 0, usersid
);
3129 static void test_publish_product(void)
3131 static const char prodpath
[] =
3132 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3133 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3134 static const char cuprodpath
[] =
3135 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3136 static const char cuupgrades
[] =
3137 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3138 static const char badprod
[] =
3139 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
3140 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3141 static const char machprod
[] =
3142 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3143 static const char machup
[] =
3144 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3148 HKEY sourcelist
, net
, props
;
3149 HKEY hkey
, patches
, media
;
3150 CHAR keypath
[MAX_PATH
];
3151 CHAR temp
[MAX_PATH
];
3152 CHAR path
[MAX_PATH
];
3153 BOOL old_installer
= FALSE
;
3154 REGSAM access
= KEY_ALL_ACCESS
;
3156 if (is_process_limited())
3158 skip("process is limited\n");
3162 if (!(usersid
= get_user_sid()))
3165 GetTempPathA(MAX_PATH
, temp
);
3167 CreateDirectoryA("msitest", NULL
);
3168 create_file("msitest\\maximus", 500);
3170 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3173 access
|= KEY_WOW64_64KEY
;
3175 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3177 /* PublishProduct, current user */
3178 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
3179 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3181 skip("Not enough rights to perform tests\n");
3184 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3185 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3186 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3188 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3189 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3191 sprintf(keypath
, prodpath
, usersid
);
3192 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3193 if (res
== ERROR_FILE_NOT_FOUND
)
3195 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3196 if (res
== ERROR_SUCCESS
)
3198 win_skip("Windows Installer < 3.0 detected\n");
3200 old_installer
= TRUE
;
3205 win_skip("Install failed, no need to continue\n");
3209 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3211 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3212 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3214 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3217 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3218 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3221 delete_key(patches
, "", access
);
3222 RegCloseKey(patches
);
3223 delete_key(hkey
, "", access
);
3227 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3228 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3230 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3231 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3232 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3233 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3235 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3236 CHECK_DEL_REG_DWORD(hkey
, "Assignment", 0);
3237 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3238 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3239 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3241 res
= RegOpenKeyA(hkey
, "SourceList", &sourcelist
);
3242 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3244 lstrcpyA(path
, "n;1;");
3245 lstrcatA(path
, temp
);
3246 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3247 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3249 res
= RegOpenKeyA(sourcelist
, "Net", &net
);
3250 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3252 CHECK_DEL_REG_STR(net
, "1", temp
);
3254 RegDeleteKeyA(net
, "");
3257 res
= RegOpenKeyA(sourcelist
, "Media", &media
);
3258 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3260 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3262 RegDeleteKeyA(media
, "");
3264 RegDeleteKeyA(sourcelist
, "");
3265 RegCloseKey(sourcelist
);
3266 RegDeleteKeyA(hkey
, "");
3269 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuupgrades
, &hkey
);
3270 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3272 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3274 RegDeleteKeyA(hkey
, "");
3277 /* PublishProduct, machine */
3278 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3281 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3282 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3283 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3285 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3286 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3288 sprintf(keypath
, prodpath
, "S-1-5-18");
3289 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3290 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3292 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3293 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3295 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3298 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3299 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3302 delete_key(patches
, "", access
);
3303 RegCloseKey(patches
);
3304 delete_key(hkey
, "", access
);
3308 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machprod
, 0, access
, &hkey
);
3309 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3311 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3312 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3313 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3314 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3316 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3317 todo_wine
CHECK_DEL_REG_DWORD(hkey
, "Assignment", 1);
3318 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3319 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3320 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3322 res
= RegOpenKeyExA(hkey
, "SourceList", 0, access
, &sourcelist
);
3323 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3325 lstrcpyA(path
, "n;1;");
3326 lstrcatA(path
, temp
);
3327 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3328 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3330 res
= RegOpenKeyExA(sourcelist
, "Net", 0, access
, &net
);
3331 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3333 CHECK_DEL_REG_STR(net
, "1", temp
);
3335 res
= delete_key(net
, "", access
);
3336 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3339 res
= RegOpenKeyExA(sourcelist
, "Media", 0, access
, &media
);
3340 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3342 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3344 res
= delete_key(media
, "", access
);
3345 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3347 res
= delete_key(sourcelist
, "", access
);
3348 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3349 RegCloseKey(sourcelist
);
3350 res
= delete_key(hkey
, "", access
);
3351 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3354 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machup
, 0, access
, &hkey
);
3355 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3357 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3359 res
= delete_key(hkey
, "", access
);
3360 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3364 DeleteFileA(msifile
);
3365 DeleteFileA("msitest\\maximus");
3366 RemoveDirectoryA("msitest");
3367 HeapFree(GetProcessHeap(), 0, usersid
);
3370 static void test_publish_features(void)
3372 static const char cupath
[] =
3373 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3374 static const char udfeatpath
[] =
3375 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3376 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3377 static const char udpridpath
[] =
3378 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3379 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3380 static const char featkey
[] =
3381 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3382 static const char classfeat
[] =
3383 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3388 CHAR keypath
[MAX_PATH
];
3389 REGSAM access
= KEY_ALL_ACCESS
;
3391 if (is_process_limited())
3393 skip("process is limited\n");
3397 if (!(usersid
= get_user_sid()))
3400 CreateDirectoryA("msitest", NULL
);
3401 create_file("msitest\\maximus", 500);
3403 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3406 access
|= KEY_WOW64_64KEY
;
3408 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3410 /* PublishFeatures, current user */
3411 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
3412 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3414 skip("Not enough rights to perform tests\n");
3417 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3418 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3419 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3421 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3422 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3424 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3425 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3427 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3428 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3430 CHECK_REG_STR(hkey
, "feature", "");
3431 CHECK_REG_STR(hkey
, "montecristo", "");
3433 RegDeleteValueA(hkey
, "feature");
3434 RegDeleteValueA(hkey
, "montecristo");
3435 delete_key(hkey
, "", access
);
3438 sprintf(keypath
, udfeatpath
, usersid
);
3439 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3440 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3442 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3443 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3445 RegDeleteValueA(hkey
, "feature");
3446 RegDeleteValueA(hkey
, "montecristo");
3447 delete_key(hkey
, "", access
);
3449 sprintf(keypath
, udpridpath
, usersid
);
3450 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3452 /* PublishFeatures, machine */
3453 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1 ALLUSERS=1");
3454 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3455 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3456 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3458 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3459 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3461 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3462 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3463 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3464 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3466 CHECK_REG_STR(hkey
, "feature", "");
3467 CHECK_REG_STR(hkey
, "montecristo", "");
3469 RegDeleteValueA(hkey
, "feature");
3470 RegDeleteValueA(hkey
, "montecristo");
3471 delete_key(hkey
, "", access
);
3474 sprintf(keypath
, udfeatpath
, "S-1-5-18");
3475 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3476 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3478 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3479 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3481 RegDeleteValueA(hkey
, "feature");
3482 RegDeleteValueA(hkey
, "montecristo");
3483 delete_key(hkey
, "", access
);
3485 sprintf(keypath
, udpridpath
, "S-1-5-18");
3486 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3489 DeleteFileA(msifile
);
3490 DeleteFileA("msitest\\maximus");
3491 RemoveDirectoryA("msitest");
3492 HeapFree(GetProcessHeap(), 0, usersid
);
3495 static LPSTR
reg_get_val_str(HKEY hkey
, LPCSTR name
)
3501 r
= RegQueryValueExA(hkey
, name
, NULL
, NULL
, NULL
, &len
);
3502 if (r
!= ERROR_SUCCESS
)
3505 len
+= sizeof (WCHAR
);
3506 val
= HeapAlloc(GetProcessHeap(), 0, len
);
3507 if (!val
) return NULL
;
3509 RegQueryValueExA(hkey
, name
, NULL
, NULL
, (LPBYTE
)val
, &len
);
3513 static void get_owner_company(LPSTR
*owner
, LPSTR
*company
)
3517 REGSAM access
= KEY_ALL_ACCESS
;
3519 *owner
= *company
= NULL
;
3522 access
|= KEY_WOW64_64KEY
;
3524 res
= RegOpenKeyA(HKEY_CURRENT_USER
,
3525 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey
);
3526 if (res
== ERROR_SUCCESS
)
3528 *owner
= reg_get_val_str(hkey
, "DefName");
3529 *company
= reg_get_val_str(hkey
, "DefCompany");
3533 if (!*owner
|| !*company
)
3535 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3536 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access
, &hkey
);
3537 if (res
== ERROR_SUCCESS
)
3539 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3540 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3545 if (!*owner
|| !*company
)
3547 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3548 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey
);
3549 if (res
== ERROR_SUCCESS
)
3551 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3552 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3558 static void test_register_user(void)
3564 LPSTR owner
, company
;
3565 CHAR keypath
[MAX_PATH
];
3566 REGSAM access
= KEY_ALL_ACCESS
;
3568 static const CHAR keypropsfmt
[] =
3569 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3570 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3571 static const CHAR keypridfmt
[] =
3572 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3573 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3575 if (is_process_limited())
3577 skip("process is limited\n");
3581 if (!(usersid
= get_user_sid()))
3584 get_owner_company(&owner
, &company
);
3586 CreateDirectoryA("msitest", NULL
);
3587 create_file("msitest\\maximus", 500);
3589 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3592 access
|= KEY_WOW64_64KEY
;
3594 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3596 /* RegisterUser, per-user */
3597 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1");
3598 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3600 skip("Not enough rights to perform tests\n");
3603 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3604 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3605 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3607 sprintf(keypath
, keypropsfmt
, usersid
);
3608 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3609 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3611 CHECK_REG_STR(props
, "ProductID", "none");
3612 CHECK_REG_STR(props
, "RegCompany", company
);
3613 CHECK_REG_STR(props
, "RegOwner", owner
);
3615 RegDeleteValueA(props
, "ProductID");
3616 RegDeleteValueA(props
, "RegCompany");
3617 RegDeleteValueA(props
, "RegOwner");
3618 delete_key(props
, "", access
);
3620 sprintf(keypath
, keypridfmt
, usersid
);
3621 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3623 /* RegisterUser, machine */
3624 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1 ALLUSERS=1");
3625 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3626 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3627 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3629 sprintf(keypath
, keypropsfmt
, "S-1-5-18");
3630 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3631 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3633 CHECK_REG_STR(props
, "ProductID", "none");
3634 CHECK_REG_STR(props
, "RegCompany", company
);
3635 CHECK_REG_STR(props
, "RegOwner", owner
);
3637 RegDeleteValueA(props
, "ProductID");
3638 RegDeleteValueA(props
, "RegCompany");
3639 RegDeleteValueA(props
, "RegOwner");
3640 delete_key(props
, "", access
);
3642 sprintf(keypath
, keypridfmt
, "S-1-5-18");
3643 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3646 HeapFree(GetProcessHeap(), 0, company
);
3647 HeapFree(GetProcessHeap(), 0, owner
);
3649 DeleteFileA(msifile
);
3650 DeleteFileA("msitest\\maximus");
3651 RemoveDirectoryA("msitest");
3655 static void test_process_components(void)
3657 static const char keyfmt
[] =
3658 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3659 static const char compkey
[] =
3660 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3667 CHAR keypath
[MAX_PATH
];
3668 CHAR program_files_maximus
[MAX_PATH
];
3669 REGSAM access
= KEY_ALL_ACCESS
;
3671 if (is_process_limited())
3673 skip("process is limited\n");
3677 if (!(usersid
= get_user_sid()))
3680 CreateDirectoryA("msitest", NULL
);
3681 create_file("msitest\\maximus", 500);
3683 create_database(msifile
, ppc_tables
, sizeof(ppc_tables
) / sizeof(msi_table
));
3686 access
|= KEY_WOW64_64KEY
;
3688 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3690 /* ProcessComponents, per-user */
3691 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
3692 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3694 skip("Not enough rights to perform tests\n");
3697 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3698 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3699 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3701 sprintf(keypath
, keyfmt
, usersid
, "CBABC2FDCCB35E749A8944D8C1C098B5");
3702 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3703 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3706 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3707 NULL
, NULL
, (LPBYTE
)val
, &size
);
3708 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3710 lstrcpyA(program_files_maximus
,PROG_FILES_DIR
);
3711 lstrcatA(program_files_maximus
,"\\msitest\\maximus");
3713 ok(!lstrcmpiA(val
, program_files_maximus
),
3714 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3716 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3717 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3719 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3720 delete_key(comp
, "", access
);
3723 sprintf(keypath
, keyfmt
, usersid
, "241C3DA58FECD0945B9687D408766058");
3724 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3725 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3728 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3729 NULL
, NULL
, (LPBYTE
)val
, &size
);
3730 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3731 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3732 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3734 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3735 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3737 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3738 delete_key(comp
, "", access
);
3741 /* ProcessComponents, machine */
3742 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3743 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3744 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3745 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3747 sprintf(keypath
, keyfmt
, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3748 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3749 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3752 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3753 NULL
, NULL
, (LPBYTE
)val
, &size
);
3754 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3755 ok(!lstrcmpiA(val
, program_files_maximus
),
3756 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3758 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3759 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3761 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3762 delete_key(comp
, "", access
);
3765 sprintf(keypath
, keyfmt
, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3766 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3767 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3770 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3771 NULL
, NULL
, (LPBYTE
)val
, &size
);
3772 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3773 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3774 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3776 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3777 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3779 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3780 delete_key(comp
, "", access
);
3784 DeleteFileA(msifile
);
3785 DeleteFileA("msitest\\maximus");
3786 RemoveDirectoryA("msitest");
3790 static void test_publish(void)
3792 static const char subkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3793 static const char subkey_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3796 HKEY uninstall
, prodkey
, uninstall_32node
= NULL
;
3798 char date
[MAX_PATH
], temp
[MAX_PATH
], prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3799 REGSAM access
= KEY_ALL_ACCESS
;
3802 if (!pMsiQueryFeatureStateExA
)
3804 win_skip("MsiQueryFeatureStateExA is not available\n");
3807 if (is_process_limited())
3809 skip("process is limited\n");
3814 GetTempPathA(MAX_PATH
, temp
);
3817 access
|= KEY_WOW64_64KEY
;
3819 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey
, 0, KEY_ALL_ACCESS
, &uninstall
);
3820 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3824 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey_32node
, 0, KEY_ALL_ACCESS
, &uninstall_32node
);
3825 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3828 CreateDirectoryA("msitest", NULL
);
3829 create_file("msitest\\maximus", 500);
3831 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3833 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3835 state
= MsiQueryProductStateA(prodcode
);
3836 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3838 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3839 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3842 SetLastError(0xdeadbeef);
3843 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3844 error
= GetLastError();
3845 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3846 ok(state
== 0xdead, "got %d\n", state
);
3847 ok(error
== 0xdeadbeef, "got %u\n", error
);
3850 SetLastError(0xdeadbeef);
3851 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
3852 error
= GetLastError();
3853 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3854 ok(state
== 0xdead, "got %d\n", state
);
3855 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3858 SetLastError(0xdeadbeef);
3859 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
3860 error
= GetLastError();
3861 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3862 ok(state
== 0xdead, "got %d\n", state
);
3863 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3865 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3866 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3868 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3869 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3871 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3872 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3873 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3874 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3876 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3877 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3879 /* nothing published */
3880 r
= MsiInstallProductA(msifile
, NULL
);
3881 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3883 skip("Not enough rights to perform tests\n");
3886 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3887 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3888 ok(pf_exists("msitest"), "File not installed\n");
3890 state
= MsiQueryProductStateA(prodcode
);
3891 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3893 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3894 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3896 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3897 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3899 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3900 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3901 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3902 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3904 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3905 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3907 /* PublishProduct and RegisterProduct */
3908 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3909 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3910 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3911 ok(pf_exists("msitest"), "File not installed\n");
3913 state
= MsiQueryProductStateA(prodcode
);
3914 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3916 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3917 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3919 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3920 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3922 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3923 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3924 ok(r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3925 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3929 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3930 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3934 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3935 if (is_wow64
&& res
== ERROR_FILE_NOT_FOUND
) /* XP - Vista, Wow64 */
3936 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3937 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3940 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
3941 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
3942 CHECK_REG_STR(prodkey
, "InstallDate", date
);
3943 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
3944 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3945 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
3946 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3947 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
3948 CHECK_REG_STR(prodkey
, "Comments", NULL
);
3949 CHECK_REG_STR(prodkey
, "Contact", NULL
);
3950 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
3951 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
3952 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
3953 CHECK_REG_STR(prodkey
, "Readme", NULL
);
3954 CHECK_REG_STR(prodkey
, "Size", NULL
);
3955 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
3956 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
3957 CHECK_REG_DWORD(prodkey
, "Language", 1033);
3958 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
3959 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
3960 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
3961 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
3964 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
3967 RegCloseKey(prodkey
);
3969 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
3970 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3971 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3972 ok(pf_exists("msitest"), "File deleted\n");
3974 state
= MsiQueryProductStateA(prodcode
);
3975 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3977 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3978 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3980 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3981 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3983 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3984 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3985 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3986 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3988 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3989 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3991 /* complete install */
3992 r
= MsiInstallProductA(msifile
, "FULL=1");
3993 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3994 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3995 ok(pf_exists("msitest"), "File not installed\n");
3997 state
= MsiQueryProductStateA(prodcode
);
3998 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4000 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4001 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4004 SetLastError(0xdeadbeef);
4005 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
4006 error
= GetLastError();
4007 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
4008 ok(state
== 0xdead, "got %d\n", state
);
4009 ok(error
== 0xdeadbeef, "got %u\n", error
);
4012 SetLastError(0xdeadbeef);
4013 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
4014 error
= GetLastError();
4015 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
4016 ok(state
== 0xdead, "got %d\n", state
);
4017 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
4020 SetLastError(0xdeadbeef);
4021 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
4022 error
= GetLastError();
4023 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
4024 ok(state
== INSTALLSTATE_LOCAL
, "got %d\n", state
);
4025 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
4027 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4028 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4030 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4031 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4032 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4033 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4037 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4038 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4042 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4043 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4046 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4047 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4048 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4049 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4050 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4051 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4052 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4053 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4054 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4055 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4056 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4057 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4058 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4059 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4060 CHECK_REG_STR(prodkey
, "Size", NULL
);
4061 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4062 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4063 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4064 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4065 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4066 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4067 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4070 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4073 RegCloseKey(prodkey
);
4075 /* no UnpublishFeatures */
4076 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4077 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4078 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4079 ok(!pf_exists("msitest"), "Directory not deleted\n");
4081 state
= MsiQueryProductStateA(prodcode
);
4082 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4084 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4085 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4087 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4088 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4090 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4091 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4092 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4093 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4095 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4096 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4098 /* complete install */
4099 r
= MsiInstallProductA(msifile
, "FULL=1");
4100 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4101 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4102 ok(pf_exists("msitest"), "File not installed\n");
4104 state
= MsiQueryProductStateA(prodcode
);
4105 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4107 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4108 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4110 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4111 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4113 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4114 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4115 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4116 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4120 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4121 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4125 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4126 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4129 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4130 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4131 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4132 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4133 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4134 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4135 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4136 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4137 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4138 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4139 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4140 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4141 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4142 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4143 CHECK_REG_STR(prodkey
, "Size", NULL
);
4144 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4145 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4146 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4147 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4148 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4149 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4150 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4153 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4156 RegCloseKey(prodkey
);
4158 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4159 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4160 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4161 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4162 ok(pf_exists("msitest"), "Directory deleted\n");
4164 state
= MsiQueryProductStateA(prodcode
);
4165 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4167 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4168 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4170 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4171 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4173 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4174 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4175 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4176 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4180 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4181 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4185 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4186 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4189 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4190 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4191 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4192 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4193 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4194 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4195 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4196 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4197 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4198 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4199 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4200 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4201 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4202 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4203 CHECK_REG_STR(prodkey
, "Size", NULL
);
4204 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4205 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4206 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4207 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4208 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4209 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4210 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4213 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4216 RegCloseKey(prodkey
);
4218 /* complete install */
4219 r
= MsiInstallProductA(msifile
, "FULL=1");
4220 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4221 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4222 ok(pf_exists("msitest"), "File not installed\n");
4224 state
= MsiQueryProductStateA(prodcode
);
4225 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4227 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4228 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4230 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4231 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4233 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4234 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4235 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4236 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4240 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4241 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4245 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4246 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4249 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4250 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4251 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4252 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4253 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4254 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4255 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4256 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4257 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4258 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4259 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4260 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4261 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4262 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4263 CHECK_REG_STR(prodkey
, "Size", NULL
);
4264 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4265 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4266 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4267 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4268 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4269 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4270 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4273 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -20, 10, 24);
4276 RegCloseKey(prodkey
);
4278 /* UnpublishFeatures, both features removed */
4279 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4280 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4281 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4282 ok(!pf_exists("msitest"), "Directory not deleted\n");
4284 state
= MsiQueryProductStateA(prodcode
);
4285 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4287 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4288 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4290 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4291 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4293 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4294 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4295 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4296 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4298 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4299 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4301 /* complete install */
4302 r
= MsiInstallProductA(msifile
, "FULL=1");
4303 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4304 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4305 ok(pf_exists("msitest"), "File not installed\n");
4307 state
= MsiQueryProductStateA(prodcode
);
4308 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4310 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4311 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4313 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4314 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4316 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4317 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4318 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4319 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4323 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4324 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4328 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4329 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4332 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4333 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4334 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4335 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4336 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4337 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4338 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4339 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4340 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4341 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4342 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4343 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4344 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4345 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4346 CHECK_REG_STR(prodkey
, "Size", NULL
);
4347 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4348 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4349 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4350 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4351 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4352 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4353 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4356 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4359 RegCloseKey(prodkey
);
4361 /* complete uninstall */
4362 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4363 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4364 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4365 ok(!pf_exists("msitest"), "Directory not deleted\n");
4367 state
= MsiQueryProductStateA(prodcode
);
4368 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4370 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4371 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4373 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4374 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4376 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4377 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4378 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4379 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4381 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4382 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4384 /* make sure 'Program Files\msitest' is removed */
4385 delete_pfmsitest_files();
4388 RegCloseKey(uninstall
);
4389 RegCloseKey(uninstall_32node
);
4390 DeleteFileA(msifile
);
4391 DeleteFileA("msitest\\maximus");
4392 RemoveDirectoryA("msitest");
4395 static void test_publish_sourcelist(void)
4399 CHAR value
[MAX_PATH
];
4400 CHAR path
[MAX_PATH
];
4401 CHAR prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4403 if (!pMsiSourceListEnumSourcesA
|| !pMsiSourceListGetInfoA
)
4405 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4408 if (is_process_limited())
4410 skip("process is limited\n");
4414 CreateDirectoryA("msitest", NULL
);
4415 create_file("msitest\\maximus", 500);
4417 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
4419 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4421 r
= MsiInstallProductA(msifile
, NULL
);
4422 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4424 skip("Not enough rights to perform tests\n");
4427 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4428 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4429 ok(pf_exists("msitest"), "File not installed\n");
4431 /* nothing published */
4433 lstrcpyA(value
, "aaa");
4434 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4435 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4436 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4437 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4438 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4441 lstrcpyA(value
, "aaa");
4442 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4443 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4444 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4445 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4446 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4448 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
4449 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4450 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4451 ok(pf_exists("msitest"), "File not installed\n");
4453 /* after RegisterProduct */
4455 lstrcpyA(value
, "aaa");
4456 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4457 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4458 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4459 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4460 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4463 lstrcpyA(value
, "aaa");
4464 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4465 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4466 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4467 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4468 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4470 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
4471 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4472 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4473 ok(pf_exists("msitest"), "File not installed\n");
4475 /* after ProcessComponents */
4477 lstrcpyA(value
, "aaa");
4478 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4479 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4480 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4481 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4482 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4485 lstrcpyA(value
, "aaa");
4486 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4487 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4488 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4489 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4490 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4492 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
4493 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4494 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4495 ok(pf_exists("msitest"), "File not installed\n");
4497 /* after PublishFeatures */
4499 lstrcpyA(value
, "aaa");
4500 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4501 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4502 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4503 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4504 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4507 lstrcpyA(value
, "aaa");
4508 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4509 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4510 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4511 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4512 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4514 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
4515 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4516 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4517 ok(pf_exists("msitest"), "File not installed\n");
4519 /* after PublishProduct */
4521 lstrcpyA(value
, "aaa");
4522 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4523 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4524 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4525 ok(!lstrcmpA(value
, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value
);
4526 ok(size
== 11, "Expected 11, got %d\n", size
);
4529 lstrcpyA(value
, "aaa");
4530 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4531 MSICODE_PRODUCT
, INSTALLPROPERTY_MEDIAPACKAGEPATHA
, value
, &size
);
4532 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4533 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4534 ok(size
== 0, "Expected 0, got %d\n", size
);
4537 lstrcpyA(value
, "aaa");
4538 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4539 MSICODE_PRODUCT
, INSTALLPROPERTY_DISKPROMPTA
, value
, &size
);
4540 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4541 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4542 ok(size
== 0, "Expected 0, got %d\n", size
);
4544 lstrcpyA(path
, CURR_DIR
);
4545 lstrcatA(path
, "\\");
4548 lstrcpyA(value
, "aaa");
4549 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4550 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCEA
, value
, &size
);
4551 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4552 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4553 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4556 lstrcpyA(value
, "aaa");
4557 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4558 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDTYPEA
, value
, &size
);
4559 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4560 ok(!lstrcmpA(value
, "n"), "Expected \"n\", got \"%s\"\n", value
);
4561 ok(size
== 1, "Expected 1, got %d\n", size
);
4564 lstrcpyA(value
, "aaa");
4565 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4566 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4567 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4568 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4569 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4572 lstrcpyA(value
, "aaa");
4573 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4574 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 0, value
, &size
);
4575 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4576 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4577 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4580 lstrcpyA(value
, "aaa");
4581 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4582 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 1, value
, &size
);
4583 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4584 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4585 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4587 /* complete uninstall */
4588 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4590 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4591 ok(!pf_exists("msitest"), "Directory not deleted\n");
4593 /* make sure 'Program Files\msitest' is removed */
4594 delete_pfmsitest_files();
4597 DeleteFileA(msifile
);
4598 DeleteFileA("msitest\\maximus");
4599 RemoveDirectoryA("msitest");
4602 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
4604 CHAR path
[MAX_PATH
];
4606 lstrcpyA(path
, PROG_FILES_DIR
);
4607 lstrcatA(path
, "\\");
4608 lstrcatA(path
, file
);
4611 create_file_data(path
, data
, 500);
4613 CreateDirectoryA(path
, NULL
);
4616 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
4618 static void test_remove_files(void)
4622 if (is_process_limited())
4624 skip("process is limited\n");
4628 CreateDirectoryA("msitest", NULL
);
4629 create_file("msitest\\hydrogen", 500);
4630 create_file("msitest\\helium", 500);
4631 create_file("msitest\\lithium", 500);
4633 create_database(msifile
, rem_tables
, sizeof(rem_tables
) / sizeof(msi_table
));
4635 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4637 r
= MsiInstallProductA(msifile
, NULL
);
4638 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4640 skip("Not enough rights to perform tests\n");
4643 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4644 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4645 ok(!pf_exists("msitest\\helium"), "File installed\n");
4646 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4647 ok(pf_exists("msitest"), "File not installed\n");
4649 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4650 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4651 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4652 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4653 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4654 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4656 create_pf("msitest", FALSE
);
4657 create_pf("msitest\\hydrogen", TRUE
);
4658 create_pf("msitest\\helium", TRUE
);
4659 create_pf("msitest\\lithium", TRUE
);
4661 r
= MsiInstallProductA(msifile
, NULL
);
4662 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4663 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4664 ok(pf_exists("msitest\\helium"), "File not installed\n");
4665 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4666 ok(pf_exists("msitest"), "File not installed\n");
4668 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4669 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4670 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4671 ok(delete_pf("msitest\\helium", TRUE
), "File deleted\n");
4672 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4673 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4675 create_pf("msitest", FALSE
);
4676 create_pf("msitest\\furlong", TRUE
);
4677 create_pf("msitest\\firkin", TRUE
);
4678 create_pf("msitest\\fortnight", TRUE
);
4679 create_pf("msitest\\becquerel", TRUE
);
4680 create_pf("msitest\\dioptre", TRUE
);
4681 create_pf("msitest\\attoparsec", TRUE
);
4682 create_pf("msitest\\storeys", TRUE
);
4683 create_pf("msitest\\block", TRUE
);
4684 create_pf("msitest\\siriometer", TRUE
);
4685 create_pf("msitest\\cabout", FALSE
);
4686 create_pf("msitest\\cabout\\blocker", TRUE
);
4688 r
= MsiInstallProductA(msifile
, NULL
);
4689 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4690 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4691 ok(!pf_exists("msitest\\helium"), "File installed\n");
4692 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4693 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4694 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4695 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4696 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4697 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4698 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4699 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4700 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4701 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4702 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4703 ok(pf_exists("msitest"), "File not installed\n");
4705 create_pf("msitest\\furlong", TRUE
);
4706 create_pf("msitest\\firkin", TRUE
);
4707 create_pf("msitest\\fortnight", TRUE
);
4708 create_pf("msitest\\storeys", TRUE
);
4709 create_pf("msitest\\block", TRUE
);
4710 create_pf("msitest\\siriometer", TRUE
);
4712 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4713 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4714 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not deleted\n");
4715 ok(!delete_pf("msitest\\helium", TRUE
), "File not deleted\n");
4716 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4717 ok(delete_pf("msitest\\furlong", TRUE
), "File deleted\n");
4718 ok(delete_pf("msitest\\firkin", TRUE
), "File deleted\n");
4719 ok(delete_pf("msitest\\fortnight", TRUE
), "File deleted\n");
4720 ok(!delete_pf("msitest\\becquerel", TRUE
), "File not deleted\n");
4721 ok(!delete_pf("msitest\\dioptre", TRUE
), "File not deleted\n");
4722 ok(delete_pf("msitest\\attoparsec", TRUE
), "File deleted\n");
4723 ok(!delete_pf("msitest\\storeys", TRUE
), "File not deleted\n");
4724 ok(!delete_pf("msitest\\block", TRUE
), "File not deleted\n");
4725 ok(delete_pf("msitest\\siriometer", TRUE
), "File deleted\n");
4726 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4727 ok(pf_exists("msitest"), "Directory deleted\n");
4729 r
= MsiInstallProductA(msifile
, NULL
);
4730 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4731 ok(delete_pf("msitest\\hydrogen", TRUE
), "File not installed\n");
4732 ok(!delete_pf("msitest\\helium", TRUE
), "File installed\n");
4733 ok(delete_pf("msitest\\lithium", TRUE
), "File not installed\n");
4734 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4735 ok(pf_exists("msitest"), "Directory deleted\n");
4737 delete_pf("msitest\\cabout\\blocker", TRUE
);
4739 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4740 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4741 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory not deleted\n");
4742 delete_pf("msitest", FALSE
);
4745 DeleteFileA(msifile
);
4746 DeleteFileA("msitest\\hydrogen");
4747 DeleteFileA("msitest\\helium");
4748 DeleteFileA("msitest\\lithium");
4749 RemoveDirectoryA("msitest");
4752 static void test_move_files(void)
4755 char props
[MAX_PATH
];
4757 if (is_process_limited())
4759 skip("process is limited\n");
4763 CreateDirectoryA("msitest", NULL
);
4764 create_file("msitest\\augustus", 100);
4765 create_file("cameroon", 100);
4766 create_file("djibouti", 100);
4767 create_file("egypt", 100);
4768 create_file("finland", 100);
4769 create_file("gambai", 100);
4770 create_file("honduras", 100);
4771 create_file("msitest\\india", 100);
4772 create_file("japan", 100);
4773 create_file("kenya", 100);
4774 CreateDirectoryA("latvia", NULL
);
4775 create_file("nauru", 100);
4776 create_file("peru", 100);
4777 create_file("apple", 100);
4778 create_file("application", 100);
4779 create_file("ape", 100);
4780 create_file("foo", 100);
4781 create_file("fao", 100);
4782 create_file("fbod", 100);
4783 create_file("budding", 100);
4784 create_file("buddy", 100);
4785 create_file("bud", 100);
4786 create_file("bar", 100);
4787 create_file("bur", 100);
4788 create_file("bird", 100);
4790 create_database(msifile
, mov_tables
, sizeof(mov_tables
) / sizeof(msi_table
));
4792 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4794 /* if the source or dest property is not a full path,
4795 * windows tries to access it as a network resource
4798 sprintf(props
, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4799 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4800 CURR_DIR
, PROG_FILES_DIR
, CURR_DIR
, CURR_DIR
);
4802 r
= MsiInstallProductA(msifile
, props
);
4803 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4805 skip("Not enough rights to perform tests\n");
4808 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4809 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4810 ok(!delete_pf("msitest\\dest", TRUE
), "File copied\n");
4811 ok(delete_pf("msitest\\canada", TRUE
), "File not copied\n");
4812 ok(delete_pf("msitest\\dominica", TRUE
), "File not moved\n");
4813 ok(!delete_pf("msitest\\elsalvador", TRUE
), "File moved\n");
4814 ok(!delete_pf("msitest\\france", TRUE
), "File moved\n");
4815 ok(!delete_pf("msitest\\georgia", TRUE
), "File moved\n");
4816 ok(delete_pf("msitest\\hungary", TRUE
), "File not moved\n");
4817 ok(!delete_pf("msitest\\indonesia", TRUE
), "File moved\n");
4818 ok(!delete_pf("msitest\\jordan", TRUE
), "File moved\n");
4819 ok(delete_pf("msitest\\kiribati", TRUE
), "File not moved\n");
4820 ok(!delete_pf("msitest\\lebanon", TRUE
), "File moved\n");
4821 ok(!delete_pf("msitest\\lebanon", FALSE
), "Directory moved\n");
4822 ok(delete_pf("msitest\\poland", TRUE
), "File not moved\n");
4823 /* either apple or application will be moved depending on directory order */
4824 if (!delete_pf("msitest\\apple", TRUE
))
4825 ok(delete_pf("msitest\\application", TRUE
), "File not moved\n");
4827 ok(!delete_pf("msitest\\application", TRUE
), "File should not exist\n");
4828 ok(delete_pf("msitest\\wildcard", TRUE
), "File not moved\n");
4829 ok(!delete_pf("msitest\\ape", TRUE
), "File moved\n");
4830 /* either fao or foo will be moved depending on directory order */
4831 if (delete_pf("msitest\\foo", TRUE
))
4832 ok(!delete_pf("msitest\\fao", TRUE
), "File should not exist\n");
4834 ok(delete_pf("msitest\\fao", TRUE
), "File not moved\n");
4835 ok(delete_pf("msitest\\single", TRUE
), "File not moved\n");
4836 ok(!delete_pf("msitest\\fbod", TRUE
), "File moved\n");
4837 ok(delete_pf("msitest\\budding", TRUE
), "File not moved\n");
4838 ok(delete_pf("msitest\\buddy", TRUE
), "File not moved\n");
4839 ok(!delete_pf("msitest\\bud", TRUE
), "File moved\n");
4840 ok(delete_pf("msitest\\bar", TRUE
), "File not moved\n");
4841 ok(delete_pf("msitest\\bur", TRUE
), "File not moved\n");
4842 ok(!delete_pf("msitest\\bird", TRUE
), "File moved\n");
4843 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4844 ok(DeleteFileA("cameroon"), "File moved\n");
4845 ok(!DeleteFileA("djibouti"), "File not moved\n");
4846 ok(DeleteFileA("egypt"), "File moved\n");
4847 ok(DeleteFileA("finland"), "File moved\n");
4848 ok(DeleteFileA("gambai"), "File moved\n");
4849 ok(!DeleteFileA("honduras"), "File not moved\n");
4850 ok(DeleteFileA("msitest\\india"), "File moved\n");
4851 ok(DeleteFileA("japan"), "File moved\n");
4852 ok(!DeleteFileA("kenya"), "File not moved\n");
4853 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4854 ok(!DeleteFileA("nauru"), "File not moved\n");
4855 ok(!DeleteFileA("peru"), "File not moved\n");
4856 ok(!DeleteFileA("apple"), "File not moved\n");
4857 ok(!DeleteFileA("application"), "File not moved\n");
4858 ok(DeleteFileA("ape"), "File moved\n");
4859 ok(!DeleteFileA("foo"), "File not moved\n");
4860 ok(!DeleteFileA("fao"), "File not moved\n");
4861 ok(DeleteFileA("fbod"), "File moved\n");
4862 ok(!DeleteFileA("budding"), "File not moved\n");
4863 ok(!DeleteFileA("buddy"), "File not moved\n");
4864 ok(DeleteFileA("bud"), "File moved\n");
4865 ok(!DeleteFileA("bar"), "File not moved\n");
4866 ok(!DeleteFileA("bur"), "File not moved\n");
4867 ok(DeleteFileA("bird"), "File moved\n");
4870 DeleteFileA("cameroon");
4871 DeleteFileA("djibouti");
4872 DeleteFileA("egypt");
4873 DeleteFileA("finland");
4874 DeleteFileA("gambai");
4875 DeleteFileA("honduras");
4876 DeleteFileA("japan");
4877 DeleteFileA("kenya");
4878 DeleteFileA("nauru");
4879 DeleteFileA("peru");
4880 DeleteFileA("apple");
4881 DeleteFileA("application");
4885 DeleteFileA("fbod");
4886 DeleteFileA("budding");
4887 DeleteFileA("buddy");
4891 DeleteFileA("bird");
4892 DeleteFileA("msitest\\india");
4893 DeleteFileA("msitest\\augustus");
4894 RemoveDirectoryA("latvia");
4895 RemoveDirectoryA("msitest");
4896 DeleteFileA(msifile
);
4899 static void test_duplicate_files(void)
4903 if (is_process_limited())
4905 skip("process is limited\n");
4909 CreateDirectoryA("msitest", NULL
);
4910 create_file("msitest\\maximus", 500);
4911 create_database(msifile
, df_tables
, sizeof(df_tables
) / sizeof(msi_table
));
4913 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4915 /* fails if the destination folder is not a valid property */
4917 r
= MsiInstallProductA(msifile
, NULL
);
4918 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4920 skip("Not enough rights to perform tests\n");
4923 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4924 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
4925 ok(delete_pf("msitest\\augustus", TRUE
), "File not duplicated\n");
4926 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE
), "File not duplicated\n");
4927 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE
), "Directory not created\n");
4928 ok(delete_pf("msitest\\this\\doesnot", FALSE
), "Directory not created\n");
4929 ok(delete_pf("msitest\\this", FALSE
), "Directory not created\n");
4930 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4933 DeleteFileA("msitest\\maximus");
4934 RemoveDirectoryA("msitest");
4935 DeleteFileA(msifile
);
4938 static void test_write_registry_values(void)
4944 CHAR path
[MAX_PATH
];
4947 if (is_process_limited())
4949 skip("process is limited\n");
4953 CreateDirectoryA("msitest", NULL
);
4954 create_file("msitest\\augustus", 500);
4956 create_database(msifile
, wrv_tables
, sizeof(wrv_tables
) / sizeof(msi_table
));
4958 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4961 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL
, 0,
4962 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
4964 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, NULL
, 0, KEY_ALL_ACCESS
,
4966 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4968 res
= RegSetValueExA(hkey
, "Value1", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4969 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4970 res
= RegSetValueExA(hkey
, "Value2", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4971 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4972 res
= RegSetValueExA(hkey
, "Value3", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4973 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4974 res
= RegSetValueExA(hkey
, "Value4", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4975 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4976 res
= RegSetValueExA(hkey
, "Value5", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0two\0", 9);
4977 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4978 res
= RegSetValueExA(hkey
, "Value6", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4979 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4980 res
= RegSetValueExA(hkey
, "Value7", 0, REG_SZ
, (const BYTE
*)"one", 4);
4981 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4984 r
= MsiInstallProductA(msifile
, NULL
);
4985 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4987 skip("Not enough rights to perform tests\n");
4990 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4991 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4992 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4995 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4997 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4998 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5002 memset(path
, 'a', MAX_PATH
);
5003 res
= RegQueryValueExA(hkey
, "Value", NULL
, &type
, (LPBYTE
)path
, &size
);
5004 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5005 ok(!memcmp(path
, "one\0two\0three\0\0", size
), "Wrong multi-sz data\n");
5006 ok(size
== 15, "Expected 15, got %d\n", size
);
5007 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5009 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, NULL
, NULL
);
5010 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5012 res
= action_RegDeleteTreeA(hkey
, "VisualStudio", KEY_ALL_ACCESS
);
5013 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5017 memset(path
, 'a', MAX_PATH
);
5018 res
= RegQueryValueExA(hkey
, "Value1", NULL
, &type
, (LPBYTE
)path
, &size
);
5019 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5020 ok(!memcmp(path
, "one\0", size
), "Wrong multi-sz data\n");
5021 ok(size
== 5, "Expected 5, got %d\n", size
);
5022 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5026 memset(path
, 'a', MAX_PATH
);
5027 res
= RegQueryValueExA(hkey
, "Value2", NULL
, &type
, (LPBYTE
)path
, &size
);
5028 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5029 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5030 ok(size
== 9, "Expected 9, got %d\n", size
);
5031 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5035 memset(path
, 'a', MAX_PATH
);
5036 res
= RegQueryValueExA(hkey
, "Value3", NULL
, &type
, (LPBYTE
)path
, &size
);
5037 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5038 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5039 ok(size
== 9, "Expected 9, got %d\n", size
);
5040 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5044 memset(path
, 'a', MAX_PATH
);
5045 res
= RegQueryValueExA(hkey
, "Value4", NULL
, &type
, (LPBYTE
)path
, &size
);
5046 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5047 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5048 ok(size
== 9, "Expected 9, got %d\n", size
);
5049 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5053 memset(path
, 'a', MAX_PATH
);
5054 res
= RegQueryValueExA(hkey
, "Value5", NULL
, &type
, (LPBYTE
)path
, &size
);
5055 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5056 ok(!memcmp(path
, "one\0two\0three\0", size
), "Wrong multi-sz data\n");
5057 ok(size
== 15, "Expected 15, got %d\n", size
);
5058 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5062 memset(path
, 'a', MAX_PATH
);
5063 res
= RegQueryValueExA(hkey
, "Value6", NULL
, &type
, (LPBYTE
)path
, &size
);
5064 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5065 ok(!memcmp(path
, "", size
), "Wrong multi-sz data\n");
5066 ok(size
== 1, "Expected 1, got %d\n", size
);
5067 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5071 memset(path
, 'a', MAX_PATH
);
5072 res
= RegQueryValueExA(hkey
, "Value7", NULL
, &type
, (LPBYTE
)path
, &size
);
5073 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5074 ok(!memcmp(path
, "two\0", size
), "Wrong multi-sz data\n");
5075 ok(size
== 5, "Expected 5, got %d\n", size
);
5076 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5080 memset(buf
, 0, size
);
5081 res
= RegQueryValueExA(hkey
, "Value8", NULL
, &type
, buf
, &size
);
5082 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5083 ok(*(DWORD
*)buf
== 1, "got %u\n", *(DWORD
*)buf
);
5084 ok(size
== 4, "got %u\n", size
);
5085 ok(type
== REG_DWORD
, "got %u\n", type
);
5089 memset(buf
, 0, size
);
5090 res
= RegQueryValueExA(hkey
, "Value9", NULL
, &type
, buf
, &size
);
5091 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5092 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5093 ok(size
== 1, "got %u\n", size
);
5094 ok(type
== REG_BINARY
, "got %u\n", type
);
5098 memset(buf
, 0, size
);
5099 res
= RegQueryValueExA(hkey
, "Value10", NULL
, &type
, buf
, &size
);
5100 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5101 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5102 ok(size
== 1, "got %u\n", size
);
5103 ok(type
== REG_BINARY
, "got %u\n", type
);
5107 memset(buf
, 0, size
);
5108 res
= RegQueryValueExA(hkey
, "Value11", NULL
, &type
, buf
, &size
);
5109 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5110 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5111 ok(size
== 1, "got %u\n", size
);
5112 ok(type
== REG_BINARY
, "got %u\n", type
);
5114 RegDeleteValueA(hkey
, "Value");
5115 RegDeleteValueA(hkey
, "Value1");
5116 RegDeleteValueA(hkey
, "Value2");
5117 RegDeleteValueA(hkey
, "Value3");
5118 RegDeleteValueA(hkey
, "Value4");
5119 RegDeleteValueA(hkey
, "Value5");
5120 RegDeleteValueA(hkey
, "Value6");
5121 RegDeleteValueA(hkey
, "Value7");
5122 RegDeleteValueA(hkey
, "Value8");
5123 RegDeleteValueA(hkey
, "Value9");
5124 RegDeleteValueA(hkey
, "Value10");
5125 RegDeleteValueA(hkey
, "Value11");
5127 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
5130 DeleteFileA(msifile
);
5131 DeleteFileA("msitest\\augustus");
5132 RemoveDirectoryA("msitest");
5135 static void test_envvar(void)
5137 static const char *results
[] =
5139 "1;2", /* MSITESTVAR11 */
5140 "1", /* MSITESTVAR12 */
5141 "1;2", /* MSITESTVAR13 */
5142 ";1;", /* MSITESTVAR14 */
5143 ";;1;;", /* MSITESTVAR15 */
5144 " 1 ", /* MSITESTVAR16 */
5145 ";;2;;1", /* MSITESTVAR17 */
5146 "1;;2;;", /* MSITESTVAR18 */
5147 "1", /* MSITESTVAR19 */
5148 "1", /* MSITESTVAR20 */
5149 "1", /* MSITESTVAR21 */
5159 if (is_process_limited())
5161 skip("process is limited\n");
5165 create_test_files();
5166 create_database(msifile
, env_tables
, sizeof(env_tables
) / sizeof(msi_table
));
5168 res
= RegCreateKeyExA(HKEY_CURRENT_USER
, "Environment", 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &env
, NULL
);
5169 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5171 res
= RegSetValueExA(env
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"0", 2);
5172 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5174 res
= RegSetValueExA(env
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"0", 2);
5175 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5177 res
= RegSetValueExA(env
, "MSITESTVAR21", 0, REG_SZ
, (const BYTE
*)"1", 2);
5178 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5180 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5182 r
= MsiInstallProductA(msifile
, NULL
);
5183 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5185 skip("Not enough rights to perform tests\n");
5188 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5191 size
= sizeof(buffer
);
5193 res
= RegQueryValueExA(env
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5194 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5195 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5196 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5198 res
= RegDeleteValueA(env
, "MSITESTVAR1");
5199 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5202 size
= sizeof(buffer
);
5204 res
= RegQueryValueExA(env
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5205 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5206 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5207 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5209 res
= RegDeleteValueA(env
, "MSITESTVAR2");
5210 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5212 res
= RegDeleteValueA(env
, "MSITESTVAR3");
5213 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5215 res
= RegDeleteValueA(env
, "MSITESTVAR4");
5216 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5218 res
= RegDeleteValueA(env
, "MSITESTVAR5");
5219 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5221 res
= RegDeleteValueA(env
, "MSITESTVAR6");
5222 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5224 res
= RegDeleteValueA(env
, "MSITESTVAR7");
5225 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5227 res
= RegDeleteValueA(env
, "MSITESTVAR8");
5228 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5230 res
= RegDeleteValueA(env
, "MSITESTVAR9");
5231 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5233 res
= RegDeleteValueA(env
, "MSITESTVAR10");
5234 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5237 while (results
[i
- 11])
5240 sprintf(name
, "MSITESTVAR%d", i
);
5243 size
= sizeof(buffer
);
5245 res
= RegQueryValueExA(env
, name
, NULL
, &type
, (LPBYTE
)buffer
, &size
);
5246 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5247 ok(type
== REG_SZ
, "%d: Expected REG_SZ, got %u\n", i
, type
);
5248 ok(!lstrcmpA(buffer
, results
[i
- 11]), "%d: Expected %s, got %s\n", i
, results
[i
- 11], buffer
);
5250 res
= RegDeleteValueA(env
, name
);
5251 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5255 delete_pf("msitest\\cabout\\new\\five.txt", TRUE
);
5256 delete_pf("msitest\\cabout\\new", FALSE
);
5257 delete_pf("msitest\\cabout\\four.txt", TRUE
);
5258 delete_pf("msitest\\cabout", FALSE
);
5259 delete_pf("msitest\\changed\\three.txt", TRUE
);
5260 delete_pf("msitest\\changed", FALSE
);
5261 delete_pf("msitest\\first\\two.txt", TRUE
);
5262 delete_pf("msitest\\first", FALSE
);
5263 delete_pf("msitest\\filename", TRUE
);
5264 delete_pf("msitest\\one.txt", TRUE
);
5265 delete_pf("msitest\\service.exe", TRUE
);
5266 delete_pf("msitest\\service2.exe", TRUE
);
5267 delete_pf("msitest", FALSE
);
5270 RegDeleteValueA(env
, "MSITESTVAR1");
5271 RegDeleteValueA(env
, "MSITESTVAR2");
5272 RegDeleteValueA(env
, "MSITESTVAR21");
5275 delete_test_files();
5276 DeleteFileA(msifile
);
5279 static void test_create_remove_folder(void)
5283 if (is_process_limited())
5285 skip("process is limited\n");
5289 CreateDirectoryA("msitest", NULL
);
5290 CreateDirectoryA("msitest\\first", NULL
);
5291 CreateDirectoryA("msitest\\second", NULL
);
5292 create_file("msitest\\first\\one.txt", 1000);
5293 create_file("msitest\\second\\two.txt", 1000);
5294 create_database(msifile
, cf_tables
, sizeof(cf_tables
) / sizeof(msi_table
));
5296 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5298 r
= MsiInstallProductA(msifile
, NULL
);
5299 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5301 skip("Not enough rights to perform tests\n");
5304 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5306 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5307 ok(pf_exists("msitest\\first"), "directory not created\n");
5308 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5309 ok(pf_exists("msitest\\second"), "directory not created\n");
5310 ok(pf_exists("msitest\\third"), "directory not created\n");
5311 ok(pf_exists("msitest"), "directory not created\n");
5313 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5314 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5316 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5317 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5318 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5319 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5320 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5321 todo_wine
ok(!pf_exists("msitest"), "directory not removed\n");
5324 DeleteFileA("msitest\\first\\one.txt");
5325 DeleteFileA("msitest\\second\\two.txt");
5326 RemoveDirectoryA("msitest\\first");
5327 RemoveDirectoryA("msitest\\second");
5328 RemoveDirectoryA("msitest");
5329 DeleteFileA(msifile
);
5332 static void test_start_stop_services(void)
5335 SC_HANDLE scm
, service
;
5337 DWORD error
= ERROR_SUCCESS
;
5339 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5340 if (!scm
&& GetLastError() == ERROR_ACCESS_DENIED
)
5342 skip("Not enough rights to perform tests\n");
5345 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
5348 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5349 if (!service
&& GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST
)
5351 win_skip("The 'Spooler' service does not exist\n");
5352 CloseServiceHandle(scm
);
5355 ok(service
!= NULL
, "Failed to open Spooler, error %d\n", GetLastError());
5357 CloseServiceHandle(scm
);
5361 ret
= StartServiceA(service
, 0, NULL
);
5362 if (!ret
&& (error
= GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING
)
5364 skip("Spooler service not available, skipping test\n");
5365 CloseServiceHandle(service
);
5366 CloseServiceHandle(scm
);
5370 CloseServiceHandle(service
);
5371 CloseServiceHandle(scm
);
5373 create_test_files();
5374 create_database(msifile
, sss_tables
, sizeof(sss_tables
) / sizeof(msi_table
));
5376 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5378 r
= MsiInstallProductA(msifile
, NULL
);
5379 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5381 if (error
== ERROR_SUCCESS
)
5383 SERVICE_STATUS status
;
5385 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5386 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5388 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5389 ok(ret
, "ControlService failed %u\n", GetLastError());
5391 CloseServiceHandle(service
);
5392 CloseServiceHandle(scm
);
5395 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5396 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5398 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5399 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5400 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5401 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5402 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5403 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5404 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5405 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5406 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5407 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5408 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5409 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5410 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5412 if (error
== ERROR_SUCCESS
)
5414 SERVICE_STATUS status
;
5416 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5417 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5419 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5420 ok(ret
, "ControlService failed %u\n", GetLastError());
5422 CloseServiceHandle(service
);
5423 CloseServiceHandle(scm
);
5426 delete_test_files();
5427 DeleteFileA(msifile
);
5430 static void delete_TestService(void)
5433 SC_HANDLE manager
, service
;
5435 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5436 ok(manager
!= NULL
, "can't open service manager\n");
5440 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5441 ok(service
!= NULL
, "TestService doesn't exist\n");
5445 ret
= DeleteService( service
);
5446 ok( ret
, "failed to delete service %u\n", GetLastError() );
5448 CloseServiceHandle(service
);
5450 CloseServiceHandle(manager
);
5454 static void test_delete_services(void)
5457 SC_HANDLE manager
, service
;
5460 if (is_process_limited())
5462 skip("process is limited\n");
5466 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5467 ok(manager
!= NULL
, "can't open service manager %u\n", GetLastError());
5468 if (!manager
) return;
5470 service
= CreateServiceA(manager
, "TestService3", "TestService3",
5471 SERVICE_ALL_ACCESS
, SERVICE_WIN32_OWN_PROCESS
, SERVICE_DEMAND_START
,
5472 SERVICE_ERROR_NORMAL
, "C:\\doesnt_exist.exe", NULL
, NULL
, NULL
, NULL
, NULL
);
5473 ok(service
!= NULL
, "can't create service %u\n", GetLastError());
5474 CloseServiceHandle(service
);
5475 CloseServiceHandle(manager
);
5476 if (!service
) goto error
;
5478 create_test_files();
5479 create_database(msifile
, sds_tables
, sizeof(sds_tables
) / sizeof(msi_table
));
5481 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5483 r
= MsiInstallProductA(msifile
, NULL
);
5484 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5486 skip("Not enough rights to perform tests\n");
5489 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5491 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5492 ok(manager
!= NULL
, "can't open service manager\n");
5493 if (!manager
) goto error
;
5495 service
= OpenServiceA(manager
, "TestService3", GENERIC_ALL
);
5496 error
= GetLastError();
5497 ok(service
== NULL
, "TestService3 not deleted\n");
5498 ok(error
== ERROR_SERVICE_DOES_NOT_EXIST
, "wrong error %u\n", error
);
5499 CloseServiceHandle(manager
);
5501 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5502 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5504 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5505 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5506 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5507 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5508 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5509 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5510 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5511 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5512 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5513 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5514 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5515 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5516 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5519 delete_TestService();
5520 delete_test_files();
5521 DeleteFileA(msifile
);
5524 static void test_install_services(void)
5527 SC_HANDLE manager
, service
;
5530 DWORD err_control
, err_controlsize
, err_controltype
;
5532 if (is_process_limited())
5534 skip("process is limited\n");
5538 create_test_files();
5539 create_database(msifile
, sis_tables
, sizeof(sis_tables
) / sizeof(msi_table
));
5541 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5543 r
= MsiInstallProductA(msifile
, NULL
);
5544 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5546 skip("Not enough rights to perform tests\n");
5549 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5551 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5552 ok(manager
!= NULL
, "can't open service manager\n");
5553 if (!manager
) goto error
;
5555 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5556 ok(service
!= NULL
, "TestService not installed\n");
5557 CloseServiceHandle(service
);
5559 service
= OpenServiceA(manager
, "TestService4", GENERIC_ALL
);
5560 ok(service
== NULL
, "TestService4 installed\n");
5561 CloseServiceHandle(manager
);
5563 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey
);
5564 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5566 if (res
== ERROR_SUCCESS
)
5568 err_control
= 0xBEEF;
5569 err_controltype
= REG_DWORD
;
5570 err_controlsize
= sizeof(err_control
);
5571 res
= RegQueryValueExA(hKey
, "ErrorControl", NULL
, &err_controltype
, (LPBYTE
)&err_control
, &err_controlsize
);
5572 ok(err_control
== 0, "TestService.ErrorControl wrong, expected 0, got %u\n", err_control
);
5576 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5577 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5579 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5580 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5581 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5582 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5583 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5584 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5585 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5586 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5587 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5588 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5589 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5590 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5591 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5594 delete_TestService();
5595 delete_test_files();
5596 DeleteFileA(msifile
);
5599 static void test_self_registration(void)
5603 if (is_process_limited())
5605 skip("process is limited\n");
5609 create_test_files();
5610 create_database(msifile
, sr_tables
, sizeof(sr_tables
) / sizeof(msi_table
));
5612 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5614 r
= MsiInstallProductA(msifile
, NULL
);
5615 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5617 skip("Not enough rights to perform tests\n");
5620 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5622 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5623 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5624 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5625 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5626 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5627 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5628 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5629 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5630 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5631 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5632 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5633 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5634 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5637 delete_test_files();
5638 DeleteFileA(msifile
);
5641 static void test_register_font(void)
5643 static const char regfont1
[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5644 static const char regfont2
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5648 REGSAM access
= KEY_ALL_ACCESS
;
5650 if (is_process_limited())
5652 skip("process is limited\n");
5656 create_test_files();
5657 create_file("msitest\\font.ttf", 1000);
5658 create_database(msifile
, font_tables
, sizeof(font_tables
) / sizeof(msi_table
));
5661 access
|= KEY_WOW64_64KEY
;
5663 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5665 r
= MsiInstallProductA(msifile
, NULL
);
5666 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5668 skip("Not enough rights to perform tests\n");
5671 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5673 ret
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont1
, 0, access
, &key
);
5675 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont2
, 0, access
, &key
);
5677 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5678 ok(ret
!= ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5680 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5681 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5683 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5685 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5686 ok(ret
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5688 RegDeleteValueA(key
, "msi test font");
5692 DeleteFileA("msitest\\font.ttf");
5693 delete_test_files();
5694 DeleteFileA(msifile
);
5697 static void test_validate_product_id(void)
5701 if (is_process_limited())
5703 skip("process is limited\n");
5707 create_test_files();
5708 create_database(msifile
, vp_tables
, sizeof(vp_tables
) / sizeof(msi_table
));
5710 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5712 r
= MsiInstallProductA(msifile
, NULL
);
5713 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5715 skip("Not enough rights to perform tests\n");
5718 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5720 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=1");
5721 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5723 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=2");
5724 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5726 r
= MsiInstallProductA(msifile
, "PIDKEY=123-1234567");
5727 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5729 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5730 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5731 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5732 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5733 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5734 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5735 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5736 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5737 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5738 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5739 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5740 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5741 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5744 delete_test_files();
5745 DeleteFileA(msifile
);
5748 static void test_install_remove_odbc(void)
5752 if (is_process_limited())
5754 skip("process is limited\n");
5758 create_test_files();
5759 create_file("msitest\\ODBCdriver.dll", 1000);
5760 create_file("msitest\\ODBCdriver2.dll", 1000);
5761 create_file("msitest\\ODBCtranslator.dll", 1000);
5762 create_file("msitest\\ODBCtranslator2.dll", 1000);
5763 create_file("msitest\\ODBCsetup.dll", 1000);
5764 create_database(msifile
, odbc_tables
, sizeof(odbc_tables
) / sizeof(msi_table
));
5766 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5768 r
= MsiInstallProductA(msifile
, NULL
);
5769 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5771 skip("Not enough rights to perform tests\n");
5774 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5776 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5777 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5778 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5779 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5780 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5782 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5783 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5785 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE
), "file not removed\n");
5786 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE
), "file not removed\n");
5787 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE
), "file not removed\n");
5788 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE
), "file not removed\n");
5789 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE
), "file not removed\n");
5790 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5793 DeleteFileA("msitest\\ODBCdriver.dll");
5794 DeleteFileA("msitest\\ODBCdriver2.dll");
5795 DeleteFileA("msitest\\ODBCtranslator.dll");
5796 DeleteFileA("msitest\\ODBCtranslator2.dll");
5797 DeleteFileA("msitest\\ODBCsetup.dll");
5798 delete_test_files();
5799 DeleteFileA(msifile
);
5802 static void test_register_typelib(void)
5806 if (is_process_limited())
5808 skip("process is limited\n");
5812 create_test_files();
5813 create_file("msitest\\typelib.dll", 1000);
5814 create_database(msifile
, tl_tables
, sizeof(tl_tables
) / sizeof(msi_table
));
5816 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5818 r
= MsiInstallProductA(msifile
, "REGISTER_TYPELIB=1");
5819 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5821 skip("Not enough rights to perform tests\n");
5824 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5826 r
= MsiInstallProductA(msifile
, NULL
);
5827 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5829 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5830 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5832 ok(!delete_pf("msitest\\typelib.dll", TRUE
), "file not removed\n");
5833 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5836 DeleteFileA("msitest\\typelib.dll");
5837 delete_test_files();
5838 DeleteFileA(msifile
);
5841 static void test_create_remove_shortcut(void)
5845 if (is_process_limited())
5847 skip("process is limited\n");
5851 create_test_files();
5852 create_file("msitest\\target.txt", 1000);
5853 create_database(msifile
, crs_tables
, sizeof(crs_tables
) / sizeof(msi_table
));
5855 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5857 r
= MsiInstallProductA(msifile
, NULL
);
5858 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5860 skip("Not enough rights to perform tests\n");
5863 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5865 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5866 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5868 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5869 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5871 ok(!delete_pf("msitest\\shortcut.lnk", TRUE
), "file not removed\n");
5872 ok(!delete_pf("msitest\\target.txt", TRUE
), "file not removed\n");
5873 todo_wine
ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5876 DeleteFileA("msitest\\target.txt");
5877 delete_test_files();
5878 DeleteFileA(msifile
);
5881 static void test_publish_components(void)
5883 static const char keypath
[] =
5884 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5885 static const char keypath2
[] =
5886 "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5894 if (is_process_limited())
5896 skip("process is limited\n");
5900 create_test_files();
5901 create_file("msitest\\english.txt", 1000);
5902 create_database(msifile
, pub_tables
, sizeof(pub_tables
) / sizeof(msi_table
));
5904 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5906 r
= MsiInstallProductA(msifile
, NULL
);
5907 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5909 skip("Not enough rights to perform tests\n");
5912 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5915 r
= MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5916 "english.txt", INSTALLMODE_DEFAULT
, NULL
, &size
);
5917 ok(r
== ERROR_SUCCESS
, "MsiProvideQualifiedComponent returned %d\n", r
);
5919 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5920 ok(res
== ERROR_SUCCESS
, "components key not created %d\n", res
);
5922 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, NULL
, &size
);
5923 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5925 data
= HeapAlloc(GetProcessHeap(), 0, size
);
5926 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, data
, &size
);
5927 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5930 res
= RegDeleteKeyA(HKEY_CURRENT_USER
, keypath
);
5931 ok(res
== ERROR_SUCCESS
, "RegDeleteKey failed %d\n", res
);
5933 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath2
, 0, NULL
, REG_OPTION_NON_VOLATILE
,
5934 MAXIMUM_ALLOWED
| KEY_WOW64_64KEY
, NULL
, &key
, NULL
);
5935 ok(res
== ERROR_SUCCESS
, "RegCreateKeyEx failed %d\n", res
);
5936 res
= RegSetValueExA(key
, "english.txt", 0, REG_MULTI_SZ
, data
, size
);
5937 ok(res
== ERROR_SUCCESS
, "RegSetValueEx failed %d\n", res
);
5941 r
= MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5942 "english.txt", INSTALLMODE_DEFAULT
, NULL
, &size
);
5943 ok(r
== ERROR_SUCCESS
, "MsiProvideQualifiedComponent returned %d\n", r
);
5945 if (pRegDeleteKeyExA
)
5946 res
= pRegDeleteKeyExA(HKEY_LOCAL_MACHINE
, keypath2
, KEY_WOW64_64KEY
, 0);
5948 res
= RegDeleteKeyA(HKEY_LOCAL_MACHINE
, keypath2
);
5949 ok(res
== ERROR_SUCCESS
, "RegDeleteKey failed %d\n", res
);
5951 res
= RegCreateKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5952 ok(res
== ERROR_SUCCESS
, "RegCreateKey failed %d\n", res
);
5954 res
= RegSetValueExA(key
, "english.txt", 0, REG_MULTI_SZ
, data
, size
);
5955 ok(res
== ERROR_SUCCESS
, "RegSetValueEx failed %d\n", res
);
5956 HeapFree(GetProcessHeap(), 0, data
);
5959 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5960 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5962 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5963 ok(res
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", res
);
5965 ok(!delete_pf("msitest\\english.txt", TRUE
), "file not removed\n");
5966 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5969 DeleteFileA("msitest\\english.txt");
5970 delete_test_files();
5971 DeleteFileA(msifile
);
5974 static void test_remove_duplicate_files(void)
5978 if (is_process_limited())
5980 skip("process is limited\n");
5984 create_test_files();
5985 create_file("msitest\\original.txt", 1000);
5986 create_file("msitest\\original2.txt", 1000);
5987 create_file("msitest\\original3.txt", 1000);
5988 create_database(msifile
, rd_tables
, sizeof(rd_tables
) / sizeof(msi_table
));
5990 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5992 r
= MsiInstallProductA(msifile
, NULL
);
5993 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5995 skip("Not enough rights to perform tests\n");
5998 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6000 ok(pf_exists("msitest\\original.txt"), "file not created\n");
6001 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
6002 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
6003 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
6004 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
6006 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6007 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6009 ok(delete_pf("msitest\\original.txt", TRUE
), "file removed\n");
6010 ok(!delete_pf("msitest\\original2.txt", TRUE
), "file not removed\n");
6011 ok(!delete_pf("msitest\\original3.txt", TRUE
), "file not removed\n");
6012 ok(!delete_pf("msitest\\duplicate.txt", TRUE
), "file not removed\n");
6013 ok(!delete_pf("msitest\\duplicate2.txt", TRUE
), "file not removed\n");
6014 ok(delete_pf("msitest", FALSE
), "directory removed\n");
6017 DeleteFileA("msitest\\original.txt");
6018 DeleteFileA("msitest\\original2.txt");
6019 DeleteFileA("msitest\\original3.txt");
6020 delete_test_files();
6021 DeleteFileA(msifile
);
6024 static void test_remove_registry_values(void)
6029 REGSAM access
= KEY_ALL_ACCESS
;
6031 if (is_process_limited())
6033 skip("process is limited\n");
6037 create_test_files();
6038 create_file("msitest\\registry.txt", 1000);
6039 create_database(msifile
, rrv_tables
, sizeof(rrv_tables
) / sizeof(msi_table
));
6042 access
|= KEY_WOW64_64KEY
;
6044 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6046 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6047 RegSetValueExA(key
, "value1", 0, REG_SZ
, (const BYTE
*)"1", 2);
6050 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6051 RegSetValueExA(key
, "value2", 0, REG_SZ
, (const BYTE
*)"2", 2);
6054 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6055 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
6056 RegSetValueExA(key
, "valueA", 0, REG_SZ
, (const BYTE
*)"A", 2);
6057 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
6060 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6061 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
6062 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
6065 r
= MsiInstallProductA(msifile
, NULL
);
6066 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6068 skip("Not enough rights to perform tests\n");
6071 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6073 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, access
, &key
);
6074 ok(res
== ERROR_SUCCESS
, "key removed\n");
6079 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
6080 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6084 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
6085 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6088 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6089 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6092 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6093 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6097 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
6098 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6102 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
6103 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6106 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, access
, &key
);
6107 ok(res
== ERROR_SUCCESS
, "key removed\n");
6110 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, access
, &key
);
6111 ok(res
== ERROR_SUCCESS
, "key removed\n");
6116 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
6117 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6121 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
6122 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6125 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
6126 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
6127 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine", access
);
6129 ok(!delete_pf("msitest\\registry.txt", TRUE
), "file not removed\n");
6130 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6133 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", access
);
6134 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
6135 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
6136 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", access
);
6138 DeleteFileA("msitest\\registry.txt");
6139 delete_test_files();
6140 DeleteFileA(msifile
);
6143 static void test_find_related_products(void)
6147 if (is_process_limited())
6149 skip("process is limited\n");
6153 create_test_files();
6154 create_file("msitest\\product.txt", 1000);
6155 create_database(msifile
, frp_tables
, sizeof(frp_tables
) / sizeof(msi_table
));
6157 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6159 r
= MsiInstallProductA(msifile
, NULL
);
6160 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6162 skip("Not enough rights to perform tests\n");
6165 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6167 /* install again, so it finds the upgrade code */
6168 r
= MsiInstallProductA(msifile
, NULL
);
6169 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6171 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6172 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6174 ok(!delete_pf("msitest\\product.txt", TRUE
), "file not removed\n");
6175 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6178 DeleteFileA("msitest\\product.txt");
6179 delete_test_files();
6180 DeleteFileA(msifile
);
6183 static void test_remove_ini_values(void)
6187 char inifile
[MAX_PATH
], buf
[0x10];
6191 if (is_process_limited())
6193 skip("process is limited\n");
6197 create_test_files();
6198 create_file("msitest\\inifile.txt", 1000);
6199 create_database(msifile
, riv_tables
, sizeof(riv_tables
) / sizeof(msi_table
));
6201 lstrcpyA(inifile
, PROG_FILES_DIR
);
6202 lstrcatA(inifile
, "\\msitest");
6203 ret
= CreateDirectoryA(inifile
, NULL
);
6204 if (!ret
&& GetLastError() == ERROR_ACCESS_DENIED
)
6206 skip("Not enough rights to perform tests\n");
6209 lstrcatA(inifile
, "\\test.ini");
6210 file
= CreateFileA(inifile
, GENERIC_WRITE
|GENERIC_READ
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
6213 ret
= WritePrivateProfileStringA("section1", "key1", "value1", inifile
);
6214 ok(ret
, "failed to write profile string %u\n", GetLastError());
6216 ret
= WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile
);
6217 ok(ret
, "failed to write profile string %u\n", GetLastError());
6219 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6221 r
= MsiInstallProductA(msifile
, NULL
);
6222 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6224 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6225 ok(len
== 6, "got %u expected 6\n", len
);
6227 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6228 ok(!len
, "got %u expected 0\n", len
);
6230 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6231 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6233 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6234 ok(!len
, "got %u expected 0\n", len
);
6236 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6237 ok(!len
, "got %u expected 0\n", len
);
6239 todo_wine
ok(!delete_pf("msitest\\test.ini", TRUE
), "file removed\n");
6240 ok(!delete_pf("msitest\\inifile.txt", TRUE
), "file not removed\n");
6241 ok(delete_pf("msitest", FALSE
), "directory removed\n");
6244 DeleteFileA("msitest\\inifile.txt");
6245 delete_test_files();
6246 DeleteFileA(msifile
);
6249 static void test_remove_env_strings(void)
6257 if (is_process_limited())
6259 skip("process is limited\n");
6263 create_test_files();
6264 create_file("msitest\\envvar.txt", 1000);
6265 create_database(msifile
, res_tables
, sizeof(res_tables
) / sizeof(msi_table
));
6267 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6269 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6270 ok(!res
, "failed to open environment key %d\n", res
);
6272 RegSetValueExA(key
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"1", 2);
6273 RegSetValueExA(key
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"1", 2);
6274 RegSetValueExA(key
, "MSITESTVAR3", 0, REG_SZ
, (const BYTE
*)"1", 2);
6275 RegSetValueExA(key
, "MSITESTVAR4", 0, REG_SZ
, (const BYTE
*)"1", 2);
6276 RegSetValueExA(key
, "MSITESTVAR5", 0, REG_SZ
, (const BYTE
*)"1", 2);
6277 RegSetValueExA(key
, "MSITESTVAR6", 0, REG_SZ
, (const BYTE
*)"1;2", 4);
6278 RegSetValueExA(key
, "MSITESTVAR7", 0, REG_SZ
, (const BYTE
*)"1;2", 4);
6279 RegSetValueExA(key
, "MSITESTVAR8", 0, REG_SZ
, (const BYTE
*)"2;1;0", 6);
6280 RegSetValueExA(key
, "MSITESTVAR9", 0, REG_SZ
, (const BYTE
*)"0;1;2", 6);
6281 RegSetValueExA(key
, "MSITESTVAR10", 0, REG_SZ
, (const BYTE
*)"1", 2);
6282 RegSetValueExA(key
, "MSITESTVAR11", 0, REG_SZ
, (const BYTE
*)"1", 2);
6286 r
= MsiInstallProductA(msifile
, NULL
);
6287 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6289 skip("Not enough rights to perform tests\n");
6292 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6294 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6295 ok(!res
, "failed to open environment key %d\n", res
);
6299 size
= sizeof(buffer
);
6300 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6301 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6302 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6303 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6307 size
= sizeof(buffer
);
6308 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6309 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6310 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6311 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6315 size
= sizeof(buffer
);
6316 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6317 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6318 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6319 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6323 size
= sizeof(buffer
);
6324 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6325 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6326 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6327 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6331 size
= sizeof(buffer
);
6332 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6333 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6334 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6335 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6339 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6340 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6342 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6343 ok(!res
, "failed to open environment key %d\n", res
);
6345 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, NULL
, NULL
, NULL
);
6346 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6348 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, NULL
, NULL
, NULL
);
6349 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6353 size
= sizeof(buffer
);
6354 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6355 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6356 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6357 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6358 RegDeleteValueA(key
, "MSITESTVAR3");
6360 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, NULL
, NULL
, NULL
);
6361 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6365 size
= sizeof(buffer
);
6366 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6367 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6368 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6369 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6370 RegDeleteValueA(key
, "MSITESTVAR5");
6374 size
= sizeof(buffer
);
6375 res
= RegQueryValueExA(key
, "MSITESTVAR6", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6376 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6377 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6378 ok(!lstrcmpA(buffer
, "2"), "expected \"2\", got \"%s\"\n", buffer
);
6379 RegDeleteValueA(key
, "MSITESTVAR6");
6383 size
= sizeof(buffer
);
6384 res
= RegQueryValueExA(key
, "MSITESTVAR7", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6385 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6386 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6387 ok(!lstrcmpA(buffer
, "2"), "expected \"2\", got \"%s\"\n", buffer
);
6388 RegDeleteValueA(key
, "MSITESTVAR7");
6392 size
= sizeof(buffer
);
6393 res
= RegQueryValueExA(key
, "MSITESTVAR8", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6394 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6395 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6396 ok(!lstrcmpA(buffer
, "2;0"), "expected \"2;0\", got \"%s\"\n", buffer
);
6397 RegDeleteValueA(key
, "MSITESTVAR8");
6401 size
= sizeof(buffer
);
6402 res
= RegQueryValueExA(key
, "MSITESTVAR9", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6403 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6404 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6405 ok(!lstrcmpA(buffer
, "0;2"), "expected \"0;2\", got \"%s\"\n", buffer
);
6406 RegDeleteValueA(key
, "MSITESTVAR9");
6410 size
= sizeof(buffer
);
6411 res
= RegQueryValueExA(key
, "MSITESTVAR10", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6412 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6416 size
= sizeof(buffer
);
6417 res
= RegQueryValueExA(key
, "MSITESTVAR11", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6418 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6419 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6420 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6421 RegDeleteValueA(key
, "MSITESTVAR11");
6423 ok(!delete_pf("msitest\\envvar.txt", TRUE
), "file not removed\n");
6424 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6427 RegDeleteValueA(key
, "MSITESTVAR1");
6428 RegDeleteValueA(key
, "MSITESTVAR2");
6429 RegDeleteValueA(key
, "MSITESTVAR3");
6430 RegDeleteValueA(key
, "MSITESTVAR4");
6431 RegDeleteValueA(key
, "MSITESTVAR5");
6432 RegDeleteValueA(key
, "MSITESTVAR6");
6433 RegDeleteValueA(key
, "MSITESTVAR7");
6434 RegDeleteValueA(key
, "MSITESTVAR8");
6435 RegDeleteValueA(key
, "MSITESTVAR9");
6436 RegDeleteValueA(key
, "MSITESTVAR10");
6437 RegDeleteValueA(key
, "MSITESTVAR11");
6440 DeleteFileA("msitest\\envvar.txt");
6441 delete_test_files();
6442 DeleteFileA(msifile
);
6445 static void test_register_class_info(void)
6451 if (is_process_limited())
6453 skip("process is limited\n");
6457 create_test_files();
6458 create_file("msitest\\class.txt", 1000);
6459 create_database(msifile
, rci_tables
, sizeof(rci_tables
) / sizeof(msi_table
));
6461 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6463 r
= MsiInstallProductA(msifile
, NULL
);
6464 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6466 skip("Not enough rights to perform tests\n");
6469 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6472 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6474 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6475 ok(res
== ERROR_SUCCESS
, "key not created\n");
6478 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6479 ok(res
== ERROR_SUCCESS
, "key not created\n");
6482 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6483 ok(res
== ERROR_SUCCESS
, "key not created\n");
6486 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6487 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6490 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6492 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6493 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6495 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6496 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6498 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6499 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6501 ok(!delete_pf("msitest\\class.txt", TRUE
), "file not removed\n");
6502 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6505 DeleteFileA("msitest\\class.txt");
6506 delete_test_files();
6507 DeleteFileA(msifile
);
6510 static void test_register_extension_info(void)
6516 if (is_process_limited())
6518 skip("process is limited\n");
6522 create_test_files();
6523 create_file("msitest\\extension.txt", 1000);
6524 create_database(msifile
, rei_tables
, sizeof(rei_tables
) / sizeof(msi_table
));
6526 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6528 r
= MsiInstallProductA(msifile
, NULL
);
6529 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6531 skip("Not enough rights to perform tests\n");
6534 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6536 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6537 ok(res
== ERROR_SUCCESS
, "key not created\n");
6540 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1\\shell\\Open\\command", &hkey
);
6541 ok(res
== ERROR_SUCCESS
, "key not created\n");
6544 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6545 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6547 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6548 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6550 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1", &hkey
);
6551 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6553 ok(!delete_pf("msitest\\extension.txt", TRUE
), "file not removed\n");
6554 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6557 DeleteFileA("msitest\\extension.txt");
6558 delete_test_files();
6559 DeleteFileA(msifile
);
6562 static void test_register_progid_info(void)
6568 if (is_process_limited())
6570 skip("process is limited\n");
6574 create_test_files();
6575 create_file("msitest\\progid.txt", 1000);
6576 create_database(msifile
, rpi_tables
, sizeof(rpi_tables
) / sizeof(msi_table
));
6578 res
= RegCreateKeyExA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", 0, NULL
, 0,
6579 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
6580 ok(res
== ERROR_SUCCESS
, "key not created\n");
6583 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6585 r
= MsiInstallProductA(msifile
, NULL
);
6586 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6588 skip("Not enough rights to perform tests\n");
6591 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6594 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6596 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6597 ok(res
== ERROR_SUCCESS
, "key not created\n");
6600 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6601 ok(res
== ERROR_SUCCESS
, "key not created\n");
6604 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6605 ok(res
== ERROR_SUCCESS
, "key not created\n");
6608 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6609 ok(res
== ERROR_SUCCESS
, "key not created\n");
6612 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6613 ok(res
== ERROR_SUCCESS
, "key not created\n");
6616 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6617 ok(res
== ERROR_SUCCESS
, "key not created\n");
6620 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6621 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6622 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6624 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6625 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6627 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6628 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6629 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6631 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6632 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6634 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6635 ok(res
== ERROR_SUCCESS
, "key not created\n");
6638 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6639 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6642 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6644 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6645 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6647 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6648 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6650 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6651 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6653 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6654 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6656 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6657 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6659 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6660 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6662 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6663 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6665 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6666 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6668 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6669 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6670 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6672 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6673 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6675 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6676 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6678 ok(!delete_pf("msitest\\progid.txt", TRUE
), "file not removed\n");
6679 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6682 DeleteFileA("msitest\\progid.txt");
6683 delete_test_files();
6684 DeleteFileA(msifile
);
6685 RegDeleteKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned");
6688 static void test_register_mime_info(void)
6694 if (is_process_limited())
6696 skip("process is limited\n");
6700 create_test_files();
6701 create_file("msitest\\mime.txt", 1000);
6702 create_database(msifile
, rmi_tables
, sizeof(rmi_tables
) / sizeof(msi_table
));
6704 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6706 r
= MsiInstallProductA(msifile
, NULL
);
6707 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6709 skip("Not enough rights to perform tests\n");
6712 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6714 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6715 ok(res
== ERROR_SUCCESS
, "key not created\n");
6718 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6719 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6721 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6722 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6724 ok(!delete_pf("msitest\\mime.txt", TRUE
), "file not removed\n");
6725 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6728 DeleteFileA("msitest\\mime.txt");
6729 delete_test_files();
6730 DeleteFileA(msifile
);
6733 static void test_publish_assemblies(void)
6735 static const char manifest
[] =
6736 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6737 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6738 "processorArchitecture=\"x86\"/>";
6739 static const char manifest_local
[] =
6740 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6741 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6742 "processorArchitecture=\"x86\"/>";
6743 static const char classes_path_dotnet
[] =
6744 "Installer\\Assemblies\\Global";
6745 static const char classes_path_dotnet_local
[] =
6746 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6747 static const char classes_path_dotnet_local_wow64
[] =
6748 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6749 static const char classes_path_win32
[] =
6750 "Installer\\Win32Assemblies\\Global";
6751 static const char classes_path_win32_local
[] =
6752 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6753 static const char classes_path_win32_local_wow64
[] =
6754 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6755 static const char path_dotnet
[] =
6756 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6757 static const char path_dotnet_local
[] =
6758 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6759 static const char path_dotnet_local_wow64
[] =
6760 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6761 static const char path_win32
[] =
6762 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6763 static const char path_win32_local
[] =
6764 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6765 static const char path_win32_local_wow64
[] =
6766 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6767 static const char name_dotnet
[] =
6768 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6769 "version=\"1.0.0.0\",culture=\"neutral\"";
6770 static const char name_dotnet_local
[] =
6771 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6772 "version=\"1.0.0.0\",culture=\"neutral\"";
6773 static const char name_win32
[] =
6774 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6775 "type=\"win32\",version=\"1.0.0.0\"";
6776 static const char name_win32_local
[] =
6777 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6778 "type=\"win32\",version=\"1.0.0.0\"";
6785 if (is_process_limited())
6787 skip("process is limited\n");
6791 create_test_files();
6792 create_file("msitest\\win32.txt", 1000);
6793 create_file("msitest\\win32_local.txt", 1000);
6794 create_file("msitest\\dotnet.txt", 1000);
6795 create_file("msitest\\dotnet_local.txt", 1000);
6796 create_file_data("msitest\\manifest.txt", manifest
, 0);
6797 create_file_data("msitest\\manifest_local.txt", manifest_local
, 0);
6798 create_file("msitest\\application_win32.txt", 1000);
6799 create_file("msitest\\application_dotnet.txt", 1000);
6800 create_database(msifile
, pa_tables
, sizeof(pa_tables
) / sizeof(msi_table
));
6802 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6804 r
= MsiInstallProductA(msifile
, NULL
);
6805 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6807 skip("Not enough rights to perform tests\n");
6810 if (r
== ERROR_INSTALL_FAILURE
)
6812 skip("No support for installing side-by-side assemblies\n");
6815 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6817 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6818 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6819 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6822 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6823 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6824 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6825 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6828 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6829 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6830 "Expected ERROR_SUCCESS, got %d\n", res
);
6831 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6834 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6835 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6836 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6837 "Expected ERROR_SUCCESS, got %d\n", res
);
6838 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6841 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6842 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6844 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6845 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6846 if (res
== ERROR_SUCCESS
)
6848 res
= RegDeleteValueA(hkey
, name_dotnet
);
6849 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6853 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6854 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6855 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6857 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6858 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6859 if (res
== ERROR_SUCCESS
)
6861 res
= RegDeleteValueA(hkey
, name_win32
);
6862 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6866 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6867 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6868 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6870 r
= MsiInstallProductA(msifile
, "ALLUSERS=1");
6871 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6873 access
= KEY_QUERY_VALUE
;
6874 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6875 if (res
== ERROR_FILE_NOT_FOUND
&& is_wow64
) /* Vista WOW64 */
6877 trace("Using 64-bit registry view for HKCR\\Installer\n");
6878 access
= KEY_QUERY_VALUE
| KEY_WOW64_64KEY
;
6879 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6881 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6882 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6885 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6886 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6887 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6888 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6891 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_win32
, 0, access
, &hkey
);
6892 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6893 "Expected ERROR_SUCCESS, got %d\n", res
);
6894 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6897 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6898 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6899 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6900 "Expected ERROR_SUCCESS, got %d\n", res
);
6901 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6904 r
= MsiInstallProductA(msifile
, "REMOVE=ALL ALLUSERS=1");
6905 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6907 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, &hkey
);
6908 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6909 if (res
== ERROR_SUCCESS
)
6911 res
= RegDeleteValueA(hkey
, name_dotnet
);
6912 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6916 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6917 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6918 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6920 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_win32
, &hkey
);
6921 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6922 if (res
== ERROR_SUCCESS
)
6924 res
= RegDeleteValueA(hkey
, name_win32
);
6925 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6929 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6930 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6931 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6934 DeleteFileA("msitest\\win32.txt");
6935 DeleteFileA("msitest\\win32_local.txt");
6936 DeleteFileA("msitest\\dotnet.txt");
6937 DeleteFileA("msitest\\dotnet_local.txt");
6938 DeleteFileA("msitest\\manifest.txt");
6939 DeleteFileA("msitest\\manifest_local.txt");
6940 DeleteFileA("msitest\\application_win32.txt");
6941 DeleteFileA("msitest\\application_dotnet.txt");
6942 delete_test_files();
6943 DeleteFileA(msifile
);
6946 static void test_remove_existing_products(void)
6950 if (is_process_limited())
6952 skip("process is limited\n");
6956 create_test_files();
6957 create_file("msitest\\rep.txt", 1000);
6958 create_database(msifile
, rep_tables
, sizeof(rep_tables
) / sizeof(msi_table
));
6960 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6962 r
= MsiInstallProductA(msifile
, NULL
);
6963 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6965 skip("Not enough rights to perform tests\n");
6968 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6970 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6971 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6973 ok(!delete_pf("msitest\\rep.txt", TRUE
), "file not removed\n");
6974 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6977 DeleteFileA("msitest\\rep.txt");
6978 delete_test_files();
6979 DeleteFileA(msifile
);
6985 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6986 STATEMGRSTATUS status
;
6989 init_functionpointers();
6991 if (pIsWow64Process
)
6992 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
6994 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6995 GetTempPathA(MAX_PATH
, temp_path
);
6996 SetCurrentDirectoryA(temp_path
);
6998 lstrcpyA(CURR_DIR
, temp_path
);
6999 len
= lstrlenA(CURR_DIR
);
7001 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
7002 CURR_DIR
[len
- 1] = 0;
7004 ok(get_system_dirs(), "failed to retrieve system dirs\n");
7005 ok(get_user_dirs(), "failed to retrieve user dirs\n");
7007 /* Create a restore point ourselves so we circumvent the multitude of restore points
7008 * that would have been created by all the installation and removal tests.
7010 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
7011 * creation of restore points.
7013 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
7015 memset(&status
, 0, sizeof(status
));
7016 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
7019 /* Create only one log file and don't append. We have to pass something
7020 * for the log mode for this to work. The logfile needs to have an absolute
7021 * path otherwise we still end up with some extra logfiles as some tests
7022 * change the current directory.
7024 lstrcpyA(log_file
, temp_path
);
7025 lstrcatA(log_file
, "\\msitest.log");
7026 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
7028 test_register_product();
7029 test_publish_product();
7030 test_publish_features();
7031 test_register_user();
7032 test_process_components();
7034 test_publish_sourcelist();
7035 test_remove_files();
7037 test_duplicate_files();
7038 test_write_registry_values();
7040 test_create_remove_folder();
7041 test_start_stop_services();
7042 test_delete_services();
7043 test_install_services();
7044 test_self_registration();
7045 test_register_font();
7046 test_validate_product_id();
7047 test_install_remove_odbc();
7048 test_register_typelib();
7049 test_create_remove_shortcut();
7050 test_publish_components();
7051 test_remove_duplicate_files();
7052 test_remove_registry_values();
7053 test_find_related_products();
7054 test_remove_ini_values();
7055 test_remove_env_strings();
7056 test_register_class_info();
7057 test_register_extension_info();
7058 test_register_progid_info();
7059 test_register_mime_info();
7060 test_publish_assemblies();
7061 test_remove_existing_products();
7063 DeleteFileA(log_file
);
7065 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
7067 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
7069 remove_restore_point(status
.llSequenceNumber
);
7071 FreeLibrary(hsrclient
);
7073 SetCurrentDirectoryA(prev_path
);