msi/tests: Test deferral of CreateShorcuts and RemoveShortcuts.
[wine.git] / dlls / msi / tests / action.c
blobce36edaefd8b45489d2dbb90ae9244c028f5efd0
1 /*
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
23 #include <stdio.h>
24 #include <stdlib.h>
26 #include <windows.h>
27 #include <msiquery.h>
28 #include <msidefs.h>
29 #include <msi.h>
30 #include <fci.h>
31 #include <srrestoreptapi.h>
32 #include <wtypes.h>
33 #include <shellapi.h>
34 #include <winsvc.h>
36 #include "wine/test.h"
37 #include "utils.h"
39 static UINT (WINAPI *pMsiQueryComponentStateA)
40 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
41 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
42 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
43 static UINT (WINAPI *pMsiSourceListGetInfoA)
44 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
45 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
46 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
47 static UINT (WINAPI *pMsiQueryFeatureStateExA)
48 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
50 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
51 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
52 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
54 static HMODULE hsrclient;
55 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
56 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
58 static BOOL is_wow64;
59 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
61 static const char *msifile = "msitest.msi";
63 /* msi database data */
65 static const char component_dat[] =
66 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
67 "s72\tS38\ts72\ti2\tS255\tS72\n"
68 "Component\tComponent\n"
69 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
70 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
71 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
72 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
73 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
74 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
75 "component\t\tMSITESTDIR\t0\t1\tfile\n"
76 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
77 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
78 "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
80 static const char directory_dat[] =
81 "Directory\tDirectory_Parent\tDefaultDir\n"
82 "s72\tS72\tl255\n"
83 "Directory\tDirectory\n"
84 "CABOUTDIR\tMSITESTDIR\tcabout\n"
85 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
86 "FIRSTDIR\tMSITESTDIR\tfirst\n"
87 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
88 "NEWDIR\tCABOUTDIR\tnew\n"
89 "ProgramFilesFolder\tTARGETDIR\t.\n"
90 "TARGETDIR\t\tSourceDir";
92 static const char feature_dat[] =
93 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
94 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
95 "Feature\tFeature\n"
96 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
97 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
98 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
99 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
100 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
101 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
102 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
104 static const char feature_comp_dat[] =
105 "Feature_\tComponent_\n"
106 "s38\ts72\n"
107 "FeatureComponents\tFeature_\tComponent_\n"
108 "Five\tFive\n"
109 "Four\tFour\n"
110 "One\tOne\n"
111 "Three\tThree\n"
112 "Two\tTwo\n"
113 "feature\tcomponent\n"
114 "service_feature\tservice_comp\n"
115 "service_feature\tservice_comp2\n"
116 "service_feature\tservice_comp3";
118 static const char file_dat[] =
119 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
120 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
121 "File\tFile\n"
122 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
123 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
124 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
125 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
126 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
127 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
128 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
129 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
131 static const char install_exec_seq_dat[] =
132 "Action\tCondition\tSequence\n"
133 "s72\tS255\tI2\n"
134 "InstallExecuteSequence\tAction\n"
135 "AllocateRegistrySpace\tNOT Installed\t1550\n"
136 "CostFinalize\t\t1000\n"
137 "CostInitialize\t\t800\n"
138 "FileCost\t\t900\n"
139 "ResolveSource\t\t950\n"
140 "MoveFiles\t\t1700\n"
141 "InstallFiles\t\t4000\n"
142 "DuplicateFiles\t\t4500\n"
143 "WriteEnvironmentStrings\t\t4550\n"
144 "CreateShortcuts\t\t4600\n"
145 "InstallServices\t\t5000\n"
146 "InstallFinalize\t\t6600\n"
147 "InstallInitialize\t\t1500\n"
148 "InstallValidate\t\t1400\n"
149 "LaunchConditions\t\t100\n"
150 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
152 static const char media_dat[] =
153 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
154 "i2\ti4\tL64\tS255\tS32\tS72\n"
155 "Media\tDiskId\n"
156 "1\t3\t\t\tDISK1\t\n"
157 "2\t7\t\tmsitest.cab\tDISK2\t\n";
159 static const char property_dat[] =
160 "Property\tValue\n"
161 "s72\tl0\n"
162 "Property\tProperty\n"
163 "DefaultUIFont\tDlgFont8\n"
164 "HASUIRUN\t0\n"
165 "INSTALLLEVEL\t3\n"
166 "InstallMode\tTypical\n"
167 "Manufacturer\tWine\n"
168 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
169 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
170 "ProductID\tnone\n"
171 "ProductLanguage\t1033\n"
172 "ProductName\tMSITEST\n"
173 "ProductVersion\t1.1.1\n"
174 "PROMPTROLLBACKCOST\tP\n"
175 "Setup\tSetup\n"
176 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
177 "AdminProperties\tPOSTADMIN\n"
178 "ROOTDRIVE\tC:\\\n"
179 "SERVNAME\tTestService\n"
180 "SERVNAME2\tTestService2\n"
181 "SERVDISP\tTestServiceDisp\n"
182 "SERVDISP2\tTestServiceDisp2\n"
183 "MSIFASTINSTALL\t1\n"
184 "regdata15\t#x01\n";
186 static const char environment_dat[] =
187 "Environment\tName\tValue\tComponent_\n"
188 "s72\tl255\tL255\ts72\n"
189 "Environment\tEnvironment\n"
190 "Var1\t=-MSITESTVAR1\t1\tOne\n"
191 "Var2\tMSITESTVAR2\t1\tOne\n"
192 "Var3\t=-MSITESTVAR3\t1\tOne\n"
193 "Var4\tMSITESTVAR4\t1\tOne\n"
194 "Var5\t-MSITESTVAR5\t\tOne\n"
195 "Var6\tMSITESTVAR6\t\tOne\n"
196 "Var7\t!-MSITESTVAR7\t\tOne\n"
197 "Var8\t!-*MSITESTVAR8\t\tOne\n"
198 "Var9\t=-MSITESTVAR9\t\tOne\n"
199 "Var10\t=MSITESTVAR10\t\tOne\n"
200 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
201 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
202 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
203 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
204 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
205 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
206 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
207 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
208 "Var19\t+-MSITESTVAR17\t1\tOne\n"
209 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
210 "Var21\t+-MSITESTVAR18\t1\tOne\n"
211 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
212 "Var23\t+-MSITESTVAR19\t1\tOne\n"
213 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
214 "Var25\t+-MSITESTVAR20\t1\tOne\n"
215 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"
216 "Var27\t+-MSITESTVAR21\t[~];1\tOne\n";
218 static const char service_install_dat[] =
219 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
220 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
221 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
222 "ServiceInstall\tServiceInstall\n"
223 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
224 "TestService2\t[SERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription\n";
226 static const char service_install2_dat[] =
227 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
228 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
229 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
230 "ServiceInstall\tServiceInstall\n"
231 "TestService\tTestService\tTestService\t2\t3\t32768\t\t\tTestService\t\t\tservice_comp\t\n"
232 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
234 static const char service_control_dat[] =
235 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
236 "s72\tl255\ti2\tL255\tI2\ts72\n"
237 "ServiceControl\tServiceControl\n"
238 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
239 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
241 static const char sss_service_control_dat[] =
242 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
243 "s72\tl255\ti2\tL255\tI2\ts72\n"
244 "ServiceControl\tServiceControl\n"
245 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
246 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
247 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
248 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
250 static const char sss_install_exec_seq_dat[] =
251 "Action\tCondition\tSequence\n"
252 "s72\tS255\tI2\n"
253 "InstallExecuteSequence\tAction\n"
254 "LaunchConditions\t\t100\n"
255 "CostInitialize\t\t800\n"
256 "FileCost\t\t900\n"
257 "ResolveSource\t\t950\n"
258 "CostFinalize\t\t1000\n"
259 "InstallValidate\t\t1400\n"
260 "InstallInitialize\t\t1500\n"
261 "StopServices\t\t4000\n"
262 "DeleteServices\t\t5000\n"
263 "MoveFiles\t\t5100\n"
264 "InstallFiles\t\t5200\n"
265 "DuplicateFiles\t\t5300\n"
266 "StartServices\t\t5400\n"
267 "RegisterProduct\t\t5500\n"
268 "PublishFeatures\t\t5600\n"
269 "PublishProduct\t\t5700\n"
270 "InstallFinalize\t\t6000\n";
272 static const char sds_install_exec_seq_dat[] =
273 "Action\tCondition\tSequence\n"
274 "s72\tS255\tI2\n"
275 "InstallExecuteSequence\tAction\n"
276 "LaunchConditions\t\t100\n"
277 "CostInitialize\t\t800\n"
278 "FileCost\t\t900\n"
279 "ResolveSource\t\t950\n"
280 "CostFinalize\t\t1000\n"
281 "InstallValidate\t\t1400\n"
282 "InstallInitialize\t\t1500\n"
283 "StopServices\t\t5000\n"
284 "DeleteServices\t\t5050\n"
285 "MoveFiles\t\t5100\n"
286 "InstallFiles\t\t5200\n"
287 "DuplicateFiles\t\t5300\n"
288 "InstallServices\t\t5400\n"
289 "StartServices\t\t5450\n"
290 "RegisterProduct\t\t5500\n"
291 "PublishFeatures\t\t5600\n"
292 "PublishProduct\t\t5700\n"
293 "InstallFinalize\t\t6000\n";
295 static const char rof_component_dat[] =
296 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
297 "s72\tS38\ts72\ti2\tS255\tS72\n"
298 "Component\tComponent\n"
299 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
301 static const char rof_feature_dat[] =
302 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
303 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
304 "Feature\tFeature\n"
305 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
306 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
308 static const char rof_feature_comp_dat[] =
309 "Feature_\tComponent_\n"
310 "s38\ts72\n"
311 "FeatureComponents\tFeature_\tComponent_\n"
312 "feature\tmaximus\n"
313 "montecristo\tmaximus";
315 static const char rof_file_dat[] =
316 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
317 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
318 "File\tFile\n"
319 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
321 static const char rof_media_dat[] =
322 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
323 "i2\ti4\tL64\tS255\tS32\tS72\n"
324 "Media\tDiskId\n"
325 "1\t1\t\t\tDISK1\t\n";
327 static const char ci2_feature_comp_dat[] =
328 "Feature_\tComponent_\n"
329 "s38\ts72\n"
330 "FeatureComponents\tFeature_\tComponent_\n"
331 "feature\taugustus";
333 static const char ci2_file_dat[] =
334 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
335 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
336 "File\tFile\n"
337 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
339 static const char pp_install_exec_seq_dat[] =
340 "Action\tCondition\tSequence\n"
341 "s72\tS255\tI2\n"
342 "InstallExecuteSequence\tAction\n"
343 "ValidateProductID\t\t700\n"
344 "CostInitialize\t\t800\n"
345 "FileCost\t\t900\n"
346 "CostFinalize\t\t1000\n"
347 "InstallValidate\t\t1400\n"
348 "InstallInitialize\t\t1500\n"
349 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
350 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
351 "RemoveFiles\t\t3500\n"
352 "InstallFiles\t\t4000\n"
353 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
354 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
355 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
356 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
357 "InstallFinalize\t\t6600";
359 static const char pp_component_dat[] =
360 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
361 "s72\tS38\ts72\ti2\tS255\tS72\n"
362 "Component\tComponent\n"
363 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
365 static const char ppc_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"
370 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
372 static const char ppc_file_dat[] =
373 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
374 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
375 "File\tFile\n"
376 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
377 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
379 static const char ppc_media_dat[] =
380 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
381 "i2\ti4\tL64\tS255\tS32\tS72\n"
382 "Media\tDiskId\n"
383 "1\t2\t\t\tDISK1\t\n";
385 static const char ppc_feature_comp_dat[] =
386 "Feature_\tComponent_\n"
387 "s38\ts72\n"
388 "FeatureComponents\tFeature_\tComponent_\n"
389 "feature\tmaximus\n"
390 "feature\taugustus\n"
391 "montecristo\tmaximus";
393 static const char cwd_component_dat[] =
394 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
395 "s72\tS38\ts72\ti2\tS255\tS72\n"
396 "Component\tComponent\n"
397 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
399 static const char rem_component_dat[] =
400 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
401 "s72\tS38\ts72\ti2\tS255\tS72\n"
402 "Component\tComponent\n"
403 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
404 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
405 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
407 static const char rem_feature_comp_dat[] =
408 "Feature_\tComponent_\n"
409 "s38\ts72\n"
410 "FeatureComponents\tFeature_\tComponent_\n"
411 "feature\thydrogen\n"
412 "feature\thelium\n"
413 "feature\tlithium";
415 static const char rem_file_dat[] =
416 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
417 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
418 "File\tFile\n"
419 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
420 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
421 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
423 static const char rem_install_exec_seq_dat[] =
424 "Action\tCondition\tSequence\n"
425 "s72\tS255\tI2\n"
426 "InstallExecuteSequence\tAction\n"
427 "ValidateProductID\t\t700\n"
428 "CostInitialize\t\t800\n"
429 "FileCost\t\t900\n"
430 "CostFinalize\t\t1000\n"
431 "InstallValidate\t\t1400\n"
432 "InstallInitialize\t\t1500\n"
433 "ProcessComponents\t\t1600\n"
434 "UnpublishFeatures\t\t1800\n"
435 "RemoveFiles\t\t3500\n"
436 "InstallFiles\t\t4000\n"
437 "RegisterProduct\t\t6100\n"
438 "PublishFeatures\t\t6300\n"
439 "PublishProduct\t\t6400\n"
440 "InstallFinalize\t\t6600";
442 static const char rem_remove_files_dat[] =
443 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
444 "s72\ts72\tS255\ts72\tI2\n"
445 "RemoveFile\tFileKey\n"
446 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
447 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
448 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
449 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
450 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
451 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
452 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
453 "block\thelium\tblock\tMSITESTDIR\t3\n"
454 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
455 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
457 static const char mov_move_file_dat[] =
458 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
459 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
460 "MoveFile\tFileKey\n"
461 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
462 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
463 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
464 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
465 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
466 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
467 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
468 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
469 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
470 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
471 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
472 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
473 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
474 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
475 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
476 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
477 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
478 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
480 static const char df_directory_dat[] =
481 "Directory\tDirectory_Parent\tDefaultDir\n"
482 "s72\tS72\tl255\n"
483 "Directory\tDirectory\n"
484 "THIS\tMSITESTDIR\tthis\n"
485 "DOESNOT\tTHIS\tdoesnot\n"
486 "NONEXISTENT\tDOESNOT\texist\n"
487 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
488 "ProgramFilesFolder\tTARGETDIR\t.\n"
489 "TARGETDIR\t\tSourceDir";
491 static const char df_duplicate_file_dat[] =
492 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
493 "s72\ts72\ts72\tS255\tS72\n"
494 "DuplicateFile\tFileKey\n"
495 "maximus\tmaximus\tmaximus\taugustus\t\n"
496 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
497 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
499 static const char wrv_component_dat[] =
500 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
501 "s72\tS38\ts72\ti2\tS255\tS72\n"
502 "Component\tComponent\n"
503 "augustus\t\tMSITESTDIR\t0\t\taugustus\n"
504 "caesar\t\tMSITESTDIR\t1\t\t\n";
506 static const char wrv_feature_dat[] =
507 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
508 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
509 "Feature\tFeature\n"
510 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
511 "feature2\t\tFeature2\tFeature2\t2\t1\tTARGETDIR\t1";
513 static const char wrv_feature_comp_dat[] =
514 "Feature_\tComponent_\n"
515 "s38\ts72\n"
516 "FeatureComponents\tFeature_\tComponent_\n"
517 "feature\taugustus\n"
518 "feature2\tcaesar";
520 static const char wrv_registry_dat[] =
521 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
522 "s72\ti2\tl255\tL255\tL0\ts72\n"
523 "Registry\tRegistry\n"
524 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
525 "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
526 "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
527 "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
528 "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"
529 "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
530 "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
531 "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
532 "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
533 "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
534 "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
535 "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
536 "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
537 "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
538 "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
539 "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n"
540 "regdata16\t2\tSOFTWARE\\Wine\\msitest\tValue12\t#1\tcaesar\n";
542 static const char cf_directory_dat[] =
543 "Directory\tDirectory_Parent\tDefaultDir\n"
544 "s72\tS72\tl255\n"
545 "Directory\tDirectory\n"
546 "FIRSTDIR\tMSITESTDIR\tfirst\n"
547 "SECONDDIR\tMSITESTDIR\tsecond\n"
548 "THIRDDIR\tMSITESTDIR\tthird\n"
549 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
550 "ProgramFilesFolder\tTARGETDIR\t.\n"
551 "TARGETDIR\t\tSourceDir";
553 static const char cf_component_dat[] =
554 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
555 "s72\tS38\ts72\ti2\tS255\tS72\n"
556 "Component\tComponent\n"
557 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
558 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
560 static const char cf_feature_dat[] =
561 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
562 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
563 "Feature\tFeature\n"
564 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
565 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
567 static const char cf_feature_comp_dat[] =
568 "Feature_\tComponent_\n"
569 "s38\ts72\n"
570 "FeatureComponents\tFeature_\tComponent_\n"
571 "One\tOne\n"
572 "Two\tTwo\n";
574 static const char cf_file_dat[] =
575 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
576 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
577 "File\tFile\n"
578 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
579 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
581 static const char cf_create_folders_dat[] =
582 "Directory_\tComponent_\n"
583 "s72\ts72\n"
584 "CreateFolder\tDirectory_\tComponent_\n"
585 "FIRSTDIR\tOne\n"
586 "SECONDDIR\tTwo\n"
587 "THIRDDIR\tTwo\n";
589 static const char cf_install_exec_seq_dat[] =
590 "Action\tCondition\tSequence\n"
591 "s72\tS255\tI2\n"
592 "InstallExecuteSequence\tAction\n"
593 "CostFinalize\t\t1000\n"
594 "ValidateProductID\t\t700\n"
595 "CostInitialize\t\t800\n"
596 "FileCost\t\t900\n"
597 "RemoveFiles\t\t3500\n"
598 "CreateFolders\t\t3700\n"
599 "cf_immediate\tNOT REMOVE\t3701\n"
600 "cf_deferred\tNOT REMOVE\t3702\n"
601 "RemoveFolders\t\t3800\n"
602 "rf_immediate\tREMOVE\t3801\n"
603 "rf_deferred\tREMOVE\t3802\n"
604 "InstallFiles\t\t4000\n"
605 "RegisterUser\t\t6000\n"
606 "RegisterProduct\t\t6100\n"
607 "PublishFeatures\t\t6300\n"
608 "PublishProduct\t\t6400\n"
609 "InstallFinalize\t\t6600\n"
610 "InstallInitialize\t\t1500\n"
611 "ProcessComponents\t\t1600\n"
612 "UnpublishFeatures\t\t1800\n"
613 "InstallValidate\t\t1400\n"
614 "LaunchConditions\t\t100\n";
616 static const char cf_custom_action_dat[] =
617 "Action\tType\tSource\tTarget\n"
618 "s72\ti2\tS64\tS0\n"
619 "CustomAction\tAction\n"
620 "cf_immediate\t1\tcustom.dll\tcf_absent\n"
621 "cf_deferred\t1025\tcustom.dll\tcf_present\n"
622 "rf_immediate\t1\tcustom.dll\tcf_present\n"
623 "rf_deferred\t1025\tcustom.dll\tcf_absent\n";
625 static const char sr_selfreg_dat[] =
626 "File_\tCost\n"
627 "s72\tI2\n"
628 "SelfReg\tFile_\n"
629 "one.txt\t1\n";
631 static const char sr_install_exec_seq_dat[] =
632 "Action\tCondition\tSequence\n"
633 "s72\tS255\tI2\n"
634 "InstallExecuteSequence\tAction\n"
635 "CostFinalize\t\t1000\n"
636 "CostInitialize\t\t800\n"
637 "FileCost\t\t900\n"
638 "ResolveSource\t\t950\n"
639 "MoveFiles\t\t1700\n"
640 "SelfUnregModules\t\t3900\n"
641 "InstallFiles\t\t4000\n"
642 "DuplicateFiles\t\t4500\n"
643 "WriteEnvironmentStrings\t\t4550\n"
644 "CreateShortcuts\t\t4600\n"
645 "InstallFinalize\t\t6600\n"
646 "InstallInitialize\t\t1500\n"
647 "InstallValidate\t\t1400\n"
648 "LaunchConditions\t\t100\n";
650 static const char font_media_dat[] =
651 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
652 "i2\ti4\tL64\tS255\tS32\tS72\n"
653 "Media\tDiskId\n"
654 "1\t3\t\t\tDISK1\t\n";
656 static const char font_file_dat[] =
657 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
658 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
659 "File\tFile\n"
660 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
662 static const char font_feature_dat[] =
663 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
664 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
665 "Feature\tFeature\n"
666 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
668 static const char font_component_dat[] =
669 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
670 "s72\tS38\ts72\ti2\tS255\tS72\n"
671 "Component\tComponent\n"
672 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
674 static const char font_feature_comp_dat[] =
675 "Feature_\tComponent_\n"
676 "s38\ts72\n"
677 "FeatureComponents\tFeature_\tComponent_\n"
678 "fonts\tfonts\n";
680 static const char font_dat[] =
681 "File_\tFontTitle\n"
682 "s72\tS128\n"
683 "Font\tFile_\n"
684 "font.ttf\tmsi test font\n";
686 static const char font_install_exec_seq_dat[] =
687 "Action\tCondition\tSequence\n"
688 "s72\tS255\tI2\n"
689 "InstallExecuteSequence\tAction\n"
690 "ValidateProductID\t\t700\n"
691 "CostInitialize\t\t800\n"
692 "FileCost\t\t900\n"
693 "CostFinalize\t\t1000\n"
694 "InstallValidate\t\t1400\n"
695 "InstallInitialize\t\t1500\n"
696 "ProcessComponents\t\t1600\n"
697 "UnpublishFeatures\t\t1800\n"
698 "RemoveFiles\t\t3500\n"
699 "InstallFiles\t\t4000\n"
700 "RegisterFonts\t\t4100\n"
701 "UnregisterFonts\t\t4200\n"
702 "RegisterUser\t\t6000\n"
703 "RegisterProduct\t\t6100\n"
704 "PublishFeatures\t\t6300\n"
705 "PublishProduct\t\t6400\n"
706 "InstallFinalize\t\t6600";
708 static const char vp_property_dat[] =
709 "Property\tValue\n"
710 "s72\tl0\n"
711 "Property\tProperty\n"
712 "HASUIRUN\t0\n"
713 "INSTALLLEVEL\t3\n"
714 "InstallMode\tTypical\n"
715 "Manufacturer\tWine\n"
716 "PIDTemplate\t###-#######\n"
717 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
718 "ProductLanguage\t1033\n"
719 "ProductName\tMSITEST\n"
720 "ProductVersion\t1.1.1\n"
721 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
722 "MSIFASTINSTALL\t1\n";
724 static const char vp_custom_action_dat[] =
725 "Action\tType\tSource\tTarget\tISComments\n"
726 "s72\ti2\tS64\tS0\tS255\n"
727 "CustomAction\tAction\n"
728 "SetProductID1\t51\tProductID\t1\t\n"
729 "SetProductID2\t51\tProductID\t2\t\n"
730 "TestProductID1\t19\t\t\tHalts installation\n"
731 "TestProductID2\t19\t\t\tHalts installation\n";
733 static const char vp_install_exec_seq_dat[] =
734 "Action\tCondition\tSequence\n"
735 "s72\tS255\tI2\n"
736 "InstallExecuteSequence\tAction\n"
737 "LaunchConditions\t\t100\n"
738 "CostInitialize\t\t800\n"
739 "FileCost\t\t900\n"
740 "CostFinalize\t\t1000\n"
741 "InstallValidate\t\t1400\n"
742 "InstallInitialize\t\t1500\n"
743 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
744 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
745 "ValidateProductID\t\t3200\n"
746 "InstallExecute\t\t3300\n"
747 "TestProductID1\tProductID=1\t3400\n"
748 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
749 "InstallFiles\t\t4000\n"
750 "InstallFinalize\t\t6000\n";
752 static const char odbc_file_dat[] =
753 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
754 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
755 "File\tFile\n"
756 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
757 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
758 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
759 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
760 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
762 static const char odbc_feature_dat[] =
763 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
764 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
765 "Feature\tFeature\n"
766 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
768 static const char odbc_feature_comp_dat[] =
769 "Feature_\tComponent_\n"
770 "s38\ts72\n"
771 "FeatureComponents\tFeature_\tComponent_\n"
772 "odbc\todbc\n";
774 static const char odbc_component_dat[] =
775 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
776 "s72\tS38\ts72\ti2\tS255\tS72\n"
777 "Component\tComponent\n"
778 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
780 static const char odbc_driver_dat[] =
781 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
782 "s72\ts72\ts255\ts72\tS72\n"
783 "ODBCDriver\tDriver\n"
784 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
785 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
787 static const char odbc_translator_dat[] =
788 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
789 "s72\ts72\ts255\ts72\tS72\n"
790 "ODBCTranslator\tTranslator\n"
791 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
792 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
794 static const char odbc_datasource_dat[] =
795 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
796 "s72\ts72\ts255\ts255\ti2\n"
797 "ODBCDataSource\tDataSource\n"
798 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
800 static const char odbc_install_exec_seq_dat[] =
801 "Action\tCondition\tSequence\n"
802 "s72\tS255\tI2\n"
803 "InstallExecuteSequence\tAction\n"
804 "LaunchConditions\t\t100\n"
805 "CostInitialize\t\t800\n"
806 "FileCost\t\t900\n"
807 "CostFinalize\t\t1000\n"
808 "InstallValidate\t\t1400\n"
809 "InstallInitialize\t\t1500\n"
810 "ProcessComponents\t\t1600\n"
811 "InstallODBC\t\t3000\n"
812 "RemoveODBC\t\t3100\n"
813 "RemoveFiles\t\t3900\n"
814 "InstallFiles\t\t4000\n"
815 "RegisterProduct\t\t5000\n"
816 "PublishFeatures\t\t5100\n"
817 "PublishProduct\t\t5200\n"
818 "InstallFinalize\t\t6000\n";
820 static const char odbc_media_dat[] =
821 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
822 "i2\ti4\tL64\tS255\tS32\tS72\n"
823 "Media\tDiskId\n"
824 "1\t5\t\t\tDISK1\t\n";
826 static const char tl_file_dat[] =
827 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
828 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
829 "File\tFile\n"
830 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
832 static const char tl_feature_dat[] =
833 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
834 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
835 "Feature\tFeature\n"
836 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
838 static const char tl_feature_comp_dat[] =
839 "Feature_\tComponent_\n"
840 "s38\ts72\n"
841 "FeatureComponents\tFeature_\tComponent_\n"
842 "typelib\ttypelib\n";
844 static const char tl_component_dat[] =
845 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
846 "s72\tS38\ts72\ti2\tS255\tS72\n"
847 "Component\tComponent\n"
848 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
850 static const char tl_typelib_dat[] =
851 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
852 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
853 "TypeLib\tLibID\tLanguage\tComponent_\n"
854 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
856 static const char tl_install_exec_seq_dat[] =
857 "Action\tCondition\tSequence\n"
858 "s72\tS255\tI2\n"
859 "InstallExecuteSequence\tAction\n"
860 "LaunchConditions\t\t100\n"
861 "CostInitialize\t\t800\n"
862 "FileCost\t\t900\n"
863 "CostFinalize\t\t1000\n"
864 "InstallValidate\t\t1400\n"
865 "InstallInitialize\t\t1500\n"
866 "ProcessComponents\t\t1600\n"
867 "RemoveFiles\t\t1700\n"
868 "InstallFiles\t\t2000\n"
869 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
870 "UnregisterTypeLibraries\t\t3100\n"
871 "RegisterProduct\t\t5100\n"
872 "PublishFeatures\t\t5200\n"
873 "PublishProduct\t\t5300\n"
874 "InstallFinalize\t\t6000\n";
876 static const char crs_file_dat[] =
877 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
878 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
879 "File\tFile\n"
880 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
882 static const char crs_feature_dat[] =
883 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
884 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
885 "Feature\tFeature\n"
886 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
888 static const char crs_feature_comp_dat[] =
889 "Feature_\tComponent_\n"
890 "s38\ts72\n"
891 "FeatureComponents\tFeature_\tComponent_\n"
892 "shortcut\tshortcut\n";
894 static const char crs_component_dat[] =
895 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
896 "s72\tS38\ts72\ti2\tS255\tS72\n"
897 "Component\tComponent\n"
898 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
900 static const char crs_shortcut_dat[] =
901 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
902 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
903 "Shortcut\tShortcut\n"
904 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
906 static const char crs_install_exec_seq_dat[] =
907 "Action\tCondition\tSequence\n"
908 "s72\tS255\tI2\n"
909 "InstallExecuteSequence\tAction\n"
910 "LaunchConditions\t\t100\n"
911 "CostInitialize\t\t800\n"
912 "FileCost\t\t900\n"
913 "CostFinalize\t\t1000\n"
914 "InstallValidate\t\t1400\n"
915 "InstallInitialize\t\t1500\n"
916 "ProcessComponents\t\t1600\n"
917 "RemoveFiles\t\t1700\n"
918 "InstallFiles\t\t2000\n"
919 "RemoveShortcuts\t\t3000\n"
920 "rs_immediate\tREMOVE\t3001\n"
921 "rs_deferred\tREMOVE\t3002\n"
922 "CreateShortcuts\t\t3100\n"
923 "cs_immediate\tNOT REMOVE\t3101\n"
924 "cs_deferred\tNOT REMOVE\t3102\n"
925 "RegisterProduct\t\t5000\n"
926 "PublishFeatures\t\t5100\n"
927 "PublishProduct\t\t5200\n"
928 "InstallFinalize\t\t6000\n";
930 static const char crs_custom_action_dat[] =
931 "Action\tType\tSource\tTarget\n"
932 "s72\ti2\tS64\tS0\n"
933 "CustomAction\tAction\n"
934 "cs_immediate\t1\tcustom.dll\tcrs_absent\n"
935 "cs_deferred\t1025\tcustom.dll\tcrs_present\n"
936 "rs_immediate\t1\tcustom.dll\tcrs_present\n"
937 "rs_deferred\t1025\tcustom.dll\tcrs_absent\n";
939 static const char pub_file_dat[] =
940 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
941 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
942 "File\tFile\n"
943 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
945 static const char pub_feature_dat[] =
946 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
947 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
948 "Feature\tFeature\n"
949 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
951 static const char pub_feature_comp_dat[] =
952 "Feature_\tComponent_\n"
953 "s38\ts72\n"
954 "FeatureComponents\tFeature_\tComponent_\n"
955 "publish\tpublish\n";
957 static const char pub_component_dat[] =
958 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
959 "s72\tS38\ts72\ti2\tS255\tS72\n"
960 "Component\tComponent\n"
961 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
963 static const char pub_publish_component_dat[] =
964 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
965 "s38\ts255\ts72\tL255\ts38\n"
966 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
967 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
969 static const char pub_install_exec_seq_dat[] =
970 "Action\tCondition\tSequence\n"
971 "s72\tS255\tI2\n"
972 "InstallExecuteSequence\tAction\n"
973 "LaunchConditions\t\t100\n"
974 "CostInitialize\t\t800\n"
975 "FileCost\t\t900\n"
976 "CostFinalize\t\t1000\n"
977 "InstallValidate\t\t1400\n"
978 "InstallInitialize\t\t1500\n"
979 "ProcessComponents\t\t1600\n"
980 "RemoveFiles\t\t1700\n"
981 "InstallFiles\t\t2000\n"
982 "PublishComponents\t\t3000\n"
983 "UnpublishComponents\t\t3100\n"
984 "RegisterProduct\t\t5000\n"
985 "PublishFeatures\t\t5100\n"
986 "PublishProduct\t\t5200\n"
987 "InstallFinalize\t\t6000\n";
989 static const char rd_file_dat[] =
990 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
991 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
992 "File\tFile\n"
993 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
994 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
995 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
997 static const char rd_feature_dat[] =
998 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
999 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1000 "Feature\tFeature\n"
1001 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
1003 static const char rd_feature_comp_dat[] =
1004 "Feature_\tComponent_\n"
1005 "s38\ts72\n"
1006 "FeatureComponents\tFeature_\tComponent_\n"
1007 "duplicate\tduplicate\n";
1009 static const char rd_component_dat[] =
1010 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1011 "s72\tS38\ts72\ti2\tS255\tS72\n"
1012 "Component\tComponent\n"
1013 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
1014 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
1016 static const char rd_duplicate_file_dat[] =
1017 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
1018 "s72\ts72\ts72\tS255\tS72\n"
1019 "DuplicateFile\tFileKey\n"
1020 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
1021 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
1022 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
1024 static const char rd_install_exec_seq_dat[] =
1025 "Action\tCondition\tSequence\n"
1026 "s72\tS255\tI2\n"
1027 "InstallExecuteSequence\tAction\n"
1028 "LaunchConditions\t\t100\n"
1029 "CostInitialize\t\t800\n"
1030 "FileCost\t\t900\n"
1031 "CostFinalize\t\t1000\n"
1032 "InstallValidate\t\t1400\n"
1033 "InstallInitialize\t\t1500\n"
1034 "ProcessComponents\t\t1600\n"
1035 "RemoveDuplicateFiles\t\t1900\n"
1036 "InstallFiles\t\t2000\n"
1037 "DuplicateFiles\t\t2100\n"
1038 "RegisterProduct\t\t5000\n"
1039 "PublishFeatures\t\t5100\n"
1040 "PublishProduct\t\t5200\n"
1041 "InstallFinalize\t\t6000\n";
1043 static const char rrv_file_dat[] =
1044 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1045 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1046 "File\tFile\n"
1047 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1049 static const char rrv_feature_dat[] =
1050 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1051 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1052 "Feature\tFeature\n"
1053 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1055 static const char rrv_feature_comp_dat[] =
1056 "Feature_\tComponent_\n"
1057 "s38\ts72\n"
1058 "FeatureComponents\tFeature_\tComponent_\n"
1059 "registry\tregistry\n";
1061 static const char rrv_component_dat[] =
1062 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1063 "s72\tS38\ts72\ti2\tS255\tS72\n"
1064 "Component\tComponent\n"
1065 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1067 static const char rrv_registry_dat[] =
1068 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1069 "s72\ti2\tl255\tL255\tL0\ts72\n"
1070 "Registry\tRegistry\n"
1071 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1072 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1073 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1075 static const char rrv_remove_registry_dat[] =
1076 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1077 "s72\ti2\tl255\tL255\ts72\n"
1078 "RemoveRegistry\tRemoveRegistry\n"
1079 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1080 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1081 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1083 static const char rrv_install_exec_seq_dat[] =
1084 "Action\tCondition\tSequence\n"
1085 "s72\tS255\tI2\n"
1086 "InstallExecuteSequence\tAction\n"
1087 "LaunchConditions\t\t100\n"
1088 "CostInitialize\t\t800\n"
1089 "FileCost\t\t900\n"
1090 "CostFinalize\t\t1000\n"
1091 "InstallValidate\t\t1400\n"
1092 "InstallInitialize\t\t1500\n"
1093 "ProcessComponents\t\t1600\n"
1094 "RemoveFiles\t\t1700\n"
1095 "InstallFiles\t\t2000\n"
1096 "RemoveRegistryValues\t\t3000\n"
1097 "RegisterProduct\t\t5000\n"
1098 "PublishFeatures\t\t5100\n"
1099 "PublishProduct\t\t5200\n"
1100 "InstallFinalize\t\t6000\n";
1102 static const char frp_file_dat[] =
1103 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1104 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1105 "File\tFile\n"
1106 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1108 static const char frp_feature_dat[] =
1109 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1110 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1111 "Feature\tFeature\n"
1112 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1114 static const char frp_feature_comp_dat[] =
1115 "Feature_\tComponent_\n"
1116 "s38\ts72\n"
1117 "FeatureComponents\tFeature_\tComponent_\n"
1118 "product\tproduct\n";
1120 static const char frp_component_dat[] =
1121 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1122 "s72\tS38\ts72\ti2\tS255\tS72\n"
1123 "Component\tComponent\n"
1124 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1126 static const char frp_custom_action_dat[] =
1127 "Action\tType\tSource\tTarget\tISComments\n"
1128 "s72\ti2\tS64\tS0\tS255\n"
1129 "CustomAction\tAction\n"
1130 "TestProp\t19\t\t\tPROP set\n";
1132 static const char frp_upgrade_dat[] =
1133 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1134 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1135 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1136 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1138 static const char frp_install_exec_seq_dat[] =
1139 "Action\tCondition\tSequence\n"
1140 "s72\tS255\tI2\n"
1141 "InstallExecuteSequence\tAction\n"
1142 "FindRelatedProducts\t\t50\n"
1143 "TestProp\tPROP AND NOT REMOVE\t51\n"
1144 "LaunchConditions\t\t100\n"
1145 "CostInitialize\t\t800\n"
1146 "FileCost\t\t900\n"
1147 "CostFinalize\t\t1000\n"
1148 "InstallValidate\t\t1400\n"
1149 "InstallInitialize\t\t1500\n"
1150 "ProcessComponents\t\t1600\n"
1151 "RemoveFiles\t\t1700\n"
1152 "InstallFiles\t\t2000\n"
1153 "RegisterProduct\t\t5000\n"
1154 "PublishFeatures\t\t5100\n"
1155 "PublishProduct\t\t5200\n"
1156 "InstallFinalize\t\t6000\n";
1158 static const char riv_file_dat[] =
1159 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1160 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1161 "File\tFile\n"
1162 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1164 static const char riv_feature_dat[] =
1165 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1166 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1167 "Feature\tFeature\n"
1168 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1170 static const char riv_feature_comp_dat[] =
1171 "Feature_\tComponent_\n"
1172 "s38\ts72\n"
1173 "FeatureComponents\tFeature_\tComponent_\n"
1174 "inifile\tinifile\n";
1176 static const char riv_component_dat[] =
1177 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1178 "s72\tS38\ts72\ti2\tS255\tS72\n"
1179 "Component\tComponent\n"
1180 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1182 static const char riv_ini_file_dat[] =
1183 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1184 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1185 "IniFile\tIniFile\n"
1186 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1188 static const char riv_remove_ini_file_dat[] =
1189 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1190 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1191 "RemoveIniFile\tRemoveIniFile\n"
1192 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1194 static const char riv_install_exec_seq_dat[] =
1195 "Action\tCondition\tSequence\n"
1196 "s72\tS255\tI2\n"
1197 "InstallExecuteSequence\tAction\n"
1198 "LaunchConditions\t\t100\n"
1199 "CostInitialize\t\t800\n"
1200 "FileCost\t\t900\n"
1201 "CostFinalize\t\t1000\n"
1202 "InstallValidate\t\t1400\n"
1203 "InstallInitialize\t\t1500\n"
1204 "ProcessComponents\t\t1600\n"
1205 "RemoveFiles\t\t1700\n"
1206 "InstallFiles\t\t2000\n"
1207 "RemoveIniValues\t\t3000\n"
1208 "RegisterProduct\t\t5000\n"
1209 "PublishFeatures\t\t5100\n"
1210 "PublishProduct\t\t5200\n"
1211 "InstallFinalize\t\t6000\n";
1213 static const char res_file_dat[] =
1214 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1215 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1216 "File\tFile\n"
1217 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1219 static const char res_feature_dat[] =
1220 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1221 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1222 "Feature\tFeature\n"
1223 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1225 static const char res_feature_comp_dat[] =
1226 "Feature_\tComponent_\n"
1227 "s38\ts72\n"
1228 "FeatureComponents\tFeature_\tComponent_\n"
1229 "envvar\tenvvar\n";
1231 static const char res_component_dat[] =
1232 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1233 "s72\tS38\ts72\ti2\tS255\tS72\n"
1234 "Component\tComponent\n"
1235 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1237 static const char res_environment_dat[] =
1238 "Environment\tName\tValue\tComponent_\n"
1239 "s72\tl255\tL255\ts72\n"
1240 "Environment\tEnvironment\n"
1241 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1242 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1243 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1244 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1245 "var5\t=MSITESTVAR5\t\tenvvar\n"
1246 "Var6\t-MSITESTVAR6\t1;[~]\tenvvar\n"
1247 "Var7\t-MSITESTVAR7\t[~];1\tenvvar\n"
1248 "Var8\t-MSITESTVAR8\t1;[~]\tenvvar\n"
1249 "Var9\t-MSITESTVAR9\t[~];1\tenvvar\n"
1250 "Var10\t-MSITESTVAR10\t1\tenvvar\n"
1251 "Var11\t-MSITESTVAR11\t2\tenvvar\n";
1253 static const char res_install_exec_seq_dat[] =
1254 "Action\tCondition\tSequence\n"
1255 "s72\tS255\tI2\n"
1256 "InstallExecuteSequence\tAction\n"
1257 "LaunchConditions\t\t100\n"
1258 "CostInitialize\t\t800\n"
1259 "FileCost\t\t900\n"
1260 "CostFinalize\t\t1000\n"
1261 "InstallValidate\t\t1400\n"
1262 "InstallInitialize\t\t1500\n"
1263 "ProcessComponents\t\t1600\n"
1264 "RemoveFiles\t\t1700\n"
1265 "InstallFiles\t\t2000\n"
1266 "RemoveEnvironmentStrings\t\t3000\n"
1267 "RegisterProduct\t\t5000\n"
1268 "PublishFeatures\t\t5100\n"
1269 "PublishProduct\t\t5200\n"
1270 "InstallFinalize\t\t6000\n";
1272 static const char rci_file_dat[] =
1273 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1274 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1275 "File\tFile\n"
1276 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1278 static const char rci_feature_dat[] =
1279 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1280 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1281 "Feature\tFeature\n"
1282 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1284 static const char rci_feature_comp_dat[] =
1285 "Feature_\tComponent_\n"
1286 "s38\ts72\n"
1287 "FeatureComponents\tFeature_\tComponent_\n"
1288 "class\tclass\n";
1290 static const char rci_component_dat[] =
1291 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1292 "s72\tS38\ts72\ti2\tS255\tS72\n"
1293 "Component\tComponent\n"
1294 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1296 static const char rci_appid_dat[] =
1297 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1298 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1299 "AppId\tAppId\n"
1300 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1302 static const char rci_class_dat[] =
1303 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1304 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1305 "Class\tCLSID\tContext\tComponent_\n"
1306 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1308 static const char rci_install_exec_seq_dat[] =
1309 "Action\tCondition\tSequence\n"
1310 "s72\tS255\tI2\n"
1311 "InstallExecuteSequence\tAction\n"
1312 "LaunchConditions\t\t100\n"
1313 "CostInitialize\t\t800\n"
1314 "FileCost\t\t900\n"
1315 "CostFinalize\t\t1000\n"
1316 "InstallValidate\t\t1400\n"
1317 "InstallInitialize\t\t1500\n"
1318 "ProcessComponents\t\t1600\n"
1319 "RemoveFiles\t\t1700\n"
1320 "InstallFiles\t\t2000\n"
1321 "UnregisterClassInfo\t\t3000\n"
1322 "RegisterClassInfo\t\t4000\n"
1323 "RegisterProduct\t\t5000\n"
1324 "PublishFeatures\t\t5100\n"
1325 "PublishProduct\t\t5200\n"
1326 "InstallFinalize\t\t6000\n";
1328 static const char rei_file_dat[] =
1329 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1330 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1331 "File\tFile\n"
1332 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1334 static const char rei_feature_dat[] =
1335 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1336 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1337 "Feature\tFeature\n"
1338 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1340 static const char rei_feature_comp_dat[] =
1341 "Feature_\tComponent_\n"
1342 "s38\ts72\n"
1343 "FeatureComponents\tFeature_\tComponent_\n"
1344 "extension\textension\n";
1346 static const char rei_component_dat[] =
1347 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1348 "s72\tS38\ts72\ti2\tS255\tS72\n"
1349 "Component\tComponent\n"
1350 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1352 static const char rei_extension_dat[] =
1353 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1354 "s255\ts72\tS255\tS64\ts38\n"
1355 "Extension\tExtension\tComponent_\n"
1356 "extension\textension\tProg.Id.1\t\textension\n";
1358 static const char rei_verb_dat[] =
1359 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1360 "s255\ts32\tI2\tL255\tL255\n"
1361 "Verb\tExtension_\tVerb\n"
1362 "extension\tOpen\t1\t&Open\t/argument\n";
1364 static const char rei_progid_dat[] =
1365 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1366 "s255\tS255\tS38\tL255\tS72\tI2\n"
1367 "ProgId\tProgId\n"
1368 "Prog.Id.1\t\t\tdescription\t\t\n";
1370 static const char rei_install_exec_seq_dat[] =
1371 "Action\tCondition\tSequence\n"
1372 "s72\tS255\tI2\n"
1373 "InstallExecuteSequence\tAction\n"
1374 "LaunchConditions\t\t100\n"
1375 "CostInitialize\t\t800\n"
1376 "FileCost\t\t900\n"
1377 "CostFinalize\t\t1000\n"
1378 "InstallValidate\t\t1400\n"
1379 "InstallInitialize\t\t1500\n"
1380 "ProcessComponents\t\t1600\n"
1381 "RemoveFiles\t\t1700\n"
1382 "InstallFiles\t\t2000\n"
1383 "UnregisterExtensionInfo\t\t3000\n"
1384 "RegisterExtensionInfo\t\t4000\n"
1385 "RegisterProduct\t\t5000\n"
1386 "PublishFeatures\t\t5100\n"
1387 "PublishProduct\t\t5200\n"
1388 "InstallFinalize\t\t6000\n";
1390 static const char rpi_file_dat[] =
1391 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1392 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1393 "File\tFile\n"
1394 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1396 static const char rpi_feature_dat[] =
1397 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1398 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1399 "Feature\tFeature\n"
1400 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1402 static const char rpi_feature_comp_dat[] =
1403 "Feature_\tComponent_\n"
1404 "s38\ts72\n"
1405 "FeatureComponents\tFeature_\tComponent_\n"
1406 "progid\tprogid\n";
1408 static const char rpi_component_dat[] =
1409 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1410 "s72\tS38\ts72\ti2\tS255\tS72\n"
1411 "Component\tComponent\n"
1412 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1414 static const char rpi_appid_dat[] =
1415 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1416 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1417 "AppId\tAppId\n"
1418 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1420 static const char rpi_class_dat[] =
1421 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1422 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1423 "Class\tCLSID\tContext\tComponent_\n"
1424 "{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"
1425 "{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"
1426 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1428 static const char rpi_extension_dat[] =
1429 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1430 "s255\ts72\tS255\tS64\ts38\n"
1431 "Extension\tExtension\tComponent_\n"
1432 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1434 static const char rpi_verb_dat[] =
1435 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1436 "s255\ts32\tI2\tL255\tL255\n"
1437 "Verb\tExtension_\tVerb\n"
1438 "winetest\tOpen\t1\t&Open\t/argument\n";
1440 static const char rpi_progid_dat[] =
1441 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1442 "s255\tS255\tS38\tL255\tS72\tI2\n"
1443 "ProgId\tProgId\n"
1444 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1445 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1446 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1447 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1448 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1449 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1450 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1451 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1452 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1453 "Winetest.Extension\t\t\tdescription\t\t\n";
1455 static const char rpi_install_exec_seq_dat[] =
1456 "Action\tCondition\tSequence\n"
1457 "s72\tS255\tI2\n"
1458 "InstallExecuteSequence\tAction\n"
1459 "LaunchConditions\t\t100\n"
1460 "CostInitialize\t\t800\n"
1461 "FileCost\t\t900\n"
1462 "CostFinalize\t\t1000\n"
1463 "InstallValidate\t\t1400\n"
1464 "InstallInitialize\t\t1500\n"
1465 "ProcessComponents\t\t1600\n"
1466 "RemoveFiles\t\t1700\n"
1467 "UnregisterClassInfo\t\t3000\n"
1468 "UnregisterExtensionInfo\t\t3200\n"
1469 "UnregisterProgIdInfo\t\t3400\n"
1470 "InstallFiles\t\t3600\n"
1471 "RegisterClassInfo\t\t4000\n"
1472 "RegisterExtensionInfo\t\t4200\n"
1473 "RegisterProgIdInfo\t\t4400\n"
1474 "RegisterProduct\t\t5000\n"
1475 "PublishFeatures\t\t5100\n"
1476 "PublishProduct\t\t5200\n"
1477 "InstallFinalize\t\t6000\n";
1479 static const char rmi_file_dat[] =
1480 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1481 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1482 "File\tFile\n"
1483 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1485 static const char rmi_feature_dat[] =
1486 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1487 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1488 "Feature\tFeature\n"
1489 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1491 static const char rmi_feature_comp_dat[] =
1492 "Feature_\tComponent_\n"
1493 "s38\ts72\n"
1494 "FeatureComponents\tFeature_\tComponent_\n"
1495 "mime\tmime\n";
1497 static const char rmi_component_dat[] =
1498 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1499 "s72\tS38\ts72\ti2\tS255\tS72\n"
1500 "Component\tComponent\n"
1501 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1503 static const char rmi_extension_dat[] =
1504 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1505 "s255\ts72\tS255\tS64\ts38\n"
1506 "Extension\tExtension\tComponent_\n"
1507 "mime\tmime\t\tmime/type\tmime\n";
1509 static const char rmi_verb_dat[] =
1510 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1511 "s255\ts32\tI2\tL255\tL255\n"
1512 "Verb\tExtension_\tVerb\n"
1513 "mime\tOpen\t1\t&Open\t/argument\n";
1515 static const char rmi_mime_dat[] =
1516 "ContentType\tExtension_\tCLSID\n"
1517 "s64\ts255\tS38\n"
1518 "MIME\tContentType\n"
1519 "mime/type\tmime\t\n";
1521 static const char rmi_install_exec_seq_dat[] =
1522 "Action\tCondition\tSequence\n"
1523 "s72\tS255\tI2\n"
1524 "InstallExecuteSequence\tAction\n"
1525 "LaunchConditions\t\t100\n"
1526 "CostInitialize\t\t800\n"
1527 "FileCost\t\t900\n"
1528 "CostFinalize\t\t1000\n"
1529 "InstallValidate\t\t1400\n"
1530 "InstallInitialize\t\t1500\n"
1531 "ProcessComponents\t\t1600\n"
1532 "RemoveFiles\t\t1700\n"
1533 "InstallFiles\t\t2000\n"
1534 "UnregisterExtensionInfo\t\t3000\n"
1535 "UnregisterMIMEInfo\t\t3500\n"
1536 "RegisterExtensionInfo\t\t4000\n"
1537 "RegisterMIMEInfo\t\t4500\n"
1538 "RegisterProduct\t\t5000\n"
1539 "PublishFeatures\t\t5100\n"
1540 "PublishProduct\t\t5200\n"
1541 "InstallFinalize\t\t6000\n";
1543 static const char pa_file_dat[] =
1544 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1545 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1546 "File\tFile\n"
1547 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1548 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1549 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1550 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1551 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1552 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1553 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1554 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1556 static const char pa_feature_dat[] =
1557 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1558 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1559 "Feature\tFeature\n"
1560 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1562 static const char pa_feature_comp_dat[] =
1563 "Feature_\tComponent_\n"
1564 "s38\ts72\n"
1565 "FeatureComponents\tFeature_\tComponent_\n"
1566 "assembly\twin32\n"
1567 "assembly\twin32_local\n"
1568 "assembly\tdotnet\n"
1569 "assembly\tdotnet_local\n";
1571 static const char pa_component_dat[] =
1572 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1573 "s72\tS38\ts72\ti2\tS255\tS72\n"
1574 "Component\tComponent\n"
1575 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1576 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1577 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1578 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1580 static const char pa_msi_assembly_dat[] =
1581 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1582 "s72\ts38\tS72\tS72\tI2\n"
1583 "MsiAssembly\tComponent_\n"
1584 "win32\tassembly\tmanifest.txt\t\t1\n"
1585 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1586 "dotnet\tassembly\t\t\t0\n"
1587 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1589 static const char pa_msi_assembly_name_dat[] =
1590 "Component_\tName\tValue\n"
1591 "s72\ts255\ts255\n"
1592 "MsiAssemblyName\tComponent_\tName\n"
1593 "win32\tName\tWine.Win32.Assembly\n"
1594 "win32\tprocessorArchitecture\tx86\n"
1595 "win32\tpublicKeyToken\tabcdef0123456789\n"
1596 "win32\ttype\twin32\n"
1597 "win32\tversion\t1.0.0.0\n"
1598 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1599 "win32_local\tprocessorArchitecture\tx86\n"
1600 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1601 "win32_local\ttype\twin32\n"
1602 "win32_local\tversion\t1.0.0.0\n"
1603 "dotnet\tName\tWine.Dotnet.Assembly\n"
1604 "dotnet\tprocessorArchitecture\tMSIL\n"
1605 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1606 "dotnet\tculture\tneutral\n"
1607 "dotnet\tversion\t1.0.0.0\n"
1608 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1609 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1610 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1611 "dotnet_local\tculture\tneutral\n"
1612 "dotnet_local\tversion\t1.0.0.0\n";
1614 static const char pa_install_exec_seq_dat[] =
1615 "Action\tCondition\tSequence\n"
1616 "s72\tS255\tI2\n"
1617 "InstallExecuteSequence\tAction\n"
1618 "LaunchConditions\t\t100\n"
1619 "CostInitialize\t\t800\n"
1620 "FileCost\t\t900\n"
1621 "CostFinalize\t\t1000\n"
1622 "InstallValidate\t\t1400\n"
1623 "InstallInitialize\t\t1500\n"
1624 "ProcessComponents\t\t1600\n"
1625 "MsiPublishAssemblies\t\t3000\n"
1626 "MsiUnpublishAssemblies\t\t4000\n"
1627 "RegisterProduct\t\t5000\n"
1628 "PublishFeatures\t\t5100\n"
1629 "PublishProduct\t\t5200\n"
1630 "InstallFinalize\t\t6000\n";
1632 static const char rep_file_dat[] =
1633 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1634 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1635 "File\tFile\n"
1636 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1638 static const char rep_feature_dat[] =
1639 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1640 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1641 "Feature\tFeature\n"
1642 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1644 static const char rep_feature_comp_dat[] =
1645 "Feature_\tComponent_\n"
1646 "s38\ts72\n"
1647 "FeatureComponents\tFeature_\tComponent_\n"
1648 "rep\trep\n";
1650 static const char rep_component_dat[] =
1651 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1652 "s72\tS38\ts72\ti2\tS255\tS72\n"
1653 "Component\tComponent\n"
1654 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1656 static const char rep_upgrade_dat[] =
1657 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1658 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1659 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1660 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1662 static const char rep_property_dat[] =
1663 "Property\tValue\n"
1664 "s72\tl0\n"
1665 "Property\tProperty\n"
1666 "HASUIRUN\t0\n"
1667 "INSTALLLEVEL\t3\n"
1668 "InstallMode\tTypical\n"
1669 "Manufacturer\tWine\n"
1670 "PIDTemplate\t###-#######\n"
1671 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1672 "ProductLanguage\t1033\n"
1673 "ProductName\tMSITEST\n"
1674 "ProductVersion\t1.1.1\n"
1675 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1676 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1677 "MSIFASTINSTALL\t1\n";
1679 static const char rep_install_exec_seq_dat[] =
1680 "Action\tCondition\tSequence\n"
1681 "s72\tS255\tI2\n"
1682 "InstallExecuteSequence\tAction\n"
1683 "FindRelatedProducts\t\t100\n"
1684 "CostInitialize\t\t800\n"
1685 "FileCost\t\t900\n"
1686 "CostFinalize\t\t1000\n"
1687 "InstallValidate\t\t1400\n"
1688 "RemoveExistingProducts\t\t1499\n"
1689 "InstallInitialize\t\t1500\n"
1690 "ProcessComponents\t\t1600\n"
1691 "RemoveFiles\t\t1700\n"
1692 "InstallFiles\t\t2000\n"
1693 "UnregisterExtensionInfo\t\t3000\n"
1694 "UnregisterMIMEInfo\t\t3500\n"
1695 "RegisterExtensionInfo\t\t4000\n"
1696 "RegisterMIMEInfo\t\t4500\n"
1697 "RegisterProduct\t\t5000\n"
1698 "PublishFeatures\t\t5100\n"
1699 "PublishProduct\t\t5200\n"
1700 "InstallFinalize\t\t6000\n";
1702 static const msi_table env_tables[] =
1704 ADD_TABLE(component),
1705 ADD_TABLE(directory),
1706 ADD_TABLE(feature),
1707 ADD_TABLE(feature_comp),
1708 ADD_TABLE(file),
1709 ADD_TABLE(install_exec_seq),
1710 ADD_TABLE(media),
1711 ADD_TABLE(property),
1712 ADD_TABLE(environment)
1715 static const msi_table pp_tables[] =
1717 ADD_TABLE(pp_component),
1718 ADD_TABLE(directory),
1719 ADD_TABLE(rof_feature),
1720 ADD_TABLE(rof_feature_comp),
1721 ADD_TABLE(rof_file),
1722 ADD_TABLE(pp_install_exec_seq),
1723 ADD_TABLE(rof_media),
1724 ADD_TABLE(property),
1727 static const msi_table ppc_tables[] =
1729 ADD_TABLE(ppc_component),
1730 ADD_TABLE(directory),
1731 ADD_TABLE(rof_feature),
1732 ADD_TABLE(ppc_feature_comp),
1733 ADD_TABLE(ppc_file),
1734 ADD_TABLE(pp_install_exec_seq),
1735 ADD_TABLE(ppc_media),
1736 ADD_TABLE(property),
1739 static const msi_table rem_tables[] =
1741 ADD_TABLE(rem_component),
1742 ADD_TABLE(directory),
1743 ADD_TABLE(rof_feature),
1744 ADD_TABLE(rem_feature_comp),
1745 ADD_TABLE(rem_file),
1746 ADD_TABLE(rem_install_exec_seq),
1747 ADD_TABLE(rof_media),
1748 ADD_TABLE(property),
1749 ADD_TABLE(rem_remove_files),
1752 static const msi_table mov_tables[] =
1754 ADD_TABLE(cwd_component),
1755 ADD_TABLE(directory),
1756 ADD_TABLE(rof_feature),
1757 ADD_TABLE(ci2_feature_comp),
1758 ADD_TABLE(ci2_file),
1759 ADD_TABLE(install_exec_seq),
1760 ADD_TABLE(rof_media),
1761 ADD_TABLE(property),
1762 ADD_TABLE(mov_move_file),
1765 static const msi_table df_tables[] =
1767 ADD_TABLE(rof_component),
1768 ADD_TABLE(df_directory),
1769 ADD_TABLE(rof_feature),
1770 ADD_TABLE(rof_feature_comp),
1771 ADD_TABLE(rof_file),
1772 ADD_TABLE(install_exec_seq),
1773 ADD_TABLE(rof_media),
1774 ADD_TABLE(property),
1775 ADD_TABLE(df_duplicate_file),
1778 static const msi_table wrv_tables[] =
1780 ADD_TABLE(wrv_component),
1781 ADD_TABLE(directory),
1782 ADD_TABLE(wrv_feature),
1783 ADD_TABLE(wrv_feature_comp),
1784 ADD_TABLE(ci2_file),
1785 ADD_TABLE(install_exec_seq),
1786 ADD_TABLE(rof_media),
1787 ADD_TABLE(property),
1788 ADD_TABLE(wrv_registry),
1791 static const msi_table cf_tables[] =
1793 ADD_TABLE(cf_component),
1794 ADD_TABLE(cf_directory),
1795 ADD_TABLE(cf_feature),
1796 ADD_TABLE(cf_feature_comp),
1797 ADD_TABLE(cf_file),
1798 ADD_TABLE(cf_create_folders),
1799 ADD_TABLE(cf_install_exec_seq),
1800 ADD_TABLE(cf_custom_action),
1801 ADD_TABLE(media),
1802 ADD_TABLE(property)
1805 static const msi_table sss_tables[] =
1807 ADD_TABLE(component),
1808 ADD_TABLE(directory),
1809 ADD_TABLE(feature),
1810 ADD_TABLE(feature_comp),
1811 ADD_TABLE(file),
1812 ADD_TABLE(sss_install_exec_seq),
1813 ADD_TABLE(sss_service_control),
1814 ADD_TABLE(media),
1815 ADD_TABLE(property)
1818 static const msi_table sds_tables[] =
1820 ADD_TABLE(component),
1821 ADD_TABLE(directory),
1822 ADD_TABLE(feature),
1823 ADD_TABLE(feature_comp),
1824 ADD_TABLE(file),
1825 ADD_TABLE(sds_install_exec_seq),
1826 ADD_TABLE(service_control),
1827 ADD_TABLE(service_install),
1828 ADD_TABLE(media),
1829 ADD_TABLE(property)
1832 static const msi_table sis_tables[] =
1834 ADD_TABLE(component),
1835 ADD_TABLE(directory),
1836 ADD_TABLE(feature),
1837 ADD_TABLE(feature_comp),
1838 ADD_TABLE(file),
1839 ADD_TABLE(sds_install_exec_seq),
1840 ADD_TABLE(service_install2),
1841 ADD_TABLE(media),
1842 ADD_TABLE(property)
1845 static const msi_table sr_tables[] =
1847 ADD_TABLE(component),
1848 ADD_TABLE(directory),
1849 ADD_TABLE(feature),
1850 ADD_TABLE(feature_comp),
1851 ADD_TABLE(file),
1852 ADD_TABLE(sr_selfreg),
1853 ADD_TABLE(sr_install_exec_seq),
1854 ADD_TABLE(media),
1855 ADD_TABLE(property)
1858 static const msi_table font_tables[] =
1860 ADD_TABLE(font_component),
1861 ADD_TABLE(directory),
1862 ADD_TABLE(font_feature),
1863 ADD_TABLE(font_feature_comp),
1864 ADD_TABLE(font_file),
1865 ADD_TABLE(font),
1866 ADD_TABLE(font_install_exec_seq),
1867 ADD_TABLE(font_media),
1868 ADD_TABLE(property)
1871 static const msi_table vp_tables[] =
1873 ADD_TABLE(component),
1874 ADD_TABLE(directory),
1875 ADD_TABLE(feature),
1876 ADD_TABLE(feature_comp),
1877 ADD_TABLE(file),
1878 ADD_TABLE(vp_custom_action),
1879 ADD_TABLE(vp_install_exec_seq),
1880 ADD_TABLE(media),
1881 ADD_TABLE(vp_property)
1884 static const msi_table odbc_tables[] =
1886 ADD_TABLE(odbc_component),
1887 ADD_TABLE(directory),
1888 ADD_TABLE(odbc_feature),
1889 ADD_TABLE(odbc_feature_comp),
1890 ADD_TABLE(odbc_file),
1891 ADD_TABLE(odbc_driver),
1892 ADD_TABLE(odbc_translator),
1893 ADD_TABLE(odbc_datasource),
1894 ADD_TABLE(odbc_install_exec_seq),
1895 ADD_TABLE(odbc_media),
1896 ADD_TABLE(property)
1899 static const msi_table tl_tables[] =
1901 ADD_TABLE(tl_component),
1902 ADD_TABLE(directory),
1903 ADD_TABLE(tl_feature),
1904 ADD_TABLE(tl_feature_comp),
1905 ADD_TABLE(tl_file),
1906 ADD_TABLE(tl_typelib),
1907 ADD_TABLE(tl_install_exec_seq),
1908 ADD_TABLE(media),
1909 ADD_TABLE(property)
1912 static const msi_table crs_tables[] =
1914 ADD_TABLE(crs_component),
1915 ADD_TABLE(directory),
1916 ADD_TABLE(crs_feature),
1917 ADD_TABLE(crs_feature_comp),
1918 ADD_TABLE(crs_file),
1919 ADD_TABLE(crs_shortcut),
1920 ADD_TABLE(crs_install_exec_seq),
1921 ADD_TABLE(crs_custom_action),
1922 ADD_TABLE(media),
1923 ADD_TABLE(property)
1926 static const msi_table pub_tables[] =
1928 ADD_TABLE(directory),
1929 ADD_TABLE(pub_component),
1930 ADD_TABLE(pub_feature),
1931 ADD_TABLE(pub_feature_comp),
1932 ADD_TABLE(pub_file),
1933 ADD_TABLE(pub_publish_component),
1934 ADD_TABLE(pub_install_exec_seq),
1935 ADD_TABLE(media),
1936 ADD_TABLE(property)
1939 static const msi_table rd_tables[] =
1941 ADD_TABLE(directory),
1942 ADD_TABLE(rd_component),
1943 ADD_TABLE(rd_feature),
1944 ADD_TABLE(rd_feature_comp),
1945 ADD_TABLE(rd_file),
1946 ADD_TABLE(rd_duplicate_file),
1947 ADD_TABLE(rd_install_exec_seq),
1948 ADD_TABLE(media),
1949 ADD_TABLE(property)
1952 static const msi_table rrv_tables[] =
1954 ADD_TABLE(directory),
1955 ADD_TABLE(rrv_component),
1956 ADD_TABLE(rrv_feature),
1957 ADD_TABLE(rrv_feature_comp),
1958 ADD_TABLE(rrv_file),
1959 ADD_TABLE(rrv_registry),
1960 ADD_TABLE(rrv_remove_registry),
1961 ADD_TABLE(rrv_install_exec_seq),
1962 ADD_TABLE(media),
1963 ADD_TABLE(property)
1966 static const msi_table frp_tables[] =
1968 ADD_TABLE(directory),
1969 ADD_TABLE(frp_component),
1970 ADD_TABLE(frp_feature),
1971 ADD_TABLE(frp_feature_comp),
1972 ADD_TABLE(frp_file),
1973 ADD_TABLE(frp_upgrade),
1974 ADD_TABLE(frp_custom_action),
1975 ADD_TABLE(frp_install_exec_seq),
1976 ADD_TABLE(media),
1977 ADD_TABLE(property)
1980 static const msi_table riv_tables[] =
1982 ADD_TABLE(directory),
1983 ADD_TABLE(riv_component),
1984 ADD_TABLE(riv_feature),
1985 ADD_TABLE(riv_feature_comp),
1986 ADD_TABLE(riv_file),
1987 ADD_TABLE(riv_ini_file),
1988 ADD_TABLE(riv_remove_ini_file),
1989 ADD_TABLE(riv_install_exec_seq),
1990 ADD_TABLE(media),
1991 ADD_TABLE(property)
1994 static const msi_table res_tables[] =
1996 ADD_TABLE(directory),
1997 ADD_TABLE(res_component),
1998 ADD_TABLE(res_feature),
1999 ADD_TABLE(res_feature_comp),
2000 ADD_TABLE(res_file),
2001 ADD_TABLE(res_environment),
2002 ADD_TABLE(res_install_exec_seq),
2003 ADD_TABLE(media),
2004 ADD_TABLE(property)
2007 static const msi_table rci_tables[] =
2009 ADD_TABLE(directory),
2010 ADD_TABLE(rci_component),
2011 ADD_TABLE(rci_feature),
2012 ADD_TABLE(rci_feature_comp),
2013 ADD_TABLE(rci_file),
2014 ADD_TABLE(rci_appid),
2015 ADD_TABLE(rci_class),
2016 ADD_TABLE(rci_install_exec_seq),
2017 ADD_TABLE(media),
2018 ADD_TABLE(property)
2021 static const msi_table rei_tables[] =
2023 ADD_TABLE(directory),
2024 ADD_TABLE(rei_component),
2025 ADD_TABLE(rei_feature),
2026 ADD_TABLE(rei_feature_comp),
2027 ADD_TABLE(rei_file),
2028 ADD_TABLE(rei_extension),
2029 ADD_TABLE(rei_verb),
2030 ADD_TABLE(rei_progid),
2031 ADD_TABLE(rei_install_exec_seq),
2032 ADD_TABLE(media),
2033 ADD_TABLE(property)
2036 static const msi_table rpi_tables[] =
2038 ADD_TABLE(directory),
2039 ADD_TABLE(rpi_component),
2040 ADD_TABLE(rpi_feature),
2041 ADD_TABLE(rpi_feature_comp),
2042 ADD_TABLE(rpi_file),
2043 ADD_TABLE(rpi_appid),
2044 ADD_TABLE(rpi_class),
2045 ADD_TABLE(rpi_extension),
2046 ADD_TABLE(rpi_verb),
2047 ADD_TABLE(rpi_progid),
2048 ADD_TABLE(rpi_install_exec_seq),
2049 ADD_TABLE(media),
2050 ADD_TABLE(property)
2053 static const msi_table rmi_tables[] =
2055 ADD_TABLE(directory),
2056 ADD_TABLE(rmi_component),
2057 ADD_TABLE(rmi_feature),
2058 ADD_TABLE(rmi_feature_comp),
2059 ADD_TABLE(rmi_file),
2060 ADD_TABLE(rmi_extension),
2061 ADD_TABLE(rmi_verb),
2062 ADD_TABLE(rmi_mime),
2063 ADD_TABLE(rmi_install_exec_seq),
2064 ADD_TABLE(media),
2065 ADD_TABLE(property)
2068 static const msi_table pa_tables[] =
2070 ADD_TABLE(directory),
2071 ADD_TABLE(pa_component),
2072 ADD_TABLE(pa_feature),
2073 ADD_TABLE(pa_feature_comp),
2074 ADD_TABLE(pa_file),
2075 ADD_TABLE(pa_msi_assembly),
2076 ADD_TABLE(pa_msi_assembly_name),
2077 ADD_TABLE(pa_install_exec_seq),
2078 ADD_TABLE(media),
2079 ADD_TABLE(property)
2082 static const msi_table rep_tables[] =
2084 ADD_TABLE(directory),
2085 ADD_TABLE(rep_component),
2086 ADD_TABLE(rep_feature),
2087 ADD_TABLE(rep_feature_comp),
2088 ADD_TABLE(rep_file),
2089 ADD_TABLE(rep_upgrade),
2090 ADD_TABLE(rep_property),
2091 ADD_TABLE(rep_install_exec_seq),
2092 ADD_TABLE(media)
2095 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2096 static LSTATUS action_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey, REGSAM access)
2098 LONG ret;
2099 DWORD dwMaxSubkeyLen, dwMaxValueLen;
2100 DWORD dwMaxLen, dwSize;
2101 char szNameBuf[MAX_PATH], *lpszName = szNameBuf;
2102 HKEY hSubKey = hKey;
2104 if(lpszSubKey)
2106 ret = RegOpenKeyExA(hKey, lpszSubKey, 0, access, &hSubKey);
2107 if (ret) return ret;
2110 ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
2111 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
2112 if (ret) goto cleanup;
2114 dwMaxSubkeyLen++;
2115 dwMaxValueLen++;
2116 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
2117 if (dwMaxLen > sizeof(szNameBuf))
2119 /* Name too big: alloc a buffer for it */
2120 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen)))
2122 ret = ERROR_NOT_ENOUGH_MEMORY;
2123 goto cleanup;
2127 /* Recursively delete all the subkeys */
2128 while (TRUE)
2130 dwSize = dwMaxLen;
2131 if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
2132 NULL, NULL, NULL)) break;
2134 ret = action_RegDeleteTreeA(hSubKey, lpszName, access);
2135 if (ret) goto cleanup;
2138 if (lpszSubKey)
2140 if (pRegDeleteKeyExA)
2141 ret = pRegDeleteKeyExA(hKey, lpszSubKey, access, 0);
2142 else
2143 ret = RegDeleteKeyA(hKey, lpszSubKey);
2145 else
2146 while (TRUE)
2148 dwSize = dwMaxLen;
2149 if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
2150 NULL, NULL, NULL, NULL)) break;
2152 ret = RegDeleteValueA(hKey, lpszName);
2153 if (ret) goto cleanup;
2156 cleanup:
2157 if (lpszName != szNameBuf)
2158 HeapFree(GetProcessHeap(), 0, lpszName);
2159 if(lpszSubKey)
2160 RegCloseKey(hSubKey);
2161 return ret;
2164 /* cabinet definitions */
2166 /* make the max size large so there is only one cab file */
2167 #define MEDIA_SIZE 0x7FFFFFFF
2169 static void init_functionpointers(void)
2171 HMODULE hmsi = GetModuleHandleA("msi.dll");
2172 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2173 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2175 #define GET_PROC(mod, func) \
2176 p ## func = (void*)GetProcAddress(mod, #func); \
2177 if(!p ## func) \
2178 trace("GetProcAddress(%s) failed\n", #func);
2180 GET_PROC(hmsi, MsiQueryComponentStateA);
2181 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
2182 GET_PROC(hmsi, MsiSourceListGetInfoA);
2183 GET_PROC(hmsi, MsiGetComponentPathExA);
2184 GET_PROC(hmsi, MsiQueryFeatureStateExA);
2186 GET_PROC(hadvapi32, ConvertSidToStringSidA);
2187 GET_PROC(hadvapi32, RegDeleteKeyExA)
2188 GET_PROC(hkernel32, IsWow64Process)
2190 hsrclient = LoadLibraryA("srclient.dll");
2191 GET_PROC(hsrclient, SRRemoveRestorePoint);
2192 GET_PROC(hsrclient, SRSetRestorePointA);
2194 #undef GET_PROC
2197 static char *get_user_sid(void)
2199 HANDLE token;
2200 DWORD size = 0;
2201 TOKEN_USER *user;
2202 char *usersid = NULL;
2204 if (!pConvertSidToStringSidA)
2206 win_skip("ConvertSidToStringSidA is not available\n");
2207 return NULL;
2209 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
2210 GetTokenInformation(token, TokenUser, NULL, size, &size);
2212 user = HeapAlloc(GetProcessHeap(), 0, size);
2213 GetTokenInformation(token, TokenUser, user, size, &size);
2214 pConvertSidToStringSidA(user->User.Sid, &usersid);
2215 HeapFree(GetProcessHeap(), 0, user);
2217 CloseHandle(token);
2218 return usersid;
2221 static void create_test_files(void)
2223 CreateDirectoryA("msitest", NULL);
2224 create_file("msitest\\one.txt", 100);
2225 CreateDirectoryA("msitest\\first", NULL);
2226 create_file("msitest\\first\\two.txt", 100);
2227 CreateDirectoryA("msitest\\second", NULL);
2228 create_file("msitest\\second\\three.txt", 100);
2230 create_file("four.txt", 100);
2231 create_file("five.txt", 100);
2232 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2234 create_file("msitest\\filename", 100);
2235 create_file("msitest\\service.exe", 100);
2236 create_file("msitest\\service2.exe", 100);
2238 DeleteFileA("four.txt");
2239 DeleteFileA("five.txt");
2242 static void delete_test_files(void)
2244 DeleteFileA("msitest.msi");
2245 DeleteFileA("msitest.cab");
2246 DeleteFileA("msitest\\second\\three.txt");
2247 DeleteFileA("msitest\\first\\two.txt");
2248 DeleteFileA("msitest\\one.txt");
2249 DeleteFileA("msitest\\service.exe");
2250 DeleteFileA("msitest\\service2.exe");
2251 DeleteFileA("msitest\\filename");
2252 RemoveDirectoryA("msitest\\second");
2253 RemoveDirectoryA("msitest\\first");
2254 RemoveDirectoryA("msitest");
2257 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
2259 RESTOREPOINTINFOA spec;
2261 spec.dwEventType = event_type;
2262 spec.dwRestorePtType = APPLICATION_INSTALL;
2263 spec.llSequenceNumber = status->llSequenceNumber;
2264 lstrcpyA(spec.szDescription, "msitest restore point");
2266 return pSRSetRestorePointA(&spec, status);
2269 static void remove_restore_point(DWORD seq_number)
2271 DWORD res;
2273 res = pSRRemoveRestorePoint(seq_number);
2274 if (res != ERROR_SUCCESS)
2275 trace("Failed to remove the restore point : %08x\n", res);
2278 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
2280 if (pRegDeleteKeyExA)
2281 return pRegDeleteKeyExA( key, subkey, access, 0 );
2282 return RegDeleteKeyA( key, subkey );
2285 static void delete_pfmsitest_files(void)
2287 SHFILEOPSTRUCTA shfl;
2288 CHAR path[MAX_PATH+11];
2290 lstrcpyA(path, PROG_FILES_DIR);
2291 lstrcatA(path, "\\msitest\\*");
2292 path[strlen(path) + 1] = '\0';
2294 shfl.hwnd = NULL;
2295 shfl.wFunc = FO_DELETE;
2296 shfl.pFrom = path;
2297 shfl.pTo = NULL;
2298 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
2300 SHFileOperationA(&shfl);
2302 lstrcpyA(path, PROG_FILES_DIR);
2303 lstrcatA(path, "\\msitest");
2304 RemoveDirectoryA(path);
2307 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, DWORD line)
2309 char val[MAX_PATH];
2310 DWORD size, type;
2311 LONG res;
2313 size = MAX_PATH;
2314 val[0] = '\0';
2315 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)val, &size);
2317 if (res != ERROR_SUCCESS ||
2318 (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_MULTI_SZ))
2320 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2321 return;
2324 if (!expected)
2325 ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val);
2326 else
2328 if (bcase)
2329 ok_(__FILE__, line)(!lstrcmpA(val, expected), "Expected %s, got %s\n", expected, val);
2330 else
2331 ok_(__FILE__, line)(!lstrcmpiA(val, expected), "Expected %s, got %s\n", expected, val);
2335 static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line)
2337 DWORD val, size, type;
2338 LONG res;
2340 size = sizeof(DWORD);
2341 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2343 if (res != ERROR_SUCCESS || type != REG_DWORD)
2345 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2346 return;
2349 ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val);
2352 #define CHECK_REG_STR(prodkey, name, expected) \
2353 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2355 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2356 do { \
2357 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2358 RegDeleteValueA(prodkey, name); \
2359 } while(0)
2361 #define CHECK_REG_ISTR(prodkey, name, expected) \
2362 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2364 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2365 do { \
2366 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2367 RegDeleteValueA(prodkey, name); \
2368 } while(0)
2370 #define CHECK_REG_DWORD(prodkey, name, expected) \
2371 check_reg_dword(prodkey, name, expected, __LINE__);
2373 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2374 do { \
2375 check_reg_dword(prodkey, name, expected, __LINE__); \
2376 RegDeleteValueA(prodkey, name); \
2377 } while(0)
2379 static void get_date_str(LPSTR date)
2381 SYSTEMTIME systime;
2383 static const char date_fmt[] = "%d%02d%02d";
2384 GetLocalTime(&systime);
2385 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
2388 /* EstimatedSize is the size in KiB of .msi + installed files, rounded up to page size. */
2389 static DWORD get_estimated_size(void)
2391 SYSTEM_INFO si;
2392 HANDLE file;
2393 DWORD size;
2395 GetSystemInfo(&si);
2397 file = CreateFileA(msifile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
2398 size = ((GetFileSize(file, NULL) + si.dwPageSize - 1) / si.dwPageSize + 1);
2399 size = size * si.dwPageSize / 1024;
2400 CloseHandle(file);
2401 return size;
2404 static void test_register_product(void)
2406 UINT r;
2407 LONG res;
2408 HKEY hkey, props, usage;
2409 LPSTR usersid;
2410 char date[MAX_PATH], temp[MAX_PATH], keypath[MAX_PATH], path[MAX_PATH];
2411 DWORD size, type;
2412 REGSAM access = KEY_ALL_ACCESS;
2414 static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2415 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2416 static const CHAR uninstall_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2417 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2418 static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2419 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2420 static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2421 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2422 static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2423 "\\51AAE0C44620A5E4788506E91F249BD2";
2425 if (is_process_limited())
2427 skip("process is limited\n");
2428 return;
2431 if (!(usersid = get_user_sid()))
2432 return;
2434 get_date_str(date);
2435 GetTempPathA(MAX_PATH, temp);
2437 CreateDirectoryA("msitest", NULL);
2438 create_file("msitest\\maximus", 500);
2440 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2442 if (is_wow64)
2443 access |= KEY_WOW64_64KEY;
2445 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2447 /* RegisterProduct */
2448 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
2449 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2451 skip("Not enough rights to perform tests\n");
2452 goto error;
2454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2455 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2456 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2458 res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
2459 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2461 if (is_64bit)
2463 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
2464 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2466 else
2468 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
2469 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2472 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2473 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2474 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2475 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2476 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2477 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2478 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2479 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2480 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2481 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2482 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2483 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2484 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2485 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2486 CHECK_DEL_REG_STR(hkey, "Size", NULL);
2487 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2488 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2489 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2490 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2491 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2492 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2493 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2494 todo_wine
2495 CHECK_DEL_REG_DWORD(hkey, "EstimatedSize", get_estimated_size());
2497 delete_key(hkey, "", access);
2498 RegCloseKey(hkey);
2500 sprintf(keypath, userdata, usersid);
2501 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2502 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2504 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2505 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2507 size = sizeof(path);
2508 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2509 DeleteFileA(path);
2510 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2512 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2513 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2514 CHECK_DEL_REG_STR(props, "InstallDate", date);
2515 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2516 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2517 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2518 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2519 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
2520 CHECK_DEL_REG_STR(props, "Comments", NULL);
2521 CHECK_DEL_REG_STR(props, "Contact", NULL);
2522 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
2523 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
2524 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
2525 CHECK_DEL_REG_STR(props, "Readme", NULL);
2526 CHECK_DEL_REG_STR(props, "Size", NULL);
2527 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
2528 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
2529 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2530 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2531 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2532 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2533 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2534 todo_wine
2535 CHECK_DEL_REG_DWORD(props, "EstimatedSize", get_estimated_size());
2537 delete_key(props, "", access);
2538 RegCloseKey(props);
2540 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
2541 todo_wine
2543 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2546 delete_key(usage, "", access);
2547 RegCloseKey(usage);
2548 delete_key(hkey, "", access);
2549 RegCloseKey(hkey);
2551 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
2552 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2554 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2556 delete_key(hkey, "", access);
2557 RegCloseKey(hkey);
2559 /* RegisterProduct, machine */
2560 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1");
2561 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2562 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2563 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2565 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, access, &hkey);
2566 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2568 if (is_64bit)
2570 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
2571 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2573 else
2575 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
2576 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2579 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2580 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2581 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2582 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2583 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2584 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2585 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2586 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2587 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2588 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2589 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2590 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2591 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2592 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2593 CHECK_DEL_REG_STR(hkey, "Size", NULL);
2594 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2595 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2596 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2597 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2598 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2599 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2600 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2601 todo_wine
2602 CHECK_DEL_REG_DWORD(hkey, "EstimatedSize", get_estimated_size());
2604 delete_key(hkey, "", access);
2605 RegCloseKey(hkey);
2607 sprintf(keypath, userdata, "S-1-5-18");
2608 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2609 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2611 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2612 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2614 size = sizeof(path);
2615 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2616 DeleteFileA(path);
2617 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2619 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2620 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2621 CHECK_DEL_REG_STR(props, "InstallDate", date);
2622 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2623 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2624 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2625 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2626 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
2627 CHECK_DEL_REG_STR(props, "Comments", NULL);
2628 CHECK_DEL_REG_STR(props, "Contact", NULL);
2629 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
2630 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
2631 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
2632 CHECK_DEL_REG_STR(props, "Readme", NULL);
2633 CHECK_DEL_REG_STR(props, "Size", NULL);
2634 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
2635 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
2636 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2637 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2638 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2639 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2640 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2641 todo_wine
2642 CHECK_DEL_REG_DWORD(props, "EstimatedSize", get_estimated_size());
2644 delete_key(props, "", access);
2645 RegCloseKey(props);
2647 res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
2648 todo_wine
2650 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2653 delete_key(usage, "", access);
2654 RegCloseKey(usage);
2655 delete_key(hkey, "", access);
2656 RegCloseKey(hkey);
2658 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
2659 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2661 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2663 delete_key(hkey, "", access);
2664 RegCloseKey(hkey);
2666 error:
2667 DeleteFileA(msifile);
2668 DeleteFileA("msitest\\maximus");
2669 RemoveDirectoryA("msitest");
2670 HeapFree(GetProcessHeap(), 0, usersid);
2673 static void test_publish_product(void)
2675 static const char prodpath[] =
2676 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
2677 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2678 static const char cuprodpath[] =
2679 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2680 static const char cuupgrades[] =
2681 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2682 static const char badprod[] =
2683 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
2684 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2685 static const char machprod[] =
2686 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2687 static const char machup[] =
2688 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2689 UINT r;
2690 LONG res;
2691 LPSTR usersid;
2692 HKEY sourcelist, net, props;
2693 HKEY hkey, patches, media;
2694 CHAR keypath[MAX_PATH];
2695 CHAR temp[MAX_PATH];
2696 CHAR path[MAX_PATH];
2697 BOOL old_installer = FALSE;
2698 REGSAM access = KEY_ALL_ACCESS;
2700 if (is_process_limited())
2702 skip("process is limited\n");
2703 return;
2706 if (!(usersid = get_user_sid()))
2707 return;
2709 GetTempPathA(MAX_PATH, temp);
2711 CreateDirectoryA("msitest", NULL);
2712 create_file("msitest\\maximus", 500);
2714 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2716 if (is_wow64)
2717 access |= KEY_WOW64_64KEY;
2719 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2721 /* PublishProduct, current user */
2722 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
2723 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2725 skip("Not enough rights to perform tests\n");
2726 goto error;
2728 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2729 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2730 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2732 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
2733 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2735 sprintf(keypath, prodpath, usersid);
2736 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2737 if (res == ERROR_FILE_NOT_FOUND)
2739 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
2740 if (res == ERROR_SUCCESS)
2742 win_skip("Windows Installer < 3.0 detected\n");
2743 RegCloseKey(hkey);
2744 old_installer = TRUE;
2745 goto currentuser;
2747 else
2749 win_skip("Install failed, no need to continue\n");
2750 return;
2753 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2755 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2756 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2758 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
2759 todo_wine
2761 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2762 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
2765 delete_key(patches, "", access);
2766 RegCloseKey(patches);
2767 delete_key(hkey, "", access);
2768 RegCloseKey(hkey);
2770 currentuser:
2771 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
2772 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2774 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
2775 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
2776 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2777 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2778 if (!old_installer)
2779 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
2780 CHECK_DEL_REG_DWORD(hkey, "Assignment", 0);
2781 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
2782 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
2783 CHECK_DEL_REG_STR(hkey, "Clients", ":");
2785 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
2786 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2788 lstrcpyA(path, "n;1;");
2789 lstrcatA(path, temp);
2790 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
2791 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
2793 res = RegOpenKeyA(sourcelist, "Net", &net);
2794 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2796 CHECK_DEL_REG_STR(net, "1", temp);
2798 RegDeleteKeyA(net, "");
2799 RegCloseKey(net);
2801 res = RegOpenKeyA(sourcelist, "Media", &media);
2802 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2804 CHECK_DEL_REG_STR(media, "1", "DISK1;");
2806 RegDeleteKeyA(media, "");
2807 RegCloseKey(media);
2808 RegDeleteKeyA(sourcelist, "");
2809 RegCloseKey(sourcelist);
2810 RegDeleteKeyA(hkey, "");
2811 RegCloseKey(hkey);
2813 res = RegOpenKeyA(HKEY_CURRENT_USER, cuupgrades, &hkey);
2814 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2816 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2818 RegDeleteKeyA(hkey, "");
2819 RegCloseKey(hkey);
2821 /* PublishProduct, machine */
2822 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
2823 if (old_installer)
2824 goto machprod;
2825 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2826 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2827 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2829 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
2830 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2832 sprintf(keypath, prodpath, "S-1-5-18");
2833 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2834 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2836 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2837 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2839 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
2840 todo_wine
2842 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2843 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
2846 delete_key(patches, "", access);
2847 RegCloseKey(patches);
2848 delete_key(hkey, "", access);
2849 RegCloseKey(hkey);
2851 machprod:
2852 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machprod, 0, access, &hkey);
2853 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2855 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
2856 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
2857 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2858 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2859 if (!old_installer)
2860 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
2861 todo_wine CHECK_DEL_REG_DWORD(hkey, "Assignment", 1);
2862 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
2863 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
2864 CHECK_DEL_REG_STR(hkey, "Clients", ":");
2866 res = RegOpenKeyExA(hkey, "SourceList", 0, access, &sourcelist);
2867 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2869 lstrcpyA(path, "n;1;");
2870 lstrcatA(path, temp);
2871 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
2872 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
2874 res = RegOpenKeyExA(sourcelist, "Net", 0, access, &net);
2875 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2877 CHECK_DEL_REG_STR(net, "1", temp);
2879 res = delete_key(net, "", access);
2880 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2881 RegCloseKey(net);
2883 res = RegOpenKeyExA(sourcelist, "Media", 0, access, &media);
2884 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2886 CHECK_DEL_REG_STR(media, "1", "DISK1;");
2888 res = delete_key(media, "", access);
2889 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2890 RegCloseKey(media);
2891 res = delete_key(sourcelist, "", access);
2892 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2893 RegCloseKey(sourcelist);
2894 res = delete_key(hkey, "", access);
2895 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2896 RegCloseKey(hkey);
2898 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machup, 0, access, &hkey);
2899 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2901 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2903 res = delete_key(hkey, "", access);
2904 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2905 RegCloseKey(hkey);
2907 error:
2908 DeleteFileA(msifile);
2909 DeleteFileA("msitest\\maximus");
2910 RemoveDirectoryA("msitest");
2911 HeapFree(GetProcessHeap(), 0, usersid);
2914 static void test_publish_features(void)
2916 static const char cupath[] =
2917 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2918 static const char udfeatpath[] =
2919 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
2920 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
2921 static const char udpridpath[] =
2922 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
2923 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2924 static const char featkey[] =
2925 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
2926 static const char classfeat[] =
2927 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2928 UINT r;
2929 LONG res;
2930 HKEY hkey;
2931 LPSTR usersid;
2932 CHAR keypath[MAX_PATH];
2933 REGSAM access = KEY_ALL_ACCESS;
2935 if (is_process_limited())
2937 skip("process is limited\n");
2938 return;
2941 if (!(usersid = get_user_sid()))
2942 return;
2944 CreateDirectoryA("msitest", NULL);
2945 create_file("msitest\\maximus", 500);
2947 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2949 if (is_wow64)
2950 access |= KEY_WOW64_64KEY;
2952 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2954 /* PublishFeatures, current user */
2955 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
2956 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2958 skip("Not enough rights to perform tests\n");
2959 goto error;
2961 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2962 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2963 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2965 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
2966 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2968 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
2969 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2971 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
2972 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2974 CHECK_REG_STR(hkey, "feature", "");
2975 CHECK_REG_STR(hkey, "montecristo", "");
2977 RegDeleteValueA(hkey, "feature");
2978 RegDeleteValueA(hkey, "montecristo");
2979 delete_key(hkey, "", access);
2980 RegCloseKey(hkey);
2982 sprintf(keypath, udfeatpath, usersid);
2983 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2984 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2986 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
2987 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
2989 RegDeleteValueA(hkey, "feature");
2990 RegDeleteValueA(hkey, "montecristo");
2991 delete_key(hkey, "", access);
2992 RegCloseKey(hkey);
2993 sprintf(keypath, udpridpath, usersid);
2994 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
2996 /* PublishFeatures, machine */
2997 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
2998 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2999 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3000 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3002 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3003 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3005 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3006 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3007 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3008 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3010 CHECK_REG_STR(hkey, "feature", "");
3011 CHECK_REG_STR(hkey, "montecristo", "");
3013 RegDeleteValueA(hkey, "feature");
3014 RegDeleteValueA(hkey, "montecristo");
3015 delete_key(hkey, "", access);
3016 RegCloseKey(hkey);
3018 sprintf(keypath, udfeatpath, "S-1-5-18");
3019 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3020 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3022 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3023 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3025 RegDeleteValueA(hkey, "feature");
3026 RegDeleteValueA(hkey, "montecristo");
3027 delete_key(hkey, "", access);
3028 RegCloseKey(hkey);
3029 sprintf(keypath, udpridpath, "S-1-5-18");
3030 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3032 error:
3033 DeleteFileA(msifile);
3034 DeleteFileA("msitest\\maximus");
3035 RemoveDirectoryA("msitest");
3036 HeapFree(GetProcessHeap(), 0, usersid);
3039 static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
3041 DWORD len = 0;
3042 LPSTR val;
3043 LONG r;
3045 r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
3046 if (r != ERROR_SUCCESS)
3047 return NULL;
3049 len += sizeof (WCHAR);
3050 val = HeapAlloc(GetProcessHeap(), 0, len);
3051 if (!val) return NULL;
3052 val[0] = 0;
3053 RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len);
3054 return val;
3057 static void get_owner_company(LPSTR *owner, LPSTR *company)
3059 LONG res;
3060 HKEY hkey;
3061 REGSAM access = KEY_ALL_ACCESS;
3063 *owner = *company = NULL;
3065 if (is_wow64)
3066 access |= KEY_WOW64_64KEY;
3068 res = RegOpenKeyA(HKEY_CURRENT_USER,
3069 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
3070 if (res == ERROR_SUCCESS)
3072 *owner = reg_get_val_str(hkey, "DefName");
3073 *company = reg_get_val_str(hkey, "DefCompany");
3074 RegCloseKey(hkey);
3077 if (!*owner || !*company)
3079 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3080 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
3081 if (res == ERROR_SUCCESS)
3083 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3084 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3085 RegCloseKey(hkey);
3089 if (!*owner || !*company)
3091 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3092 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
3093 if (res == ERROR_SUCCESS)
3095 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3096 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3097 RegCloseKey(hkey);
3102 static void test_register_user(void)
3104 UINT r;
3105 LONG res;
3106 HKEY props;
3107 LPSTR usersid;
3108 LPSTR owner, company;
3109 CHAR keypath[MAX_PATH];
3110 REGSAM access = KEY_ALL_ACCESS;
3112 static const CHAR keypropsfmt[] =
3113 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3114 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3115 static const CHAR keypridfmt[] =
3116 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3117 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3119 if (is_process_limited())
3121 skip("process is limited\n");
3122 return;
3125 if (!(usersid = get_user_sid()))
3126 return;
3128 get_owner_company(&owner, &company);
3130 CreateDirectoryA("msitest", NULL);
3131 create_file("msitest\\maximus", 500);
3133 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3135 if (is_wow64)
3136 access |= KEY_WOW64_64KEY;
3138 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3140 /* RegisterUser, per-user */
3141 r = MsiInstallProductA(msifile, "REGISTER_USER=1");
3142 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3144 skip("Not enough rights to perform tests\n");
3145 goto error;
3147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3148 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3149 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3151 sprintf(keypath, keypropsfmt, usersid);
3152 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3153 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3155 CHECK_REG_STR(props, "ProductID", "none");
3156 CHECK_REG_STR(props, "RegCompany", company);
3157 CHECK_REG_STR(props, "RegOwner", owner);
3159 RegDeleteValueA(props, "ProductID");
3160 RegDeleteValueA(props, "RegCompany");
3161 RegDeleteValueA(props, "RegOwner");
3162 delete_key(props, "", access);
3163 RegCloseKey(props);
3164 sprintf(keypath, keypridfmt, usersid);
3165 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3167 /* RegisterUser, machine */
3168 r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
3169 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3170 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3171 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3173 sprintf(keypath, keypropsfmt, "S-1-5-18");
3174 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3175 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3177 CHECK_REG_STR(props, "ProductID", "none");
3178 CHECK_REG_STR(props, "RegCompany", company);
3179 CHECK_REG_STR(props, "RegOwner", owner);
3181 RegDeleteValueA(props, "ProductID");
3182 RegDeleteValueA(props, "RegCompany");
3183 RegDeleteValueA(props, "RegOwner");
3184 delete_key(props, "", access);
3185 RegCloseKey(props);
3186 sprintf(keypath, keypridfmt, "S-1-5-18");
3187 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3189 error:
3190 HeapFree(GetProcessHeap(), 0, company);
3191 HeapFree(GetProcessHeap(), 0, owner);
3193 DeleteFileA(msifile);
3194 DeleteFileA("msitest\\maximus");
3195 RemoveDirectoryA("msitest");
3196 LocalFree(usersid);
3199 static void test_process_components(void)
3201 static const char keyfmt[] =
3202 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3203 static const char compkey[] =
3204 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3205 UINT r;
3206 LONG res;
3207 DWORD size;
3208 HKEY comp, hkey;
3209 LPSTR usersid;
3210 CHAR val[MAX_PATH];
3211 CHAR keypath[MAX_PATH];
3212 CHAR program_files_maximus[MAX_PATH];
3213 REGSAM access = KEY_ALL_ACCESS;
3215 if (is_process_limited())
3217 skip("process is limited\n");
3218 return;
3221 if (!(usersid = get_user_sid()))
3222 return;
3224 CreateDirectoryA("msitest", NULL);
3225 create_file("msitest\\maximus", 500);
3227 create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table));
3229 if (is_wow64)
3230 access |= KEY_WOW64_64KEY;
3232 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3234 /* ProcessComponents, per-user */
3235 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
3236 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3238 skip("Not enough rights to perform tests\n");
3239 goto error;
3241 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3242 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3243 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3245 sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
3246 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3247 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3249 size = MAX_PATH;
3250 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3251 NULL, NULL, (LPBYTE)val, &size);
3252 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3254 lstrcpyA(program_files_maximus,PROG_FILES_DIR);
3255 lstrcatA(program_files_maximus,"\\msitest\\maximus");
3257 ok(!lstrcmpiA(val, program_files_maximus),
3258 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3260 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3261 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3263 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3264 delete_key(comp, "", access);
3265 RegCloseKey(comp);
3267 sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
3268 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3269 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3271 size = MAX_PATH;
3272 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3273 NULL, NULL, (LPBYTE)val, &size);
3274 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3275 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3276 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3278 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3279 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3281 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3282 delete_key(comp, "", access);
3283 RegCloseKey(comp);
3285 /* ProcessComponents, machine */
3286 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3287 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3288 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3289 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3291 sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3292 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3293 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3295 size = MAX_PATH;
3296 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3297 NULL, NULL, (LPBYTE)val, &size);
3298 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3299 ok(!lstrcmpiA(val, program_files_maximus),
3300 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3302 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3303 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3305 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3306 delete_key(comp, "", access);
3307 RegCloseKey(comp);
3309 sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3310 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3311 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3313 size = MAX_PATH;
3314 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3315 NULL, NULL, (LPBYTE)val, &size);
3316 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3317 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3318 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3320 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3321 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3323 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3324 delete_key(comp, "", access);
3325 RegCloseKey(comp);
3327 error:
3328 DeleteFileA(msifile);
3329 DeleteFileA("msitest\\maximus");
3330 RemoveDirectoryA("msitest");
3331 LocalFree(usersid);
3334 static void test_publish(void)
3336 static const char subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3337 static const char subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3338 UINT r;
3339 LONG res;
3340 HKEY uninstall, prodkey, uninstall_32node = NULL;
3341 INSTALLSTATE state;
3342 char date[MAX_PATH], temp[MAX_PATH], prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3343 REGSAM access = KEY_ALL_ACCESS;
3344 DWORD error;
3346 if (!pMsiQueryFeatureStateExA)
3348 win_skip("MsiQueryFeatureStateExA is not available\n");
3349 return;
3351 if (is_process_limited())
3353 skip("process is limited\n");
3354 return;
3357 get_date_str(date);
3358 GetTempPathA(MAX_PATH, temp);
3360 if (is_wow64)
3361 access |= KEY_WOW64_64KEY;
3363 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
3364 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3366 if (is_64bit)
3368 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
3369 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3372 CreateDirectoryA("msitest", NULL);
3373 create_file("msitest\\maximus", 500);
3375 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3377 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3379 state = MsiQueryProductStateA(prodcode);
3380 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3382 state = MsiQueryFeatureStateA(prodcode, "feature");
3383 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3385 state = 0xdead;
3386 SetLastError(0xdeadbeef);
3387 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3388 error = GetLastError();
3389 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3390 ok(state == 0xdead, "got %d\n", state);
3391 ok(error == 0xdeadbeef, "got %u\n", error);
3393 state = 0xdead;
3394 SetLastError(0xdeadbeef);
3395 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3396 error = GetLastError();
3397 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3398 ok(state == 0xdead, "got %d\n", state);
3399 ok(error == ERROR_SUCCESS, "got %u\n", error);
3401 state = 0xdead;
3402 SetLastError(0xdeadbeef);
3403 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3404 error = GetLastError();
3405 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3406 ok(state == 0xdead, "got %d\n", state);
3407 ok(error == ERROR_SUCCESS, "got %u\n", error);
3409 state = MsiQueryFeatureStateA(prodcode, "feature");
3410 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3412 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3413 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3415 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3416 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3417 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3418 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3420 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3421 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3423 /* nothing published */
3424 r = MsiInstallProductA(msifile, NULL);
3425 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3427 skip("Not enough rights to perform tests\n");
3428 goto error;
3430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3431 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3432 ok(pf_exists("msitest"), "File not installed\n");
3434 state = MsiQueryProductStateA(prodcode);
3435 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3437 state = MsiQueryFeatureStateA(prodcode, "feature");
3438 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3440 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3441 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3443 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3444 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3445 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3446 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3448 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3449 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3451 /* PublishProduct and RegisterProduct */
3452 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3453 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3454 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3455 ok(pf_exists("msitest"), "File not installed\n");
3457 state = MsiQueryProductStateA(prodcode);
3458 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3460 state = MsiQueryFeatureStateA(prodcode, "feature");
3461 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3463 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3464 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3466 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3467 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3468 ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
3469 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3471 if (is_64bit)
3473 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3474 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3476 else
3478 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3479 if (is_wow64 && res == ERROR_FILE_NOT_FOUND) /* XP - Vista, Wow64 */
3480 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3481 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3484 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3485 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3486 CHECK_REG_STR(prodkey, "InstallDate", date);
3487 CHECK_REG_STR(prodkey, "InstallSource", temp);
3488 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3489 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3490 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3491 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3492 CHECK_REG_STR(prodkey, "Comments", NULL);
3493 CHECK_REG_STR(prodkey, "Contact", NULL);
3494 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3495 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3496 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3497 CHECK_REG_STR(prodkey, "Readme", NULL);
3498 CHECK_REG_STR(prodkey, "Size", NULL);
3499 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3500 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3501 CHECK_REG_DWORD(prodkey, "Language", 1033);
3502 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3503 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3504 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3505 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3506 todo_wine
3507 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3509 RegCloseKey(prodkey);
3511 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3512 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3513 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3514 ok(pf_exists("msitest"), "File deleted\n");
3516 state = MsiQueryProductStateA(prodcode);
3517 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3519 state = MsiQueryFeatureStateA(prodcode, "feature");
3520 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3522 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3523 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3525 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3526 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3527 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3528 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3530 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3531 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3533 /* complete install */
3534 r = MsiInstallProductA(msifile, "FULL=1");
3535 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3536 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3537 ok(pf_exists("msitest"), "File not installed\n");
3539 state = MsiQueryProductStateA(prodcode);
3540 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3542 state = MsiQueryFeatureStateA(prodcode, "feature");
3543 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3545 state = 0xdead;
3546 SetLastError(0xdeadbeef);
3547 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3548 error = GetLastError();
3549 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3550 ok(state == 0xdead, "got %d\n", state);
3551 ok(error == 0xdeadbeef, "got %u\n", error);
3553 state = 0xdead;
3554 SetLastError(0xdeadbeef);
3555 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3556 error = GetLastError();
3557 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3558 ok(state == 0xdead, "got %d\n", state);
3559 ok(error == ERROR_SUCCESS, "got %u\n", error);
3561 state = 0xdead;
3562 SetLastError(0xdeadbeef);
3563 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3564 error = GetLastError();
3565 ok(r == ERROR_SUCCESS, "got %u\n", r);
3566 ok(state == INSTALLSTATE_LOCAL, "got %d\n", state);
3567 ok(error == ERROR_SUCCESS, "got %u\n", error);
3569 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3570 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3572 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3573 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3574 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3575 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3577 if (is_64bit)
3579 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3580 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3582 else
3584 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3585 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3588 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3589 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3590 CHECK_REG_STR(prodkey, "InstallDate", date);
3591 CHECK_REG_STR(prodkey, "InstallSource", temp);
3592 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3593 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3594 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3595 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3596 CHECK_REG_STR(prodkey, "Comments", NULL);
3597 CHECK_REG_STR(prodkey, "Contact", NULL);
3598 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3599 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3600 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3601 CHECK_REG_STR(prodkey, "Readme", NULL);
3602 CHECK_REG_STR(prodkey, "Size", NULL);
3603 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3604 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3605 CHECK_REG_DWORD(prodkey, "Language", 1033);
3606 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3607 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3608 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3609 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3610 todo_wine
3611 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3613 RegCloseKey(prodkey);
3615 /* no UnpublishFeatures */
3616 r = MsiInstallProductA(msifile, "REMOVE=ALL");
3617 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3618 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3619 ok(!pf_exists("msitest"), "Directory not deleted\n");
3621 state = MsiQueryProductStateA(prodcode);
3622 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3624 state = MsiQueryFeatureStateA(prodcode, "feature");
3625 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3627 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3628 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3630 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3631 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3632 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3633 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3635 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3636 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3638 /* complete install */
3639 r = MsiInstallProductA(msifile, "FULL=1");
3640 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3641 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3642 ok(pf_exists("msitest"), "File not installed\n");
3644 state = MsiQueryProductStateA(prodcode);
3645 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3647 state = MsiQueryFeatureStateA(prodcode, "feature");
3648 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3650 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3651 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3653 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3654 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3655 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3656 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3658 if (is_64bit)
3660 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3661 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3663 else
3665 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3666 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3669 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3670 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3671 CHECK_REG_STR(prodkey, "InstallDate", date);
3672 CHECK_REG_STR(prodkey, "InstallSource", temp);
3673 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3674 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3675 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3676 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3677 CHECK_REG_STR(prodkey, "Comments", NULL);
3678 CHECK_REG_STR(prodkey, "Contact", NULL);
3679 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3680 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3681 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3682 CHECK_REG_STR(prodkey, "Readme", NULL);
3683 CHECK_REG_STR(prodkey, "Size", NULL);
3684 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3685 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3686 CHECK_REG_DWORD(prodkey, "Language", 1033);
3687 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3688 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3689 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3690 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3691 todo_wine
3692 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3694 RegCloseKey(prodkey);
3696 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
3697 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
3698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3699 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3700 ok(pf_exists("msitest"), "Directory deleted\n");
3702 state = MsiQueryProductStateA(prodcode);
3703 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3705 state = MsiQueryFeatureStateA(prodcode, "feature");
3706 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3708 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3709 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3711 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3712 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3713 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3714 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3716 if (is_64bit)
3718 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3719 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3721 else
3723 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3724 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3727 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3728 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3729 CHECK_REG_STR(prodkey, "InstallDate", date);
3730 CHECK_REG_STR(prodkey, "InstallSource", temp);
3731 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3732 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3733 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3734 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3735 CHECK_REG_STR(prodkey, "Comments", NULL);
3736 CHECK_REG_STR(prodkey, "Contact", NULL);
3737 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3738 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3739 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3740 CHECK_REG_STR(prodkey, "Readme", NULL);
3741 CHECK_REG_STR(prodkey, "Size", NULL);
3742 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3743 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3744 CHECK_REG_DWORD(prodkey, "Language", 1033);
3745 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3746 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3747 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3748 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3749 todo_wine
3750 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3752 RegCloseKey(prodkey);
3754 /* complete install */
3755 r = MsiInstallProductA(msifile, "FULL=1");
3756 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3757 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3758 ok(pf_exists("msitest"), "File not installed\n");
3760 state = MsiQueryProductStateA(prodcode);
3761 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3763 state = MsiQueryFeatureStateA(prodcode, "feature");
3764 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3766 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3767 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3769 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3770 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3771 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3772 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3774 if (is_64bit)
3776 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3777 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3779 else
3781 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3782 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3785 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3786 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3787 CHECK_REG_STR(prodkey, "InstallDate", date);
3788 CHECK_REG_STR(prodkey, "InstallSource", temp);
3789 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3790 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3791 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3792 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3793 CHECK_REG_STR(prodkey, "Comments", NULL);
3794 CHECK_REG_STR(prodkey, "Contact", NULL);
3795 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3796 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3797 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3798 CHECK_REG_STR(prodkey, "Readme", NULL);
3799 CHECK_REG_STR(prodkey, "Size", NULL);
3800 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3801 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3802 CHECK_REG_DWORD(prodkey, "Language", 1033);
3803 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3804 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3805 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3806 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3807 todo_wine
3808 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3810 RegCloseKey(prodkey);
3812 /* UnpublishFeatures, both features removed */
3813 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
3814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3815 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3816 ok(!pf_exists("msitest"), "Directory not deleted\n");
3818 state = MsiQueryProductStateA(prodcode);
3819 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3821 state = MsiQueryFeatureStateA(prodcode, "feature");
3822 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3824 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3825 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3827 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3828 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3829 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3830 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3832 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3833 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3835 /* complete install */
3836 r = MsiInstallProductA(msifile, "FULL=1");
3837 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3838 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3839 ok(pf_exists("msitest"), "File not installed\n");
3841 state = MsiQueryProductStateA(prodcode);
3842 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3844 state = MsiQueryFeatureStateA(prodcode, "feature");
3845 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3847 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3848 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3850 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3851 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3852 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3853 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3855 if (is_64bit)
3857 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3858 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3860 else
3862 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3863 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3866 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3867 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3868 CHECK_REG_STR(prodkey, "InstallDate", date);
3869 CHECK_REG_STR(prodkey, "InstallSource", temp);
3870 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3871 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3872 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3873 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3874 CHECK_REG_STR(prodkey, "Comments", NULL);
3875 CHECK_REG_STR(prodkey, "Contact", NULL);
3876 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3877 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3878 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3879 CHECK_REG_STR(prodkey, "Readme", NULL);
3880 CHECK_REG_STR(prodkey, "Size", NULL);
3881 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3882 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3883 CHECK_REG_DWORD(prodkey, "Language", 1033);
3884 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3885 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3886 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3887 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3888 todo_wine
3889 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3891 RegCloseKey(prodkey);
3893 /* complete uninstall */
3894 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3895 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3896 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3897 ok(!pf_exists("msitest"), "Directory not deleted\n");
3899 state = MsiQueryProductStateA(prodcode);
3900 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3902 state = MsiQueryFeatureStateA(prodcode, "feature");
3903 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3905 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3906 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3908 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3909 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3910 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3911 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3913 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3914 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3916 /* make sure 'Program Files\msitest' is removed */
3917 delete_pfmsitest_files();
3919 error:
3920 RegCloseKey(uninstall);
3921 RegCloseKey(uninstall_32node);
3922 DeleteFileA(msifile);
3923 DeleteFileA("msitest\\maximus");
3924 RemoveDirectoryA("msitest");
3927 static void test_publish_sourcelist(void)
3929 UINT r;
3930 DWORD size;
3931 CHAR value[MAX_PATH];
3932 CHAR path[MAX_PATH];
3933 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3935 if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
3937 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
3938 return;
3940 if (is_process_limited())
3942 skip("process is limited\n");
3943 return;
3946 CreateDirectoryA("msitest", NULL);
3947 create_file("msitest\\maximus", 500);
3949 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3951 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3953 r = MsiInstallProductA(msifile, NULL);
3954 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3956 skip("Not enough rights to perform tests\n");
3957 goto error;
3959 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3960 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3961 ok(pf_exists("msitest"), "File not installed\n");
3963 /* nothing published */
3964 size = MAX_PATH;
3965 lstrcpyA(value, "aaa");
3966 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3967 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
3968 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3969 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
3970 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
3972 size = MAX_PATH;
3973 lstrcpyA(value, "aaa");
3974 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3975 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
3976 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3977 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
3978 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
3980 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
3981 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3982 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3983 ok(pf_exists("msitest"), "File not installed\n");
3985 /* after RegisterProduct */
3986 size = MAX_PATH;
3987 lstrcpyA(value, "aaa");
3988 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3989 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
3990 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3991 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
3992 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
3994 size = MAX_PATH;
3995 lstrcpyA(value, "aaa");
3996 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3997 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
3998 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3999 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4000 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4002 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
4003 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4004 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4005 ok(pf_exists("msitest"), "File not installed\n");
4007 /* after ProcessComponents */
4008 size = MAX_PATH;
4009 lstrcpyA(value, "aaa");
4010 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4011 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4012 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4013 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4014 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4016 size = MAX_PATH;
4017 lstrcpyA(value, "aaa");
4018 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4019 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4020 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4021 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4022 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4024 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
4025 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4026 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4027 ok(pf_exists("msitest"), "File not installed\n");
4029 /* after PublishFeatures */
4030 size = MAX_PATH;
4031 lstrcpyA(value, "aaa");
4032 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4033 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4034 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4035 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4036 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4038 size = MAX_PATH;
4039 lstrcpyA(value, "aaa");
4040 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4041 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4042 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4043 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4044 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4046 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
4047 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4048 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4049 ok(pf_exists("msitest"), "File not installed\n");
4051 /* after PublishProduct */
4052 size = MAX_PATH;
4053 lstrcpyA(value, "aaa");
4054 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4055 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4056 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4057 ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
4058 ok(size == 11, "Expected 11, got %d\n", size);
4060 size = MAX_PATH;
4061 lstrcpyA(value, "aaa");
4062 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4063 MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
4064 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4065 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4066 ok(size == 0, "Expected 0, got %d\n", size);
4068 size = MAX_PATH;
4069 lstrcpyA(value, "aaa");
4070 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4071 MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
4072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4073 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4074 ok(size == 0, "Expected 0, got %d\n", size);
4076 lstrcpyA(path, CURR_DIR);
4077 lstrcatA(path, "\\");
4079 size = MAX_PATH;
4080 lstrcpyA(value, "aaa");
4081 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4082 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
4083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4084 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4085 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4087 size = MAX_PATH;
4088 lstrcpyA(value, "aaa");
4089 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4090 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
4091 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4092 ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
4093 ok(size == 1, "Expected 1, got %d\n", size);
4095 size = MAX_PATH;
4096 lstrcpyA(value, "aaa");
4097 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4098 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4099 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4100 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4101 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
4103 size = MAX_PATH;
4104 lstrcpyA(value, "aaa");
4105 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4106 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
4107 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4108 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4109 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4111 size = MAX_PATH;
4112 lstrcpyA(value, "aaa");
4113 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4114 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
4115 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4116 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4117 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
4119 /* complete uninstall */
4120 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
4121 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4122 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4123 ok(!pf_exists("msitest"), "Directory not deleted\n");
4125 /* make sure 'Program Files\msitest' is removed */
4126 delete_pfmsitest_files();
4128 error:
4129 DeleteFileA(msifile);
4130 DeleteFileA("msitest\\maximus");
4131 RemoveDirectoryA("msitest");
4134 static void test_remove_files(void)
4136 UINT r;
4138 if (is_process_limited())
4140 skip("process is limited\n");
4141 return;
4144 CreateDirectoryA("msitest", NULL);
4145 create_file("msitest\\hydrogen", 500);
4146 create_file("msitest\\helium", 500);
4147 create_file("msitest\\lithium", 500);
4149 create_database(msifile, rem_tables, sizeof(rem_tables) / sizeof(msi_table));
4151 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4153 r = MsiInstallProductA(msifile, NULL);
4154 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4156 skip("Not enough rights to perform tests\n");
4157 goto error;
4159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4160 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4161 ok(!pf_exists("msitest\\helium"), "File installed\n");
4162 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4163 ok(pf_exists("msitest"), "File not installed\n");
4165 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4167 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4168 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4169 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4170 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4172 create_pf("msitest", FALSE);
4173 create_pf("msitest\\hydrogen", TRUE);
4174 create_pf("msitest\\helium", TRUE);
4175 create_pf("msitest\\lithium", TRUE);
4177 r = MsiInstallProductA(msifile, NULL);
4178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4179 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4180 ok(pf_exists("msitest\\helium"), "File not installed\n");
4181 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4182 ok(pf_exists("msitest"), "File not installed\n");
4184 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4185 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4186 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4187 ok(delete_pf("msitest\\helium", TRUE), "File deleted\n");
4188 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4189 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4191 create_pf("msitest", FALSE);
4192 create_pf("msitest\\furlong", TRUE);
4193 create_pf("msitest\\firkin", TRUE);
4194 create_pf("msitest\\fortnight", TRUE);
4195 create_pf("msitest\\becquerel", TRUE);
4196 create_pf("msitest\\dioptre", TRUE);
4197 create_pf("msitest\\attoparsec", TRUE);
4198 create_pf("msitest\\storeys", TRUE);
4199 create_pf("msitest\\block", TRUE);
4200 create_pf("msitest\\siriometer", TRUE);
4201 create_pf("msitest\\cabout", FALSE);
4202 create_pf("msitest\\cabout\\blocker", TRUE);
4204 r = MsiInstallProductA(msifile, NULL);
4205 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4206 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4207 ok(!pf_exists("msitest\\helium"), "File installed\n");
4208 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4209 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4210 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4211 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4212 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4213 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4214 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4215 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4216 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4217 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4218 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4219 ok(pf_exists("msitest"), "File not installed\n");
4221 create_pf("msitest\\furlong", TRUE);
4222 create_pf("msitest\\firkin", TRUE);
4223 create_pf("msitest\\fortnight", TRUE);
4224 create_pf("msitest\\storeys", TRUE);
4225 create_pf("msitest\\block", TRUE);
4226 create_pf("msitest\\siriometer", TRUE);
4228 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4229 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4230 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
4231 ok(!delete_pf("msitest\\helium", TRUE), "File not deleted\n");
4232 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4233 ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
4234 ok(delete_pf("msitest\\firkin", TRUE), "File deleted\n");
4235 ok(delete_pf("msitest\\fortnight", TRUE), "File deleted\n");
4236 ok(!delete_pf("msitest\\becquerel", TRUE), "File not deleted\n");
4237 ok(!delete_pf("msitest\\dioptre", TRUE), "File not deleted\n");
4238 ok(delete_pf("msitest\\attoparsec", TRUE), "File deleted\n");
4239 ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
4240 ok(!delete_pf("msitest\\block", TRUE), "File not deleted\n");
4241 ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
4242 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4243 ok(pf_exists("msitest"), "Directory deleted\n");
4245 r = MsiInstallProductA(msifile, NULL);
4246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4247 ok(delete_pf("msitest\\hydrogen", TRUE), "File not installed\n");
4248 ok(!delete_pf("msitest\\helium", TRUE), "File installed\n");
4249 ok(delete_pf("msitest\\lithium", TRUE), "File not installed\n");
4250 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4251 ok(pf_exists("msitest"), "Directory deleted\n");
4253 delete_pf("msitest\\cabout\\blocker", TRUE);
4255 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4257 ok(!delete_pf("msitest\\cabout", FALSE), "Directory not deleted\n");
4258 delete_pf("msitest", FALSE);
4260 error:
4261 DeleteFileA(msifile);
4262 DeleteFileA("msitest\\hydrogen");
4263 DeleteFileA("msitest\\helium");
4264 DeleteFileA("msitest\\lithium");
4265 RemoveDirectoryA("msitest");
4268 static void test_move_files(void)
4270 UINT r;
4271 char props[MAX_PATH];
4273 if (is_process_limited())
4275 skip("process is limited\n");
4276 return;
4279 CreateDirectoryA("msitest", NULL);
4280 create_file("msitest\\augustus", 100);
4281 create_file("cameroon", 100);
4282 create_file("djibouti", 100);
4283 create_file("egypt", 100);
4284 create_file("finland", 100);
4285 create_file("gambai", 100);
4286 create_file("honduras", 100);
4287 create_file("msitest\\india", 100);
4288 create_file("japan", 100);
4289 create_file("kenya", 100);
4290 CreateDirectoryA("latvia", NULL);
4291 create_file("nauru", 100);
4292 create_file("peru", 100);
4293 create_file("apple", 100);
4294 create_file("application", 100);
4295 create_file("ape", 100);
4296 create_file("foo", 100);
4297 create_file("fao", 100);
4298 create_file("fbod", 100);
4299 create_file("budding", 100);
4300 create_file("buddy", 100);
4301 create_file("bud", 100);
4302 create_file("bar", 100);
4303 create_file("bur", 100);
4304 create_file("bird", 100);
4306 create_database(msifile, mov_tables, sizeof(mov_tables) / sizeof(msi_table));
4308 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4310 /* if the source or dest property is not a full path,
4311 * windows tries to access it as a network resource
4314 sprintf(props, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4315 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4316 CURR_DIR, PROG_FILES_DIR, CURR_DIR, CURR_DIR);
4318 r = MsiInstallProductA(msifile, props);
4319 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4321 skip("Not enough rights to perform tests\n");
4322 goto error;
4324 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4325 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4326 ok(!delete_pf("msitest\\dest", TRUE), "File copied\n");
4327 ok(delete_pf("msitest\\canada", TRUE), "File not copied\n");
4328 ok(delete_pf("msitest\\dominica", TRUE), "File not moved\n");
4329 ok(!delete_pf("msitest\\elsalvador", TRUE), "File moved\n");
4330 ok(!delete_pf("msitest\\france", TRUE), "File moved\n");
4331 ok(!delete_pf("msitest\\georgia", TRUE), "File moved\n");
4332 ok(delete_pf("msitest\\hungary", TRUE), "File not moved\n");
4333 ok(!delete_pf("msitest\\indonesia", TRUE), "File moved\n");
4334 ok(!delete_pf("msitest\\jordan", TRUE), "File moved\n");
4335 ok(delete_pf("msitest\\kiribati", TRUE), "File not moved\n");
4336 ok(!delete_pf("msitest\\lebanon", TRUE), "File moved\n");
4337 ok(!delete_pf("msitest\\lebanon", FALSE), "Directory moved\n");
4338 ok(delete_pf("msitest\\poland", TRUE), "File not moved\n");
4339 /* either apple or application will be moved depending on directory order */
4340 if (!delete_pf("msitest\\apple", TRUE))
4341 ok(delete_pf("msitest\\application", TRUE), "File not moved\n");
4342 else
4343 ok(!delete_pf("msitest\\application", TRUE), "File should not exist\n");
4344 ok(delete_pf("msitest\\wildcard", TRUE), "File not moved\n");
4345 ok(!delete_pf("msitest\\ape", TRUE), "File moved\n");
4346 /* either fao or foo will be moved depending on directory order */
4347 if (delete_pf("msitest\\foo", TRUE))
4348 ok(!delete_pf("msitest\\fao", TRUE), "File should not exist\n");
4349 else
4350 ok(delete_pf("msitest\\fao", TRUE), "File not moved\n");
4351 ok(delete_pf("msitest\\single", TRUE), "File not moved\n");
4352 ok(!delete_pf("msitest\\fbod", TRUE), "File moved\n");
4353 ok(delete_pf("msitest\\budding", TRUE), "File not moved\n");
4354 ok(delete_pf("msitest\\buddy", TRUE), "File not moved\n");
4355 ok(!delete_pf("msitest\\bud", TRUE), "File moved\n");
4356 ok(delete_pf("msitest\\bar", TRUE), "File not moved\n");
4357 ok(delete_pf("msitest\\bur", TRUE), "File not moved\n");
4358 ok(!delete_pf("msitest\\bird", TRUE), "File moved\n");
4359 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4360 ok(DeleteFileA("cameroon"), "File moved\n");
4361 ok(!DeleteFileA("djibouti"), "File not moved\n");
4362 ok(DeleteFileA("egypt"), "File moved\n");
4363 ok(DeleteFileA("finland"), "File moved\n");
4364 ok(DeleteFileA("gambai"), "File moved\n");
4365 ok(!DeleteFileA("honduras"), "File not moved\n");
4366 ok(DeleteFileA("msitest\\india"), "File moved\n");
4367 ok(DeleteFileA("japan"), "File moved\n");
4368 ok(!DeleteFileA("kenya"), "File not moved\n");
4369 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4370 ok(!DeleteFileA("nauru"), "File not moved\n");
4371 ok(!DeleteFileA("peru"), "File not moved\n");
4372 ok(!DeleteFileA("apple"), "File not moved\n");
4373 ok(!DeleteFileA("application"), "File not moved\n");
4374 ok(DeleteFileA("ape"), "File moved\n");
4375 ok(!DeleteFileA("foo"), "File not moved\n");
4376 ok(!DeleteFileA("fao"), "File not moved\n");
4377 ok(DeleteFileA("fbod"), "File moved\n");
4378 ok(!DeleteFileA("budding"), "File not moved\n");
4379 ok(!DeleteFileA("buddy"), "File not moved\n");
4380 ok(DeleteFileA("bud"), "File moved\n");
4381 ok(!DeleteFileA("bar"), "File not moved\n");
4382 ok(!DeleteFileA("bur"), "File not moved\n");
4383 ok(DeleteFileA("bird"), "File moved\n");
4385 error:
4386 DeleteFileA("cameroon");
4387 DeleteFileA("djibouti");
4388 DeleteFileA("egypt");
4389 DeleteFileA("finland");
4390 DeleteFileA("gambai");
4391 DeleteFileA("honduras");
4392 DeleteFileA("japan");
4393 DeleteFileA("kenya");
4394 DeleteFileA("nauru");
4395 DeleteFileA("peru");
4396 DeleteFileA("apple");
4397 DeleteFileA("application");
4398 DeleteFileA("ape");
4399 DeleteFileA("foo");
4400 DeleteFileA("fao");
4401 DeleteFileA("fbod");
4402 DeleteFileA("budding");
4403 DeleteFileA("buddy");
4404 DeleteFileA("bud");
4405 DeleteFileA("bar");
4406 DeleteFileA("bur");
4407 DeleteFileA("bird");
4408 DeleteFileA("msitest\\india");
4409 DeleteFileA("msitest\\augustus");
4410 RemoveDirectoryA("latvia");
4411 RemoveDirectoryA("msitest");
4412 DeleteFileA(msifile);
4415 static void test_duplicate_files(void)
4417 UINT r;
4419 if (is_process_limited())
4421 skip("process is limited\n");
4422 return;
4425 CreateDirectoryA("msitest", NULL);
4426 create_file("msitest\\maximus", 500);
4427 create_database(msifile, df_tables, sizeof(df_tables) / sizeof(msi_table));
4429 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4431 /* fails if the destination folder is not a valid property */
4433 r = MsiInstallProductA(msifile, NULL);
4434 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4436 skip("Not enough rights to perform tests\n");
4437 goto error;
4439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4440 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4441 ok(delete_pf("msitest\\augustus", TRUE), "File not duplicated\n");
4442 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE), "File not duplicated\n");
4443 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE), "Directory not created\n");
4444 ok(delete_pf("msitest\\this\\doesnot", FALSE), "Directory not created\n");
4445 ok(delete_pf("msitest\\this", FALSE), "Directory not created\n");
4446 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4448 error:
4449 DeleteFileA("msitest\\maximus");
4450 RemoveDirectoryA("msitest");
4451 DeleteFileA(msifile);
4454 static void test_write_registry_values(void)
4456 UINT r;
4457 LONG res;
4458 HKEY hkey;
4459 DWORD type, size;
4460 CHAR path[MAX_PATH];
4461 BYTE buf[8];
4463 if (is_process_limited())
4465 skip("process is limited\n");
4466 return;
4469 CreateDirectoryA("msitest", NULL);
4470 create_file("msitest\\augustus", 500);
4472 create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table));
4474 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4476 if (is_64bit)
4477 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL, 0,
4478 KEY_ALL_ACCESS, NULL, &hkey, NULL);
4479 else
4480 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, NULL, 0, KEY_ALL_ACCESS,
4481 NULL, &hkey, NULL);
4482 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4484 res = RegSetValueExA(hkey, "Value1", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5);
4485 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4486 res = RegSetValueExA(hkey, "Value2", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4487 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4488 res = RegSetValueExA(hkey, "Value3", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5);
4489 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4490 res = RegSetValueExA(hkey, "Value4", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4491 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4492 res = RegSetValueExA(hkey, "Value5", 0, REG_MULTI_SZ, (const BYTE *)"one\0two\0", 9);
4493 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4494 res = RegSetValueExA(hkey, "Value6", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4495 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4496 res = RegSetValueExA(hkey, "Value7", 0, REG_SZ, (const BYTE *)"one", 4);
4497 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4498 RegCloseKey(hkey);
4500 r = MsiInstallProductA(msifile, NULL);
4501 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4503 skip("Not enough rights to perform tests\n");
4504 goto error;
4506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4507 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4508 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4510 if (is_64bit)
4511 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
4512 else
4513 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
4514 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4516 size = MAX_PATH;
4517 type = 0xdeadbeef;
4518 memset(path, 'a', MAX_PATH);
4519 res = RegQueryValueExA(hkey, "Value", NULL, &type, (LPBYTE)path, &size);
4520 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4521 ok(!memcmp(path, "one\0two\0three\0\0", size), "Wrong multi-sz data\n");
4522 ok(size == 15, "Expected 15, got %d\n", size);
4523 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4525 res = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL);
4526 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4528 res = action_RegDeleteTreeA(hkey, "VisualStudio", KEY_ALL_ACCESS);
4529 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4531 size = MAX_PATH;
4532 type = 0xdeadbeef;
4533 memset(path, 'a', MAX_PATH);
4534 res = RegQueryValueExA(hkey, "Value1", NULL, &type, (LPBYTE)path, &size);
4535 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4536 ok(!memcmp(path, "one\0", size), "Wrong multi-sz data\n");
4537 ok(size == 5, "Expected 5, got %d\n", size);
4538 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4540 size = MAX_PATH;
4541 type = 0xdeadbeef;
4542 memset(path, 'a', MAX_PATH);
4543 res = RegQueryValueExA(hkey, "Value2", NULL, &type, (LPBYTE)path, &size);
4544 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4545 ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
4546 ok(size == 9, "Expected 9, got %d\n", size);
4547 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4549 size = MAX_PATH;
4550 type = 0xdeadbeef;
4551 memset(path, 'a', MAX_PATH);
4552 res = RegQueryValueExA(hkey, "Value3", NULL, &type, (LPBYTE)path, &size);
4553 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4554 ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
4555 ok(size == 9, "Expected 9, got %d\n", size);
4556 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4558 size = MAX_PATH;
4559 type = 0xdeadbeef;
4560 memset(path, 'a', MAX_PATH);
4561 res = RegQueryValueExA(hkey, "Value4", NULL, &type, (LPBYTE)path, &size);
4562 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4563 ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
4564 ok(size == 9, "Expected 9, got %d\n", size);
4565 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4567 size = MAX_PATH;
4568 type = 0xdeadbeef;
4569 memset(path, 'a', MAX_PATH);
4570 res = RegQueryValueExA(hkey, "Value5", NULL, &type, (LPBYTE)path, &size);
4571 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4572 ok(!memcmp(path, "one\0two\0three\0", size), "Wrong multi-sz data\n");
4573 ok(size == 15, "Expected 15, got %d\n", size);
4574 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4576 size = MAX_PATH;
4577 type = 0xdeadbeef;
4578 memset(path, 'a', MAX_PATH);
4579 res = RegQueryValueExA(hkey, "Value6", NULL, &type, (LPBYTE)path, &size);
4580 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4581 ok(!memcmp(path, "", size), "Wrong multi-sz data\n");
4582 ok(size == 1, "Expected 1, got %d\n", size);
4583 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4585 size = MAX_PATH;
4586 type = 0xdeadbeef;
4587 memset(path, 'a', MAX_PATH);
4588 res = RegQueryValueExA(hkey, "Value7", NULL, &type, (LPBYTE)path, &size);
4589 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4590 ok(!memcmp(path, "two\0", size), "Wrong multi-sz data\n");
4591 ok(size == 5, "Expected 5, got %d\n", size);
4592 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4594 size = sizeof(buf);
4595 type = 0xdeadbeef;
4596 memset(buf, 0, size);
4597 res = RegQueryValueExA(hkey, "Value8", NULL, &type, buf, &size);
4598 ok(res == ERROR_SUCCESS, "got %u\n", res);
4599 ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf);
4600 ok(size == 4, "got %u\n", size);
4601 ok(type == REG_DWORD, "got %u\n", type);
4603 size = sizeof(buf);
4604 type = 0xdeadbeef;
4605 memset(buf, 0, size);
4606 res = RegQueryValueExA(hkey, "Value9", NULL, &type, buf, &size);
4607 ok(res == ERROR_SUCCESS, "got %u\n", res);
4608 ok(buf[0] == 1, "got %u\n", buf[0]);
4609 ok(size == 1, "got %u\n", size);
4610 ok(type == REG_BINARY, "got %u\n", type);
4612 size = sizeof(buf);
4613 type = 0xdeadbeef;
4614 memset(buf, 0, size);
4615 res = RegQueryValueExA(hkey, "Value10", NULL, &type, buf, &size);
4616 ok(res == ERROR_SUCCESS, "got %u\n", res);
4617 ok(buf[0] == 1, "got %u\n", buf[0]);
4618 ok(size == 1, "got %u\n", size);
4619 ok(type == REG_BINARY, "got %u\n", type);
4621 size = sizeof(buf);
4622 type = 0xdeadbeef;
4623 memset(buf, 0, size);
4624 res = RegQueryValueExA(hkey, "Value11", NULL, &type, buf, &size);
4625 ok(res == ERROR_SUCCESS, "got %u\n", res);
4626 ok(buf[0] == 1, "got %u\n", buf[0]);
4627 ok(size == 1, "got %u\n", size);
4628 ok(type == REG_BINARY, "got %u\n", type);
4630 size = sizeof(buf);
4631 type = 0xdeadbeef;
4632 memset(buf, 0, size);
4633 res = RegQueryValueExA(hkey, "Value12", NULL, &type, buf, &size);
4634 ok(res == ERROR_SUCCESS, "got %u\n", res);
4635 ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf);
4636 ok(size == 4, "got %u\n", size);
4637 ok(type == REG_DWORD, "got %u\n", type);
4639 RegDeleteValueA(hkey, "Value");
4640 RegDeleteValueA(hkey, "Value1");
4641 RegDeleteValueA(hkey, "Value2");
4642 RegDeleteValueA(hkey, "Value3");
4643 RegDeleteValueA(hkey, "Value4");
4644 RegDeleteValueA(hkey, "Value5");
4645 RegDeleteValueA(hkey, "Value6");
4646 RegDeleteValueA(hkey, "Value7");
4647 RegDeleteValueA(hkey, "Value8");
4648 RegDeleteValueA(hkey, "Value9");
4649 RegDeleteValueA(hkey, "Value10");
4650 RegDeleteValueA(hkey, "Value11");
4651 RegDeleteValueA(hkey, "Value12");
4652 RegCloseKey(hkey);
4653 RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
4655 error:
4656 DeleteFileA(msifile);
4657 DeleteFileA("msitest\\augustus");
4658 RemoveDirectoryA("msitest");
4661 static void test_envvar(void)
4663 static const char *results[] =
4665 "1;2", /* MSITESTVAR11 */
4666 "1", /* MSITESTVAR12 */
4667 "1;2", /* MSITESTVAR13 */
4668 ";1;", /* MSITESTVAR14 */
4669 ";;1;;", /* MSITESTVAR15 */
4670 " 1 ", /* MSITESTVAR16 */
4671 ";;2;;1", /* MSITESTVAR17 */
4672 "1;;2;;", /* MSITESTVAR18 */
4673 "1", /* MSITESTVAR19 */
4674 "1", /* MSITESTVAR20 */
4675 "1", /* MSITESTVAR21 */
4676 NULL
4678 UINT r;
4679 HKEY env;
4680 LONG res;
4681 DWORD type, size;
4682 char buffer[16];
4683 UINT i;
4685 if (is_process_limited())
4687 skip("process is limited\n");
4688 return;
4691 create_test_files();
4692 create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table));
4694 res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
4695 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4697 res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2);
4698 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4700 res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2);
4701 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4703 res = RegSetValueExA(env, "MSITESTVAR21", 0, REG_SZ, (const BYTE *)"1", 2);
4704 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4706 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4708 r = MsiInstallProductA(msifile, NULL);
4709 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4711 skip("Not enough rights to perform tests\n");
4712 goto error;
4714 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4716 type = REG_NONE;
4717 size = sizeof(buffer);
4718 buffer[0] = 0;
4719 res = RegQueryValueExA(env, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
4720 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4721 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
4722 ok(!lstrcmpA(buffer, "1"), "Expected \"1\", got %s\n", buffer);
4724 res = RegDeleteValueA(env, "MSITESTVAR1");
4725 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4727 type = REG_NONE;
4728 size = sizeof(buffer);
4729 buffer[0] = 0;
4730 res = RegQueryValueExA(env, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
4731 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4732 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
4733 ok(!lstrcmpA(buffer, "1"), "Expected \"1\", got %s\n", buffer);
4735 res = RegDeleteValueA(env, "MSITESTVAR2");
4736 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4738 res = RegDeleteValueA(env, "MSITESTVAR3");
4739 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4741 res = RegDeleteValueA(env, "MSITESTVAR4");
4742 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4744 res = RegDeleteValueA(env, "MSITESTVAR5");
4745 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4747 res = RegDeleteValueA(env, "MSITESTVAR6");
4748 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4750 res = RegDeleteValueA(env, "MSITESTVAR7");
4751 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4753 res = RegDeleteValueA(env, "MSITESTVAR8");
4754 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4756 res = RegDeleteValueA(env, "MSITESTVAR9");
4757 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4759 res = RegDeleteValueA(env, "MSITESTVAR10");
4760 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4762 i = 11;
4763 while (results[i - 11])
4765 char name[20];
4766 sprintf(name, "MSITESTVAR%d", i);
4768 type = REG_NONE;
4769 size = sizeof(buffer);
4770 buffer[0] = 0;
4771 res = RegQueryValueExA(env, name, NULL, &type, (LPBYTE)buffer, &size);
4772 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
4773 ok(type == REG_SZ, "%d: Expected REG_SZ, got %u\n", i, type);
4774 ok(!lstrcmpA(buffer, results[i - 11]), "%d: Expected %s, got %s\n", i, results[i - 11], buffer);
4776 res = RegDeleteValueA(env, name);
4777 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
4778 i++;
4781 delete_pf("msitest\\cabout\\new\\five.txt", TRUE);
4782 delete_pf("msitest\\cabout\\new", FALSE);
4783 delete_pf("msitest\\cabout\\four.txt", TRUE);
4784 delete_pf("msitest\\cabout", FALSE);
4785 delete_pf("msitest\\changed\\three.txt", TRUE);
4786 delete_pf("msitest\\changed", FALSE);
4787 delete_pf("msitest\\first\\two.txt", TRUE);
4788 delete_pf("msitest\\first", FALSE);
4789 delete_pf("msitest\\filename", TRUE);
4790 delete_pf("msitest\\one.txt", TRUE);
4791 delete_pf("msitest\\service.exe", TRUE);
4792 delete_pf("msitest\\service2.exe", TRUE);
4793 delete_pf("msitest", FALSE);
4795 error:
4796 RegDeleteValueA(env, "MSITESTVAR1");
4797 RegDeleteValueA(env, "MSITESTVAR2");
4798 RegDeleteValueA(env, "MSITESTVAR21");
4799 RegCloseKey(env);
4801 delete_test_files();
4802 DeleteFileA(msifile);
4805 static void test_create_remove_folder(void)
4807 UINT r;
4809 if (is_process_limited())
4811 skip("process is limited\n");
4812 return;
4815 CreateDirectoryA("msitest", NULL);
4816 CreateDirectoryA("msitest\\first", NULL);
4817 CreateDirectoryA("msitest\\second", NULL);
4818 create_file("msitest\\first\\one.txt", 1000);
4819 create_file("msitest\\second\\two.txt", 1000);
4820 create_database(msifile, cf_tables, sizeof(cf_tables) / sizeof(msi_table));
4822 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4824 r = MsiInstallProductA(msifile, NULL);
4825 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4827 skip("Not enough rights to perform tests\n");
4828 goto error;
4830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4832 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
4833 ok(pf_exists("msitest\\first"), "directory not created\n");
4834 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
4835 ok(pf_exists("msitest\\second"), "directory not created\n");
4836 ok(pf_exists("msitest\\third"), "directory not created\n");
4837 ok(pf_exists("msitest"), "directory not created\n");
4839 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4840 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4842 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
4843 ok(!pf_exists("msitest\\first"), "directory not removed\n");
4844 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
4845 ok(!pf_exists("msitest\\second"), "directory not removed\n");
4846 ok(!pf_exists("msitest\\third"), "directory not removed\n");
4847 todo_wine ok(!pf_exists("msitest"), "directory not removed\n");
4849 error:
4850 DeleteFileA("msitest\\first\\one.txt");
4851 DeleteFileA("msitest\\second\\two.txt");
4852 RemoveDirectoryA("msitest\\first");
4853 RemoveDirectoryA("msitest\\second");
4854 RemoveDirectoryA("msitest");
4855 DeleteFileA(msifile);
4858 static void test_start_stop_services(void)
4860 UINT r;
4861 SC_HANDLE scm, service;
4862 BOOL ret;
4863 DWORD error = ERROR_SUCCESS;
4865 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4866 if (!scm && GetLastError() == ERROR_ACCESS_DENIED)
4868 skip("Not enough rights to perform tests\n");
4869 return;
4871 ok(scm != NULL, "Failed to open the SC Manager\n");
4872 if (!scm) return;
4874 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
4875 if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST)
4877 win_skip("The 'Spooler' service does not exist\n");
4878 CloseServiceHandle(scm);
4879 return;
4881 ok(service != NULL, "Failed to open Spooler, error %d\n", GetLastError());
4882 if (!service) {
4883 CloseServiceHandle(scm);
4884 return;
4887 ret = StartServiceA(service, 0, NULL);
4888 if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING)
4890 skip("Spooler service not available, skipping test\n");
4891 CloseServiceHandle(service);
4892 CloseServiceHandle(scm);
4893 return;
4896 CloseServiceHandle(service);
4897 CloseServiceHandle(scm);
4899 create_test_files();
4900 create_database(msifile, sss_tables, sizeof(sss_tables) / sizeof(msi_table));
4902 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4904 r = MsiInstallProductA(msifile, NULL);
4905 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4907 if (error == ERROR_SUCCESS)
4909 SERVICE_STATUS status;
4911 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4912 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
4914 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
4915 ok(ret, "ControlService failed %u\n", GetLastError());
4917 CloseServiceHandle(service);
4918 CloseServiceHandle(scm);
4921 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4922 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4924 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4925 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
4926 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4927 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
4928 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
4929 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
4930 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
4931 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
4932 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
4933 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
4934 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
4935 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
4936 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4938 if (error == ERROR_SUCCESS)
4940 SERVICE_STATUS status;
4942 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4943 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
4945 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
4946 ok(ret, "ControlService failed %u\n", GetLastError());
4948 CloseServiceHandle(service);
4949 CloseServiceHandle(scm);
4952 delete_test_files();
4953 DeleteFileA(msifile);
4956 static void delete_test_service(const char *name)
4958 BOOL ret;
4959 SC_HANDLE manager, service;
4961 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4962 ok(manager != NULL, "can't open service manager\n");
4963 if (!manager) return;
4965 service = OpenServiceA(manager, name, GENERIC_ALL);
4966 if (service)
4968 ret = DeleteService( service );
4969 ok( ret, "failed to delete service %u\n", GetLastError() );
4970 CloseServiceHandle(service);
4972 CloseServiceHandle(manager);
4975 static void test_delete_services(void)
4977 UINT r;
4978 SC_HANDLE manager, service;
4979 DWORD error;
4981 if (is_process_limited())
4983 skip("process is limited\n");
4984 return;
4987 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
4988 ok(manager != NULL, "can't open service manager %u\n", GetLastError());
4989 if (!manager) return;
4991 service = CreateServiceA(manager, "TestService3", "TestService3",
4992 SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START,
4993 SERVICE_ERROR_NORMAL, "C:\\doesnt_exist.exe", NULL, NULL, NULL, NULL, NULL);
4994 ok(service != NULL, "can't create service %u\n", GetLastError());
4995 CloseServiceHandle(service);
4996 CloseServiceHandle(manager);
4997 if (!service) return;
4999 create_test_files();
5000 create_database(msifile, sds_tables, sizeof(sds_tables) / sizeof(msi_table));
5002 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5004 r = MsiInstallProductA(msifile, NULL);
5005 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5007 skip("Not enough rights to perform tests\n");
5008 goto error;
5010 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5012 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5013 ok(manager != NULL, "can't open service manager\n");
5014 if (!manager) goto error;
5016 service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
5017 error = GetLastError();
5018 ok(service == NULL, "TestService3 not deleted\n");
5019 ok(error == ERROR_SERVICE_DOES_NOT_EXIST, "wrong error %u\n", error);
5020 CloseServiceHandle(manager);
5022 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5025 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5026 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5027 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5028 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5029 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5030 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5031 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5032 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5033 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5034 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5035 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5036 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5037 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5039 error:
5040 delete_test_service("TestService");
5041 delete_test_service("TestService2");
5042 delete_test_service("TestService3");
5043 delete_test_files();
5044 DeleteFileA(msifile);
5047 static void test_install_services(void)
5049 UINT r;
5050 SC_HANDLE manager, service;
5051 LONG res;
5052 HKEY hKey;
5053 DWORD err_control, err_controlsize, err_controltype;
5055 if (is_process_limited())
5057 skip("process is limited\n");
5058 return;
5061 create_test_files();
5062 create_database(msifile, sis_tables, sizeof(sis_tables) / sizeof(msi_table));
5064 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5066 r = MsiInstallProductA(msifile, NULL);
5067 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5069 skip("Not enough rights to perform tests\n");
5070 goto error;
5072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5074 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5075 ok(manager != NULL, "can't open service manager\n");
5076 if (!manager) goto error;
5078 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5079 ok(service != NULL, "TestService not installed\n");
5080 CloseServiceHandle(service);
5082 service = OpenServiceA(manager, "TestService4", GENERIC_ALL);
5083 ok(service == NULL, "TestService4 installed\n");
5085 res = RegOpenKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey);
5086 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5088 if (res == ERROR_SUCCESS)
5090 err_control = 0xBEEF;
5091 err_controltype = REG_DWORD;
5092 err_controlsize = sizeof(err_control);
5093 res = RegQueryValueExA(hKey, "ErrorControl", NULL, &err_controltype, (LPBYTE)&err_control, &err_controlsize);
5094 ok(err_control == 0, "TestService.ErrorControl wrong, expected 0, got %u\n", err_control);
5095 RegCloseKey(hKey);
5098 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5099 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5101 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5102 ok(service != NULL, "TestService deleted\n");
5103 CloseServiceHandle(service);
5104 CloseServiceHandle(manager);
5106 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5107 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5108 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5109 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5110 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5111 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5112 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5113 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5114 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5115 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5116 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5117 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5118 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5120 error:
5121 delete_test_service("TestService");
5122 delete_test_files();
5123 DeleteFileA(msifile);
5126 static void test_self_registration(void)
5128 UINT r;
5130 if (is_process_limited())
5132 skip("process is limited\n");
5133 return;
5136 create_test_files();
5137 create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table));
5139 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5141 r = MsiInstallProductA(msifile, NULL);
5142 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5144 skip("Not enough rights to perform tests\n");
5145 goto error;
5147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5149 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5150 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5151 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5152 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5153 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5154 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5155 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5156 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5157 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5158 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5159 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5160 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5161 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5163 error:
5164 delete_test_files();
5165 DeleteFileA(msifile);
5168 static void test_register_font(void)
5170 static const char regfont1[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5171 static const char regfont2[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5172 LONG ret;
5173 HKEY key;
5174 UINT r;
5175 REGSAM access = KEY_ALL_ACCESS;
5177 if (is_process_limited())
5179 skip("process is limited\n");
5180 return;
5183 create_test_files();
5184 create_file("msitest\\font.ttf", 1000);
5185 create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table));
5187 if (is_wow64)
5188 access |= KEY_WOW64_64KEY;
5190 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5192 r = MsiInstallProductA(msifile, NULL);
5193 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5195 skip("Not enough rights to perform tests\n");
5196 goto error;
5198 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5200 ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont1, 0, access, &key);
5201 if (ret)
5202 RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont2, 0, access, &key);
5204 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5205 ok(ret != ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
5207 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5208 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5210 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5212 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5213 ok(ret == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
5215 RegDeleteValueA(key, "msi test font");
5216 RegCloseKey(key);
5218 error:
5219 DeleteFileA("msitest\\font.ttf");
5220 delete_test_files();
5221 DeleteFileA(msifile);
5224 static void test_validate_product_id(void)
5226 UINT r;
5228 if (is_process_limited())
5230 skip("process is limited\n");
5231 return;
5234 create_test_files();
5235 create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table));
5237 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5239 r = MsiInstallProductA(msifile, NULL);
5240 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5242 skip("Not enough rights to perform tests\n");
5243 goto error;
5245 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5247 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=1");
5248 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5250 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=2");
5251 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5253 r = MsiInstallProductA(msifile, "PIDKEY=123-1234567");
5254 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5256 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5257 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5258 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5259 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5260 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5261 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5262 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5263 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5264 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5265 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5266 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5267 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5268 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5270 error:
5271 delete_test_files();
5272 DeleteFileA(msifile);
5275 static void test_install_remove_odbc(void)
5277 UINT r;
5279 if (is_process_limited())
5281 skip("process is limited\n");
5282 return;
5285 create_test_files();
5286 create_file("msitest\\ODBCdriver.dll", 1000);
5287 create_file("msitest\\ODBCdriver2.dll", 1000);
5288 create_file("msitest\\ODBCtranslator.dll", 1000);
5289 create_file("msitest\\ODBCtranslator2.dll", 1000);
5290 create_file("msitest\\ODBCsetup.dll", 1000);
5291 create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table));
5293 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5295 r = MsiInstallProductA(msifile, NULL);
5296 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5298 skip("Not enough rights to perform tests\n");
5299 goto error;
5301 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5303 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5304 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5305 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5306 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5307 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5309 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5310 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5312 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not removed\n");
5313 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not removed\n");
5314 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not removed\n");
5315 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not removed\n");
5316 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
5317 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5319 error:
5320 DeleteFileA("msitest\\ODBCdriver.dll");
5321 DeleteFileA("msitest\\ODBCdriver2.dll");
5322 DeleteFileA("msitest\\ODBCtranslator.dll");
5323 DeleteFileA("msitest\\ODBCtranslator2.dll");
5324 DeleteFileA("msitest\\ODBCsetup.dll");
5325 delete_test_files();
5326 DeleteFileA(msifile);
5329 static void test_register_typelib(void)
5331 UINT r;
5333 if (is_process_limited())
5335 skip("process is limited\n");
5336 return;
5339 create_test_files();
5340 create_file("msitest\\typelib.dll", 1000);
5341 create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table));
5343 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5345 r = MsiInstallProductA(msifile, "REGISTER_TYPELIB=1");
5346 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5348 skip("Not enough rights to perform tests\n");
5349 goto error;
5351 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5353 r = MsiInstallProductA(msifile, NULL);
5354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5356 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5357 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5359 ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n");
5360 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5362 error:
5363 DeleteFileA("msitest\\typelib.dll");
5364 delete_test_files();
5365 DeleteFileA(msifile);
5368 static void test_create_remove_shortcut(void)
5370 UINT r;
5372 if (is_process_limited())
5374 skip("process is limited\n");
5375 return;
5378 create_test_files();
5379 create_file("msitest\\target.txt", 1000);
5380 create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table));
5382 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5384 r = MsiInstallProductA(msifile, NULL);
5385 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5387 skip("Not enough rights to perform tests\n");
5388 goto error;
5390 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5392 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5393 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5395 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5396 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5398 ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n");
5399 ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n");
5400 todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5402 error:
5403 DeleteFileA("msitest\\target.txt");
5404 delete_test_files();
5405 DeleteFileA(msifile);
5408 static void test_publish_components(void)
5410 static const char keypath[] =
5411 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5412 static const char keypath2[] =
5413 "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5415 UINT r;
5416 LONG res;
5417 HKEY key;
5418 BYTE *data;
5419 DWORD size;
5421 if (is_process_limited())
5423 skip("process is limited\n");
5424 return;
5427 create_test_files();
5428 create_file("msitest\\english.txt", 1000);
5429 create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table));
5431 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5433 r = MsiInstallProductA(msifile, NULL);
5434 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5436 skip("Not enough rights to perform tests\n");
5437 goto error;
5439 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5441 size = 0;
5442 r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5443 "english.txt", INSTALLMODE_DEFAULT, NULL, &size);
5444 ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
5446 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5447 ok(res == ERROR_SUCCESS, "components key not created %d\n", res);
5449 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, &size);
5450 ok(res == ERROR_SUCCESS, "value not found %d\n", res);
5452 data = HeapAlloc(GetProcessHeap(), 0, size);
5453 res = RegQueryValueExA(key, "english.txt", NULL, NULL, data, &size);
5454 ok(res == ERROR_SUCCESS, "value not found %d\n", res);
5455 RegCloseKey(key);
5457 res = RegDeleteKeyA(HKEY_CURRENT_USER, keypath);
5458 ok(res == ERROR_SUCCESS, "RegDeleteKey failed %d\n", res);
5460 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath2, 0, NULL, REG_OPTION_NON_VOLATILE,
5461 MAXIMUM_ALLOWED | KEY_WOW64_64KEY, NULL, &key, NULL );
5462 ok(res == ERROR_SUCCESS, "RegCreateKeyEx failed %d\n", res);
5463 res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size);
5464 ok(res == ERROR_SUCCESS, "RegSetValueEx failed %d\n", res);
5465 RegCloseKey(key);
5467 size = 0;
5468 r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5469 "english.txt", INSTALLMODE_DEFAULT, NULL, &size);
5470 ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
5472 if (pRegDeleteKeyExA)
5473 res = pRegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0);
5474 else
5475 res = RegDeleteKeyA(HKEY_LOCAL_MACHINE, keypath2);
5476 ok(res == ERROR_SUCCESS, "RegDeleteKey failed %d\n", res);
5478 res = RegCreateKeyA(HKEY_CURRENT_USER, keypath, &key);
5479 ok(res == ERROR_SUCCESS, "RegCreateKey failed %d\n", res);
5481 res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size);
5482 ok(res == ERROR_SUCCESS, "RegSetValueEx failed %d\n", res);
5483 HeapFree(GetProcessHeap(), 0, data);
5484 RegCloseKey(key);
5486 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5487 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5489 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5490 ok(res == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", res);
5492 ok(!delete_pf("msitest\\english.txt", TRUE), "file not removed\n");
5493 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5495 error:
5496 DeleteFileA("msitest\\english.txt");
5497 delete_test_files();
5498 DeleteFileA(msifile);
5501 static void test_remove_duplicate_files(void)
5503 UINT r;
5505 if (is_process_limited())
5507 skip("process is limited\n");
5508 return;
5511 create_test_files();
5512 create_file("msitest\\original.txt", 1000);
5513 create_file("msitest\\original2.txt", 1000);
5514 create_file("msitest\\original3.txt", 1000);
5515 create_database(msifile, rd_tables, sizeof(rd_tables) / sizeof(msi_table));
5517 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5519 r = MsiInstallProductA(msifile, NULL);
5520 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5522 skip("Not enough rights to perform tests\n");
5523 goto error;
5525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5527 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5528 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5529 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5530 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5531 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5533 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5534 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5536 ok(delete_pf("msitest\\original.txt", TRUE), "file removed\n");
5537 ok(!delete_pf("msitest\\original2.txt", TRUE), "file not removed\n");
5538 ok(!delete_pf("msitest\\original3.txt", TRUE), "file not removed\n");
5539 ok(!delete_pf("msitest\\duplicate.txt", TRUE), "file not removed\n");
5540 ok(!delete_pf("msitest\\duplicate2.txt", TRUE), "file not removed\n");
5541 ok(delete_pf("msitest", FALSE), "directory removed\n");
5543 error:
5544 DeleteFileA("msitest\\original.txt");
5545 DeleteFileA("msitest\\original2.txt");
5546 DeleteFileA("msitest\\original3.txt");
5547 delete_test_files();
5548 DeleteFileA(msifile);
5551 static void test_remove_registry_values(void)
5553 UINT r;
5554 LONG res;
5555 HKEY key;
5556 REGSAM access = KEY_ALL_ACCESS;
5558 if (is_process_limited())
5560 skip("process is limited\n");
5561 return;
5564 create_test_files();
5565 create_file("msitest\\registry.txt", 1000);
5566 create_database(msifile, rrv_tables, sizeof(rrv_tables) / sizeof(msi_table));
5568 if (is_wow64)
5569 access |= KEY_WOW64_64KEY;
5571 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5573 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, NULL, 0, access, NULL, &key, NULL);
5574 RegSetValueExA(key, "value1", 0, REG_SZ, (const BYTE *)"1", 2);
5575 RegCloseKey(key);
5577 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
5578 RegSetValueExA(key, "value2", 0, REG_SZ, (const BYTE *)"2", 2);
5579 RegCloseKey(key);
5581 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, NULL, 0, access, NULL, &key, NULL);
5582 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
5583 RegSetValueExA(key, "valueA", 0, REG_SZ, (const BYTE *)"A", 2);
5584 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
5585 RegCloseKey(key);
5587 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, NULL, 0, access, NULL, &key, NULL);
5588 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
5589 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
5590 RegCloseKey(key);
5592 r = MsiInstallProductA(msifile, NULL);
5593 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5595 skip("Not enough rights to perform tests\n");
5596 goto error;
5598 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5600 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, access, &key);
5601 ok(res == ERROR_SUCCESS, "key removed\n");
5602 RegCloseKey(key);
5604 if (is_64bit)
5606 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
5607 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5609 else
5611 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
5612 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5615 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
5616 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5617 RegCloseKey(key);
5619 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5620 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5622 if (is_64bit)
5624 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
5625 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5627 else
5629 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
5630 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5633 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, access, &key);
5634 ok(res == ERROR_SUCCESS, "key removed\n");
5635 RegCloseKey(key);
5637 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, access, &key);
5638 ok(res == ERROR_SUCCESS, "key removed\n");
5639 RegCloseKey(key);
5641 if (is_64bit)
5643 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
5644 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5646 else
5648 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
5649 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5652 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
5653 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
5654 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine", access);
5656 ok(!delete_pf("msitest\\registry.txt", TRUE), "file not removed\n");
5657 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5659 error:
5660 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", access);
5661 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
5662 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
5663 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", access);
5665 DeleteFileA("msitest\\registry.txt");
5666 delete_test_files();
5667 DeleteFileA(msifile);
5670 static void test_find_related_products(void)
5672 UINT r;
5674 if (is_process_limited())
5676 skip("process is limited\n");
5677 return;
5680 create_test_files();
5681 create_file("msitest\\product.txt", 1000);
5682 create_database(msifile, frp_tables, sizeof(frp_tables) / sizeof(msi_table));
5684 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5686 r = MsiInstallProductA(msifile, NULL);
5687 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5689 skip("Not enough rights to perform tests\n");
5690 goto error;
5692 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5694 /* install again, so it finds the upgrade code */
5695 r = MsiInstallProductA(msifile, NULL);
5696 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5698 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5699 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5701 ok(!delete_pf("msitest\\product.txt", TRUE), "file not removed\n");
5702 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5704 error:
5705 DeleteFileA("msitest\\product.txt");
5706 delete_test_files();
5707 DeleteFileA(msifile);
5710 static void test_remove_ini_values(void)
5712 UINT r;
5713 DWORD len;
5714 char inifile[MAX_PATH], buf[0x10];
5715 HANDLE file;
5716 BOOL ret;
5718 if (is_process_limited())
5720 skip("process is limited\n");
5721 return;
5724 create_test_files();
5725 create_file("msitest\\inifile.txt", 1000);
5726 create_database(msifile, riv_tables, sizeof(riv_tables) / sizeof(msi_table));
5728 lstrcpyA(inifile, PROG_FILES_DIR);
5729 lstrcatA(inifile, "\\msitest");
5730 ret = CreateDirectoryA(inifile, NULL);
5731 if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
5733 skip("Not enough rights to perform tests\n");
5734 goto error;
5736 lstrcatA(inifile, "\\test.ini");
5737 file = CreateFileA(inifile, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0, NULL);
5738 CloseHandle(file);
5740 ret = WritePrivateProfileStringA("section1", "key1", "value1", inifile);
5741 ok(ret, "failed to write profile string %u\n", GetLastError());
5743 ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile);
5744 ok(ret, "failed to write profile string %u\n", GetLastError());
5746 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5748 r = MsiInstallProductA(msifile, NULL);
5749 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5751 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5752 ok(len == 6, "got %u expected 6\n", len);
5754 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5755 ok(!len, "got %u expected 0\n", len);
5757 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5758 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5760 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5761 ok(!len, "got %u expected 0\n", len);
5763 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5764 ok(!len, "got %u expected 0\n", len);
5766 todo_wine ok(!delete_pf("msitest\\test.ini", TRUE), "file removed\n");
5767 ok(!delete_pf("msitest\\inifile.txt", TRUE), "file not removed\n");
5768 ok(delete_pf("msitest", FALSE), "directory removed\n");
5770 error:
5771 DeleteFileA("msitest\\inifile.txt");
5772 delete_test_files();
5773 DeleteFileA(msifile);
5776 static void test_remove_env_strings(void)
5778 UINT r;
5779 LONG res;
5780 HKEY key;
5781 DWORD type, size;
5782 char buffer[0x10];
5784 if (is_process_limited())
5786 skip("process is limited\n");
5787 return;
5790 create_test_files();
5791 create_file("msitest\\envvar.txt", 1000);
5792 create_database(msifile, res_tables, sizeof(res_tables) / sizeof(msi_table));
5794 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5796 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
5797 ok(!res, "failed to open environment key %d\n", res);
5799 RegSetValueExA(key, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"1", 2);
5800 RegSetValueExA(key, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"1", 2);
5801 RegSetValueExA(key, "MSITESTVAR3", 0, REG_SZ, (const BYTE *)"1", 2);
5802 RegSetValueExA(key, "MSITESTVAR4", 0, REG_SZ, (const BYTE *)"1", 2);
5803 RegSetValueExA(key, "MSITESTVAR5", 0, REG_SZ, (const BYTE *)"1", 2);
5804 RegSetValueExA(key, "MSITESTVAR6", 0, REG_SZ, (const BYTE *)"1;2", 4);
5805 RegSetValueExA(key, "MSITESTVAR7", 0, REG_SZ, (const BYTE *)"1;2", 4);
5806 RegSetValueExA(key, "MSITESTVAR8", 0, REG_SZ, (const BYTE *)"2;1;0", 6);
5807 RegSetValueExA(key, "MSITESTVAR9", 0, REG_SZ, (const BYTE *)"0;1;2", 6);
5808 RegSetValueExA(key, "MSITESTVAR10", 0, REG_SZ, (const BYTE *)"1", 2);
5809 RegSetValueExA(key, "MSITESTVAR11", 0, REG_SZ, (const BYTE *)"1", 2);
5811 RegCloseKey(key);
5813 r = MsiInstallProductA(msifile, NULL);
5814 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5816 skip("Not enough rights to perform tests\n");
5817 goto error;
5819 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5821 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
5822 ok(!res, "failed to open environment key %d\n", res);
5824 type = REG_NONE;
5825 buffer[0] = 0;
5826 size = sizeof(buffer);
5827 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
5828 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5829 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5830 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5832 type = REG_NONE;
5833 buffer[0] = 0;
5834 size = sizeof(buffer);
5835 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
5836 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5837 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5838 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5840 type = REG_NONE;
5841 buffer[0] = 0;
5842 size = sizeof(buffer);
5843 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
5844 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5845 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5846 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5848 type = REG_NONE;
5849 buffer[0] = 0;
5850 size = sizeof(buffer);
5851 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, &type, (LPBYTE)buffer, &size);
5852 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5853 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5854 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5856 type = REG_NONE;
5857 buffer[0] = 0;
5858 size = sizeof(buffer);
5859 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
5860 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5861 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5862 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5864 RegCloseKey(key);
5866 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5867 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5869 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
5870 ok(!res, "failed to open environment key %d\n", res);
5872 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, NULL, NULL, NULL);
5873 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5875 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, NULL, NULL, NULL);
5876 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5878 type = REG_NONE;
5879 buffer[0] = 0;
5880 size = sizeof(buffer);
5881 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
5882 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5883 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5884 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5885 RegDeleteValueA(key, "MSITESTVAR3");
5887 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, NULL, NULL, NULL);
5888 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5890 type = REG_NONE;
5891 buffer[0] = 0;
5892 size = sizeof(buffer);
5893 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
5894 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5895 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5896 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5897 RegDeleteValueA(key, "MSITESTVAR5");
5899 type = REG_NONE;
5900 buffer[0] = 0;
5901 size = sizeof(buffer);
5902 res = RegQueryValueExA(key, "MSITESTVAR6", NULL, &type, (LPBYTE)buffer, &size);
5903 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5904 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5905 ok(!lstrcmpA(buffer, "2"), "expected \"2\", got \"%s\"\n", buffer);
5906 RegDeleteValueA(key, "MSITESTVAR6");
5908 type = REG_NONE;
5909 buffer[0] = 0;
5910 size = sizeof(buffer);
5911 res = RegQueryValueExA(key, "MSITESTVAR7", NULL, &type, (LPBYTE)buffer, &size);
5912 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5913 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5914 ok(!lstrcmpA(buffer, "2"), "expected \"2\", got \"%s\"\n", buffer);
5915 RegDeleteValueA(key, "MSITESTVAR7");
5917 type = REG_NONE;
5918 buffer[0] = 0;
5919 size = sizeof(buffer);
5920 res = RegQueryValueExA(key, "MSITESTVAR8", NULL, &type, (LPBYTE)buffer, &size);
5921 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5922 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5923 ok(!lstrcmpA(buffer, "2;0"), "expected \"2;0\", got \"%s\"\n", buffer);
5924 RegDeleteValueA(key, "MSITESTVAR8");
5926 type = REG_NONE;
5927 buffer[0] = 0;
5928 size = sizeof(buffer);
5929 res = RegQueryValueExA(key, "MSITESTVAR9", NULL, &type, (LPBYTE)buffer, &size);
5930 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5931 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5932 ok(!lstrcmpA(buffer, "0;2"), "expected \"0;2\", got \"%s\"\n", buffer);
5933 RegDeleteValueA(key, "MSITESTVAR9");
5935 type = REG_NONE;
5936 buffer[0] = 0;
5937 size = sizeof(buffer);
5938 res = RegQueryValueExA(key, "MSITESTVAR10", NULL, &type, (LPBYTE)buffer, &size);
5939 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5941 type = REG_NONE;
5942 buffer[0] = 0;
5943 size = sizeof(buffer);
5944 res = RegQueryValueExA(key, "MSITESTVAR11", NULL, &type, (LPBYTE)buffer, &size);
5945 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5946 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
5947 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
5948 RegDeleteValueA(key, "MSITESTVAR11");
5950 ok(!delete_pf("msitest\\envvar.txt", TRUE), "file not removed\n");
5951 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5953 error:
5954 RegDeleteValueA(key, "MSITESTVAR1");
5955 RegDeleteValueA(key, "MSITESTVAR2");
5956 RegDeleteValueA(key, "MSITESTVAR3");
5957 RegDeleteValueA(key, "MSITESTVAR4");
5958 RegDeleteValueA(key, "MSITESTVAR5");
5959 RegDeleteValueA(key, "MSITESTVAR6");
5960 RegDeleteValueA(key, "MSITESTVAR7");
5961 RegDeleteValueA(key, "MSITESTVAR8");
5962 RegDeleteValueA(key, "MSITESTVAR9");
5963 RegDeleteValueA(key, "MSITESTVAR10");
5964 RegDeleteValueA(key, "MSITESTVAR11");
5965 RegCloseKey(key);
5967 DeleteFileA("msitest\\envvar.txt");
5968 delete_test_files();
5969 DeleteFileA(msifile);
5972 static void test_register_class_info(void)
5974 UINT r;
5975 LONG res;
5976 HKEY hkey;
5978 if (is_process_limited())
5980 skip("process is limited\n");
5981 return;
5984 create_test_files();
5985 create_file("msitest\\class.txt", 1000);
5986 create_database(msifile, rci_tables, sizeof(rci_tables) / sizeof(msi_table));
5988 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5990 r = MsiInstallProductA(msifile, NULL);
5991 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5993 skip("Not enough rights to perform tests\n");
5994 goto error;
5996 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5998 if (is_64bit)
5999 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6000 else
6001 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6002 ok(res == ERROR_SUCCESS, "key not created\n");
6003 RegCloseKey(hkey);
6005 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6006 ok(res == ERROR_SUCCESS, "key not created\n");
6007 RegCloseKey(hkey);
6009 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
6010 ok(res == ERROR_SUCCESS, "key not created\n");
6011 RegCloseKey(hkey);
6013 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6014 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6016 if (is_64bit)
6017 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6018 else
6019 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6020 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6022 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6023 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6025 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
6026 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6028 ok(!delete_pf("msitest\\class.txt", TRUE), "file not removed\n");
6029 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6031 error:
6032 DeleteFileA("msitest\\class.txt");
6033 delete_test_files();
6034 DeleteFileA(msifile);
6037 static void test_register_extension_info(void)
6039 UINT r;
6040 LONG res;
6041 HKEY hkey;
6043 if (is_process_limited())
6045 skip("process is limited\n");
6046 return;
6049 create_test_files();
6050 create_file("msitest\\extension.txt", 1000);
6051 create_database(msifile, rei_tables, sizeof(rei_tables) / sizeof(msi_table));
6053 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6055 r = MsiInstallProductA(msifile, NULL);
6056 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6058 skip("Not enough rights to perform tests\n");
6059 goto error;
6061 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6063 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
6064 ok(res == ERROR_SUCCESS, "key not created\n");
6065 RegCloseKey(hkey);
6067 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &hkey);
6068 ok(res == ERROR_SUCCESS, "key not created\n");
6069 RegCloseKey(hkey);
6071 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6072 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6074 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
6075 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6077 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1", &hkey);
6078 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6080 ok(!delete_pf("msitest\\extension.txt", TRUE), "file not removed\n");
6081 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6083 error:
6084 DeleteFileA("msitest\\extension.txt");
6085 delete_test_files();
6086 DeleteFileA(msifile);
6089 static void test_register_progid_info(void)
6091 UINT r;
6092 LONG res;
6093 HKEY hkey;
6095 if (is_process_limited())
6097 skip("process is limited\n");
6098 return;
6101 create_test_files();
6102 create_file("msitest\\progid.txt", 1000);
6103 create_database(msifile, rpi_tables, sizeof(rpi_tables) / sizeof(msi_table));
6105 res = RegCreateKeyExA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", 0, NULL, 0,
6106 KEY_ALL_ACCESS, NULL, &hkey, NULL);
6107 ok(res == ERROR_SUCCESS, "key not created\n");
6108 RegCloseKey(hkey);
6110 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6112 r = MsiInstallProductA(msifile, NULL);
6113 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6115 skip("Not enough rights to perform tests\n");
6116 goto error;
6118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6120 if (is_64bit)
6121 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6122 else
6123 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6124 ok(res == ERROR_SUCCESS, "key not created\n");
6125 RegCloseKey(hkey);
6127 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &hkey);
6128 ok(res == ERROR_SUCCESS, "key not created\n");
6129 RegCloseKey(hkey);
6131 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &hkey);
6132 ok(res == ERROR_SUCCESS, "key not created\n");
6133 RegCloseKey(hkey);
6135 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &hkey);
6136 ok(res == ERROR_SUCCESS, "key not created\n");
6137 RegCloseKey(hkey);
6139 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass.1", &hkey);
6140 ok(res == ERROR_SUCCESS, "key not created\n");
6141 RegCloseKey(hkey);
6143 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass", &hkey);
6144 ok(res == ERROR_SUCCESS, "key not created\n");
6145 RegCloseKey(hkey);
6147 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass.1", &hkey);
6148 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6149 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6151 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass", &hkey);
6152 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6154 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", &hkey);
6155 ok(res == ERROR_SUCCESS, "key deleted\n");
6156 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6158 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned2", &hkey);
6159 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6161 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Extension", &hkey);
6162 ok(res == ERROR_SUCCESS, "key not created\n");
6163 RegCloseKey(hkey);
6165 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6168 if (is_64bit)
6169 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6170 else
6171 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6172 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6174 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &hkey);
6175 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6177 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &hkey);
6178 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6180 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &hkey);
6181 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6183 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass.1", &hkey);
6184 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6186 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass", &hkey);
6187 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6189 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass.1", &hkey);
6190 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6192 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass", &hkey);
6193 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6195 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", &hkey);
6196 ok(res == ERROR_SUCCESS, "key deleted\n");
6197 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6199 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned2", &hkey);
6200 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6202 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Extension", &hkey);
6203 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6205 ok(!delete_pf("msitest\\progid.txt", TRUE), "file not removed\n");
6206 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6208 error:
6209 DeleteFileA("msitest\\progid.txt");
6210 delete_test_files();
6211 DeleteFileA(msifile);
6212 RegDeleteKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned");
6215 static void test_register_mime_info(void)
6217 UINT r;
6218 LONG res;
6219 HKEY hkey;
6221 if (is_process_limited())
6223 skip("process is limited\n");
6224 return;
6227 create_test_files();
6228 create_file("msitest\\mime.txt", 1000);
6229 create_database(msifile, rmi_tables, sizeof(rmi_tables) / sizeof(msi_table));
6231 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6233 r = MsiInstallProductA(msifile, NULL);
6234 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6236 skip("Not enough rights to perform tests\n");
6237 goto error;
6239 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6241 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
6242 ok(res == ERROR_SUCCESS, "key not created\n");
6243 RegCloseKey(hkey);
6245 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6246 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6248 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
6249 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6251 ok(!delete_pf("msitest\\mime.txt", TRUE), "file not removed\n");
6252 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6254 error:
6255 DeleteFileA("msitest\\mime.txt");
6256 delete_test_files();
6257 DeleteFileA(msifile);
6260 static void test_publish_assemblies(void)
6262 static const char manifest[] =
6263 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6264 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6265 "processorArchitecture=\"x86\"/>";
6266 static const char manifest_local[] =
6267 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6268 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6269 "processorArchitecture=\"x86\"/>";
6270 static const char classes_path_dotnet[] =
6271 "Installer\\Assemblies\\Global";
6272 static const char classes_path_dotnet_local[] =
6273 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6274 static const char classes_path_dotnet_local_wow64[] =
6275 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6276 static const char classes_path_win32[] =
6277 "Installer\\Win32Assemblies\\Global";
6278 static const char classes_path_win32_local[] =
6279 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6280 static const char classes_path_win32_local_wow64[] =
6281 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6282 static const char path_dotnet[] =
6283 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6284 static const char path_dotnet_local[] =
6285 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6286 static const char path_dotnet_local_wow64[] =
6287 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6288 static const char path_win32[] =
6289 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6290 static const char path_win32_local[] =
6291 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6292 static const char path_win32_local_wow64[] =
6293 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6294 static const char name_dotnet[] =
6295 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6296 "version=\"1.0.0.0\",culture=\"neutral\"";
6297 static const char name_dotnet_local[] =
6298 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6299 "version=\"1.0.0.0\",culture=\"neutral\"";
6300 static const char name_win32[] =
6301 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6302 "type=\"win32\",version=\"1.0.0.0\"";
6303 static const char name_win32_local[] =
6304 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6305 "type=\"win32\",version=\"1.0.0.0\"";
6306 UINT r;
6307 LONG res;
6308 HKEY hkey;
6309 const char *path;
6310 int access;
6312 if (is_process_limited())
6314 skip("process is limited\n");
6315 return;
6318 create_test_files();
6319 create_file("msitest\\win32.txt", 1000);
6320 create_file("msitest\\win32_local.txt", 1000);
6321 create_file("msitest\\dotnet.txt", 1000);
6322 create_file("msitest\\dotnet_local.txt", 1000);
6323 create_file_data("msitest\\manifest.txt", manifest, 0);
6324 create_file_data("msitest\\manifest_local.txt", manifest_local, 0);
6325 create_file("msitest\\application_win32.txt", 1000);
6326 create_file("msitest\\application_dotnet.txt", 1000);
6327 create_database(msifile, pa_tables, sizeof(pa_tables) / sizeof(msi_table));
6329 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6331 r = MsiInstallProductA(msifile, NULL);
6332 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6334 skip("Not enough rights to perform tests\n");
6335 goto done;
6337 if (r == ERROR_INSTALL_FAILURE)
6339 skip("No support for installing side-by-side assemblies\n");
6340 goto done;
6342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6344 res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey);
6345 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6346 CHECK_REG_STR(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6347 RegCloseKey(hkey);
6349 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6350 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6351 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6352 CHECK_REG_STR(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6353 RegCloseKey(hkey);
6355 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6356 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6357 "Expected ERROR_SUCCESS, got %d\n", res);
6358 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6359 RegCloseKey(hkey);
6361 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6362 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6363 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6364 "Expected ERROR_SUCCESS, got %d\n", res);
6365 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6366 RegCloseKey(hkey);
6368 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6369 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6371 res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey);
6372 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6373 if (res == ERROR_SUCCESS)
6375 res = RegDeleteValueA(hkey, name_dotnet);
6376 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6377 RegCloseKey(hkey);
6380 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6381 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6382 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6384 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6385 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6386 if (res == ERROR_SUCCESS)
6388 res = RegDeleteValueA(hkey, name_win32);
6389 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6390 RegCloseKey(hkey);
6393 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6394 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6395 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6397 r = MsiInstallProductA(msifile, "ALLUSERS=1");
6398 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6400 access = KEY_QUERY_VALUE;
6401 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6402 if (res == ERROR_FILE_NOT_FOUND && is_wow64) /* Vista WOW64 */
6404 trace("Using 64-bit registry view for HKCR\\Installer\n");
6405 access = KEY_QUERY_VALUE | KEY_WOW64_64KEY;
6406 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6408 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6409 CHECK_REG_STR(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6410 RegCloseKey(hkey);
6412 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6413 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6414 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6415 CHECK_REG_STR(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6416 RegCloseKey(hkey);
6418 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_win32, 0, access, &hkey);
6419 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6420 "Expected ERROR_SUCCESS, got %d\n", res);
6421 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6422 RegCloseKey(hkey);
6424 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6425 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6426 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6427 "Expected ERROR_SUCCESS, got %d\n", res);
6428 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6429 RegCloseKey(hkey);
6431 r = MsiInstallProductA(msifile, "REMOVE=ALL ALLUSERS=1");
6432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6434 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_dotnet, &hkey);
6435 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6436 if (res == ERROR_SUCCESS)
6438 res = RegDeleteValueA(hkey, name_dotnet);
6439 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6440 RegCloseKey(hkey);
6443 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6444 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6445 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6447 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_win32, &hkey);
6448 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6449 if (res == ERROR_SUCCESS)
6451 res = RegDeleteValueA(hkey, name_win32);
6452 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6453 RegCloseKey(hkey);
6456 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6457 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6458 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6460 done:
6461 DeleteFileA("msitest\\win32.txt");
6462 DeleteFileA("msitest\\win32_local.txt");
6463 DeleteFileA("msitest\\dotnet.txt");
6464 DeleteFileA("msitest\\dotnet_local.txt");
6465 DeleteFileA("msitest\\manifest.txt");
6466 DeleteFileA("msitest\\manifest_local.txt");
6467 DeleteFileA("msitest\\application_win32.txt");
6468 DeleteFileA("msitest\\application_dotnet.txt");
6469 delete_test_files();
6470 DeleteFileA(msifile);
6473 static void test_remove_existing_products(void)
6475 UINT r;
6477 if (is_process_limited())
6479 skip("process is limited\n");
6480 return;
6483 create_test_files();
6484 create_file("msitest\\rep.txt", 1000);
6485 create_database(msifile, rep_tables, sizeof(rep_tables) / sizeof(msi_table));
6487 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6489 r = MsiInstallProductA(msifile, NULL);
6490 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6492 skip("Not enough rights to perform tests\n");
6493 goto error;
6495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6497 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6500 ok(!delete_pf("msitest\\rep.txt", TRUE), "file not removed\n");
6501 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6503 error:
6504 DeleteFileA("msitest\\rep.txt");
6505 delete_test_files();
6506 DeleteFileA(msifile);
6509 START_TEST(action)
6511 DWORD len;
6512 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6513 STATEMGRSTATUS status;
6514 BOOL ret = FALSE;
6516 init_functionpointers();
6518 if (pIsWow64Process)
6519 pIsWow64Process(GetCurrentProcess(), &is_wow64);
6521 GetCurrentDirectoryA(MAX_PATH, prev_path);
6522 GetTempPathA(MAX_PATH, temp_path);
6523 SetCurrentDirectoryA(temp_path);
6525 lstrcpyA(CURR_DIR, temp_path);
6526 len = lstrlenA(CURR_DIR);
6528 if(len && (CURR_DIR[len - 1] == '\\'))
6529 CURR_DIR[len - 1] = 0;
6531 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6532 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6534 /* Create a restore point ourselves so we circumvent the multitude of restore points
6535 * that would have been created by all the installation and removal tests.
6537 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6538 * creation of restore points.
6540 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
6542 memset(&status, 0, sizeof(status));
6543 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
6546 /* Create only one log file and don't append. We have to pass something
6547 * for the log mode for this to work. The logfile needs to have an absolute
6548 * path otherwise we still end up with some extra logfiles as some tests
6549 * change the current directory.
6551 lstrcpyA(log_file, temp_path);
6552 lstrcatA(log_file, "\\msitest.log");
6553 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
6555 test_register_product();
6556 test_publish_product();
6557 test_publish_features();
6558 test_register_user();
6559 test_process_components();
6560 test_publish();
6561 test_publish_sourcelist();
6562 test_remove_files();
6563 test_move_files();
6564 test_duplicate_files();
6565 test_write_registry_values();
6566 test_envvar();
6567 test_create_remove_folder();
6568 test_start_stop_services();
6569 test_delete_services();
6570 test_install_services();
6571 test_self_registration();
6572 test_register_font();
6573 test_validate_product_id();
6574 test_install_remove_odbc();
6575 test_register_typelib();
6576 test_create_remove_shortcut();
6577 test_publish_components();
6578 test_remove_duplicate_files();
6579 test_remove_registry_values();
6580 test_find_related_products();
6581 test_remove_ini_values();
6582 test_remove_env_strings();
6583 test_register_class_info();
6584 test_register_extension_info();
6585 test_register_progid_info();
6586 test_register_mime_info();
6587 test_publish_assemblies();
6588 test_remove_existing_products();
6590 DeleteFileA(log_file);
6592 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
6594 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
6595 if (ret)
6596 remove_restore_point(status.llSequenceNumber);
6598 FreeLibrary(hsrclient);
6600 SetCurrentDirectoryA(prev_path);