msi/tests: Fix an intermittent test failure.
[wine.git] / dlls / msi / tests / action.c
blobe5c862e206cf07ac69b8e53eb62c7b8689e1a9d0
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 #define COBJMACROS
27 #include <windows.h>
28 #include <msiquery.h>
29 #include <msidefs.h>
30 #include <msi.h>
31 #include <fci.h>
32 #include <srrestoreptapi.h>
33 #include <wtypes.h>
34 #include <shellapi.h>
35 #include <winsvc.h>
36 #include <odbcinst.h>
37 #include <sddl.h>
39 #include "wine/test.h"
40 #include "utils.h"
41 #include "typelib.h"
43 static UINT (WINAPI *pMsiQueryComponentStateA)
44 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
45 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
46 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
47 static UINT (WINAPI *pMsiSourceListGetInfoA)
48 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
49 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
50 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
51 static UINT (WINAPI *pMsiQueryFeatureStateExA)
52 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
54 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
55 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
57 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
58 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
60 static BOOL is_wow64;
61 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
63 static const char *msifile = "msitest.msi";
65 /* msi database data */
67 static const char component_dat[] =
68 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
69 "s72\tS38\ts72\ti2\tS255\tS72\n"
70 "Component\tComponent\n"
71 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
72 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
73 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
74 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
75 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
76 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
77 "component\t\tMSITESTDIR\t0\t1\tfile\n"
78 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
79 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
80 "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
82 static const char directory_dat[] =
83 "Directory\tDirectory_Parent\tDefaultDir\n"
84 "s72\tS72\tl255\n"
85 "Directory\tDirectory\n"
86 "CABOUTDIR\tMSITESTDIR\tcabout\n"
87 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
88 "FIRSTDIR\tMSITESTDIR\tfirst\n"
89 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
90 "NEWDIR\tCABOUTDIR\tnew\n"
91 "ProgramFilesFolder\tTARGETDIR\t.\n"
92 "TARGETDIR\t\tSourceDir";
94 static const char feature_dat[] =
95 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
96 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
97 "Feature\tFeature\n"
98 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
99 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
100 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
101 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
102 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
103 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
104 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
106 static const char feature_comp_dat[] =
107 "Feature_\tComponent_\n"
108 "s38\ts72\n"
109 "FeatureComponents\tFeature_\tComponent_\n"
110 "Five\tFive\n"
111 "Four\tFour\n"
112 "One\tOne\n"
113 "Three\tThree\n"
114 "Two\tTwo\n"
115 "feature\tcomponent\n"
116 "service_feature\tservice_comp\n"
117 "service_feature\tservice_comp2\n"
118 "service_feature\tservice_comp3";
120 static const char file_dat[] =
121 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
122 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
123 "File\tFile\n"
124 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
125 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
126 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
127 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
128 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
129 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
130 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
131 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
133 static const char install_exec_seq_dat[] =
134 "Action\tCondition\tSequence\n"
135 "s72\tS255\tI2\n"
136 "InstallExecuteSequence\tAction\n"
137 "AllocateRegistrySpace\tNOT Installed\t1550\n"
138 "CostFinalize\t\t1000\n"
139 "CostInitialize\t\t800\n"
140 "FileCost\t\t900\n"
141 "ResolveSource\t\t950\n"
142 "MoveFiles\t\t1700\n"
143 "InstallFiles\t\t4000\n"
144 "DuplicateFiles\t\t4500\n"
145 "CreateShortcuts\t\t4600\n"
146 "InstallServices\t\t5000\n"
147 "InstallFinalize\t\t6600\n"
148 "InstallInitialize\t\t1500\n"
149 "InstallValidate\t\t1400\n"
150 "LaunchConditions\t\t100\n"
151 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
153 static const char media_dat[] =
154 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
155 "i2\ti4\tL64\tS255\tS32\tS72\n"
156 "Media\tDiskId\n"
157 "1\t3\t\t\tDISK1\t\n"
158 "2\t7\t\tmsitest.cab\tDISK2\t\n";
160 static const char property_dat[] =
161 "Property\tValue\n"
162 "s72\tl0\n"
163 "Property\tProperty\n"
164 "DefaultUIFont\tDlgFont8\n"
165 "HASUIRUN\t0\n"
166 "INSTALLLEVEL\t3\n"
167 "InstallMode\tTypical\n"
168 "Manufacturer\tWine\n"
169 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
170 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
171 "ProductID\tnone\n"
172 "ProductLanguage\t1033\n"
173 "ProductName\tMSITEST\n"
174 "ProductVersion\t1.1.1\n"
175 "PROMPTROLLBACKCOST\tP\n"
176 "Setup\tSetup\n"
177 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
178 "AdminProperties\tPOSTADMIN\n"
179 "ROOTDRIVE\tC:\\\n"
180 "SERVNAME\tTestService\n"
181 "SERVNAME2\tTestService2\n"
182 "SERVDISP\tTestServiceDisp\n"
183 "SERVDISP2\tTestServiceDisp2\n"
184 "MSIFASTINSTALL\t1\n"
185 "ARPNOMODIFY\t1\n"
186 "regdata17\t#1\n";
188 static const char env_install_exec_seq_dat[] =
189 "Action\tCondition\tSequence\n"
190 "s72\tS255\tI2\n"
191 "InstallExecuteSequence\tAction\n"
192 "CostInitialize\t\t100\n"
193 "FileCost\t\t200\n"
194 "CostFinalize\t\t300\n"
195 "InstallValidate\t\t400\n"
196 "InstallInitialize\t\t500\n"
197 "ProcessComponents\t\t600\n"
198 "WriteEnvironmentStrings\t\t700\n"
199 "wes_immediate\tNOT REMOVE\t701\n"
200 "wes_deferred\tNOT REMOVE\t702\n"
201 "RemoveEnvironmentStrings\t\t800\n"
202 "res_immediate\tREMOVE\t801\n"
203 "res_deferred\tREMOVE\t802\n"
204 "RegisterProduct\t\t900\n"
205 "PublishFeatures\t\t1000\n"
206 "PublishProduct\t\t1100\n"
207 "UnpublishFeatures\t\t1150\n"
208 "InstallFinalize\t\t1200\n";
210 static const char env_custom_action_dat[] =
211 "Action\tType\tSource\tTarget\n"
212 "s72\ti2\tS64\tS0\n"
213 "CustomAction\tAction\n"
214 "wes_immediate\t1\tcustom.dll\tenv_absent\n"
215 "wes_deferred\t1025\tcustom.dll\tenv_present\n"
216 "res_immediate\t1\tcustom.dll\tenv_present\n"
217 "res_deferred\t1025\tcustom.dll\tenv_absent\n";
219 static const char env_environment_dat[] =
220 "Environment\tName\tValue\tComponent_\n"
221 "s72\tl255\tL255\ts72\n"
222 "Environment\tEnvironment\n"
223 "Var1\t=-MSITESTVAR1\t1\tOne\n"
224 "Var2\tMSITESTVAR2\t1\tOne\n"
225 "Var3\t=-MSITESTVAR3\t1\tOne\n"
226 "Var4\tMSITESTVAR4\t1\tOne\n"
227 "Var5\t-MSITESTVAR5\t\tOne\n"
228 "Var6\tMSITESTVAR6\t\tOne\n"
229 "Var7\t!-MSITESTVAR7\t\tOne\n"
230 "Var8\t!-*MSITESTVAR8\t\tOne\n"
231 "Var9\t=-MSITESTVAR9\t\tOne\n"
232 "Var10\t=MSITESTVAR10\t\tOne\n"
233 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
234 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
235 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
236 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
237 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
238 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
239 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
240 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
241 "Var19\t+-MSITESTVAR17\t1\tOne\n"
242 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
243 "Var21\t+-MSITESTVAR18\t1\tOne\n"
244 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
245 "Var23\t+-MSITESTVAR19\t1\tOne\n"
246 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
247 "Var25\t+-MSITESTVAR20\t1\tOne\n"
248 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"
249 "Var27\t+-MSITESTVAR21\t[~];1\tOne\n"
250 "Var28\t-MSITESTVAR22\t1\tOne\n"
251 "Var29\t-MSITESTVAR23\t2\tOne\n"
252 "Var30\t*MSITESTVAR100\t1\tOne\n"
253 "Var31\t-=MSITESTVAR24\t[SERVNAME]\tOne\n"
254 "Var32\t-=MSITESTVAR25\t[bogus_prop]\tOne\n";
256 static const char service_install_dat[] =
257 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
258 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
259 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
260 "ServiceInstall\tServiceInstall\n"
261 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
262 "TestService2\t[SERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription\n";
264 static const char service_install2_dat[] =
265 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
266 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
267 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
268 "ServiceInstall\tServiceInstall\n"
269 "TestService\tTestService\tTestService\t2\t3\t32768\t\t\tTestService\t\t\tservice_comp\t\n"
270 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
272 static const char service_control_dat[] =
273 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
274 "s72\tl255\ti2\tL255\tI2\ts72\n"
275 "ServiceControl\tServiceControl\n"
276 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
277 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
279 static const char sss_service_control_dat[] =
280 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
281 "s72\tl255\ti2\tL255\tI2\ts72\n"
282 "ServiceControl\tServiceControl\n"
283 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
284 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
285 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
286 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
288 static const char sss_install_exec_seq_dat[] =
289 "Action\tCondition\tSequence\n"
290 "s72\tS255\tI2\n"
291 "InstallExecuteSequence\tAction\n"
292 "LaunchConditions\t\t100\n"
293 "CostInitialize\t\t800\n"
294 "FileCost\t\t900\n"
295 "ResolveSource\t\t950\n"
296 "CostFinalize\t\t1000\n"
297 "InstallValidate\t\t1400\n"
298 "InstallInitialize\t\t1500\n"
299 "StopServices\t\t4000\n"
300 "stop_immediate\tNOT REMOVE\t4001\n"
301 "stop_deferred\tNOT REMOVE\t4002\n"
302 "DeleteServices\t\t5000\n"
303 "MoveFiles\t\t5100\n"
304 "InstallFiles\t\t5200\n"
305 "DuplicateFiles\t\t5300\n"
306 "StartServices\t\t5400\n"
307 "start_deferred\tNOT REMOVE\t5401\n"
308 "RegisterProduct\t\t5500\n"
309 "PublishFeatures\t\t5600\n"
310 "PublishProduct\t\t5700\n"
311 "UnpublishFeatures\t\t5800\n"
312 "InstallFinalize\t\t6000\n";
314 static const char sss_custom_action_dat[] =
315 "Action\tType\tSource\tTarget\n"
316 "s72\ti2\tS64\tS0\n"
317 "CustomAction\tAction\n"
318 "stop_immediate\t1\tcustom.dll\tsss_started\n"
319 "stop_deferred\t1025\tcustom.dll\tsss_stopped\n"
320 "start_deferred\t1025\tcustom.dll\tsss_started\n";
322 static const char sds_install_exec_seq_dat[] =
323 "Action\tCondition\tSequence\n"
324 "s72\tS255\tI2\n"
325 "InstallExecuteSequence\tAction\n"
326 "LaunchConditions\t\t100\n"
327 "CostInitialize\t\t800\n"
328 "FileCost\t\t900\n"
329 "ResolveSource\t\t950\n"
330 "CostFinalize\t\t1000\n"
331 "InstallValidate\t\t1400\n"
332 "InstallInitialize\t\t1500\n"
333 "StopServices\t\t5000\n"
334 "DeleteServices\t\t5050\n"
335 "sds_immediate\tNOT REMOVE\t5051\n"
336 "sds_deferred\tNOT REMOVE\t5052\n"
337 "MoveFiles\t\t5100\n"
338 "InstallFiles\t\t5200\n"
339 "DuplicateFiles\t\t5300\n"
340 "InstallServices\t\t5400\n"
341 "StartServices\t\t5450\n"
342 "RegisterProduct\t\t5500\n"
343 "PublishFeatures\t\t5600\n"
344 "PublishProduct\t\t5700\n"
345 "UnpublishFeatures\t\t5800\n"
346 "InstallFinalize\t\t6000\n";
348 static const char sds_custom_action_dat[] =
349 "Action\tType\tSource\tTarget\n"
350 "s72\ti2\tS64\tS0\n"
351 "CustomAction\tAction\n"
352 "sds_immediate\t1\tcustom.dll\tsds_present\n"
353 "sds_deferred\t1025\tcustom.dll\tsds_absent\n";
355 static const char sis_install_exec_seq_dat[] =
356 "Action\tCondition\tSequence\n"
357 "s72\tS255\tI2\n"
358 "InstallExecuteSequence\tAction\n"
359 "CostInitialize\t\t800\n"
360 "FileCost\t\t900\n"
361 "CostFinalize\t\t1000\n"
362 "InstallValidate\t\t1400\n"
363 "InstallInitialize\t\t1500\n"
364 "StopServices\t\t5000\n"
365 "DeleteServices\t\t5050\n"
366 "InstallFiles\t\t5200\n"
367 "InstallServices\t\t5400\n"
368 "sis_immediate\tNOT REMOVE\t5401\n"
369 "sis_deferred\tNOT REMOVE\t5402\n"
370 "StartServices\t\t5450\n"
371 "RegisterProduct\t\t5500\n"
372 "PublishFeatures\t\t5600\n"
373 "PublishProduct\t\t5700\n"
374 "UnpublishFeatures\t\t5800\n"
375 "InstallFinalize\t\t6000\n";
377 static const char sis_custom_action_dat[] =
378 "Action\tType\tSource\tTarget\n"
379 "s72\ti2\tS64\tS0\n"
380 "CustomAction\tAction\n"
381 "sis_immediate\t1\tcustom.dll\tsis_absent\n"
382 "sis_deferred\t1025\tcustom.dll\tsis_present\n";
384 static const char rof_component_dat[] =
385 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
386 "s72\tS38\ts72\ti2\tS255\tS72\n"
387 "Component\tComponent\n"
388 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
390 static const char rof_feature_dat[] =
391 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
392 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
393 "Feature\tFeature\n"
394 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
395 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
397 static const char rof_feature_comp_dat[] =
398 "Feature_\tComponent_\n"
399 "s38\ts72\n"
400 "FeatureComponents\tFeature_\tComponent_\n"
401 "feature\tmaximus\n"
402 "montecristo\tmaximus";
404 static const char rof_file_dat[] =
405 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
406 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
407 "File\tFile\n"
408 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
410 static const char rof_media_dat[] =
411 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
412 "i2\ti4\tL64\tS255\tS32\tS72\n"
413 "Media\tDiskId\n"
414 "1\t1\t\t\tDISK1\t\n";
416 static const char ci2_feature_comp_dat[] =
417 "Feature_\tComponent_\n"
418 "s38\ts72\n"
419 "FeatureComponents\tFeature_\tComponent_\n"
420 "feature\taugustus";
422 static const char ci2_file_dat[] =
423 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
424 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
425 "File\tFile\n"
426 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
428 static const char pp_install_exec_seq_dat[] =
429 "Action\tCondition\tSequence\n"
430 "s72\tS255\tI2\n"
431 "InstallExecuteSequence\tAction\n"
432 "ValidateProductID\t\t700\n"
433 "CostInitialize\t\t800\n"
434 "FileCost\t\t900\n"
435 "CostFinalize\t\t1000\n"
436 "InstallValidate\t\t1400\n"
437 "InstallInitialize\t\t1500\n"
438 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
439 "ppc_immediate\tPROCESS_COMPONENTS AND ALLUSERS\t1601\n"
440 "ppc_deferred\tPROCESS_COMPONENTS AND ALLUSERS\t1602\n"
441 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
442 "uf_immediate\tUNPUBLISH_FEATURES AND ALLUSERS\t1801\n"
443 "uf_deferred\tUNPUBLISH_FEATURES AND ALLUSERS\t1802\n"
444 "RemoveFiles\t\t3500\n"
445 "InstallFiles\t\t4000\n"
446 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
447 "ru_immediate\tREGISTER_USER AND ALLUSERS\t6001\n"
448 "ru_deferred\tREGISTER_USER AND ALLUSERS\t6002\n"
449 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
450 "rp_immediate\tREGISTER_PRODUCT AND ALLUSERS AND NOT RP_TEST64\t6101\n"
451 "rp_deferred\tREGISTER_PRODUCT AND ALLUSERS AND NOT RP_TEST64\t6102\n"
452 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
453 "pf_immediate\tPUBLISH_FEATURES AND ALLUSERS\t6301\n"
454 "pf_deferred\tPUBLISH_FEATURES AND ALLUSERS\t6302\n"
455 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
456 "pp_immediate\tPUBLISH_PRODUCT AND ALLUSERS\t6401\n"
457 "pp_deferred\tPUBLISH_PRODUCT AND ALLUSERS\t6402\n"
458 "InstallFinalize\t\t6600";
460 static const char pp_custom_action_dat[] =
461 "Action\tType\tSource\tTarget\n"
462 "s72\ti2\tS64\tS0\n"
463 "CustomAction\tAction\n"
464 "pf_immediate\t1\tcustom.dll\tpf_absent\n"
465 "pf_deferred\t1025\tcustom.dll\tpf_present\n"
466 "uf_immediate\t1\tcustom.dll\tpf_present\n"
467 "uf_deferred\t1025\tcustom.dll\tpf_absent\n"
468 "pp_immediate\t1\tcustom.dll\tpp_absent\n"
469 "pp_deferred\t1025\tcustom.dll\tpp_present\n"
470 "rp_immediate\t1\tcustom.dll\trp_absent\n"
471 "rp_deferred\t1025\tcustom.dll\trp_present\n"
472 "ru_immediate\t1\tcustom.dll\tru_absent\n"
473 "ru_deferred\t1025\tcustom.dll\tru_present\n"
474 "ppc_immediate\t1\tcustom.dll\tppc_absent\n"
475 "ppc_deferred\t1025\tcustom.dll\tppc_present\n";
477 static const char pp_component_dat[] =
478 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
479 "s72\tS38\ts72\ti2\tS255\tS72\n"
480 "Component\tComponent\n"
481 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
483 static const char ppc_component_dat[] =
484 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
485 "s72\tS38\ts72\ti2\tS255\tS72\n"
486 "Component\tComponent\n"
487 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
488 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
490 static const char ppc_file_dat[] =
491 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
492 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
493 "File\tFile\n"
494 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
495 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
497 static const char ppc_media_dat[] =
498 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
499 "i2\ti4\tL64\tS255\tS32\tS72\n"
500 "Media\tDiskId\n"
501 "1\t2\t\t\tDISK1\t\n";
503 static const char ppc_feature_comp_dat[] =
504 "Feature_\tComponent_\n"
505 "s38\ts72\n"
506 "FeatureComponents\tFeature_\tComponent_\n"
507 "feature\tmaximus\n"
508 "feature\taugustus\n"
509 "montecristo\tmaximus";
511 static const char cwd_component_dat[] =
512 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
513 "s72\tS38\ts72\ti2\tS255\tS72\n"
514 "Component\tComponent\n"
515 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
517 static const char rem_component_dat[] =
518 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
519 "s72\tS38\ts72\ti2\tS255\tS72\n"
520 "Component\tComponent\n"
521 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
522 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
523 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
525 static const char rem_feature_comp_dat[] =
526 "Feature_\tComponent_\n"
527 "s38\ts72\n"
528 "FeatureComponents\tFeature_\tComponent_\n"
529 "feature\thydrogen\n"
530 "feature\thelium\n"
531 "feature\tlithium";
533 static const char rem_file_dat[] =
534 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
535 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
536 "File\tFile\n"
537 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
538 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
539 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
541 static const char rem_install_exec_seq_dat[] =
542 "Action\tCondition\tSequence\n"
543 "s72\tS255\tI2\n"
544 "InstallExecuteSequence\tAction\n"
545 "ValidateProductID\t\t700\n"
546 "CostInitialize\t\t800\n"
547 "FileCost\t\t900\n"
548 "CostFinalize\t\t1000\n"
549 "InstallValidate\t\t1400\n"
550 "InstallInitialize\t\t1500\n"
551 "ProcessComponents\t\t1600\n"
552 "RemoveFiles\t\t3500\n"
553 "InstallFiles\t\t4000\n"
554 "RegisterProduct\t\t6100\n"
555 "PublishFeatures\t\t6300\n"
556 "PublishProduct\t\t6400\n"
557 "UnpublishFeatures\t\t6500\n"
558 "InstallFinalize\t\t6600";
560 static const char rem_remove_files_dat[] =
561 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
562 "s72\ts72\tS255\ts72\tI2\n"
563 "RemoveFile\tFileKey\n"
564 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
565 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
566 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
567 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
568 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
569 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
570 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
571 "block\thelium\tblock\tMSITESTDIR\t3\n"
572 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
573 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
575 static const char mov_move_file_dat[] =
576 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
577 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
578 "MoveFile\tFileKey\n"
579 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
580 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
581 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
582 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
583 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
584 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
585 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
586 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
587 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
588 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
589 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
590 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
591 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
592 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
593 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
594 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
595 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
596 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
598 static const char mov_install_exec_seq_dat[] =
599 "Action\tCondition\tSequence\n"
600 "s72\tS255\tI2\n"
601 "InstallExecuteSequence\tAction\n"
602 "CostInitialize\t\t100\n"
603 "FileCost\t\t200\n"
604 "ResolveSource\t\t300\n"
605 "CostFinalize\t\t400\n"
606 "InstallValidate\t\t500\n"
607 "InstallInitialize\t\t600\n"
608 "MoveFiles\t\t700\n"
609 "mov_immediate\t\t701\n"
610 "mov_deferred\t\t702\n"
611 "InstallFiles\t\t800\n"
612 "InstallFinalize\t\t900\n";
614 static const char mov_custom_action_dat[] =
615 "Action\tType\tSource\tTarget\n"
616 "s72\ti2\tS64\tS0\n"
617 "CustomAction\tAction\n"
618 "mov_immediate\t1\tcustom.dll\tmov_absent\n"
619 "mov_deferred\t1025\tcustom.dll\tmov_present\n";
621 static const char df_directory_dat[] =
622 "Directory\tDirectory_Parent\tDefaultDir\n"
623 "s72\tS72\tl255\n"
624 "Directory\tDirectory\n"
625 "THIS\tMSITESTDIR\tthis\n"
626 "DOESNOT\tTHIS\tdoesnot\n"
627 "NONEXISTENT\tDOESNOT\texist\n"
628 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
629 "ProgramFilesFolder\tTARGETDIR\t.\n"
630 "TARGETDIR\t\tSourceDir";
632 static const char df_duplicate_file_dat[] =
633 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
634 "s72\ts72\ts72\tS255\tS72\n"
635 "DuplicateFile\tFileKey\n"
636 "maximus\tmaximus\tmaximus\taugustus\t\n"
637 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
638 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
640 static const char wrv_component_dat[] =
641 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
642 "s72\tS38\ts72\ti2\tS255\tS72\n"
643 "Component\tComponent\n"
644 "augustus\t{bafe0297-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t0\t\t\n"
645 "caesar\t{bafe0298-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t1\t\t\n";
647 static const char wrv_feature_dat[] =
648 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
649 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
650 "Feature\tFeature\n"
651 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
652 "feature2\t\tFeature2\tFeature2\t2\t1\tTARGETDIR\t1";
654 static const char wrv_feature_comp_dat[] =
655 "Feature_\tComponent_\n"
656 "s38\ts72\n"
657 "FeatureComponents\tFeature_\tComponent_\n"
658 "feature\taugustus\n"
659 "feature2\tcaesar";
661 static const char wrv_registry_dat[] =
662 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
663 "s72\ti2\tl255\tL255\tL0\ts72\n"
664 "Registry\tRegistry\n"
665 "regdata0\t1\tmsitest\tsz\tstring\taugustus\n"
666 "regdata1\t1\tmsitest\tmultisz\tone[~]two[~]three\taugustus\n"
667 "regdata2\t1\tmsitest\texpandsz\t#%string\taugustus\n"
668 "regdata3\t1\tmsitest\tdword\t#123\taugustus\n"
669 "regdata4\t1\tmsitest\tbinary\t#x01234567\taugustus\n"
670 "regdata5\t1\tmsitest\t\tdefault\taugustus\n"
671 "regdata6\t1\tmsitest\\subkey\t*\t\taugustus\n"
672 "regdata7\t1\tmsitest\\subkey\t*\t#%\taugustus\n"
673 "regdata8\t1\tmsitest\\subkey\t*\t#x\taugustus\n"
674 "regdata9\t1\tmsitest\\VisualStudio\\10.0\\AD7Metrics\\Exception\\{049EC4CC-30D2-4032-9256-EE18EB41B62B}\\Common Language Runtime Exceptions\\System.Workflow.ComponentModel.Serialization\\System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException\tlong\tkey\taugustus\n"
675 "regdata10\t1\tmsitest\tValue1\t[~]one[~]\taugustus\n"
676 "regdata11\t1\tmsitest\tValue2\t[~]two\taugustus\n"
677 "regdata12\t1\tmsitest\tValue3\tone[~]\taugustus\n"
678 "regdata13\t1\tmsitest\tValue4\tone[~]two\taugustus\n"
679 "regdata14\t1\tmsitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
680 "regdata15\t1\tmsitest\tValue6\t[~]\taugustus\n"
681 "regdata16\t1\tmsitest\tValue7\t[~]two\taugustus\n"
682 "regdata17\t1\tmsitest\tformat\t[regdata17]\taugustus\n"
683 "regdata18\t1\tmsitest\tsource\t#1\tcaesar\n"
684 "regdata19\t1\tmsitest\\create\t+\t\taugustus\n"
685 "regdata20\t1\tmsitest\\delete\t-\t\taugustus\n";
687 static const char wrv_remove_registry_dat[] =
688 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
689 "s72\ti2\tl255\tL255\ts72\n"
690 "RemoveRegistry\tRemoveRegistry\n"
691 "regdata0\t1\tmsitest\tinstremove\taugustus\n"
692 "regdata1\t1\tmsitest\\instremove\t-\taugustus\n";
694 static const char wrv_install_exec_seq_dat[] =
695 "Action\tCondition\tSequence\n"
696 "s72\tS255\tI2\n"
697 "InstallExecuteSequence\tAction\n"
698 "CostInitialize\t\t800\n"
699 "FileCost\t\t900\n"
700 "CostFinalize\t\t1000\n"
701 "InstallValidate\t\t1400\n"
702 "InstallInitialize\t\t1500\n"
703 "ProcessComponents\t\t1600\n"
704 "RemoveRegistryValues\t\t4900\n"
705 "rrv_immediate\tREMOVE\t4901\n"
706 "rrv_deferred\tREMOVE\t4902\n"
707 "WriteRegistryValues\t\t5000\n"
708 "wrv_immediate\tNOT REMOVE\t5001\n"
709 "wrv_deferred\tNOT REMOVE\t5002\n"
710 "RegisterProduct\t\t6100\n"
711 "PublishFeatures\t\t6200\n"
712 "PublishProduct\t\t6300\n"
713 "UnpublishFeatures\t\t6400\n"
714 "InstallFinalize\t\t6600\n";
716 static const char wrv_custom_action_dat[] =
717 "Action\tType\tSource\tTarget\n"
718 "s72\ti2\tS64\tS0\n"
719 "CustomAction\tAction\n"
720 "wrv_immediate\t1\tcustom.dll\twrv_absent\n"
721 "wrv_deferred\t1025\tcustom.dll\twrv_present\n"
722 "rrv_immediate\t1\tcustom.dll\twrv_present\n"
723 "rrv_deferred\t1025\tcustom.dll\twrv_absent\n";
725 static const char cf_directory_dat[] =
726 "Directory\tDirectory_Parent\tDefaultDir\n"
727 "s72\tS72\tl255\n"
728 "Directory\tDirectory\n"
729 "FIRSTDIR\tMSITESTDIR\tfirst\n"
730 "SECONDDIR\tMSITESTDIR\tsecond\n"
731 "THIRDDIR\tMSITESTDIR\tthird\n"
732 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
733 "ProgramFilesFolder\tTARGETDIR\t.\n"
734 "TARGETDIR\t\tSourceDir";
736 static const char cf_component_dat[] =
737 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
738 "s72\tS38\ts72\ti2\tS255\tS72\n"
739 "Component\tComponent\n"
740 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
741 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
743 static const char cf_feature_dat[] =
744 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
745 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
746 "Feature\tFeature\n"
747 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
748 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
750 static const char cf_feature_comp_dat[] =
751 "Feature_\tComponent_\n"
752 "s38\ts72\n"
753 "FeatureComponents\tFeature_\tComponent_\n"
754 "One\tOne\n"
755 "Two\tTwo\n";
757 static const char cf_file_dat[] =
758 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
759 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
760 "File\tFile\n"
761 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
762 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
764 static const char cf_create_folders_dat[] =
765 "Directory_\tComponent_\n"
766 "s72\ts72\n"
767 "CreateFolder\tDirectory_\tComponent_\n"
768 "FIRSTDIR\tOne\n"
769 "SECONDDIR\tTwo\n"
770 "THIRDDIR\tTwo\n";
772 static const char cf_install_exec_seq_dat[] =
773 "Action\tCondition\tSequence\n"
774 "s72\tS255\tI2\n"
775 "InstallExecuteSequence\tAction\n"
776 "CostFinalize\t\t1000\n"
777 "ValidateProductID\t\t700\n"
778 "CostInitialize\t\t800\n"
779 "FileCost\t\t900\n"
780 "RemoveFiles\t\t3500\n"
781 "rfi_immediate\tREMOVE\t3501\n"
782 "rfi_deferred\tREMOVE\t3502\n"
783 "CreateFolders\t\t3700\n"
784 "cf_immediate\tNOT REMOVE\t3701\n"
785 "cf_deferred\tNOT REMOVE\t3702\n"
786 "RemoveFolders\t\t3800\n"
787 "rf_immediate\tREMOVE\t3801\n"
788 "rf_deferred\tREMOVE\t3802\n"
789 "InstallFiles\t\t4000\n"
790 "ifi_immediate\tNOT REMOVE\t4001\n"
791 "ifi_deferred\tNOT REMOVE\t4002\n"
792 "RegisterUser\t\t6000\n"
793 "RegisterProduct\t\t6100\n"
794 "PublishFeatures\t\t6300\n"
795 "PublishProduct\t\t6400\n"
796 "InstallFinalize\t\t6600\n"
797 "InstallInitialize\t\t1500\n"
798 "ProcessComponents\t\t1600\n"
799 "UnpublishFeatures\t\t1800\n"
800 "InstallValidate\t\t1400\n"
801 "LaunchConditions\t\t100\n";
803 static const char cf_custom_action_dat[] =
804 "Action\tType\tSource\tTarget\n"
805 "s72\ti2\tS64\tS0\n"
806 "CustomAction\tAction\n"
807 "ifi_immediate\t1\tcustom.dll\tfile_absent\n"
808 "ifi_deferred\t1025\tcustom.dll\tfile_present\n"
809 "rfi_immediate\t1\tcustom.dll\tfile_present\n"
810 "rfi_deferred\t1025\tcustom.dll\tfile_absent\n"
811 "cf_immediate\t1\tcustom.dll\tcf_absent\n"
812 "cf_deferred\t1025\tcustom.dll\tcf_present\n"
813 "rf_immediate\t1\tcustom.dll\tcf_present\n"
814 "rf_deferred\t1025\tcustom.dll\tcf_absent\n";
816 static const char sr_file_dat[] =
817 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
818 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
819 "File\tFile\n"
820 "selfreg.dll\tselfreg\tselfreg.dll\t1000\t\t\t8192\t1\n";
822 static const char sr_feature_dat[] =
823 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
824 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
825 "Feature\tFeature\n"
826 "selfreg\t\t\tselfreg feature\t1\t2\tMSITESTDIR\t0\n";
828 static const char sr_feature_comp_dat[] =
829 "Feature_\tComponent_\n"
830 "s38\ts72\n"
831 "FeatureComponents\tFeature_\tComponent_\n"
832 "selfreg\tselfreg\n";
834 static const char sr_component_dat[] =
835 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
836 "s72\tS38\ts72\ti2\tS255\tS72\n"
837 "Component\tComponent\n"
838 "selfreg\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\tselfreg.dll\n";
840 static const char sr_selfreg_dat[] =
841 "File_\tCost\n"
842 "s72\tI2\n"
843 "SelfReg\tFile_\n"
844 "selfreg.dll\t\n";
846 static const char sr_install_exec_seq_dat[] =
847 "Action\tCondition\tSequence\n"
848 "s72\tS255\tI2\n"
849 "InstallExecuteSequence\tAction\n"
850 "CostInitialize\t\t800\n"
851 "FileCost\t\t900\n"
852 "CostFinalize\t\t1000\n"
853 "InstallValidate\t\t1400\n"
854 "InstallInitialize\t\t1500\n"
855 "ProcessComponents\t\t1600\n"
856 "SelfUnregModules\t\t3800\n"
857 "su_immediate\tREMOVE\t3801\n"
858 "su_deferred\tREMOVE\t3802\n"
859 "RemoveFiles\t\t3900\n"
860 "InstallFiles\t\t4000\n"
861 "SelfRegModules\t\t4100\n"
862 "sr_immediate\tNOT REMOVE\t4101\n"
863 "sr_deferred\tNOT REMOVE\t4102\n"
864 "CreateShortcuts\t\t4600\n"
865 "RegisterProduct\t\t5100\n"
866 "PublishFeatures\t\t5200\n"
867 "PublishProduct\t\t5300\n"
868 "UnpublishFeatures\t\t5400\n"
869 "InstallFinalize\t\t6600\n";
871 static const char sr_custom_action_dat[] =
872 "Action\tType\tSource\tTarget\n"
873 "s72\ti2\tS64\tS0\n"
874 "CustomAction\tAction\n"
875 "sr_immediate\t1\tcustom.dll\tsr_absent\n"
876 "sr_deferred\t1025\tcustom.dll\tsr_present\n"
877 "su_immediate\t1\tcustom.dll\tsr_present\n"
878 "su_deferred\t1025\tcustom.dll\tsr_absent\n";
880 static const char font_media_dat[] =
881 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
882 "i2\ti4\tL64\tS255\tS32\tS72\n"
883 "Media\tDiskId\n"
884 "1\t3\t\t\tDISK1\t\n";
886 static const char font_file_dat[] =
887 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
888 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
889 "File\tFile\n"
890 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
892 static const char font_feature_dat[] =
893 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
894 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
895 "Feature\tFeature\n"
896 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
898 static const char font_component_dat[] =
899 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
900 "s72\tS38\ts72\ti2\tS255\tS72\n"
901 "Component\tComponent\n"
902 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
904 static const char font_feature_comp_dat[] =
905 "Feature_\tComponent_\n"
906 "s38\ts72\n"
907 "FeatureComponents\tFeature_\tComponent_\n"
908 "fonts\tfonts\n";
910 static const char font_dat[] =
911 "File_\tFontTitle\n"
912 "s72\tS128\n"
913 "Font\tFile_\n"
914 "font.ttf\tmsi test font\n";
916 static const char font_install_exec_seq_dat[] =
917 "Action\tCondition\tSequence\n"
918 "s72\tS255\tI2\n"
919 "InstallExecuteSequence\tAction\n"
920 "ValidateProductID\t\t700\n"
921 "CostInitialize\t\t800\n"
922 "FileCost\t\t900\n"
923 "CostFinalize\t\t1000\n"
924 "InstallValidate\t\t1400\n"
925 "InstallInitialize\t\t1500\n"
926 "ProcessComponents\t\t1600\n"
927 "RemoveFiles\t\t3500\n"
928 "InstallFiles\t\t4000\n"
929 "RegisterFonts\t\t4100\n"
930 "rf_immediate\tNOT REMOVE\t4101\n"
931 "rf_deferred\tNOT REMOVE\t4102\n"
932 "UnregisterFonts\t\t4200\n"
933 "uf_immediate\tREMOVE\t4201\n"
934 "uf_deferred\tREMOVE\t4202\n"
935 "RegisterUser\t\t6000\n"
936 "RegisterProduct\t\t6100\n"
937 "PublishFeatures\t\t6300\n"
938 "PublishProduct\t\t6400\n"
939 "UnpublishFeatures\t\t6500\n"
940 "InstallFinalize\t\t6600";
942 static const char font_custom_action_dat[] =
943 "Action\tType\tSource\tTarget\n"
944 "s72\ti2\tS64\tS0\n"
945 "CustomAction\tAction\n"
946 "rf_immediate\t1\tcustom.dll\tfont_absent\n"
947 "rf_deferred\t1025\tcustom.dll\tfont_present\n"
948 "uf_immediate\t1\tcustom.dll\tfont_present\n"
949 "uf_deferred\t1025\tcustom.dll\tfont_absent\n";
951 static const char vp_property_dat[] =
952 "Property\tValue\n"
953 "s72\tl0\n"
954 "Property\tProperty\n"
955 "HASUIRUN\t0\n"
956 "INSTALLLEVEL\t3\n"
957 "InstallMode\tTypical\n"
958 "Manufacturer\tWine\n"
959 "PIDTemplate\t###-#######\n"
960 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
961 "ProductLanguage\t1033\n"
962 "ProductName\tMSITEST\n"
963 "ProductVersion\t1.1.1\n"
964 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
965 "MSIFASTINSTALL\t1\n";
967 static const char vp_custom_action_dat[] =
968 "Action\tType\tSource\tTarget\tISComments\n"
969 "s72\ti2\tS64\tS0\tS255\n"
970 "CustomAction\tAction\n"
971 "SetProductID1\t51\tProductID\t1\t\n"
972 "SetProductID2\t51\tProductID\t2\t\n"
973 "TestProductID1\t19\t\t\tHalts installation\n"
974 "TestProductID2\t19\t\t\tHalts installation\n";
976 static const char vp_install_exec_seq_dat[] =
977 "Action\tCondition\tSequence\n"
978 "s72\tS255\tI2\n"
979 "InstallExecuteSequence\tAction\n"
980 "LaunchConditions\t\t100\n"
981 "CostInitialize\t\t800\n"
982 "FileCost\t\t900\n"
983 "CostFinalize\t\t1000\n"
984 "InstallValidate\t\t1400\n"
985 "InstallInitialize\t\t1500\n"
986 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
987 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
988 "ValidateProductID\t\t3200\n"
989 "InstallExecute\t\t3300\n"
990 "TestProductID1\tProductID=1\t3400\n"
991 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
992 "InstallFiles\t\t4000\n"
993 "InstallFinalize\t\t6000\n";
995 static const char odbc_file_dat[] =
996 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
997 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
998 "File\tFile\n"
999 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
1000 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
1001 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
1002 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
1003 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
1005 static const char odbc_feature_dat[] =
1006 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1007 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1008 "Feature\tFeature\n"
1009 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
1011 static const char odbc_feature_comp_dat[] =
1012 "Feature_\tComponent_\n"
1013 "s38\ts72\n"
1014 "FeatureComponents\tFeature_\tComponent_\n"
1015 "odbc\todbc64\n"
1016 "odbc\todbc\n";
1018 static const char odbc_component_dat[] =
1019 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1020 "s72\tS38\ts72\ti2\tS255\tS72\n"
1021 "Component\tComponent\n"
1022 "odbc64\t{B6F3E4AF-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t256\tMsix64\tODBCdriver.dll\n"
1023 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
1025 static const char odbc_driver_dat[] =
1026 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
1027 "s72\ts72\ts255\ts72\tS72\n"
1028 "ODBCDriver\tDriver\n"
1029 "64-bit driver\todbc64\tODBC test driver\tODBCdriver.dll\t\n"
1030 "64-bit driver2\todbc64\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n"
1031 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
1032 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
1034 static const char odbc_translator_dat[] =
1035 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
1036 "s72\ts72\ts255\ts72\tS72\n"
1037 "ODBCTranslator\tTranslator\n"
1038 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
1039 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
1041 static const char odbc_datasource_dat[] =
1042 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
1043 "s72\ts72\ts255\ts255\ti2\n"
1044 "ODBCDataSource\tDataSource\n"
1045 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
1047 static const char odbc_install_exec_seq_dat[] =
1048 "Action\tCondition\tSequence\n"
1049 "s72\tS255\tI2\n"
1050 "InstallExecuteSequence\tAction\n"
1051 "LaunchConditions\t\t100\n"
1052 "CostInitialize\t\t800\n"
1053 "FileCost\t\t900\n"
1054 "CostFinalize\t\t1000\n"
1055 "InstallValidate\t\t1400\n"
1056 "InstallInitialize\t\t1500\n"
1057 "ProcessComponents\t\t1600\n"
1058 "InstallODBC\t\t3000\n"
1059 "io_immediate\tNOT REMOVE\t3001\n"
1060 "io_deferred\tNOT REMOVE\t3002\n"
1061 "RemoveODBC\t\t3100\n"
1062 "ro_immediate\tREMOVE\t3101\n"
1063 "ro_deferred\tREMOVE\t3102\n"
1064 "RemoveFiles\t\t3900\n"
1065 "InstallFiles\t\t4000\n"
1066 "RegisterProduct\t\t5000\n"
1067 "PublishFeatures\t\t5100\n"
1068 "PublishProduct\t\t5200\n"
1069 "UnpublishFeatures\t\t5300\n"
1070 "InstallFinalize\t\t6000\n";
1072 static const char odbc_custom_action_dat[] =
1073 "Action\tType\tSource\tTarget\n"
1074 "s72\ti2\tS64\tS0\n"
1075 "CustomAction\tAction\n"
1076 "io_immediate\t1\tcustom.dll\todbc_absent\n"
1077 "io_deferred\t1025\tcustom.dll\todbc_present\n"
1078 "ro_immediate\t1\tcustom.dll\todbc_present\n"
1079 "ro_deferred\t1025\tcustom.dll\todbc_absent\n";
1081 static const char odbc_media_dat[] =
1082 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
1083 "i2\ti4\tL64\tS255\tS32\tS72\n"
1084 "Media\tDiskId\n"
1085 "1\t5\t\t\tDISK1\t\n";
1087 static const char tl_file_dat[] =
1088 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1089 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1090 "File\tFile\n"
1091 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
1093 static const char tl_feature_dat[] =
1094 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1095 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1096 "Feature\tFeature\n"
1097 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
1099 static const char tl_feature_comp_dat[] =
1100 "Feature_\tComponent_\n"
1101 "s38\ts72\n"
1102 "FeatureComponents\tFeature_\tComponent_\n"
1103 "typelib\ttypelib\n";
1105 static const char tl_component_dat[] =
1106 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1107 "s72\tS38\ts72\ti2\tS255\tS72\n"
1108 "Component\tComponent\n"
1109 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
1111 static const char tl_typelib_dat[] =
1112 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
1113 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
1114 "TypeLib\tLibID\tLanguage\tComponent_\n"
1115 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
1117 static const char tl_install_exec_seq_dat[] =
1118 "Action\tCondition\tSequence\n"
1119 "s72\tS255\tI2\n"
1120 "InstallExecuteSequence\tAction\n"
1121 "LaunchConditions\t\t100\n"
1122 "CostInitialize\t\t800\n"
1123 "FileCost\t\t900\n"
1124 "CostFinalize\t\t1000\n"
1125 "InstallValidate\t\t1400\n"
1126 "InstallInitialize\t\t1500\n"
1127 "ProcessComponents\t\t1600\n"
1128 "UnregisterTypeLibraries\t\t3100\n"
1129 "ut_immediate\tREMOVE\t3101\n"
1130 "ut_deferred\tREMOVE\t3102\n"
1131 "RemoveFiles\t\t3200\n"
1132 "InstallFiles\t\t3300\n"
1133 "RegisterTypeLibraries\t\t3400\n"
1134 "rt_immediate\tNOT REMOVE\t3401\n"
1135 "rt_deferred\tNOT REMOVE\t3402\n"
1136 "RegisterProduct\t\t5100\n"
1137 "PublishFeatures\t\t5200\n"
1138 "PublishProduct\t\t5300\n"
1139 "UnpublishFeatures\t\t5400\n"
1140 "InstallFinalize\t\t6000\n";
1142 static const char tl_custom_action_dat[] =
1143 "Action\tType\tSource\tTarget\n"
1144 "s72\ti2\tS64\tS0\n"
1145 "CustomAction\tAction\n"
1146 "rt_immediate\t1\tcustom.dll\ttl_absent\n"
1147 "rt_deferred\t1025\tcustom.dll\ttl_present\n"
1148 "ut_immediate\t1\tcustom.dll\ttl_present\n"
1149 "ut_deferred\t1025\tcustom.dll\ttl_absent\n";
1151 static const char crs_file_dat[] =
1152 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1153 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1154 "File\tFile\n"
1155 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
1157 static const char crs_feature_dat[] =
1158 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1159 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1160 "Feature\tFeature\n"
1161 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
1163 static const char crs_feature_comp_dat[] =
1164 "Feature_\tComponent_\n"
1165 "s38\ts72\n"
1166 "FeatureComponents\tFeature_\tComponent_\n"
1167 "shortcut\tshortcut\n";
1169 static const char crs_component_dat[] =
1170 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1171 "s72\tS38\ts72\ti2\tS255\tS72\n"
1172 "Component\tComponent\n"
1173 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
1175 static const char crs_shortcut_dat[] =
1176 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
1177 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
1178 "Shortcut\tShortcut\n"
1179 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
1181 static const char crs_install_exec_seq_dat[] =
1182 "Action\tCondition\tSequence\n"
1183 "s72\tS255\tI2\n"
1184 "InstallExecuteSequence\tAction\n"
1185 "LaunchConditions\t\t100\n"
1186 "CostInitialize\t\t800\n"
1187 "FileCost\t\t900\n"
1188 "CostFinalize\t\t1000\n"
1189 "InstallValidate\t\t1400\n"
1190 "InstallInitialize\t\t1500\n"
1191 "ProcessComponents\t\t1600\n"
1192 "RemoveFiles\t\t1700\n"
1193 "InstallFiles\t\t2000\n"
1194 "RemoveShortcuts\t\t3000\n"
1195 "rs_immediate\tREMOVE\t3001\n"
1196 "rs_deferred\tREMOVE\t3002\n"
1197 "CreateShortcuts\t\t3100\n"
1198 "cs_immediate\tNOT REMOVE\t3101\n"
1199 "cs_deferred\tNOT REMOVE\t3102\n"
1200 "RegisterProduct\t\t5000\n"
1201 "PublishFeatures\t\t5100\n"
1202 "PublishProduct\t\t5200\n"
1203 "UnpublishFeatures\t\t5300\n"
1204 "InstallFinalize\t\t6000\n";
1206 static const char crs_custom_action_dat[] =
1207 "Action\tType\tSource\tTarget\n"
1208 "s72\ti2\tS64\tS0\n"
1209 "CustomAction\tAction\n"
1210 "cs_immediate\t1\tcustom.dll\tcrs_absent\n"
1211 "cs_deferred\t1025\tcustom.dll\tcrs_present\n"
1212 "rs_immediate\t1\tcustom.dll\tcrs_present\n"
1213 "rs_deferred\t1025\tcustom.dll\tcrs_absent\n";
1215 static const char pub_file_dat[] =
1216 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1217 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1218 "File\tFile\n"
1219 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
1221 static const char pub_feature_dat[] =
1222 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1223 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1224 "Feature\tFeature\n"
1225 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
1227 static const char pub_feature_comp_dat[] =
1228 "Feature_\tComponent_\n"
1229 "s38\ts72\n"
1230 "FeatureComponents\tFeature_\tComponent_\n"
1231 "publish\tpublish\n";
1233 static const char pub_component_dat[] =
1234 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1235 "s72\tS38\ts72\ti2\tS255\tS72\n"
1236 "Component\tComponent\n"
1237 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
1239 static const char pub_publish_component_dat[] =
1240 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
1241 "s38\ts255\ts72\tL255\ts38\n"
1242 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
1243 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
1245 static const char pub_install_exec_seq_dat[] =
1246 "Action\tCondition\tSequence\n"
1247 "s72\tS255\tI2\n"
1248 "InstallExecuteSequence\tAction\n"
1249 "LaunchConditions\t\t100\n"
1250 "CostInitialize\t\t800\n"
1251 "FileCost\t\t900\n"
1252 "CostFinalize\t\t1000\n"
1253 "InstallValidate\t\t1400\n"
1254 "InstallInitialize\t\t1500\n"
1255 "ProcessComponents\t\t1600\n"
1256 "RemoveFiles\t\t1700\n"
1257 "InstallFiles\t\t2000\n"
1258 "PublishComponents\t\t3000\n"
1259 "pub_immediate\tNOT REMOVE\t3001\n"
1260 "pub_deferred\tNOT REMOVE\t3002\n"
1261 "UnpublishComponents\t\t3100\n"
1262 "unp_immediate\tREMOVE\t3101\n"
1263 "unp_deferred\tREMOVE\t3102\n"
1264 "RegisterProduct\t\t5000\n"
1265 "PublishFeatures\t\t5100\n"
1266 "PublishProduct\t\t5200\n"
1267 "UnpublishFeatures\t\t5300\n"
1268 "InstallFinalize\t\t6000\n";
1270 static const char pub_custom_action_dat[] =
1271 "Action\tType\tSource\tTarget\n"
1272 "s72\ti2\tS64\tS0\n"
1273 "CustomAction\tAction\n"
1274 "pub_immediate\t1\tcustom.dll\tpub_absent\n"
1275 "pub_deferred\t1025\tcustom.dll\tpub_present\n"
1276 "unp_immediate\t1\tcustom.dll\tpub_present\n"
1277 "unp_deferred\t1025\tcustom.dll\tpub_absent\n";
1279 static const char rd_file_dat[] =
1280 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1281 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1282 "File\tFile\n"
1283 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
1284 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
1285 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
1287 static const char rd_feature_dat[] =
1288 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1289 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1290 "Feature\tFeature\n"
1291 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
1293 static const char rd_feature_comp_dat[] =
1294 "Feature_\tComponent_\n"
1295 "s38\ts72\n"
1296 "FeatureComponents\tFeature_\tComponent_\n"
1297 "duplicate\tduplicate\n";
1299 static const char rd_component_dat[] =
1300 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1301 "s72\tS38\ts72\ti2\tS255\tS72\n"
1302 "Component\tComponent\n"
1303 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
1304 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
1306 static const char rd_duplicate_file_dat[] =
1307 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
1308 "s72\ts72\ts72\tS255\tS72\n"
1309 "DuplicateFile\tFileKey\n"
1310 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
1311 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
1312 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
1314 static const char rd_install_exec_seq_dat[] =
1315 "Action\tCondition\tSequence\n"
1316 "s72\tS255\tI2\n"
1317 "InstallExecuteSequence\tAction\n"
1318 "LaunchConditions\t\t100\n"
1319 "CostInitialize\t\t800\n"
1320 "FileCost\t\t900\n"
1321 "CostFinalize\t\t1000\n"
1322 "InstallValidate\t\t1400\n"
1323 "InstallInitialize\t\t1500\n"
1324 "ProcessComponents\t\t1600\n"
1325 "RemoveDuplicateFiles\t\t1900\n"
1326 "rd_immediate\tREMOVE\t1901\n"
1327 "rd_deferred\tREMOVE\t1902\n"
1328 "InstallFiles\t\t2000\n"
1329 "DuplicateFiles\t\t2100\n"
1330 "df_immediate\tNOT REMOVE\t2101\n"
1331 "df_deferred\tNOT REMOVE\t2102\n"
1332 "RegisterProduct\t\t5000\n"
1333 "PublishFeatures\t\t5100\n"
1334 "PublishProduct\t\t5200\n"
1335 "UnpublishFeatures\t\t5300\n"
1336 "InstallFinalize\t\t6000\n";
1338 static const char rd_custom_action_dat[] =
1339 "Action\tType\tSource\tTarget\n"
1340 "s72\ti2\tS64\tS0\n"
1341 "CustomAction\tAction\n"
1342 "df_immediate\t1\tcustom.dll\trd_absent\n"
1343 "df_deferred\t1025\tcustom.dll\trd_present\n"
1344 "rd_immediate\t1\tcustom.dll\trd_present\n"
1345 "rd_deferred\t1025\tcustom.dll\trd_absent\n";
1347 static const char frp_file_dat[] =
1348 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1349 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1350 "File\tFile\n"
1351 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1353 static const char frp_feature_dat[] =
1354 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1355 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1356 "Feature\tFeature\n"
1357 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1359 static const char frp_feature_comp_dat[] =
1360 "Feature_\tComponent_\n"
1361 "s38\ts72\n"
1362 "FeatureComponents\tFeature_\tComponent_\n"
1363 "product\tproduct\n";
1365 static const char frp_component_dat[] =
1366 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1367 "s72\tS38\ts72\ti2\tS255\tS72\n"
1368 "Component\tComponent\n"
1369 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1371 static const char frp_custom_action_dat[] =
1372 "Action\tType\tSource\tTarget\tISComments\n"
1373 "s72\ti2\tS64\tS0\tS255\n"
1374 "CustomAction\tAction\n"
1375 "TestProp\t19\t\t\tPROP set\n";
1377 static const char frp_upgrade_dat[] =
1378 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1379 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1380 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1381 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1383 static const char frp_install_exec_seq_dat[] =
1384 "Action\tCondition\tSequence\n"
1385 "s72\tS255\tI2\n"
1386 "InstallExecuteSequence\tAction\n"
1387 "FindRelatedProducts\t\t50\n"
1388 "TestProp\tPROP AND NOT REMOVE\t51\n"
1389 "LaunchConditions\t\t100\n"
1390 "CostInitialize\t\t800\n"
1391 "FileCost\t\t900\n"
1392 "CostFinalize\t\t1000\n"
1393 "InstallValidate\t\t1400\n"
1394 "InstallInitialize\t\t1500\n"
1395 "ProcessComponents\t\t1600\n"
1396 "RemoveFiles\t\t1700\n"
1397 "InstallFiles\t\t2000\n"
1398 "RegisterProduct\t\t5000\n"
1399 "PublishFeatures\t\t5100\n"
1400 "PublishProduct\t\t5200\n"
1401 "UnpublishFeatures\t\t5300\n"
1402 "InstallFinalize\t\t6000\n";
1404 static const char ini_file_dat[] =
1405 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1406 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1407 "File\tFile\n"
1408 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1410 static const char ini_feature_dat[] =
1411 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1412 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1413 "Feature\tFeature\n"
1414 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1416 static const char ini_feature_comp_dat[] =
1417 "Feature_\tComponent_\n"
1418 "s38\ts72\n"
1419 "FeatureComponents\tFeature_\tComponent_\n"
1420 "inifile\tinifile\n";
1422 static const char ini_component_dat[] =
1423 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1424 "s72\tS38\ts72\ti2\tS255\tS72\n"
1425 "Component\tComponent\n"
1426 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1428 static const char ini_ini_file_dat[] =
1429 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1430 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1431 "IniFile\tIniFile\n"
1432 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1434 static const char ini_remove_ini_file_dat[] =
1435 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1436 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1437 "RemoveIniFile\tRemoveIniFile\n"
1438 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1440 static const char ini_install_exec_seq_dat[] =
1441 "Action\tCondition\tSequence\n"
1442 "s72\tS255\tI2\n"
1443 "InstallExecuteSequence\tAction\n"
1444 "LaunchConditions\t\t100\n"
1445 "CostInitialize\t\t800\n"
1446 "FileCost\t\t900\n"
1447 "CostFinalize\t\t1000\n"
1448 "InstallValidate\t\t1400\n"
1449 "InstallInitialize\t\t1500\n"
1450 "ProcessComponents\t\t1600\n"
1451 "RemoveFiles\t\t1700\n"
1452 "InstallFiles\t\t2000\n"
1453 "RemoveIniValues\t\t3000\n"
1454 "riv_immediate\tREMOVE\t3001\n"
1455 "riv_deferred\tREMOVE\t3002\n"
1456 "WriteIniValues\t\t3100\n"
1457 "wiv_immediate\tNOT REMOVE\t3101\n"
1458 "wiv_deferred\tNOT REMOVE\t3102\n"
1459 "RegisterProduct\t\t5000\n"
1460 "PublishFeatures\t\t5100\n"
1461 "PublishProduct\t\t5200\n"
1462 "UnpublishFeatures\t\t5300\n"
1463 "InstallFinalize\t\t6000\n";
1465 static const char ini_custom_action_dat[] =
1466 "Action\tType\tSource\tTarget\n"
1467 "s72\ti2\tS64\tS0\n"
1468 "CustomAction\tAction\n"
1469 "wiv_immediate\t1\tcustom.dll\tini_absent\n"
1470 "wiv_deferred\t1025\tcustom.dll\tini_present\n"
1471 "riv_immediate\t1\tcustom.dll\tini_present\n"
1472 "riv_deferred\t1025\tcustom.dll\tini_absent\n";
1474 static const char rci_file_dat[] =
1475 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1476 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1477 "File\tFile\n"
1478 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1480 static const char rci_feature_dat[] =
1481 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1482 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1483 "Feature\tFeature\n"
1484 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1486 static const char rci_feature_comp_dat[] =
1487 "Feature_\tComponent_\n"
1488 "s38\ts72\n"
1489 "FeatureComponents\tFeature_\tComponent_\n"
1490 "class\tclass\n";
1492 static const char rci_component_dat[] =
1493 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1494 "s72\tS38\ts72\ti2\tS255\tS72\n"
1495 "Component\tComponent\n"
1496 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1498 static const char rci_appid_dat[] =
1499 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1500 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1501 "AppId\tAppId\n"
1502 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1504 static const char rci_class_dat[] =
1505 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1506 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1507 "Class\tCLSID\tContext\tComponent_\n"
1508 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1510 static const char rci_install_exec_seq_dat[] =
1511 "Action\tCondition\tSequence\n"
1512 "s72\tS255\tI2\n"
1513 "InstallExecuteSequence\tAction\n"
1514 "LaunchConditions\t\t100\n"
1515 "CostInitialize\t\t800\n"
1516 "FileCost\t\t900\n"
1517 "CostFinalize\t\t1000\n"
1518 "InstallValidate\t\t1400\n"
1519 "InstallInitialize\t\t1500\n"
1520 "ProcessComponents\t\t1600\n"
1521 "RemoveFiles\t\t1700\n"
1522 "InstallFiles\t\t2000\n"
1523 "UnregisterClassInfo\t\t3000\n"
1524 "uci_immediate\tREMOVE\t3001\n"
1525 "uci_deferred\tREMOVE\t3002\n"
1526 "RegisterClassInfo\t\t4000\n"
1527 "rci_immediate\tNOT REMOVE\t4001\n"
1528 "rci_deferred\tNOT REMOVE\t4002\n"
1529 "RegisterProduct\t\t5000\n"
1530 "PublishFeatures\t\t5100\n"
1531 "PublishProduct\t\t5200\n"
1532 "UnpublishFeatures\t\t5300\n"
1533 "InstallFinalize\t\t6000\n";
1535 static const char rci_custom_action_dat[] =
1536 "Action\tType\tSource\tTarget\n"
1537 "s72\ti2\tS64\tS0\n"
1538 "CustomAction\tAction\n"
1539 "rci_immediate\t1\tcustom.dll\trci_absent\n"
1540 "rci_deferred\t1025\tcustom.dll\trci_present\n"
1541 "uci_immediate\t1\tcustom.dll\trci_present\n"
1542 "uci_deferred\t1025\tcustom.dll\trci_absent\n";
1544 static const char rei_file_dat[] =
1545 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1546 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1547 "File\tFile\n"
1548 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1550 static const char rei_feature_dat[] =
1551 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1552 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1553 "Feature\tFeature\n"
1554 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1556 static const char rei_feature_comp_dat[] =
1557 "Feature_\tComponent_\n"
1558 "s38\ts72\n"
1559 "FeatureComponents\tFeature_\tComponent_\n"
1560 "extension\textension\n";
1562 static const char rei_component_dat[] =
1563 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1564 "s72\tS38\ts72\ti2\tS255\tS72\n"
1565 "Component\tComponent\n"
1566 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1568 static const char rei_extension_dat[] =
1569 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1570 "s255\ts72\tS255\tS64\ts38\n"
1571 "Extension\tExtension\tComponent_\n"
1572 "extension\textension\tProg.Id.1\t\textension\n";
1574 static const char rei_verb_dat[] =
1575 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1576 "s255\ts32\tI2\tL255\tL255\n"
1577 "Verb\tExtension_\tVerb\n"
1578 "extension\tOpen\t1\t&Open\t/argument\n";
1580 static const char rei_progid_dat[] =
1581 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1582 "s255\tS255\tS38\tL255\tS72\tI2\n"
1583 "ProgId\tProgId\n"
1584 "Prog.Id.1\t\t\tdescription\t\t\n";
1586 static const char rei_install_exec_seq_dat[] =
1587 "Action\tCondition\tSequence\n"
1588 "s72\tS255\tI2\n"
1589 "InstallExecuteSequence\tAction\n"
1590 "LaunchConditions\t\t100\n"
1591 "CostInitialize\t\t800\n"
1592 "FileCost\t\t900\n"
1593 "CostFinalize\t\t1000\n"
1594 "InstallValidate\t\t1400\n"
1595 "InstallInitialize\t\t1500\n"
1596 "ProcessComponents\t\t1600\n"
1597 "RemoveFiles\t\t1700\n"
1598 "InstallFiles\t\t2000\n"
1599 "UnregisterExtensionInfo\t\t3000\n"
1600 "uei_immediate\tREMOVE\t3001\n"
1601 "uei_deferred\tREMOVE\t3002\n"
1602 "RegisterExtensionInfo\t\t4000\n"
1603 "rei_immediate\tNOT REMOVE\t4001\n"
1604 "rei_deferred\tNOT REMOVE\t4002\n"
1605 "RegisterProduct\t\t5000\n"
1606 "PublishFeatures\t\t5100\n"
1607 "PublishProduct\t\t5200\n"
1608 "UnpublishFeatures\t\t5300\n"
1609 "InstallFinalize\t\t6000\n";
1611 static const char rei_custom_action_dat[] =
1612 "Action\tType\tSource\tTarget\n"
1613 "s72\ti2\tS64\tS0\n"
1614 "CustomAction\tAction\n"
1615 "rei_immediate\t1\tcustom.dll\trei_absent\n"
1616 "rei_deferred\t1025\tcustom.dll\trei_present\n"
1617 "uei_immediate\t1\tcustom.dll\trei_present\n"
1618 "uei_deferred\t1025\tcustom.dll\trei_absent\n";
1620 static const char rpi_file_dat[] =
1621 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1622 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1623 "File\tFile\n"
1624 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1626 static const char rpi_feature_dat[] =
1627 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1628 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1629 "Feature\tFeature\n"
1630 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1632 static const char rpi_feature_comp_dat[] =
1633 "Feature_\tComponent_\n"
1634 "s38\ts72\n"
1635 "FeatureComponents\tFeature_\tComponent_\n"
1636 "progid\tprogid\n";
1638 static const char rpi_component_dat[] =
1639 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1640 "s72\tS38\ts72\ti2\tS255\tS72\n"
1641 "Component\tComponent\n"
1642 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1644 static const char rpi_appid_dat[] =
1645 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1646 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1647 "AppId\tAppId\n"
1648 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1650 static const char rpi_class_dat[] =
1651 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1652 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1653 "Class\tCLSID\tContext\tComponent_\n"
1654 "{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"
1655 "{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"
1656 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1658 static const char rpi_extension_dat[] =
1659 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1660 "s255\ts72\tS255\tS64\ts38\n"
1661 "Extension\tExtension\tComponent_\n"
1662 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1664 static const char rpi_verb_dat[] =
1665 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1666 "s255\ts32\tI2\tL255\tL255\n"
1667 "Verb\tExtension_\tVerb\n"
1668 "winetest\tOpen\t1\t&Open\t/argument\n";
1670 static const char rpi_progid_dat[] =
1671 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1672 "s255\tS255\tS38\tL255\tS72\tI2\n"
1673 "ProgId\tProgId\n"
1674 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1675 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1676 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1677 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1678 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1679 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1680 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1681 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1682 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1683 "Winetest.Extension\t\t\tdescription\t\t\n";
1685 static const char rpi_install_exec_seq_dat[] =
1686 "Action\tCondition\tSequence\n"
1687 "s72\tS255\tI2\n"
1688 "InstallExecuteSequence\tAction\n"
1689 "LaunchConditions\t\t100\n"
1690 "CostInitialize\t\t800\n"
1691 "FileCost\t\t900\n"
1692 "CostFinalize\t\t1000\n"
1693 "InstallValidate\t\t1400\n"
1694 "InstallInitialize\t\t1500\n"
1695 "ProcessComponents\t\t1600\n"
1696 "RemoveFiles\t\t1700\n"
1697 "UnregisterClassInfo\t\t3000\n"
1698 "UnregisterExtensionInfo\t\t3200\n"
1699 "UnregisterProgIdInfo\t\t3400\n"
1700 "upi_immediate\tREMOVE\t3401\n"
1701 "upi_deferred\tREMOVE\t3402\n"
1702 "InstallFiles\t\t3600\n"
1703 "RegisterClassInfo\t\t4000\n"
1704 "RegisterExtensionInfo\t\t4200\n"
1705 "RegisterProgIdInfo\t\t4400\n"
1706 "rpi_immediate\tNOT REMOVE\t4401\n"
1707 "rpi_deferred\tNOT REMOVE\t4402\n"
1708 "RegisterProduct\t\t5000\n"
1709 "PublishFeatures\t\t5100\n"
1710 "PublishProduct\t\t5200\n"
1711 "UnpublishFeatures\t\t5300\n"
1712 "InstallFinalize\t\t6000\n";
1714 static const char rpi_custom_action_dat[] =
1715 "Action\tType\tSource\tTarget\n"
1716 "s72\ti2\tS64\tS0\n"
1717 "CustomAction\tAction\n"
1718 "rpi_immediate\t1\tcustom.dll\trpi_absent\n"
1719 "rpi_deferred\t1025\tcustom.dll\trpi_present\n"
1720 "upi_immediate\t1\tcustom.dll\trpi_present\n"
1721 "upi_deferred\t1025\tcustom.dll\trpi_absent\n";
1723 static const char rmi_file_dat[] =
1724 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1725 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1726 "File\tFile\n"
1727 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1729 static const char rmi_feature_dat[] =
1730 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1731 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1732 "Feature\tFeature\n"
1733 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1735 static const char rmi_feature_comp_dat[] =
1736 "Feature_\tComponent_\n"
1737 "s38\ts72\n"
1738 "FeatureComponents\tFeature_\tComponent_\n"
1739 "mime\tmime\n";
1741 static const char rmi_component_dat[] =
1742 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1743 "s72\tS38\ts72\ti2\tS255\tS72\n"
1744 "Component\tComponent\n"
1745 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1747 static const char rmi_extension_dat[] =
1748 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1749 "s255\ts72\tS255\tS64\ts38\n"
1750 "Extension\tExtension\tComponent_\n"
1751 "mime\tmime\t\tmime/type\tmime\n";
1753 static const char rmi_verb_dat[] =
1754 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1755 "s255\ts32\tI2\tL255\tL255\n"
1756 "Verb\tExtension_\tVerb\n"
1757 "mime\tOpen\t1\t&Open\t/argument\n";
1759 static const char rmi_mime_dat[] =
1760 "ContentType\tExtension_\tCLSID\n"
1761 "s64\ts255\tS38\n"
1762 "MIME\tContentType\n"
1763 "mime/type\tmime\t\n";
1765 static const char rmi_install_exec_seq_dat[] =
1766 "Action\tCondition\tSequence\n"
1767 "s72\tS255\tI2\n"
1768 "InstallExecuteSequence\tAction\n"
1769 "LaunchConditions\t\t100\n"
1770 "CostInitialize\t\t800\n"
1771 "FileCost\t\t900\n"
1772 "CostFinalize\t\t1000\n"
1773 "InstallValidate\t\t1400\n"
1774 "InstallInitialize\t\t1500\n"
1775 "ProcessComponents\t\t1600\n"
1776 "RemoveFiles\t\t1700\n"
1777 "InstallFiles\t\t2000\n"
1778 "UnregisterExtensionInfo\t\t3000\n"
1779 "UnregisterMIMEInfo\t\t3500\n"
1780 "umi_immediate\tREMOVE\t3501\n"
1781 "umi_deferred\tREMOVE\t3502\n"
1782 "RegisterExtensionInfo\t\t4000\n"
1783 "RegisterMIMEInfo\t\t4500\n"
1784 "rmi_immediate\tNOT REMOVE\t4501\n"
1785 "rmi_deferred\tNOT REMOVE\t4502\n"
1786 "RegisterProduct\t\t5000\n"
1787 "PublishFeatures\t\t5100\n"
1788 "PublishProduct\t\t5200\n"
1789 "UnpublishFeatures\t\t5300\n"
1790 "InstallFinalize\t\t6000\n";
1792 static const char rmi_custom_action_dat[] =
1793 "Action\tType\tSource\tTarget\n"
1794 "s72\ti2\tS64\tS0\n"
1795 "CustomAction\tAction\n"
1796 "rmi_immediate\t1\tcustom.dll\trmi_absent\n"
1797 "rmi_deferred\t1025\tcustom.dll\trmi_present\n"
1798 "umi_immediate\t1\tcustom.dll\trmi_present\n"
1799 "umi_deferred\t1025\tcustom.dll\trmi_absent\n";
1801 static const char pa_file_dat[] =
1802 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1803 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1804 "File\tFile\n"
1805 "fake_local.txt\tfake_local\tfake_local.txt\t1000\t\t\t8192\t1\n"
1806 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1807 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1808 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1809 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1810 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1811 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1812 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1813 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1815 static const char pa_feature_dat[] =
1816 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1817 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1818 "Feature\tFeature\n"
1819 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1821 static const char pa_feature_comp_dat[] =
1822 "Feature_\tComponent_\n"
1823 "s38\ts72\n"
1824 "FeatureComponents\tFeature_\tComponent_\n"
1825 "assembly\tfake_local\n"
1826 "assembly\twin32\n"
1827 "assembly\twin32_local\n"
1828 "assembly\tdotnet\n"
1829 "assembly\tdotnet_local\n";
1831 static const char pa_component_dat[] =
1832 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1833 "s72\tS38\ts72\ti2\tS255\tS72\n"
1834 "Component\tComponent\n"
1835 "fake_local\t{F515549D-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\tfake_local.txt\n"
1836 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1837 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1838 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1839 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1841 static const char pa_msi_assembly_dat[] =
1842 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1843 "s72\ts38\tS72\tS72\tI2\n"
1844 "MsiAssembly\tComponent_\n"
1845 "fake_local\tassembly\t\tnonexistent.txt\t0\n"
1846 "win32\tassembly\tmanifest.txt\t\t1\n"
1847 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1848 "dotnet\tassembly\t\t\t0\n"
1849 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1851 static const char pa_msi_assembly_name_dat[] =
1852 "Component_\tName\tValue\n"
1853 "s72\ts255\ts255\n"
1854 "MsiAssemblyName\tComponent_\tName\n"
1855 "fake_local\tName\tWine.Fake.Application.Assembly\n"
1856 "fake_local\tprocessorArchitecture\tx86\n"
1857 "fake_local\tpublicKeyToken\tabcdef0123456789\n"
1858 "fake_local\ttype\twin32\n"
1859 "fake_local\tversion\t1.0.0.0\n"
1860 "win32\tName\tWine.Win32.Assembly\n"
1861 "win32\tprocessorArchitecture\tx86\n"
1862 "win32\tpublicKeyToken\tabcdef0123456789\n"
1863 "win32\ttype\twin32\n"
1864 "win32\tversion\t1.0.0.0\n"
1865 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1866 "win32_local\tprocessorArchitecture\tx86\n"
1867 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1868 "win32_local\ttype\twin32\n"
1869 "win32_local\tversion\t1.0.0.0\n"
1870 "dotnet\tName\tWine.Dotnet.Assembly\n"
1871 "dotnet\tprocessorArchitecture\tMSIL\n"
1872 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1873 "dotnet\tculture\tneutral\n"
1874 "dotnet\tversion\t1.0.0.0\n"
1875 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1876 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1877 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1878 "dotnet_local\tculture\tneutral\n"
1879 "dotnet_local\tversion\t1.0.0.0\n";
1881 static const char pa_install_exec_seq_dat[] =
1882 "Action\tCondition\tSequence\n"
1883 "s72\tS255\tI2\n"
1884 "InstallExecuteSequence\tAction\n"
1885 "LaunchConditions\t\t100\n"
1886 "CostInitialize\t\t800\n"
1887 "FileCost\t\t900\n"
1888 "CostFinalize\t\t1000\n"
1889 "InstallValidate\t\t1400\n"
1890 "InstallInitialize\t\t1500\n"
1891 "ProcessComponents\t\t1600\n"
1892 "MsiPublishAssemblies\t\t3000\n"
1893 "pa_immediate\tNOT REMOVE AND NOT ALLUSERS\t3001\n"
1894 "pa_deferred\tNOT REMOVE AND NOT ALLUSERS\t3002\n"
1895 "MsiUnpublishAssemblies\t\t4000\n"
1896 "ua_immediate\tREMOVE AND NOT ALLUSERS\t4001\n"
1897 "ua_deferred\tREMOVE AND NOT ALLUSERS\t4002\n"
1898 "RegisterProduct\t\t5000\n"
1899 "PublishFeatures\t\t5100\n"
1900 "PublishProduct\t\t5200\n"
1901 "UnpublishFeatures\t\t5300\n"
1902 "InstallFinalize\t\t6000\n";
1904 static const char pa_custom_action_dat[] =
1905 "Action\tType\tSource\tTarget\n"
1906 "s72\ti2\tS64\tS0\n"
1907 "CustomAction\tAction\n"
1908 "pa_immediate\t1\tcustom.dll\tpa_absent\n"
1909 "pa_deferred\t1025\tcustom.dll\tpa_present\n"
1910 "ua_immediate\t1\tcustom.dll\tpa_present\n"
1911 "ua_deferred\t1025\tcustom.dll\tpa_absent\n";
1913 static const char rep_file_dat[] =
1914 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1915 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1916 "File\tFile\n"
1917 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1919 static const char rep_feature_dat[] =
1920 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1921 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1922 "Feature\tFeature\n"
1923 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1925 static const char rep_feature_comp_dat[] =
1926 "Feature_\tComponent_\n"
1927 "s38\ts72\n"
1928 "FeatureComponents\tFeature_\tComponent_\n"
1929 "rep\trep\n";
1931 static const char rep_component_dat[] =
1932 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1933 "s72\tS38\ts72\ti2\tS255\tS72\n"
1934 "Component\tComponent\n"
1935 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1937 static const char rep_upgrade_dat[] =
1938 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1939 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1940 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1941 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1943 static const char rep_property_dat[] =
1944 "Property\tValue\n"
1945 "s72\tl0\n"
1946 "Property\tProperty\n"
1947 "HASUIRUN\t0\n"
1948 "INSTALLLEVEL\t3\n"
1949 "InstallMode\tTypical\n"
1950 "Manufacturer\tWine\n"
1951 "PIDTemplate\t###-#######\n"
1952 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1953 "ProductLanguage\t1033\n"
1954 "ProductName\tMSITEST\n"
1955 "ProductVersion\t1.1.1\n"
1956 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1957 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1958 "MSIFASTINSTALL\t1\n";
1960 static const char rep_install_exec_seq_dat[] =
1961 "Action\tCondition\tSequence\n"
1962 "s72\tS255\tI2\n"
1963 "InstallExecuteSequence\tAction\n"
1964 "FindRelatedProducts\t\t100\n"
1965 "CostInitialize\t\t800\n"
1966 "FileCost\t\t900\n"
1967 "CostFinalize\t\t1000\n"
1968 "InstallValidate\t\t1400\n"
1969 "RemoveExistingProducts\t\t1499\n"
1970 "InstallInitialize\t\t1500\n"
1971 "ProcessComponents\t\t1600\n"
1972 "RemoveFiles\t\t1700\n"
1973 "InstallFiles\t\t2000\n"
1974 "UnregisterExtensionInfo\t\t3000\n"
1975 "UnregisterMIMEInfo\t\t3500\n"
1976 "RegisterExtensionInfo\t\t4000\n"
1977 "RegisterMIMEInfo\t\t4500\n"
1978 "RegisterProduct\t\t5000\n"
1979 "PublishFeatures\t\t5100\n"
1980 "PublishProduct\t\t5200\n"
1981 "UnpublishFeatures\t\t5300\n"
1982 "InstallFinalize\t\t6000\n";
1984 static const msi_table env_tables[] =
1986 ADD_TABLE(component),
1987 ADD_TABLE(directory),
1988 ADD_TABLE(feature),
1989 ADD_TABLE(feature_comp),
1990 ADD_TABLE(file),
1991 ADD_TABLE(env_install_exec_seq),
1992 ADD_TABLE(env_custom_action),
1993 ADD_TABLE(media),
1994 ADD_TABLE(property),
1995 ADD_TABLE(env_environment)
1998 static const msi_table pp_tables[] =
2000 ADD_TABLE(pp_component),
2001 ADD_TABLE(directory),
2002 ADD_TABLE(rof_feature),
2003 ADD_TABLE(rof_feature_comp),
2004 ADD_TABLE(rof_file),
2005 ADD_TABLE(pp_install_exec_seq),
2006 ADD_TABLE(pp_custom_action),
2007 ADD_TABLE(rof_media),
2008 ADD_TABLE(property),
2011 static const msi_table ppc_tables[] =
2013 ADD_TABLE(ppc_component),
2014 ADD_TABLE(directory),
2015 ADD_TABLE(rof_feature),
2016 ADD_TABLE(ppc_feature_comp),
2017 ADD_TABLE(ppc_file),
2018 ADD_TABLE(pp_install_exec_seq),
2019 ADD_TABLE(pp_custom_action),
2020 ADD_TABLE(ppc_media),
2021 ADD_TABLE(property),
2024 static const msi_table rem_tables[] =
2026 ADD_TABLE(rem_component),
2027 ADD_TABLE(directory),
2028 ADD_TABLE(rof_feature),
2029 ADD_TABLE(rem_feature_comp),
2030 ADD_TABLE(rem_file),
2031 ADD_TABLE(rem_install_exec_seq),
2032 ADD_TABLE(rof_media),
2033 ADD_TABLE(property),
2034 ADD_TABLE(rem_remove_files),
2037 static const msi_table mov_tables[] =
2039 ADD_TABLE(cwd_component),
2040 ADD_TABLE(directory),
2041 ADD_TABLE(rof_feature),
2042 ADD_TABLE(ci2_feature_comp),
2043 ADD_TABLE(ci2_file),
2044 ADD_TABLE(mov_install_exec_seq),
2045 ADD_TABLE(mov_custom_action),
2046 ADD_TABLE(rof_media),
2047 ADD_TABLE(property),
2048 ADD_TABLE(mov_move_file),
2051 static const msi_table df_tables[] =
2053 ADD_TABLE(rof_component),
2054 ADD_TABLE(df_directory),
2055 ADD_TABLE(rof_feature),
2056 ADD_TABLE(rof_feature_comp),
2057 ADD_TABLE(rof_file),
2058 ADD_TABLE(install_exec_seq),
2059 ADD_TABLE(rof_media),
2060 ADD_TABLE(property),
2061 ADD_TABLE(df_duplicate_file),
2064 static const msi_table wrv_tables[] =
2066 ADD_TABLE(wrv_component),
2067 ADD_TABLE(directory),
2068 ADD_TABLE(wrv_feature),
2069 ADD_TABLE(wrv_feature_comp),
2070 ADD_TABLE(wrv_install_exec_seq),
2071 ADD_TABLE(wrv_custom_action),
2072 ADD_TABLE(property),
2073 ADD_TABLE(media),
2074 ADD_TABLE(wrv_registry),
2075 ADD_TABLE(wrv_remove_registry),
2078 static const msi_table cf_tables[] =
2080 ADD_TABLE(cf_component),
2081 ADD_TABLE(cf_directory),
2082 ADD_TABLE(cf_feature),
2083 ADD_TABLE(cf_feature_comp),
2084 ADD_TABLE(cf_file),
2085 ADD_TABLE(cf_create_folders),
2086 ADD_TABLE(cf_install_exec_seq),
2087 ADD_TABLE(cf_custom_action),
2088 ADD_TABLE(media),
2089 ADD_TABLE(property)
2092 static const msi_table sss_tables[] =
2094 ADD_TABLE(component),
2095 ADD_TABLE(directory),
2096 ADD_TABLE(feature),
2097 ADD_TABLE(feature_comp),
2098 ADD_TABLE(file),
2099 ADD_TABLE(sss_install_exec_seq),
2100 ADD_TABLE(sss_service_control),
2101 ADD_TABLE(sss_custom_action),
2102 ADD_TABLE(media),
2103 ADD_TABLE(property)
2106 static const msi_table sds_tables[] =
2108 ADD_TABLE(component),
2109 ADD_TABLE(directory),
2110 ADD_TABLE(feature),
2111 ADD_TABLE(feature_comp),
2112 ADD_TABLE(file),
2113 ADD_TABLE(sds_install_exec_seq),
2114 ADD_TABLE(sds_custom_action),
2115 ADD_TABLE(service_control),
2116 ADD_TABLE(service_install),
2117 ADD_TABLE(media),
2118 ADD_TABLE(property)
2121 static const msi_table sis_tables[] =
2123 ADD_TABLE(component),
2124 ADD_TABLE(directory),
2125 ADD_TABLE(feature),
2126 ADD_TABLE(feature_comp),
2127 ADD_TABLE(file),
2128 ADD_TABLE(sis_install_exec_seq),
2129 ADD_TABLE(sis_custom_action),
2130 ADD_TABLE(service_install2),
2131 ADD_TABLE(media),
2132 ADD_TABLE(property)
2135 static const msi_table sr_tables[] =
2137 ADD_TABLE(sr_component),
2138 ADD_TABLE(directory),
2139 ADD_TABLE(sr_feature),
2140 ADD_TABLE(sr_feature_comp),
2141 ADD_TABLE(sr_file),
2142 ADD_TABLE(sr_selfreg),
2143 ADD_TABLE(sr_install_exec_seq),
2144 ADD_TABLE(sr_custom_action),
2145 ADD_TABLE(media),
2146 ADD_TABLE(property)
2149 static const msi_table font_tables[] =
2151 ADD_TABLE(font_component),
2152 ADD_TABLE(directory),
2153 ADD_TABLE(font_feature),
2154 ADD_TABLE(font_feature_comp),
2155 ADD_TABLE(font_file),
2156 ADD_TABLE(font),
2157 ADD_TABLE(font_install_exec_seq),
2158 ADD_TABLE(font_custom_action),
2159 ADD_TABLE(font_media),
2160 ADD_TABLE(property)
2163 static const msi_table vp_tables[] =
2165 ADD_TABLE(component),
2166 ADD_TABLE(directory),
2167 ADD_TABLE(feature),
2168 ADD_TABLE(feature_comp),
2169 ADD_TABLE(file),
2170 ADD_TABLE(vp_custom_action),
2171 ADD_TABLE(vp_install_exec_seq),
2172 ADD_TABLE(media),
2173 ADD_TABLE(vp_property)
2176 static const msi_table odbc_tables[] =
2178 ADD_TABLE(odbc_component),
2179 ADD_TABLE(directory),
2180 ADD_TABLE(odbc_feature),
2181 ADD_TABLE(odbc_feature_comp),
2182 ADD_TABLE(odbc_file),
2183 ADD_TABLE(odbc_driver),
2184 ADD_TABLE(odbc_translator),
2185 ADD_TABLE(odbc_datasource),
2186 ADD_TABLE(odbc_install_exec_seq),
2187 ADD_TABLE(odbc_custom_action),
2188 ADD_TABLE(odbc_media),
2189 ADD_TABLE(property)
2192 static const msi_table tl_tables[] =
2194 ADD_TABLE(tl_component),
2195 ADD_TABLE(directory),
2196 ADD_TABLE(tl_feature),
2197 ADD_TABLE(tl_feature_comp),
2198 ADD_TABLE(tl_file),
2199 ADD_TABLE(tl_typelib),
2200 ADD_TABLE(tl_install_exec_seq),
2201 ADD_TABLE(tl_custom_action),
2202 ADD_TABLE(media),
2203 ADD_TABLE(property)
2206 static const msi_table crs_tables[] =
2208 ADD_TABLE(crs_component),
2209 ADD_TABLE(directory),
2210 ADD_TABLE(crs_feature),
2211 ADD_TABLE(crs_feature_comp),
2212 ADD_TABLE(crs_file),
2213 ADD_TABLE(crs_shortcut),
2214 ADD_TABLE(crs_install_exec_seq),
2215 ADD_TABLE(crs_custom_action),
2216 ADD_TABLE(media),
2217 ADD_TABLE(property)
2220 static const msi_table pub_tables[] =
2222 ADD_TABLE(directory),
2223 ADD_TABLE(pub_component),
2224 ADD_TABLE(pub_feature),
2225 ADD_TABLE(pub_feature_comp),
2226 ADD_TABLE(pub_file),
2227 ADD_TABLE(pub_publish_component),
2228 ADD_TABLE(pub_install_exec_seq),
2229 ADD_TABLE(pub_custom_action),
2230 ADD_TABLE(media),
2231 ADD_TABLE(property)
2234 static const msi_table rd_tables[] =
2236 ADD_TABLE(directory),
2237 ADD_TABLE(rd_component),
2238 ADD_TABLE(rd_feature),
2239 ADD_TABLE(rd_feature_comp),
2240 ADD_TABLE(rd_file),
2241 ADD_TABLE(rd_duplicate_file),
2242 ADD_TABLE(rd_install_exec_seq),
2243 ADD_TABLE(rd_custom_action),
2244 ADD_TABLE(media),
2245 ADD_TABLE(property)
2248 static const msi_table frp_tables[] =
2250 ADD_TABLE(directory),
2251 ADD_TABLE(frp_component),
2252 ADD_TABLE(frp_feature),
2253 ADD_TABLE(frp_feature_comp),
2254 ADD_TABLE(frp_file),
2255 ADD_TABLE(frp_upgrade),
2256 ADD_TABLE(frp_custom_action),
2257 ADD_TABLE(frp_install_exec_seq),
2258 ADD_TABLE(media),
2259 ADD_TABLE(property)
2262 static const msi_table ini_tables[] =
2264 ADD_TABLE(directory),
2265 ADD_TABLE(ini_component),
2266 ADD_TABLE(ini_feature),
2267 ADD_TABLE(ini_feature_comp),
2268 ADD_TABLE(ini_file),
2269 ADD_TABLE(ini_ini_file),
2270 ADD_TABLE(ini_remove_ini_file),
2271 ADD_TABLE(ini_install_exec_seq),
2272 ADD_TABLE(ini_custom_action),
2273 ADD_TABLE(media),
2274 ADD_TABLE(property)
2277 static const msi_table rci_tables[] =
2279 ADD_TABLE(directory),
2280 ADD_TABLE(rci_component),
2281 ADD_TABLE(rci_feature),
2282 ADD_TABLE(rci_feature_comp),
2283 ADD_TABLE(rci_file),
2284 ADD_TABLE(rci_appid),
2285 ADD_TABLE(rci_class),
2286 ADD_TABLE(rci_install_exec_seq),
2287 ADD_TABLE(rci_custom_action),
2288 ADD_TABLE(media),
2289 ADD_TABLE(property)
2292 static const msi_table rei_tables[] =
2294 ADD_TABLE(directory),
2295 ADD_TABLE(rei_component),
2296 ADD_TABLE(rei_feature),
2297 ADD_TABLE(rei_feature_comp),
2298 ADD_TABLE(rei_file),
2299 ADD_TABLE(rei_extension),
2300 ADD_TABLE(rei_verb),
2301 ADD_TABLE(rei_progid),
2302 ADD_TABLE(rei_install_exec_seq),
2303 ADD_TABLE(rei_custom_action),
2304 ADD_TABLE(media),
2305 ADD_TABLE(property)
2308 static const msi_table rpi_tables[] =
2310 ADD_TABLE(directory),
2311 ADD_TABLE(rpi_component),
2312 ADD_TABLE(rpi_feature),
2313 ADD_TABLE(rpi_feature_comp),
2314 ADD_TABLE(rpi_file),
2315 ADD_TABLE(rpi_appid),
2316 ADD_TABLE(rpi_class),
2317 ADD_TABLE(rpi_extension),
2318 ADD_TABLE(rpi_verb),
2319 ADD_TABLE(rpi_progid),
2320 ADD_TABLE(rpi_install_exec_seq),
2321 ADD_TABLE(rpi_custom_action),
2322 ADD_TABLE(media),
2323 ADD_TABLE(property)
2326 static const msi_table rmi_tables[] =
2328 ADD_TABLE(directory),
2329 ADD_TABLE(rmi_component),
2330 ADD_TABLE(rmi_feature),
2331 ADD_TABLE(rmi_feature_comp),
2332 ADD_TABLE(rmi_file),
2333 ADD_TABLE(rmi_extension),
2334 ADD_TABLE(rmi_verb),
2335 ADD_TABLE(rmi_mime),
2336 ADD_TABLE(rmi_install_exec_seq),
2337 ADD_TABLE(rmi_custom_action),
2338 ADD_TABLE(media),
2339 ADD_TABLE(property)
2342 static const msi_table pa_tables[] =
2344 ADD_TABLE(directory),
2345 ADD_TABLE(pa_component),
2346 ADD_TABLE(pa_feature),
2347 ADD_TABLE(pa_feature_comp),
2348 ADD_TABLE(pa_file),
2349 ADD_TABLE(pa_msi_assembly),
2350 ADD_TABLE(pa_msi_assembly_name),
2351 ADD_TABLE(pa_install_exec_seq),
2352 ADD_TABLE(pa_custom_action),
2353 ADD_TABLE(media),
2354 ADD_TABLE(property)
2357 static const msi_table rep_tables[] =
2359 ADD_TABLE(directory),
2360 ADD_TABLE(rep_component),
2361 ADD_TABLE(rep_feature),
2362 ADD_TABLE(rep_feature_comp),
2363 ADD_TABLE(rep_file),
2364 ADD_TABLE(rep_upgrade),
2365 ADD_TABLE(rep_property),
2366 ADD_TABLE(rep_install_exec_seq),
2367 ADD_TABLE(media)
2370 /* cabinet definitions */
2372 /* make the max size large so there is only one cab file */
2373 #define MEDIA_SIZE 0x7FFFFFFF
2375 static void init_functionpointers(void)
2377 HMODULE hmsi = GetModuleHandleA("msi.dll");
2378 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2379 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2380 HMODULE hsrclient = LoadLibraryA("srclient.dll");
2382 #define GET_PROC(mod, func) \
2383 p ## func = (void*)GetProcAddress(mod, #func); \
2384 if(!p ## func) \
2385 trace("GetProcAddress(%s) failed\n", #func);
2387 GET_PROC(hmsi, MsiQueryComponentStateA);
2388 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
2389 GET_PROC(hmsi, MsiSourceListGetInfoA);
2390 GET_PROC(hmsi, MsiGetComponentPathExA);
2391 GET_PROC(hmsi, MsiQueryFeatureStateExA);
2393 GET_PROC(hadvapi32, RegDeleteKeyExA)
2394 GET_PROC(hkernel32, IsWow64Process)
2396 GET_PROC(hsrclient, SRRemoveRestorePoint);
2397 GET_PROC(hsrclient, SRSetRestorePointA);
2399 #undef GET_PROC
2402 static char *get_user_sid(void)
2404 HANDLE token;
2405 DWORD size = 0;
2406 TOKEN_USER *user;
2407 char *usersid = NULL;
2409 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
2410 GetTokenInformation(token, TokenUser, NULL, size, &size);
2412 user = malloc(size);
2413 GetTokenInformation(token, TokenUser, user, size, &size);
2414 ConvertSidToStringSidA(user->User.Sid, &usersid);
2415 free(user);
2417 CloseHandle(token);
2418 return usersid;
2421 static void create_test_files(void)
2423 CreateDirectoryA("msitest", NULL);
2424 create_file("msitest\\one.txt", 100);
2425 CreateDirectoryA("msitest\\first", NULL);
2426 create_file("msitest\\first\\two.txt", 100);
2427 CreateDirectoryA("msitest\\second", NULL);
2428 create_file("msitest\\second\\three.txt", 100);
2430 create_file("four.txt", 100);
2431 create_file("five.txt", 100);
2432 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2434 create_file("msitest\\filename", 100);
2435 create_file("msitest\\service.exe", 100);
2436 create_file("msitest\\service2.exe", 100);
2438 DeleteFileA("four.txt");
2439 DeleteFileA("five.txt");
2442 static void delete_test_files(void)
2444 DeleteFileA("msitest.msi");
2445 DeleteFileA("msitest.cab");
2446 DeleteFileA("msitest\\second\\three.txt");
2447 DeleteFileA("msitest\\first\\two.txt");
2448 DeleteFileA("msitest\\one.txt");
2449 DeleteFileA("msitest\\service.exe");
2450 DeleteFileA("msitest\\service2.exe");
2451 DeleteFileA("msitest\\filename");
2452 RemoveDirectoryA("msitest\\second");
2453 RemoveDirectoryA("msitest\\first");
2454 RemoveDirectoryA("msitest");
2457 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
2459 RESTOREPOINTINFOA spec;
2461 spec.dwEventType = event_type;
2462 spec.dwRestorePtType = APPLICATION_INSTALL;
2463 spec.llSequenceNumber = status->llSequenceNumber;
2464 lstrcpyA(spec.szDescription, "msitest restore point");
2466 return pSRSetRestorePointA(&spec, status);
2469 static void remove_restore_point(DWORD seq_number)
2471 DWORD res;
2473 res = pSRRemoveRestorePoint(seq_number);
2474 if (res != ERROR_SUCCESS)
2475 trace("Failed to remove the restore point : %#lx\n", res);
2478 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
2480 if (pRegDeleteKeyExA)
2481 return pRegDeleteKeyExA( key, subkey, access, 0 );
2482 return RegDeleteKeyA( key, subkey );
2485 static void delete_pfmsitest_files(void)
2487 SHFILEOPSTRUCTA shfl;
2488 CHAR path[MAX_PATH+11];
2490 lstrcpyA(path, PROG_FILES_DIR);
2491 lstrcatA(path, "\\msitest\\*");
2492 path[strlen(path) + 1] = '\0';
2494 shfl.hwnd = NULL;
2495 shfl.wFunc = FO_DELETE;
2496 shfl.pFrom = path;
2497 shfl.pTo = NULL;
2498 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
2500 SHFileOperationA(&shfl);
2502 lstrcpyA(path, PROG_FILES_DIR);
2503 lstrcatA(path, "\\msitest");
2504 RemoveDirectoryA(path);
2507 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, BOOL todo, DWORD line)
2509 char val[MAX_PATH];
2510 DWORD size, type;
2511 LONG res;
2513 size = MAX_PATH;
2514 val[0] = '\0';
2515 res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)val, &size);
2516 ok_(__FILE__, line)(!res, "Failed to query value, error %ld\n", res);
2517 ok_(__FILE__, line)(type == REG_SZ || type == REG_EXPAND_SZ, "Got wrong type %lu\n", type);
2518 todo_wine_if (todo)
2520 if (bcase)
2521 ok_(__FILE__, line)(!strcmp(val, expected), "got %s\n", debugstr_a(val));
2522 else
2523 ok_(__FILE__, line)(!strcasecmp(val, expected), "got %s\n", debugstr_a(val));
2527 static void check_reg_multi(HKEY prodkey, const char *name, const char *expect, DWORD line)
2529 char val[MAX_PATH];
2530 DWORD expect_size = 0, size, type;
2531 const char *p;
2532 LONG res;
2534 for (p = expect; *p; p += strlen(p) + 1)
2536 expect_size = (p + 1) - expect;
2538 size = MAX_PATH;
2539 val[0] = '\0';
2540 res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)val, &size);
2541 ok_(__FILE__, line)(!res, "Failed to query value, error %ld\n", res);
2542 ok_(__FILE__, line)(type == REG_MULTI_SZ, "Got wrong type %lu\n", type);
2543 ok_(__FILE__, line)(size == expect_size, "expected size %lu, got %lu\n", expect_size, size);
2544 ok_(__FILE__, line)(!memcmp(val, expect, size), "got %s\n", debugstr_an(val, size));
2547 static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, BOOL todo, DWORD line)
2549 DWORD val, size, type;
2550 LONG res;
2552 size = sizeof(DWORD);
2553 res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)&val, &size);
2554 ok_(__FILE__, line)(!res, "Failed to query value, error %ld\n", res);
2555 ok_(__FILE__, line)(type == REG_DWORD, "Got wrong type %lu\n", type);
2556 todo_wine_if (todo)
2557 ok_(__FILE__, line)(val == expected, "Expected %lu, got %lu\n", expected, val);
2560 #define CHECK_REG_STR(prodkey, name, expected) \
2561 check_reg_str(prodkey, name, expected, TRUE, FALSE, __LINE__);
2563 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2564 do { \
2565 check_reg_str(prodkey, name, expected, TRUE, FALSE, __LINE__); \
2566 RegDeleteValueA(prodkey, name); \
2567 } while(0)
2569 #define CHECK_DEL_REG_STR_TODO(prodkey, name, expected) \
2570 do { \
2571 check_reg_str(prodkey, name, expected, TRUE, TRUE, __LINE__); \
2572 RegDeleteValueA(prodkey, name); \
2573 } while(0)
2575 #define CHECK_REG_ISTR(prodkey, name, expected) \
2576 check_reg_str(prodkey, name, expected, FALSE, FALSE, __LINE__);
2578 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2579 do { \
2580 check_reg_str(prodkey, name, expected, FALSE, FALSE, __LINE__); \
2581 RegDeleteValueA(prodkey, name); \
2582 } while(0)
2584 #define CHECK_REG_MULTI(key, name, expect) \
2585 check_reg_multi(key, name, expect, __LINE__);
2587 #define CHECK_DEL_REG_MULTI(key, name, expect) \
2588 do { \
2589 check_reg_multi(key, name, expect, __LINE__); \
2590 RegDeleteValueA(key, name); \
2591 } while(0)
2593 #define CHECK_REG_DWORD(prodkey, name, expected) \
2594 check_reg_dword(prodkey, name, expected, FALSE, __LINE__);
2596 #define CHECK_REG_DWORD_TODO(prodkey, name, expected) \
2597 check_reg_dword(prodkey, name, expected, TRUE, __LINE__);
2599 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2600 do { \
2601 check_reg_dword(prodkey, name, expected, FALSE, __LINE__); \
2602 RegDeleteValueA(prodkey, name); \
2603 } while(0)
2605 #define CHECK_DEL_REG_DWORD_TODO(prodkey, name, expected) \
2606 do { \
2607 check_reg_dword(prodkey, name, expected, TRUE, __LINE__); \
2608 RegDeleteValueA(prodkey, name); \
2609 } while(0)
2611 static void get_date_str(LPSTR date)
2613 SYSTEMTIME systime;
2615 static const char date_fmt[] = "%d%02d%02d";
2616 GetLocalTime(&systime);
2617 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
2620 /* EstimatedSize is the size in KiB of .msi + installed files, rounded up to page size. */
2621 static DWORD get_estimated_size(void)
2623 SYSTEM_INFO si;
2624 HANDLE file;
2625 DWORD size;
2627 GetSystemInfo(&si);
2629 file = CreateFileA(msifile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
2630 size = ((GetFileSize(file, NULL) + si.dwPageSize - 1) / si.dwPageSize + 1);
2631 size = size * si.dwPageSize / 1024;
2632 CloseHandle(file);
2633 return size;
2636 static void extract_resource(const char *name, const char *type, const char *path)
2638 DWORD written;
2639 HANDLE file;
2640 HRSRC res;
2641 void *ptr;
2643 file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
2644 ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %lu\n", path, GetLastError());
2646 res = FindResourceA(NULL, name, type);
2647 ok( res != 0, "couldn't find resource\n" );
2648 ptr = LockResource( LoadResource( GetModuleHandleA(NULL), res ));
2649 WriteFile( file, ptr, SizeofResource( GetModuleHandleA(NULL), res ), &written, NULL );
2650 ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" );
2651 CloseHandle( file );
2654 static void test_register_product(void)
2656 UINT r;
2657 LONG res;
2658 HKEY hkey, props, usage;
2659 LPSTR usersid;
2660 char date[MAX_PATH], temp[MAX_PATH], keypath[MAX_PATH], path[MAX_PATH];
2661 DWORD size, type;
2663 static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2664 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2665 static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2666 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2667 static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2668 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2669 static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2670 "\\51AAE0C44620A5E4788506E91F249BD2";
2672 if (is_process_limited())
2674 skip("process is limited\n");
2675 return;
2678 if (!(usersid = get_user_sid()))
2679 return;
2681 get_date_str(date);
2682 GetTempPathA(MAX_PATH, temp);
2684 CreateDirectoryA("msitest", NULL);
2685 create_file("msitest\\maximus", 500);
2687 create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
2689 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2691 /* RegisterProduct */
2692 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
2693 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2695 skip("Not enough rights to perform tests\n");
2696 goto error;
2698 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2699 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2700 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2702 res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
2703 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
2705 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_READ | KEY_WOW64_32KEY, &hkey);
2706 ok(!res, "got %ld\n", res);
2708 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2709 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2710 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2711 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2712 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2713 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2714 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2715 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", "");
2716 CHECK_DEL_REG_STR(hkey, "Comments", "");
2717 CHECK_DEL_REG_STR(hkey, "Contact", "");
2718 CHECK_DEL_REG_STR(hkey, "HelpLink", "");
2719 CHECK_DEL_REG_STR(hkey, "HelpTelephone", "");
2720 CHECK_DEL_REG_STR(hkey, "InstallLocation", "");
2721 CHECK_DEL_REG_DWORD(hkey, "NoModify", 1);
2722 CHECK_DEL_REG_STR(hkey, "Readme", "");
2723 CHECK_DEL_REG_STR(hkey, "Size", "");
2724 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", "");
2725 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", "");
2726 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2727 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2728 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2729 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2730 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2731 CHECK_DEL_REG_DWORD_TODO(hkey, "EstimatedSize", get_estimated_size());
2733 res = RegDeleteKeyA(hkey, "");
2734 ok(!res, "got %ld\n", res);
2735 RegCloseKey(hkey);
2737 sprintf(keypath, userdata, usersid);
2738 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hkey);
2739 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2741 res = RegOpenKeyExA(hkey, "InstallProperties", 0, KEY_READ, &props);
2742 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2744 size = sizeof(path);
2745 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2746 DeleteFileA(path);
2747 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2749 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2750 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2751 CHECK_DEL_REG_STR(props, "InstallDate", date);
2752 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2753 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2754 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2755 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2756 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", "");
2757 CHECK_DEL_REG_STR(props, "Comments", "");
2758 CHECK_DEL_REG_STR(props, "Contact", "");
2759 CHECK_DEL_REG_STR(props, "HelpLink", "");
2760 CHECK_DEL_REG_STR(props, "HelpTelephone", "");
2761 CHECK_DEL_REG_STR(props, "InstallLocation", "");
2762 CHECK_DEL_REG_DWORD(props, "NoModify", 1);
2763 CHECK_DEL_REG_STR(props, "Readme", "");
2764 CHECK_DEL_REG_STR(props, "Size", "");
2765 CHECK_DEL_REG_STR(props, "URLInfoAbout", "");
2766 CHECK_DEL_REG_STR(props, "URLUpdateInfo", "");
2767 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2768 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2769 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2770 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2771 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2772 CHECK_DEL_REG_DWORD_TODO(props, "EstimatedSize", get_estimated_size());
2774 res = RegDeleteKeyA(props, "");
2775 ok(!res, "got %ld\n", res);
2776 RegCloseKey(props);
2778 res = RegOpenKeyExA(hkey, "Usage", 0, KEY_READ, &usage);
2779 todo_wine
2781 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2784 res = RegDeleteKeyA(usage, "");
2785 todo_wine
2786 ok(!res, "got %ld\n", res);
2787 RegCloseKey(usage);
2788 res = RegDeleteKeyA(hkey, "");
2789 ok(!res, "got %ld\n", res);
2790 RegCloseKey(hkey);
2792 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2793 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2795 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", "");
2797 res = RegDeleteKeyA(hkey, "");
2798 ok(!res, "got %ld\n", res);
2799 RegCloseKey(hkey);
2801 /* RegisterProduct, machine */
2802 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1");
2803 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2804 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2805 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2807 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2808 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
2810 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_READ | KEY_WOW64_32KEY, &hkey);
2811 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2813 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2814 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2815 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2816 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2817 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2818 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2819 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2820 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", "");
2821 CHECK_DEL_REG_STR(hkey, "Comments", "");
2822 CHECK_DEL_REG_STR(hkey, "Contact", "");
2823 CHECK_DEL_REG_STR(hkey, "HelpLink", "");
2824 CHECK_DEL_REG_STR(hkey, "HelpTelephone", "");
2825 CHECK_DEL_REG_STR(hkey, "InstallLocation", "");
2826 CHECK_DEL_REG_DWORD(hkey, "NoModify", 1);
2827 CHECK_DEL_REG_STR(hkey, "Readme", "");
2828 CHECK_DEL_REG_STR(hkey, "Size", "");
2829 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", "");
2830 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", "");
2831 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2832 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2833 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2834 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2835 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2836 CHECK_DEL_REG_DWORD_TODO(hkey, "EstimatedSize", get_estimated_size());
2838 res = RegDeleteKeyA(hkey, "");
2839 ok(!res, "got %ld\n", res);
2840 RegCloseKey(hkey);
2842 sprintf(keypath, userdata, "S-1-5-18");
2843 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2844 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2846 res = RegOpenKeyExA(hkey, "InstallProperties", 0, KEY_READ, &props);
2847 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2849 size = sizeof(path);
2850 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2851 DeleteFileA(path);
2852 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2854 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2855 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2856 CHECK_DEL_REG_STR(props, "InstallDate", date);
2857 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2858 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2859 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2860 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2861 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", "");
2862 CHECK_DEL_REG_STR(props, "Comments", "");
2863 CHECK_DEL_REG_STR(props, "Contact", "");
2864 CHECK_DEL_REG_STR(props, "HelpLink", "");
2865 CHECK_DEL_REG_STR(props, "HelpTelephone", "");
2866 CHECK_DEL_REG_STR(props, "InstallLocation", "");
2867 CHECK_DEL_REG_DWORD(props, "NoModify", 1);
2868 CHECK_DEL_REG_STR(props, "Readme", "");
2869 CHECK_DEL_REG_STR(props, "Size", "");
2870 CHECK_DEL_REG_STR(props, "URLInfoAbout", "");
2871 CHECK_DEL_REG_STR(props, "URLUpdateInfo", "");
2872 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2873 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2874 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2875 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2876 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2877 CHECK_DEL_REG_DWORD_TODO(props, "EstimatedSize", get_estimated_size());
2879 res = RegDeleteKeyA(props, "");
2880 ok(!res, "got %ld\n", res);
2881 RegCloseKey(props);
2883 res = RegOpenKeyExA(hkey, "Usage", 0, KEY_READ, &usage);
2884 todo_wine
2886 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2889 res = RegDeleteKeyA(usage, "");
2890 todo_wine
2891 ok(!res, "got %ld\n", res);
2892 RegCloseKey(usage);
2893 res = RegDeleteKeyA(hkey, "");
2894 ok(!res, "got %ld\n", res);
2895 RegCloseKey(hkey);
2897 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2898 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2900 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", "");
2902 res = RegDeleteKeyA(hkey, "");
2903 ok(!res, "got %ld\n", res);
2904 RegCloseKey(hkey);
2906 if (is_wow64 || is_64bit)
2908 DeleteFileA(msifile);
2909 create_database_template(msifile, pp_tables, ARRAY_SIZE(pp_tables), 200, "x64;1033");
2911 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1 RP_TEST64=1");
2912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2913 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2914 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2916 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2917 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
2919 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_READ | KEY_WOW64_32KEY, &hkey);
2920 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_SUCCESS, got %ld\n", res);
2922 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2923 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2925 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2926 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2927 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2928 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2929 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2930 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2931 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2932 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", "");
2933 CHECK_DEL_REG_STR(hkey, "Comments", "");
2934 CHECK_DEL_REG_STR(hkey, "Contact", "");
2935 CHECK_DEL_REG_STR(hkey, "HelpLink", "");
2936 CHECK_DEL_REG_STR(hkey, "HelpTelephone", "");
2937 CHECK_DEL_REG_STR(hkey, "InstallLocation", "");
2938 CHECK_DEL_REG_DWORD(hkey, "NoModify", 1);
2939 CHECK_DEL_REG_STR(hkey, "Readme", "");
2940 CHECK_DEL_REG_STR(hkey, "Size", "");
2941 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", "");
2942 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", "");
2943 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2944 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2945 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2946 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2947 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2948 CHECK_DEL_REG_DWORD_TODO(hkey, "EstimatedSize", get_estimated_size());
2950 res = RegDeleteKeyA(hkey, "");
2951 ok(!res, "got %ld\n", res);
2952 RegCloseKey(hkey);
2954 sprintf(keypath, userdata, "S-1-5-18");
2955 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2956 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2958 res = RegOpenKeyExA(hkey, "InstallProperties", 0, KEY_READ, &props);
2959 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
2961 size = sizeof(path);
2962 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2963 DeleteFileA(path);
2964 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2966 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2967 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2968 CHECK_DEL_REG_STR(props, "InstallDate", date);
2969 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2970 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2971 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2972 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2973 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", "");
2974 CHECK_DEL_REG_STR(props, "Comments", "");
2975 CHECK_DEL_REG_STR(props, "Contact", "");
2976 CHECK_DEL_REG_STR(props, "HelpLink", "");
2977 CHECK_DEL_REG_STR(props, "HelpTelephone", "");
2978 CHECK_DEL_REG_STR(props, "InstallLocation", "");
2979 CHECK_DEL_REG_DWORD(props, "NoModify", 1);
2980 CHECK_DEL_REG_STR(props, "Readme", "");
2981 CHECK_DEL_REG_STR(props, "Size", "");
2982 CHECK_DEL_REG_STR(props, "URLInfoAbout", "");
2983 CHECK_DEL_REG_STR(props, "URLUpdateInfo", "");
2984 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2985 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2986 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2987 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2988 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2989 CHECK_DEL_REG_DWORD_TODO(props, "EstimatedSize", get_estimated_size());
2991 res = RegDeleteKeyA(props, "");
2992 ok(!res, "got %ld\n", res);
2993 RegCloseKey(props);
2995 res = RegOpenKeyExA(hkey, "Usage", 0, KEY_READ, &usage);
2996 todo_wine
2998 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3001 res = RegDeleteKeyA(usage, "");
3002 todo_wine
3003 ok(!res, "got %ld\n", res);
3004 RegCloseKey(usage);
3005 res = RegDeleteKeyA(hkey, "");
3006 ok(!res, "got %ld\n", res);
3007 RegCloseKey(hkey);
3009 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
3010 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3012 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", "");
3014 res = RegDeleteKeyA(hkey, "");
3015 ok(!res, "got %ld\n", res);
3016 RegCloseKey(hkey);
3018 else
3019 skip("64-bit RegisterProduct tests\n");
3021 error:
3022 DeleteFileA(msifile);
3023 DeleteFileA("msitest\\maximus");
3024 RemoveDirectoryA("msitest");
3025 LocalFree(usersid);
3028 static void test_publish_product(void)
3030 static const char prodpath[] =
3031 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3032 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3033 static const char cuprodpath[] =
3034 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3035 static const char cuupgrades[] =
3036 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3037 static const char badprod[] =
3038 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
3039 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3040 static const char machprod[] =
3041 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3042 static const char machup[] =
3043 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3044 UINT r;
3045 LONG res;
3046 LPSTR usersid;
3047 HKEY sourcelist, net, props;
3048 HKEY hkey, patches, media;
3049 CHAR keypath[MAX_PATH];
3050 CHAR temp[MAX_PATH];
3051 CHAR path[MAX_PATH];
3052 BOOL old_installer = FALSE;
3053 REGSAM access = KEY_ALL_ACCESS;
3055 if (is_process_limited())
3057 skip("process is limited\n");
3058 return;
3061 if (!(usersid = get_user_sid()))
3062 return;
3064 GetTempPathA(MAX_PATH, temp);
3066 CreateDirectoryA("msitest", NULL);
3067 create_file("msitest\\maximus", 500);
3069 create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
3071 if (is_wow64)
3072 access |= KEY_WOW64_64KEY;
3074 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
3076 /* PublishProduct, current user */
3077 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
3078 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3080 skip("Not enough rights to perform tests\n");
3081 goto error;
3083 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3084 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3085 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3087 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
3088 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3090 sprintf(keypath, prodpath, usersid);
3091 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3092 if (res == ERROR_FILE_NOT_FOUND)
3094 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
3095 if (res == ERROR_SUCCESS)
3097 win_skip("Windows Installer < 3.0 detected\n");
3098 RegCloseKey(hkey);
3099 old_installer = TRUE;
3100 goto currentuser;
3102 else
3104 win_skip("Install failed, no need to continue\n");
3105 return;
3108 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3110 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
3111 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3113 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
3114 todo_wine ok(!res, "Expected ERROR_SUCCESS, got %ld\n", res);
3115 if (!res)
3116 CHECK_DEL_REG_STR(patches, "AllPatches", "");
3118 delete_key(patches, "", access);
3119 RegCloseKey(patches);
3120 delete_key(hkey, "", access);
3121 RegCloseKey(hkey);
3123 currentuser:
3124 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
3125 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3127 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
3128 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3129 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
3130 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
3131 if (!old_installer)
3132 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
3133 CHECK_DEL_REG_DWORD(hkey, "Assignment", 0);
3134 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
3135 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
3136 CHECK_DEL_REG_MULTI(hkey, "Clients", ":\0");
3138 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
3139 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3141 lstrcpyA(path, "n;1;");
3142 lstrcatA(path, temp);
3143 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
3144 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
3146 res = RegOpenKeyA(sourcelist, "Net", &net);
3147 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3149 CHECK_DEL_REG_STR(net, "1", temp);
3151 RegDeleteKeyA(net, "");
3152 RegCloseKey(net);
3154 res = RegOpenKeyA(sourcelist, "Media", &media);
3155 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3157 CHECK_DEL_REG_STR(media, "1", "DISK1;");
3159 RegDeleteKeyA(media, "");
3160 RegCloseKey(media);
3161 RegDeleteKeyA(sourcelist, "");
3162 RegCloseKey(sourcelist);
3163 RegDeleteKeyA(hkey, "");
3164 RegCloseKey(hkey);
3166 res = RegOpenKeyA(HKEY_CURRENT_USER, cuupgrades, &hkey);
3167 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3169 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", "");
3171 RegDeleteKeyA(hkey, "");
3172 RegCloseKey(hkey);
3174 /* PublishProduct, machine */
3175 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3176 if (old_installer)
3177 goto machprod;
3178 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3179 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3180 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3182 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
3183 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3185 sprintf(keypath, prodpath, "S-1-5-18");
3186 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3187 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3189 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
3190 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3192 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
3193 todo_wine ok(!res, "Expected ERROR_SUCCESS, got %ld\n", res);
3194 if (!res)
3195 CHECK_DEL_REG_STR(patches, "AllPatches", "");
3197 delete_key(patches, "", access);
3198 RegCloseKey(patches);
3199 delete_key(hkey, "", access);
3200 RegCloseKey(hkey);
3202 machprod:
3203 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machprod, 0, access, &hkey);
3204 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3206 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
3207 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3208 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
3209 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
3210 if (!old_installer)
3211 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
3212 CHECK_DEL_REG_DWORD_TODO(hkey, "Assignment", 1);
3213 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
3214 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
3215 CHECK_DEL_REG_MULTI(hkey, "Clients", ":\0");
3217 res = RegOpenKeyExA(hkey, "SourceList", 0, access, &sourcelist);
3218 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3220 lstrcpyA(path, "n;1;");
3221 lstrcatA(path, temp);
3222 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
3223 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
3225 res = RegOpenKeyExA(sourcelist, "Net", 0, access, &net);
3226 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3228 CHECK_DEL_REG_STR(net, "1", temp);
3230 res = delete_key(net, "", access);
3231 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3232 RegCloseKey(net);
3234 res = RegOpenKeyExA(sourcelist, "Media", 0, access, &media);
3235 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3237 CHECK_DEL_REG_STR(media, "1", "DISK1;");
3239 res = delete_key(media, "", access);
3240 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3241 RegCloseKey(media);
3242 res = delete_key(sourcelist, "", access);
3243 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3244 RegCloseKey(sourcelist);
3245 res = delete_key(hkey, "", access);
3246 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3247 RegCloseKey(hkey);
3249 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machup, 0, access, &hkey);
3250 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3252 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", "");
3254 res = delete_key(hkey, "", access);
3255 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3256 RegCloseKey(hkey);
3258 error:
3259 DeleteFileA(msifile);
3260 DeleteFileA("msitest\\maximus");
3261 RemoveDirectoryA("msitest");
3262 LocalFree(usersid);
3265 static void test_publish_features(void)
3267 static const char cupath[] =
3268 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3269 static const char udfeatpath[] =
3270 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3271 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3272 static const char udpridpath[] =
3273 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3274 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3275 static const char featkey[] =
3276 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3277 static const char classfeat[] =
3278 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3279 UINT r;
3280 LONG res;
3281 HKEY hkey;
3282 LPSTR usersid;
3283 CHAR keypath[MAX_PATH];
3284 REGSAM access = KEY_ALL_ACCESS;
3286 if (is_process_limited())
3288 skip("process is limited\n");
3289 return;
3292 if (!(usersid = get_user_sid()))
3293 return;
3295 CreateDirectoryA("msitest", NULL);
3296 create_file("msitest\\maximus", 500);
3298 create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
3300 if (is_wow64)
3301 access |= KEY_WOW64_64KEY;
3303 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
3305 /* PublishFeatures, current user */
3306 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
3307 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3309 skip("Not enough rights to perform tests\n");
3310 goto error;
3312 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3313 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3314 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3316 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3317 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3319 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3320 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3322 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3323 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3325 CHECK_REG_STR(hkey, "feature", "");
3326 CHECK_REG_STR(hkey, "montecristo", "");
3328 RegDeleteValueA(hkey, "feature");
3329 RegDeleteValueA(hkey, "montecristo");
3330 delete_key(hkey, "", access);
3331 RegCloseKey(hkey);
3333 sprintf(keypath, udfeatpath, usersid);
3334 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3335 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3337 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3338 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3340 RegDeleteValueA(hkey, "feature");
3341 RegDeleteValueA(hkey, "montecristo");
3342 delete_key(hkey, "", access);
3343 RegCloseKey(hkey);
3344 sprintf(keypath, udpridpath, usersid);
3345 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3347 /* PublishFeatures, machine */
3348 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
3349 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3350 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3351 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3353 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3354 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3356 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3357 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3358 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3359 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3361 CHECK_REG_STR(hkey, "feature", "");
3362 CHECK_REG_STR(hkey, "montecristo", "");
3364 RegDeleteValueA(hkey, "feature");
3365 RegDeleteValueA(hkey, "montecristo");
3366 delete_key(hkey, "", access);
3367 RegCloseKey(hkey);
3369 sprintf(keypath, udfeatpath, "S-1-5-18");
3370 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3371 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3373 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3374 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3376 RegDeleteValueA(hkey, "feature");
3377 RegDeleteValueA(hkey, "montecristo");
3378 delete_key(hkey, "", access);
3379 RegCloseKey(hkey);
3380 sprintf(keypath, udpridpath, "S-1-5-18");
3381 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3383 error:
3384 DeleteFileA(msifile);
3385 DeleteFileA("msitest\\maximus");
3386 RemoveDirectoryA("msitest");
3387 LocalFree(usersid);
3390 static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
3392 DWORD len = 0;
3393 LPSTR val;
3394 LONG r;
3396 r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
3397 if (r != ERROR_SUCCESS)
3398 return NULL;
3400 len += sizeof (WCHAR);
3401 val = malloc(len);
3402 if (!val) return NULL;
3403 val[0] = 0;
3404 RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len);
3405 return val;
3408 static void get_owner_company(LPSTR *owner, LPSTR *company)
3410 LONG res;
3411 HKEY hkey;
3412 REGSAM access = KEY_ALL_ACCESS;
3414 *owner = *company = NULL;
3416 if (is_wow64)
3417 access |= KEY_WOW64_64KEY;
3419 res = RegOpenKeyA(HKEY_CURRENT_USER,
3420 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
3421 if (res == ERROR_SUCCESS)
3423 *owner = reg_get_val_str(hkey, "DefName");
3424 *company = reg_get_val_str(hkey, "DefCompany");
3425 RegCloseKey(hkey);
3428 if (!*owner || !*company)
3430 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3431 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
3432 if (res == ERROR_SUCCESS)
3434 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3435 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3436 RegCloseKey(hkey);
3440 if (!*owner || !*company)
3442 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3443 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
3444 if (res == ERROR_SUCCESS)
3446 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3447 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3448 RegCloseKey(hkey);
3453 static void test_register_user(void)
3455 UINT r;
3456 LONG res;
3457 HKEY props;
3458 LPSTR usersid;
3459 LPSTR owner, company;
3460 CHAR keypath[MAX_PATH];
3461 REGSAM access = KEY_ALL_ACCESS;
3463 static const CHAR keypropsfmt[] =
3464 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3465 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3466 static const CHAR keypridfmt[] =
3467 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3468 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3470 if (is_process_limited())
3472 skip("process is limited\n");
3473 return;
3476 if (!(usersid = get_user_sid()))
3477 return;
3479 get_owner_company(&owner, &company);
3481 CreateDirectoryA("msitest", NULL);
3482 create_file("msitest\\maximus", 500);
3484 create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
3486 if (is_wow64)
3487 access |= KEY_WOW64_64KEY;
3489 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3491 /* RegisterUser, per-user */
3492 r = MsiInstallProductA(msifile, "REGISTER_USER=1");
3493 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3495 skip("Not enough rights to perform tests\n");
3496 goto error;
3498 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3499 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3500 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3502 sprintf(keypath, keypropsfmt, usersid);
3503 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3504 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3506 CHECK_REG_STR(props, "ProductID", "none");
3507 CHECK_REG_STR(props, "RegCompany", company);
3508 CHECK_REG_STR(props, "RegOwner", owner);
3510 RegDeleteValueA(props, "ProductID");
3511 RegDeleteValueA(props, "RegCompany");
3512 RegDeleteValueA(props, "RegOwner");
3513 delete_key(props, "", access);
3514 RegCloseKey(props);
3515 sprintf(keypath, keypridfmt, usersid);
3516 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3518 /* RegisterUser, machine */
3519 r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
3520 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3521 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3522 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3524 sprintf(keypath, keypropsfmt, "S-1-5-18");
3525 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3526 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3528 CHECK_REG_STR(props, "ProductID", "none");
3529 CHECK_REG_STR(props, "RegCompany", company);
3530 CHECK_REG_STR(props, "RegOwner", owner);
3532 RegDeleteValueA(props, "ProductID");
3533 RegDeleteValueA(props, "RegCompany");
3534 RegDeleteValueA(props, "RegOwner");
3535 delete_key(props, "", access);
3536 RegCloseKey(props);
3537 sprintf(keypath, keypridfmt, "S-1-5-18");
3538 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3540 error:
3541 free(company);
3542 free(owner);
3544 DeleteFileA(msifile);
3545 DeleteFileA("msitest\\maximus");
3546 RemoveDirectoryA("msitest");
3547 LocalFree(usersid);
3550 static void test_process_components(void)
3552 static const char keyfmt[] =
3553 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3554 static const char compkey[] =
3555 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3556 UINT r;
3557 LONG res;
3558 DWORD size;
3559 HKEY comp, hkey;
3560 LPSTR usersid;
3561 CHAR val[MAX_PATH];
3562 CHAR keypath[MAX_PATH];
3563 CHAR program_files_maximus[MAX_PATH];
3564 REGSAM access = KEY_ALL_ACCESS;
3566 if (is_process_limited())
3568 skip("process is limited\n");
3569 return;
3572 if (!(usersid = get_user_sid()))
3573 return;
3575 CreateDirectoryA("msitest", NULL);
3576 create_file("msitest\\maximus", 500);
3578 create_database(msifile, ppc_tables, ARRAY_SIZE(ppc_tables));
3580 if (is_wow64)
3581 access |= KEY_WOW64_64KEY;
3583 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3585 /* ProcessComponents, per-user */
3586 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
3587 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3589 skip("Not enough rights to perform tests\n");
3590 goto error;
3592 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3593 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3594 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3596 sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
3597 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3598 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3600 size = MAX_PATH;
3601 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3602 NULL, NULL, (LPBYTE)val, &size);
3603 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3605 lstrcpyA(program_files_maximus,PROG_FILES_DIR);
3606 lstrcatA(program_files_maximus,"\\msitest\\maximus");
3608 ok(!lstrcmpiA(val, program_files_maximus),
3609 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3611 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3612 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3614 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3615 delete_key(comp, "", access);
3616 RegCloseKey(comp);
3618 sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
3619 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3620 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3622 size = MAX_PATH;
3623 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3624 NULL, NULL, (LPBYTE)val, &size);
3625 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3626 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3627 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3629 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3630 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3632 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3633 delete_key(comp, "", access);
3634 RegCloseKey(comp);
3636 /* ProcessComponents, machine */
3637 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3638 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3639 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3640 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3642 sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3643 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3644 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3646 size = MAX_PATH;
3647 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3648 NULL, NULL, (LPBYTE)val, &size);
3649 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3650 ok(!lstrcmpiA(val, program_files_maximus),
3651 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3653 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3654 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3656 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3657 delete_key(comp, "", access);
3658 RegCloseKey(comp);
3660 sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3661 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3662 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3664 size = MAX_PATH;
3665 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3666 NULL, NULL, (LPBYTE)val, &size);
3667 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3668 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3669 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3671 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3672 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3674 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3675 delete_key(comp, "", access);
3676 RegCloseKey(comp);
3678 error:
3679 DeleteFileA(msifile);
3680 DeleteFileA("msitest\\maximus");
3681 RemoveDirectoryA("msitest");
3682 LocalFree(usersid);
3685 static void test_publish(void)
3687 static const char subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3688 static const char subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3689 UINT r;
3690 LONG res;
3691 HKEY uninstall, prodkey, uninstall_32node = NULL;
3692 INSTALLSTATE state;
3693 char date[MAX_PATH], date2[MAX_PATH], temp[MAX_PATH], buf[MAX_PATH];
3694 const char prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3695 REGSAM access = KEY_ALL_ACCESS;
3696 DWORD error, type, size;
3698 if (!pMsiQueryFeatureStateExA)
3700 win_skip("MsiQueryFeatureStateExA is not available\n");
3701 return;
3703 if (is_process_limited())
3705 skip("process is limited\n");
3706 return;
3709 get_date_str(date);
3710 GetTempPathA(MAX_PATH, temp);
3712 if (is_wow64)
3713 access |= KEY_WOW64_64KEY;
3715 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
3716 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3718 if (is_64bit)
3720 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
3721 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3724 CreateDirectoryA("msitest", NULL);
3725 create_file("msitest\\maximus", 500);
3727 create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
3729 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3731 state = MsiQueryProductStateA(prodcode);
3732 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3734 state = MsiQueryFeatureStateA(prodcode, "feature");
3735 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3737 state = 0xdead;
3738 SetLastError(0xdeadbeef);
3739 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3740 error = GetLastError();
3741 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3742 ok(state == 0xdead, "got %d\n", state);
3743 ok(error == 0xdeadbeef, "got %lu\n", error);
3745 state = 0xdead;
3746 SetLastError(0xdeadbeef);
3747 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3748 error = GetLastError();
3749 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3750 ok(state == 0xdead, "got %d\n", state);
3751 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3753 state = 0xdead;
3754 SetLastError(0xdeadbeef);
3755 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3756 error = GetLastError();
3757 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3758 ok(state == 0xdead, "got %d\n", state);
3759 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3761 state = MsiQueryFeatureStateA(prodcode, "feature");
3762 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3764 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3765 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3767 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3768 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3769 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3770 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3772 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3773 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3775 /* nothing published */
3776 r = MsiInstallProductA(msifile, NULL);
3777 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3779 skip("Not enough rights to perform tests\n");
3780 goto error;
3782 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3783 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3784 ok(pf_exists("msitest"), "File not installed\n");
3786 state = MsiQueryProductStateA(prodcode);
3787 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3789 state = MsiQueryFeatureStateA(prodcode, "feature");
3790 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3792 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3793 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3795 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3796 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3797 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3798 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3800 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3801 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3803 /* PublishProduct and RegisterProduct */
3804 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3805 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3806 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3807 ok(pf_exists("msitest"), "File not installed\n");
3809 state = MsiQueryProductStateA(prodcode);
3810 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3812 state = MsiQueryFeatureStateA(prodcode, "feature");
3813 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3815 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3816 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3818 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3819 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3820 ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
3821 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3823 if (is_64bit)
3825 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3826 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3828 else
3830 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3831 if (is_wow64 && res == ERROR_FILE_NOT_FOUND) /* XP - Vista, Wow64 */
3832 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3833 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3836 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3837 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3838 CHECK_REG_STR(prodkey, "InstallDate", date);
3839 CHECK_REG_STR(prodkey, "InstallSource", temp);
3840 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3841 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3842 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3843 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
3844 CHECK_REG_STR(prodkey, "Comments", "");
3845 CHECK_REG_STR(prodkey, "Contact", "");
3846 CHECK_REG_STR(prodkey, "HelpLink", "");
3847 CHECK_REG_STR(prodkey, "HelpTelephone", "");
3848 CHECK_REG_STR(prodkey, "InstallLocation", "");
3849 CHECK_REG_DWORD(prodkey, "NoModify", 1);
3850 CHECK_REG_STR(prodkey, "Readme", "");
3851 CHECK_REG_STR(prodkey, "Size", "");
3852 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
3853 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
3854 CHECK_REG_DWORD(prodkey, "Language", 1033);
3855 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3856 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3857 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3858 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3859 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
3861 RegCloseKey(prodkey);
3863 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3864 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3865 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3866 ok(pf_exists("msitest"), "File deleted\n");
3868 state = MsiQueryProductStateA(prodcode);
3869 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3871 state = MsiQueryFeatureStateA(prodcode, "feature");
3872 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3874 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3875 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3877 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3878 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3879 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3880 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3882 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3883 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3885 /* complete install */
3886 r = MsiInstallProductA(msifile, "FULL=1");
3887 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3888 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3889 ok(pf_exists("msitest"), "File not installed\n");
3891 state = MsiQueryProductStateA(prodcode);
3892 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3894 state = MsiQueryFeatureStateA(prodcode, "feature");
3895 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3897 state = 0xdead;
3898 SetLastError(0xdeadbeef);
3899 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3900 error = GetLastError();
3901 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3902 ok(state == 0xdead, "got %d\n", state);
3903 ok(error == 0xdeadbeef, "got %lu\n", error);
3905 state = 0xdead;
3906 SetLastError(0xdeadbeef);
3907 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3908 error = GetLastError();
3909 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3910 ok(state == 0xdead, "got %d\n", state);
3911 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3913 state = 0xdead;
3914 SetLastError(0xdeadbeef);
3915 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3916 error = GetLastError();
3917 ok(r == ERROR_SUCCESS, "got %u\n", r);
3918 ok(state == INSTALLSTATE_LOCAL, "got %d\n", state);
3919 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3921 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3922 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3924 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3925 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3926 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3927 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3929 if (is_64bit)
3931 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3932 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3934 else
3936 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3937 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3940 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3941 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3942 CHECK_REG_STR(prodkey, "InstallDate", date);
3943 CHECK_REG_STR(prodkey, "InstallSource", temp);
3944 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3945 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3946 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3947 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
3948 CHECK_REG_STR(prodkey, "Comments", "");
3949 CHECK_REG_STR(prodkey, "Contact", "");
3950 CHECK_REG_STR(prodkey, "HelpLink", "");
3951 CHECK_REG_STR(prodkey, "HelpTelephone", "");
3952 CHECK_REG_STR(prodkey, "InstallLocation", "");
3953 CHECK_REG_DWORD(prodkey, "NoModify", 1);
3954 CHECK_REG_STR(prodkey, "Readme", "");
3955 CHECK_REG_STR(prodkey, "Size", "");
3956 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
3957 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
3958 CHECK_REG_DWORD(prodkey, "Language", 1033);
3959 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3960 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3961 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3962 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3963 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
3965 RegCloseKey(prodkey);
3967 /* no UnpublishFeatures */
3968 r = MsiInstallProductA(msifile, "REMOVE=ALL");
3969 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3970 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3971 ok(!pf_exists("msitest"), "Directory not deleted\n");
3973 state = MsiQueryProductStateA(prodcode);
3974 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3976 state = MsiQueryFeatureStateA(prodcode, "feature");
3977 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3979 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3980 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3982 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3983 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3984 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3985 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3987 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3988 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3990 /* complete install */
3991 r = MsiInstallProductA(msifile, "FULL=1");
3992 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3993 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3994 ok(pf_exists("msitest"), "File not installed\n");
3996 state = MsiQueryProductStateA(prodcode);
3997 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3999 state = MsiQueryFeatureStateA(prodcode, "feature");
4000 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4002 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4003 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4005 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4006 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4007 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4008 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4010 if (is_64bit)
4012 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4013 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4015 else
4017 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4018 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4021 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4022 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4023 CHECK_REG_STR(prodkey, "InstallDate", date);
4024 CHECK_REG_STR(prodkey, "InstallSource", temp);
4025 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4026 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4027 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4028 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4029 CHECK_REG_STR(prodkey, "Comments", "");
4030 CHECK_REG_STR(prodkey, "Contact", "");
4031 CHECK_REG_STR(prodkey, "HelpLink", "");
4032 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4033 CHECK_REG_STR(prodkey, "InstallLocation", "");
4034 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4035 CHECK_REG_STR(prodkey, "Readme", "");
4036 CHECK_REG_STR(prodkey, "Size", "");
4037 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4038 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4039 CHECK_REG_DWORD(prodkey, "Language", 1033);
4040 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4041 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4042 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4043 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4044 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4046 RegCloseKey(prodkey);
4048 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4049 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4050 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4051 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4052 ok(pf_exists("msitest"), "Directory deleted\n");
4054 state = MsiQueryProductStateA(prodcode);
4055 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4057 state = MsiQueryFeatureStateA(prodcode, "feature");
4058 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4060 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4061 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4063 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4064 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4065 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4066 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4068 if (is_64bit)
4070 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4071 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4073 else
4075 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4076 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4079 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4080 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4081 CHECK_REG_STR(prodkey, "InstallDate", date);
4082 CHECK_REG_STR(prodkey, "InstallSource", temp);
4083 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4084 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4085 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4086 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4087 CHECK_REG_STR(prodkey, "Comments", "");
4088 CHECK_REG_STR(prodkey, "Contact", "");
4089 CHECK_REG_STR(prodkey, "HelpLink", "");
4090 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4091 CHECK_REG_STR(prodkey, "InstallLocation", "");
4092 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4093 CHECK_REG_STR(prodkey, "Readme", "");
4094 CHECK_REG_STR(prodkey, "Size", "");
4095 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4096 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4097 CHECK_REG_DWORD(prodkey, "Language", 1033);
4098 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4099 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4100 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4101 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4102 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4104 RegCloseKey(prodkey);
4106 /* complete install */
4107 r = MsiInstallProductA(msifile, "FULL=1");
4108 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4109 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4110 ok(pf_exists("msitest"), "File not installed\n");
4112 state = MsiQueryProductStateA(prodcode);
4113 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4115 state = MsiQueryFeatureStateA(prodcode, "feature");
4116 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4118 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4119 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4121 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4122 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4123 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4124 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4126 if (is_64bit)
4128 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4129 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4131 else
4133 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4134 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4137 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4138 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4139 CHECK_REG_STR(prodkey, "InstallDate", date);
4140 CHECK_REG_STR(prodkey, "InstallSource", temp);
4141 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4142 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4143 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4144 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4145 CHECK_REG_STR(prodkey, "Comments", "");
4146 CHECK_REG_STR(prodkey, "Contact", "");
4147 CHECK_REG_STR(prodkey, "HelpLink", "");
4148 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4149 CHECK_REG_STR(prodkey, "InstallLocation", "");
4150 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4151 CHECK_REG_STR(prodkey, "Readme", "");
4152 CHECK_REG_STR(prodkey, "Size", "");
4153 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4154 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4155 CHECK_REG_DWORD(prodkey, "Language", 1033);
4156 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4157 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4158 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4159 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4160 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4162 RegCloseKey(prodkey);
4164 /* UnpublishFeatures, both features removed */
4165 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4166 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4167 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4168 ok(!pf_exists("msitest"), "Directory not deleted\n");
4170 state = MsiQueryProductStateA(prodcode);
4171 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4173 state = MsiQueryFeatureStateA(prodcode, "feature");
4174 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4176 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4177 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4179 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4180 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4181 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4182 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4184 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4185 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
4187 /* complete install */
4188 r = MsiInstallProductA(msifile, "FULL=1");
4189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4190 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4191 ok(pf_exists("msitest"), "File not installed\n");
4193 state = MsiQueryProductStateA(prodcode);
4194 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4196 state = MsiQueryFeatureStateA(prodcode, "feature");
4197 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4199 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4200 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4202 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4203 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4204 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4205 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4207 if (is_64bit)
4209 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4210 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4212 else
4214 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4215 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4218 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4219 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4221 get_date_str(date2);
4222 size = ARRAY_SIZE(buf);
4223 buf[0] = '\0';
4224 res = RegQueryValueExA(prodkey, "InstallDate", NULL, &type, (BYTE *)buf, &size);
4225 ok(!res, "Failed to query value, error %ld\n", res);
4226 ok(type == REG_SZ, "Got wrong type %lu\n", type);
4227 ok(!strcmp(buf, date) || !strcmp(buf, date2), "got %s\n", debugstr_a(buf));
4229 CHECK_REG_STR(prodkey, "InstallSource", temp);
4230 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4231 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4232 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4233 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4234 CHECK_REG_STR(prodkey, "Comments", "");
4235 CHECK_REG_STR(prodkey, "Contact", "");
4236 CHECK_REG_STR(prodkey, "HelpLink", "");
4237 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4238 CHECK_REG_STR(prodkey, "InstallLocation", "");
4239 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4240 CHECK_REG_STR(prodkey, "Readme", "");
4241 CHECK_REG_STR(prodkey, "Size", "");
4242 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4243 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4244 CHECK_REG_DWORD(prodkey, "Language", 1033);
4245 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4246 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4247 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4248 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4249 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4251 RegCloseKey(prodkey);
4253 /* complete uninstall */
4254 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
4255 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4256 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4257 ok(!pf_exists("msitest"), "Directory not deleted\n");
4259 state = MsiQueryProductStateA(prodcode);
4260 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4262 state = MsiQueryFeatureStateA(prodcode, "feature");
4263 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4265 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4266 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4268 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4269 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4270 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4271 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4273 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4274 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
4276 /* make sure 'Program Files\msitest' is removed */
4277 delete_pfmsitest_files();
4279 error:
4280 RegCloseKey(uninstall);
4281 RegCloseKey(uninstall_32node);
4282 DeleteFileA(msifile);
4283 DeleteFileA("msitest\\maximus");
4284 RemoveDirectoryA("msitest");
4287 static void test_publish_sourcelist(void)
4289 UINT r;
4290 DWORD size;
4291 CHAR value[MAX_PATH];
4292 CHAR path[MAX_PATH];
4293 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4295 if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
4297 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4298 return;
4300 if (is_process_limited())
4302 skip("process is limited\n");
4303 return;
4306 CreateDirectoryA("msitest", NULL);
4307 create_file("msitest\\maximus", 500);
4309 create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
4311 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4313 r = MsiInstallProductA(msifile, NULL);
4314 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4316 skip("Not enough rights to perform tests\n");
4317 goto error;
4319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4320 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4321 ok(pf_exists("msitest"), "File not installed\n");
4323 /* nothing published */
4324 size = MAX_PATH;
4325 lstrcpyA(value, "aaa");
4326 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4327 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4328 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4329 ok(size == MAX_PATH, "got %lu\n", size);
4330 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4332 size = MAX_PATH;
4333 lstrcpyA(value, "aaa");
4334 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4335 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4336 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4337 ok(size == MAX_PATH, "got %lu\n", size);
4338 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4340 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
4341 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4342 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4343 ok(pf_exists("msitest"), "File not installed\n");
4345 /* after RegisterProduct */
4346 size = MAX_PATH;
4347 lstrcpyA(value, "aaa");
4348 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4349 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4350 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4351 ok(size == MAX_PATH, "got %lu\n", size);
4352 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4354 size = MAX_PATH;
4355 lstrcpyA(value, "aaa");
4356 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4357 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4358 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4359 ok(size == MAX_PATH, "got %lu\n", size);
4360 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4362 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
4363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4364 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4365 ok(pf_exists("msitest"), "File not installed\n");
4367 /* after ProcessComponents */
4368 size = MAX_PATH;
4369 lstrcpyA(value, "aaa");
4370 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4371 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4372 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4373 ok(size == MAX_PATH, "got %lu\n", size);
4374 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4376 size = MAX_PATH;
4377 lstrcpyA(value, "aaa");
4378 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4379 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4380 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4381 ok(size == MAX_PATH, "got %lu\n", size);
4382 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4384 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
4385 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4386 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4387 ok(pf_exists("msitest"), "File not installed\n");
4389 /* after PublishFeatures */
4390 size = MAX_PATH;
4391 lstrcpyA(value, "aaa");
4392 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4393 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4394 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4395 ok(size == MAX_PATH, "got %lu\n", size);
4396 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4398 size = MAX_PATH;
4399 lstrcpyA(value, "aaa");
4400 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4401 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4402 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4403 ok(size == MAX_PATH, "got %lu\n", size);
4404 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4406 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
4407 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4408 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4409 ok(pf_exists("msitest"), "File not installed\n");
4411 /* after PublishProduct */
4412 size = MAX_PATH;
4413 lstrcpyA(value, "aaa");
4414 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4415 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4417 ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
4418 ok(size == 11, "Expected 11, got %lu\n", size);
4420 size = MAX_PATH;
4421 lstrcpyA(value, "aaa");
4422 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4423 MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
4424 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4425 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4426 ok(size == 0, "Expected 0, got %lu\n", size);
4428 size = MAX_PATH;
4429 lstrcpyA(value, "aaa");
4430 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4431 MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
4432 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4433 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4434 ok(size == 0, "Expected 0, got %lu\n", size);
4436 lstrcpyA(path, CURR_DIR);
4437 lstrcatA(path, "\\");
4439 size = MAX_PATH;
4440 lstrcpyA(value, "aaa");
4441 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4442 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
4443 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4444 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4445 ok(size == lstrlenA(path), "Expected %d, got %lu\n", lstrlenA(path), size);
4447 size = MAX_PATH;
4448 lstrcpyA(value, "aaa");
4449 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4450 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
4451 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4452 ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
4453 ok(size == 1, "Expected 1, got %lu\n", size);
4455 size = MAX_PATH;
4456 lstrcpyA(value, "aaa");
4457 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4458 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4459 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4460 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4461 ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
4463 size = MAX_PATH;
4464 lstrcpyA(value, "aaa");
4465 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4466 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
4467 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4468 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4469 ok(size == lstrlenA(path), "Expected %d, got %lu\n", lstrlenA(path), size);
4471 size = MAX_PATH;
4472 lstrcpyA(value, "aaa");
4473 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4474 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
4475 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4476 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4477 ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
4479 /* complete uninstall */
4480 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
4481 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4482 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4483 ok(!pf_exists("msitest"), "Directory not deleted\n");
4485 /* make sure 'Program Files\msitest' is removed */
4486 delete_pfmsitest_files();
4488 error:
4489 DeleteFileA(msifile);
4490 DeleteFileA("msitest\\maximus");
4491 RemoveDirectoryA("msitest");
4494 static void test_remove_files(void)
4496 UINT r;
4498 if (is_process_limited())
4500 skip("process is limited\n");
4501 return;
4504 CreateDirectoryA("msitest", NULL);
4505 create_file("msitest\\hydrogen", 500);
4506 create_file("msitest\\helium", 500);
4507 create_file("msitest\\lithium", 500);
4509 create_database(msifile, rem_tables, ARRAY_SIZE(rem_tables));
4511 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4513 r = MsiInstallProductA(msifile, NULL);
4514 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4516 skip("Not enough rights to perform tests\n");
4517 goto error;
4519 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4520 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4521 ok(!pf_exists("msitest\\helium"), "File installed\n");
4522 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4523 ok(pf_exists("msitest"), "File not installed\n");
4525 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4526 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4527 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4528 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4529 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4530 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4532 create_pf("msitest", FALSE);
4533 create_pf("msitest\\hydrogen", TRUE);
4534 create_pf("msitest\\helium", TRUE);
4535 create_pf("msitest\\lithium", TRUE);
4537 r = MsiInstallProductA(msifile, NULL);
4538 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4539 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4540 ok(pf_exists("msitest\\helium"), "File not installed\n");
4541 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4542 ok(pf_exists("msitest"), "File not installed\n");
4544 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4545 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4546 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4547 ok(delete_pf("msitest\\helium", TRUE), "File deleted\n");
4548 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4549 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4551 create_pf("msitest", FALSE);
4552 create_pf("msitest\\furlong", TRUE);
4553 create_pf("msitest\\firkin", TRUE);
4554 create_pf("msitest\\fortnight", TRUE);
4555 create_pf("msitest\\becquerel", TRUE);
4556 create_pf("msitest\\dioptre", TRUE);
4557 create_pf("msitest\\attoparsec", TRUE);
4558 create_pf("msitest\\storeys", TRUE);
4559 create_pf("msitest\\block", TRUE);
4560 create_pf("msitest\\siriometer", TRUE);
4561 create_pf("msitest\\cabout", FALSE);
4562 create_pf("msitest\\cabout\\blocker", TRUE);
4564 r = MsiInstallProductA(msifile, NULL);
4565 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4566 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4567 ok(!pf_exists("msitest\\helium"), "File installed\n");
4568 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4569 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4570 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4571 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4572 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4573 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4574 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4575 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4576 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4577 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4578 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4579 ok(pf_exists("msitest"), "File not installed\n");
4581 create_pf("msitest\\furlong", TRUE);
4582 create_pf("msitest\\firkin", TRUE);
4583 create_pf("msitest\\fortnight", TRUE);
4584 create_pf("msitest\\storeys", TRUE);
4585 create_pf("msitest\\block", TRUE);
4586 create_pf("msitest\\siriometer", TRUE);
4588 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4589 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4590 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
4591 ok(!delete_pf("msitest\\helium", TRUE), "File not deleted\n");
4592 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4593 ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
4594 ok(delete_pf("msitest\\firkin", TRUE), "File deleted\n");
4595 ok(delete_pf("msitest\\fortnight", TRUE), "File deleted\n");
4596 ok(!delete_pf("msitest\\becquerel", TRUE), "File not deleted\n");
4597 ok(!delete_pf("msitest\\dioptre", TRUE), "File not deleted\n");
4598 ok(delete_pf("msitest\\attoparsec", TRUE), "File deleted\n");
4599 ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
4600 ok(!delete_pf("msitest\\block", TRUE), "File not deleted\n");
4601 ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
4602 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4603 ok(pf_exists("msitest"), "Directory deleted\n");
4605 r = MsiInstallProductA(msifile, NULL);
4606 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4607 ok(delete_pf("msitest\\hydrogen", TRUE), "File not installed\n");
4608 ok(!delete_pf("msitest\\helium", TRUE), "File installed\n");
4609 ok(delete_pf("msitest\\lithium", TRUE), "File not installed\n");
4610 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4611 ok(pf_exists("msitest"), "Directory deleted\n");
4613 delete_pf("msitest\\cabout\\blocker", TRUE);
4615 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4616 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4617 ok(!delete_pf("msitest\\cabout", FALSE), "Directory not deleted\n");
4618 delete_pf("msitest", FALSE);
4620 error:
4621 DeleteFileA(msifile);
4622 DeleteFileA("msitest\\hydrogen");
4623 DeleteFileA("msitest\\helium");
4624 DeleteFileA("msitest\\lithium");
4625 RemoveDirectoryA("msitest");
4628 static void test_move_files(void)
4630 UINT r;
4631 char props[4 * MAX_PATH + 74];
4633 if (is_process_limited())
4635 skip("process is limited\n");
4636 return;
4639 CreateDirectoryA("msitest", NULL);
4640 create_file("msitest\\augustus", 100);
4641 create_file("cameroon", 100);
4642 create_file("djibouti", 100);
4643 create_file("egypt", 100);
4644 create_file("finland", 100);
4645 create_file("gambai", 100);
4646 create_file("honduras", 100);
4647 create_file("msitest\\india", 100);
4648 create_file("japan", 100);
4649 create_file("kenya", 100);
4650 CreateDirectoryA("latvia", NULL);
4651 create_file("nauru", 100);
4652 create_file("peru", 100);
4653 create_file("apple", 100);
4654 create_file("application", 100);
4655 create_file("ape", 100);
4656 create_file("foo", 100);
4657 create_file("fao", 100);
4658 create_file("fbod", 100);
4659 create_file("budding", 100);
4660 create_file("buddy", 100);
4661 create_file("bud", 100);
4662 create_file("bar", 100);
4663 create_file("bur", 100);
4664 create_file("bird", 100);
4666 create_database(msifile, mov_tables, ARRAY_SIZE(mov_tables));
4668 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4670 /* if the source or dest property is not a full path,
4671 * windows tries to access it as a network resource
4674 sprintf(props, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4675 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4676 CURR_DIR, PROG_FILES_DIR, CURR_DIR, CURR_DIR);
4678 r = MsiInstallProductA(msifile, props);
4679 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4681 skip("Not enough rights to perform tests\n");
4682 goto error;
4684 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4685 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4686 ok(!delete_pf("msitest\\dest", TRUE), "File copied\n");
4687 ok(delete_pf("msitest\\canada", TRUE), "File not copied\n");
4688 ok(delete_pf("msitest\\dominica", TRUE), "File not moved\n");
4689 ok(!delete_pf("msitest\\elsalvador", TRUE), "File moved\n");
4690 ok(!delete_pf("msitest\\france", TRUE), "File moved\n");
4691 ok(!delete_pf("msitest\\georgia", TRUE), "File moved\n");
4692 ok(delete_pf("msitest\\hungary", TRUE), "File not moved\n");
4693 ok(!delete_pf("msitest\\indonesia", TRUE), "File moved\n");
4694 ok(!delete_pf("msitest\\jordan", TRUE), "File moved\n");
4695 ok(delete_pf("msitest\\kiribati", TRUE), "File not moved\n");
4696 ok(!delete_pf("msitest\\lebanon", TRUE), "File moved\n");
4697 ok(!delete_pf("msitest\\lebanon", FALSE), "Directory moved\n");
4698 ok(delete_pf("msitest\\poland", TRUE), "File not moved\n");
4699 /* either apple or application will be moved depending on directory order */
4700 if (!delete_pf("msitest\\apple", TRUE))
4701 ok(delete_pf("msitest\\application", TRUE), "File not moved\n");
4702 else
4703 ok(!delete_pf("msitest\\application", TRUE), "File should not exist\n");
4704 ok(delete_pf("msitest\\wildcard", TRUE), "File not moved\n");
4705 ok(!delete_pf("msitest\\ape", TRUE), "File moved\n");
4706 /* either fao or foo will be moved depending on directory order */
4707 if (delete_pf("msitest\\foo", TRUE))
4708 ok(!delete_pf("msitest\\fao", TRUE), "File should not exist\n");
4709 else
4710 ok(delete_pf("msitest\\fao", TRUE), "File not moved\n");
4711 ok(delete_pf("msitest\\single", TRUE), "File not moved\n");
4712 ok(!delete_pf("msitest\\fbod", TRUE), "File moved\n");
4713 ok(delete_pf("msitest\\budding", TRUE), "File not moved\n");
4714 ok(delete_pf("msitest\\buddy", TRUE), "File not moved\n");
4715 ok(!delete_pf("msitest\\bud", TRUE), "File moved\n");
4716 ok(delete_pf("msitest\\bar", TRUE), "File not moved\n");
4717 ok(delete_pf("msitest\\bur", TRUE), "File not moved\n");
4718 ok(!delete_pf("msitest\\bird", TRUE), "File moved\n");
4719 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4720 ok(DeleteFileA("cameroon"), "File moved\n");
4721 ok(!DeleteFileA("djibouti"), "File not moved\n");
4722 ok(DeleteFileA("egypt"), "File moved\n");
4723 ok(DeleteFileA("finland"), "File moved\n");
4724 ok(DeleteFileA("gambai"), "File moved\n");
4725 ok(!DeleteFileA("honduras"), "File not moved\n");
4726 ok(DeleteFileA("msitest\\india"), "File moved\n");
4727 ok(DeleteFileA("japan"), "File moved\n");
4728 ok(!DeleteFileA("kenya"), "File not moved\n");
4729 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4730 ok(!DeleteFileA("nauru"), "File not moved\n");
4731 ok(!DeleteFileA("peru"), "File not moved\n");
4732 ok(!DeleteFileA("apple"), "File not moved\n");
4733 ok(!DeleteFileA("application"), "File not moved\n");
4734 ok(DeleteFileA("ape"), "File moved\n");
4735 ok(!DeleteFileA("foo"), "File not moved\n");
4736 ok(!DeleteFileA("fao"), "File not moved\n");
4737 ok(DeleteFileA("fbod"), "File moved\n");
4738 ok(!DeleteFileA("budding"), "File not moved\n");
4739 ok(!DeleteFileA("buddy"), "File not moved\n");
4740 ok(DeleteFileA("bud"), "File moved\n");
4741 ok(!DeleteFileA("bar"), "File not moved\n");
4742 ok(!DeleteFileA("bur"), "File not moved\n");
4743 ok(DeleteFileA("bird"), "File moved\n");
4745 error:
4746 DeleteFileA("cameroon");
4747 DeleteFileA("djibouti");
4748 DeleteFileA("egypt");
4749 DeleteFileA("finland");
4750 DeleteFileA("gambai");
4751 DeleteFileA("honduras");
4752 DeleteFileA("japan");
4753 DeleteFileA("kenya");
4754 DeleteFileA("nauru");
4755 DeleteFileA("peru");
4756 DeleteFileA("apple");
4757 DeleteFileA("application");
4758 DeleteFileA("ape");
4759 DeleteFileA("foo");
4760 DeleteFileA("fao");
4761 DeleteFileA("fbod");
4762 DeleteFileA("budding");
4763 DeleteFileA("buddy");
4764 DeleteFileA("bud");
4765 DeleteFileA("bar");
4766 DeleteFileA("bur");
4767 DeleteFileA("bird");
4768 DeleteFileA("msitest\\india");
4769 DeleteFileA("msitest\\augustus");
4770 RemoveDirectoryA("latvia");
4771 RemoveDirectoryA("msitest");
4772 DeleteFileA(msifile);
4775 static void test_duplicate_files(void)
4777 UINT r;
4779 if (is_process_limited())
4781 skip("process is limited\n");
4782 return;
4785 CreateDirectoryA("msitest", NULL);
4786 create_file("msitest\\maximus", 500);
4787 create_database(msifile, df_tables, ARRAY_SIZE(df_tables));
4789 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4791 /* fails if the destination folder is not a valid property */
4793 r = MsiInstallProductA(msifile, NULL);
4794 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4796 skip("Not enough rights to perform tests\n");
4797 goto error;
4799 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4800 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4801 ok(delete_pf("msitest\\augustus", TRUE), "File not duplicated\n");
4802 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE), "File not duplicated\n");
4803 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE), "Directory not created\n");
4804 ok(delete_pf("msitest\\this\\doesnot", FALSE), "Directory not created\n");
4805 ok(delete_pf("msitest\\this", FALSE), "Directory not created\n");
4806 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4808 error:
4809 DeleteFileA("msitest\\maximus");
4810 RemoveDirectoryA("msitest");
4811 DeleteFileA(msifile);
4814 static void test_write_registry_values(void)
4816 HKEY hkey, subkey;
4817 DWORD type, size;
4818 char buf[20];
4819 LONG res;
4820 UINT r;
4822 if (is_process_limited())
4824 skip("process is limited\n");
4825 return;
4828 CreateDirectoryA("msitest", NULL);
4830 create_database(msifile, wrv_tables, ARRAY_SIZE(wrv_tables));
4832 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4834 res = RegCreateKeyA(HKEY_CURRENT_USER, "msitest", &hkey);
4835 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4837 res = RegSetValueExA(hkey, "Value1", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5);
4838 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4839 res = RegSetValueExA(hkey, "Value2", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4840 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4841 res = RegSetValueExA(hkey, "Value3", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5);
4842 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4843 res = RegSetValueExA(hkey, "Value4", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4844 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4845 res = RegSetValueExA(hkey, "Value5", 0, REG_MULTI_SZ, (const BYTE *)"one\0two\0", 9);
4846 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4847 res = RegSetValueExA(hkey, "Value6", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4848 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4849 res = RegSetValueExA(hkey, "Value7", 0, REG_SZ, (const BYTE *)"one", 4);
4850 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4852 res = RegSetValueExA(hkey, "instremove", 0, REG_SZ, (const BYTE *)"val", 3);
4853 ok(!res, "got %ld\n", res);
4855 res = RegCreateKeyA(hkey, "instremove", &subkey);
4856 ok(!res, "got %ld\n", res);
4857 RegCloseKey(subkey);
4859 r = MsiInstallProductA(msifile, NULL);
4860 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4862 skip("Not enough rights to perform tests\n");
4863 goto error;
4865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4867 CHECK_REG_STR(hkey, "sz", "string");
4868 CHECK_REG_MULTI(hkey, "multisz", "one\0two\0three\0");
4869 CHECK_REG_DWORD(hkey, "dword", 123);
4871 size = sizeof(buf);
4872 res = RegQueryValueExA(hkey, "expandsz", NULL, &type, (BYTE *)buf, &size);
4873 ok(!res, "got %ld\n", res);
4874 ok(type == REG_EXPAND_SZ, "got %ld\n", type);
4875 ok(!strcmp(buf, "string"), "got %s\n", buf);
4877 size = sizeof(buf);
4878 res = RegQueryValueExA(hkey, "binary", NULL, &type, (BYTE *)buf, &size);
4879 ok(!res, "got %ld\n", res);
4880 ok(type == REG_BINARY, "got %ld\n", type);
4881 ok(size == 4, "got size %lu\n", size);
4882 ok(!memcmp(buf, "\x01\x23\x45\x67", 4), "wrong data\n");
4884 CHECK_REG_STR(hkey, "", "default");
4886 res = RegOpenKeyA(hkey, "VisualStudio", &subkey);
4887 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4888 RegCloseKey(subkey);
4890 CHECK_REG_MULTI(hkey, "Value1", "one\0");
4891 CHECK_REG_MULTI(hkey, "Value2", "one\0two\0");
4892 CHECK_REG_MULTI(hkey, "Value3", "one\0two\0");
4893 CHECK_REG_MULTI(hkey, "Value4", "one\0two\0");
4894 CHECK_REG_MULTI(hkey, "Value5", "one\0two\0three\0");
4895 CHECK_REG_MULTI(hkey, "Value6", "");
4896 CHECK_REG_MULTI(hkey, "Value7", "two\0");
4898 CHECK_REG_DWORD(hkey, "format", 1);
4899 CHECK_REG_DWORD(hkey, "source", 1);
4901 res = RegOpenKeyA(hkey, "subkey", &subkey);
4902 ok(!res, "got %ld\n", res);
4903 res = RegQueryValueExA(subkey, "", NULL, NULL, NULL, NULL);
4904 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4905 RegCloseKey(subkey);
4907 res = RegOpenKeyA(hkey, "create", &subkey);
4908 ok(!res, "got %ld\n", res);
4909 RegCloseKey(subkey);
4911 res = RegOpenKeyA(hkey, "delete", &subkey);
4912 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4913 res = RegCreateKeyA(hkey, "delete", &subkey);
4914 ok(!res, "got %ld\n", res);
4915 RegCloseKey(subkey);
4917 res = RegQueryValueExA(hkey, "instremove", NULL, NULL, NULL, NULL);
4918 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4919 res = RegOpenKeyA(hkey, "instremove", &subkey);
4920 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4922 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4923 ok(!r, "got %u\n", r);
4925 res = RegQueryValueExA(hkey, "sz", NULL, NULL, NULL, NULL);
4926 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4927 res = RegQueryValueExA(hkey, "multisz", NULL, NULL, NULL, NULL);
4928 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4929 res = RegQueryValueExA(hkey, "dword", NULL, NULL, NULL, NULL);
4930 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4931 res = RegQueryValueExA(hkey, "expandsz", NULL, NULL, NULL, NULL);
4932 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4933 res = RegQueryValueExA(hkey, "binary", NULL, NULL, NULL, NULL);
4934 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4935 res = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL);
4936 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4938 res = RegOpenKeyA(hkey, "VisualStudio", &subkey);
4939 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4941 res = RegQueryValueExA(hkey, "Value1", NULL, NULL, NULL, NULL);
4942 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4943 res = RegQueryValueExA(hkey, "Value4", NULL, NULL, NULL, NULL);
4944 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4945 res = RegQueryValueExA(hkey, "Value5", NULL, NULL, NULL, NULL);
4946 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4947 res = RegQueryValueExA(hkey, "Value6", NULL, NULL, NULL, NULL);
4948 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4949 res = RegQueryValueExA(hkey, "Value7", NULL, NULL, NULL, NULL);
4950 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4952 todo_wine {
4953 CHECK_REG_MULTI(hkey, "Value2", "one\0");
4954 CHECK_REG_MULTI(hkey, "Value3", "two\0");
4957 res = RegQueryValueExA(hkey, "format", NULL, NULL, NULL, NULL);
4958 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4959 res = RegQueryValueExA(hkey, "source", NULL, NULL, NULL, NULL);
4960 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4962 res = RegOpenKeyA(hkey, "subkey", &subkey);
4963 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4965 res = RegOpenKeyA(hkey, "create", &subkey);
4966 ok(!res, "got %ld\n", res);
4967 RegCloseKey(subkey);
4968 res = RegDeleteKeyA(hkey, "create");
4969 ok(!res, "got %ld\n", res);
4971 res = RegOpenKeyA(hkey, "delete", &subkey);
4972 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
4974 RegCloseKey(hkey);
4975 res = RegDeleteKeyA(HKEY_CURRENT_USER, "msitest");
4976 ok(!res, "got %ld\n", res);
4978 error:
4979 DeleteFileA(msifile);
4980 RemoveDirectoryA("msitest");
4983 static void test_envvar(void)
4985 char buffer[16];
4986 UINT r, i;
4987 HKEY env, env2;
4988 LONG res;
4990 if (is_process_limited())
4992 skip("process is limited\n");
4993 return;
4996 create_database(msifile, env_tables, ARRAY_SIZE(env_tables));
4998 res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
4999 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5001 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Session Manager\\Environment",
5002 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env2, NULL);
5003 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5005 res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2);
5006 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5008 res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2);
5009 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5011 res = RegSetValueExA(env, "MSITESTVAR21", 0, REG_SZ, (const BYTE *)"1", 2);
5012 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5014 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5016 r = MsiInstallProductA(msifile, NULL);
5017 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5019 skip("Not enough rights to perform tests\n");
5020 goto error;
5022 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5024 CHECK_REG_STR(env, "MSITESTVAR1", "1");
5025 CHECK_REG_STR(env, "MSITESTVAR2", "1");
5026 CHECK_REG_STR(env, "MSITESTVAR3", "1");
5027 CHECK_REG_STR(env, "MSITESTVAR4", "1");
5029 res = RegDeleteValueA(env, "MSITESTVAR5");
5030 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5032 res = RegDeleteValueA(env, "MSITESTVAR6");
5033 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5035 res = RegDeleteValueA(env, "MSITESTVAR7");
5036 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5038 res = RegDeleteValueA(env, "MSITESTVAR8");
5039 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5041 res = RegDeleteValueA(env, "MSITESTVAR9");
5042 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5044 res = RegDeleteValueA(env, "MSITESTVAR10");
5045 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5047 CHECK_REG_STR(env, "MSITESTVAR11", "1;2");
5048 CHECK_REG_STR(env, "MSITESTVAR12", "1");
5049 CHECK_REG_STR(env, "MSITESTVAR13", "1;2");
5050 CHECK_REG_STR(env, "MSITESTVAR14", ";1;");
5051 CHECK_REG_STR(env, "MSITESTVAR15", ";;1;;");
5052 CHECK_REG_STR(env, "MSITESTVAR16", " 1 ");
5053 CHECK_REG_STR(env, "MSITESTVAR17", ";;2;;1");
5054 CHECK_REG_STR(env, "MSITESTVAR18", "1;;2;;");
5055 CHECK_REG_STR(env, "MSITESTVAR19", "1");
5056 CHECK_REG_STR(env, "MSITESTVAR20", "1");
5057 CHECK_REG_STR(env, "MSITESTVAR21", "1");
5058 CHECK_REG_STR(env, "MSITESTVAR24", "TestService");
5059 CHECK_REG_STR(env2, "MSITESTVAR100", "1");
5061 res = RegSetValueExA(env, "MSITESTVAR22", 0, REG_SZ, (const BYTE *)"1", 2);
5062 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5064 res = RegSetValueExA(env, "MSITESTVAR23", 0, REG_SZ, (const BYTE *)"1", 2);
5065 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5067 res = RegDeleteValueA(env, "MSITESTVAR25");
5068 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5070 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5071 ok(!r, "got %u\n", r);
5073 CHECK_DEL_REG_STR(env, "MSITESTVAR13", "1;2");
5074 CHECK_DEL_REG_STR(env, "MSITESTVAR14", ";1;");
5075 CHECK_DEL_REG_STR(env, "MSITESTVAR15", ";;1;;");
5076 CHECK_DEL_REG_STR(env, "MSITESTVAR16", " 1 ");
5077 CHECK_DEL_REG_STR_TODO(env, "MSITESTVAR17", "1");
5078 CHECK_DEL_REG_STR_TODO(env, "MSITESTVAR18", "1");
5079 CHECK_DEL_REG_STR(env, "MSITESTVAR23", "1");
5081 for (i = 1; i <= 23; i++)
5083 sprintf(buffer, "MSITESTVAR%i", i);
5084 res = RegDeleteValueA(env, buffer);
5085 ok(res == ERROR_FILE_NOT_FOUND, "[%d] got %ld\n", i, res);
5088 res = RegDeleteValueA(env2, "MSITESTVAR100");
5089 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5091 error:
5092 RegDeleteValueA(env, "MSITESTVAR1");
5093 RegDeleteValueA(env, "MSITESTVAR2");
5094 RegDeleteValueA(env, "MSITESTVAR21");
5095 RegCloseKey(env);
5096 RegCloseKey(env2);
5098 DeleteFileA(msifile);
5101 static void test_create_remove_folder(void)
5103 UINT r;
5105 if (is_process_limited())
5107 skip("process is limited\n");
5108 return;
5111 CreateDirectoryA("msitest", NULL);
5112 CreateDirectoryA("msitest\\first", NULL);
5113 CreateDirectoryA("msitest\\second", NULL);
5114 create_file("msitest\\first\\one.txt", 1000);
5115 create_file("msitest\\second\\two.txt", 1000);
5116 create_database(msifile, cf_tables, ARRAY_SIZE(cf_tables));
5118 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5120 r = MsiInstallProductA(msifile, NULL);
5121 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5123 skip("Not enough rights to perform tests\n");
5124 goto error;
5126 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5128 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5129 ok(pf_exists("msitest\\first"), "directory not created\n");
5130 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5131 ok(pf_exists("msitest\\second"), "directory not created\n");
5132 ok(pf_exists("msitest\\third"), "directory not created\n");
5133 ok(pf_exists("msitest"), "directory not created\n");
5135 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5136 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5138 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5139 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5140 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5141 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5142 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5143 todo_wine ok(!pf_exists("msitest"), "directory not removed\n");
5145 error:
5146 DeleteFileA("msitest\\first\\one.txt");
5147 DeleteFileA("msitest\\second\\two.txt");
5148 RemoveDirectoryA("msitest\\first");
5149 RemoveDirectoryA("msitest\\second");
5150 RemoveDirectoryA("msitest");
5151 DeleteFileA(msifile);
5154 static void test_start_stop_services(void)
5156 UINT r;
5157 SC_HANDLE scm, service;
5158 BOOL ret;
5159 DWORD error = ERROR_SUCCESS;
5161 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5162 if (!scm && GetLastError() == ERROR_ACCESS_DENIED)
5164 skip("Not enough rights to perform tests\n");
5165 return;
5167 ok(scm != NULL, "Failed to open the SC Manager\n");
5168 if (!scm) return;
5170 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
5171 if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST)
5173 win_skip("The 'Spooler' service does not exist\n");
5174 CloseServiceHandle(scm);
5175 return;
5177 ok(service != NULL, "Failed to open Spooler, error %lu\n", GetLastError());
5178 if (!service) {
5179 CloseServiceHandle(scm);
5180 return;
5183 ret = StartServiceA(service, 0, NULL);
5184 if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING)
5186 skip("Spooler service not available, skipping test\n");
5187 CloseServiceHandle(service);
5188 CloseServiceHandle(scm);
5189 return;
5192 CloseServiceHandle(service);
5193 CloseServiceHandle(scm);
5195 create_test_files();
5196 create_database(msifile, sss_tables, ARRAY_SIZE(sss_tables));
5198 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5200 r = MsiInstallProductA(msifile, NULL);
5201 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5203 if (error == ERROR_SUCCESS)
5205 SERVICE_STATUS status;
5207 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5208 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
5210 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
5211 ok(ret, "ControlService failed %lu\n", GetLastError());
5213 CloseServiceHandle(service);
5214 CloseServiceHandle(scm);
5217 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5218 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5220 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5221 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5222 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5223 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5224 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5225 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5226 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5227 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5228 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5229 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5230 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5231 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5232 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5234 if (error == ERROR_SUCCESS)
5236 SERVICE_STATUS status;
5238 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5239 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
5241 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
5242 ok(ret, "ControlService failed %lu\n", GetLastError());
5244 CloseServiceHandle(service);
5245 CloseServiceHandle(scm);
5248 delete_test_files();
5249 DeleteFileA(msifile);
5252 static void delete_test_service(const char *name)
5254 BOOL ret;
5255 SC_HANDLE manager, service;
5257 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5258 ok(manager != NULL, "can't open service manager\n");
5259 if (!manager) return;
5261 service = OpenServiceA(manager, name, GENERIC_ALL);
5262 if (service)
5264 ret = DeleteService( service );
5265 ok( ret, "failed to delete service %lu\n", GetLastError() );
5266 CloseServiceHandle(service);
5268 CloseServiceHandle(manager);
5271 static void test_delete_services(void)
5273 UINT r;
5274 SC_HANDLE manager, service;
5275 DWORD error;
5277 if (is_process_limited())
5279 skip("process is limited\n");
5280 return;
5283 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5284 ok(manager != NULL, "can't open service manager %lu\n", GetLastError());
5285 if (!manager) return;
5287 service = CreateServiceA(manager, "TestService3", "TestService3",
5288 SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START,
5289 SERVICE_ERROR_NORMAL, "C:\\doesnt_exist.exe", NULL, NULL, NULL, NULL, NULL);
5290 ok(service != NULL, "can't create service %lu\n", GetLastError());
5291 CloseServiceHandle(service);
5292 CloseServiceHandle(manager);
5293 if (!service) return;
5295 create_test_files();
5296 create_database(msifile, sds_tables, ARRAY_SIZE(sds_tables));
5298 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5300 r = MsiInstallProductA(msifile, NULL);
5301 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5303 skip("Not enough rights to perform tests\n");
5304 goto error;
5306 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5308 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5309 ok(manager != NULL, "can't open service manager\n");
5310 if (!manager) goto error;
5312 service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
5313 error = GetLastError();
5314 ok(service == NULL, "TestService3 not deleted\n");
5315 ok(error == ERROR_SERVICE_DOES_NOT_EXIST, "wrong error %lu\n", error);
5316 CloseServiceHandle(manager);
5318 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5319 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5321 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5322 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5323 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5324 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5325 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5326 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5327 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5328 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5329 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5330 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5331 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5332 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5333 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5335 error:
5336 delete_test_service("TestService");
5337 delete_test_service("TestService2");
5338 delete_test_service("TestService3");
5339 delete_test_files();
5340 DeleteFileA(msifile);
5343 static void test_install_services(void)
5345 UINT r;
5346 SC_HANDLE manager, service;
5347 LONG res;
5348 HKEY hKey;
5349 DWORD err_control, err_controlsize, err_controltype;
5351 if (is_process_limited())
5353 skip("process is limited\n");
5354 return;
5357 create_test_files();
5358 create_database(msifile, sis_tables, ARRAY_SIZE(sis_tables));
5360 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5362 r = MsiInstallProductA(msifile, NULL);
5363 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5365 skip("Not enough rights to perform tests\n");
5366 goto error;
5368 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5370 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5371 ok(manager != NULL, "can't open service manager\n");
5372 if (!manager) goto error;
5374 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5375 ok(service != NULL, "TestService not installed\n");
5376 CloseServiceHandle(service);
5378 service = OpenServiceA(manager, "TestService4", GENERIC_ALL);
5379 ok(service == NULL, "TestService4 installed\n");
5381 res = RegOpenKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey);
5382 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5384 if (res == ERROR_SUCCESS)
5386 err_control = 0xBEEF;
5387 err_controltype = REG_DWORD;
5388 err_controlsize = sizeof(err_control);
5389 res = RegQueryValueExA(hKey, "ErrorControl", NULL, &err_controltype, (LPBYTE)&err_control, &err_controlsize);
5390 ok(err_control == 0, "TestService.ErrorControl wrong, expected 0, got %lu\n", err_control);
5391 RegCloseKey(hKey);
5394 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5395 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5397 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5398 ok(service != NULL, "TestService deleted\n");
5399 CloseServiceHandle(service);
5400 CloseServiceHandle(manager);
5402 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5403 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5404 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5405 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5406 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5407 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5408 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5409 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5410 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5411 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5412 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5413 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5414 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5416 error:
5417 delete_test_service("TestService");
5418 delete_test_files();
5419 DeleteFileA(msifile);
5422 static void test_self_registration(void)
5424 HKEY key;
5425 UINT r;
5427 if (is_process_limited())
5429 skip("process is limited\n");
5430 return;
5433 create_test_files();
5434 extract_resource("selfreg.dll", "TESTDLL", "msitest\\selfreg.dll");
5435 create_database(msifile, sr_tables, ARRAY_SIZE(sr_tables));
5437 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5439 r = MsiInstallProductA(msifile, NULL);
5440 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5442 skip("Not enough rights to perform tests\n");
5443 goto error;
5445 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5447 r = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
5448 ok(!r, "got %u\n", r);
5449 RegCloseKey(key);
5451 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5452 ok(!r, "got %u\n", r);
5454 r = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
5455 ok(r == ERROR_FILE_NOT_FOUND, "got %u\n", r);
5457 ok(!delete_pf("msitest\\selfreg.dll", TRUE), "file not removed\n");
5458 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5460 error:
5461 DeleteFileA("msitest\\selfreg.dll");
5462 delete_test_files();
5463 DeleteFileA(msifile);
5466 static void test_register_font(void)
5468 static const char regfont1[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5469 static const char regfont2[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5470 LONG ret;
5471 HKEY key;
5472 UINT r;
5473 REGSAM access = KEY_ALL_ACCESS;
5475 if (is_process_limited())
5477 skip("process is limited\n");
5478 return;
5481 create_test_files();
5482 create_file("msitest\\font.ttf", 1000);
5483 create_database(msifile, font_tables, ARRAY_SIZE(font_tables));
5485 if (is_wow64)
5486 access |= KEY_WOW64_64KEY;
5488 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5490 r = MsiInstallProductA(msifile, NULL);
5491 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5493 skip("Not enough rights to perform tests\n");
5494 goto error;
5496 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5498 ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont1, 0, access, &key);
5499 if (ret)
5500 RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont2, 0, access, &key);
5502 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5503 ok(ret != ERROR_FILE_NOT_FOUND, "unexpected result %ld\n", ret);
5505 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5508 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5510 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5511 ok(ret == ERROR_FILE_NOT_FOUND, "unexpected result %ld\n", ret);
5513 RegDeleteValueA(key, "msi test font");
5514 RegCloseKey(key);
5516 error:
5517 DeleteFileA("msitest\\font.ttf");
5518 delete_test_files();
5519 DeleteFileA(msifile);
5522 static void test_validate_product_id(void)
5524 UINT r;
5526 if (is_process_limited())
5528 skip("process is limited\n");
5529 return;
5532 create_test_files();
5533 create_database(msifile, vp_tables, ARRAY_SIZE(vp_tables));
5535 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5537 r = MsiInstallProductA(msifile, NULL);
5538 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5540 skip("Not enough rights to perform tests\n");
5541 goto error;
5543 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5545 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=1");
5546 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5548 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=2");
5549 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5551 r = MsiInstallProductA(msifile, "PIDKEY=123-1234567");
5552 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5554 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5555 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5556 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5557 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5558 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5559 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5560 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5561 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5562 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5563 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5564 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5565 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5566 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5568 error:
5569 delete_test_files();
5570 DeleteFileA(msifile);
5573 static void test_install_remove_odbc(void)
5575 int gotdriver = 0, gotdriver2 = 0;
5576 char buffer[1000], *p;
5577 WORD len;
5578 UINT r;
5580 if (is_process_limited())
5582 skip("process is limited\n");
5583 return;
5586 create_test_files();
5587 create_file("msitest\\ODBCdriver.dll", 1000);
5588 create_file("msitest\\ODBCdriver2.dll", 1000);
5589 create_file("msitest\\ODBCtranslator.dll", 1000);
5590 create_file("msitest\\ODBCtranslator2.dll", 1000);
5591 create_file("msitest\\ODBCsetup.dll", 1000);
5592 create_database(msifile, odbc_tables, ARRAY_SIZE(odbc_tables));
5594 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5596 r = MsiInstallProductA(msifile, NULL);
5597 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5599 skip("Not enough rights to perform tests\n");
5600 goto error;
5602 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5604 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5605 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5606 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5607 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5608 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5610 r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
5611 ok(len < sizeof(buffer), "buffer too small\n");
5612 ok(r, "SQLGetInstalledDrivers failed\n");
5613 for (p = buffer; *p; p += strlen(p) + 1)
5615 if (!strcmp(p, "ODBC test driver"))
5616 gotdriver = 1;
5617 if (!strcmp(p, "ODBC test driver2"))
5618 gotdriver2 = 1;
5620 ok(gotdriver, "driver not installed\n");
5621 ok(gotdriver2, "driver 2 not installed\n");
5623 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5624 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5626 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not removed\n");
5627 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not removed\n");
5628 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not removed\n");
5629 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not removed\n");
5630 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
5631 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5633 gotdriver = gotdriver2 = 0;
5634 r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
5635 ok(len < sizeof(buffer), "buffer too small\n");
5636 ok(r, "SQLGetInstalledDrivers failed\n");
5637 for (p = buffer; *p; p += strlen(p) + 1)
5639 if (!strcmp(p, "ODBC test driver"))
5640 gotdriver = 1;
5641 if (!strcmp(p, "ODBC test driver2"))
5642 gotdriver2 = 1;
5644 ok(!gotdriver, "driver not installed\n");
5645 ok(!gotdriver2, "driver 2 not installed\n");
5647 error:
5648 DeleteFileA("msitest\\ODBCdriver.dll");
5649 DeleteFileA("msitest\\ODBCdriver2.dll");
5650 DeleteFileA("msitest\\ODBCtranslator.dll");
5651 DeleteFileA("msitest\\ODBCtranslator2.dll");
5652 DeleteFileA("msitest\\ODBCsetup.dll");
5653 delete_test_files();
5654 DeleteFileA(msifile);
5657 static void test_register_typelib(void)
5659 ITypeLib *tlb;
5660 HRESULT hr;
5661 UINT r;
5663 if (is_process_limited())
5665 skip("process is limited\n");
5666 return;
5669 /* UnregisterTypeLibraries action fails in 64-bit Windows <= 7 */
5670 if (sizeof(void *) == 8 && strcmp( winetest_platform, "wine" ))
5672 win_skip("broken on 64-bit Windows\n");
5673 return;
5676 create_test_files();
5677 extract_resource(MAKEINTRESOURCEA(1), "TYPELIB", "msitest\\typelib.dll");
5678 create_database(msifile, tl_tables, ARRAY_SIZE(tl_tables));
5680 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5682 r = MsiInstallProductA(msifile, NULL);
5683 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5685 skip("Not enough rights to perform tests\n");
5686 goto error;
5688 ok(r == ERROR_SUCCESS, "got %u\n", r);
5690 hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
5691 ok(hr == S_OK, "got %#lx\n", hr);
5692 ITypeLib_Release(tlb);
5694 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5695 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5697 hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
5698 ok(hr == TYPE_E_LIBNOTREGISTERED, "got %#lx\n", hr);
5700 ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n");
5701 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5703 error:
5704 DeleteFileA("msitest\\typelib.dll");
5705 delete_test_files();
5706 DeleteFileA(msifile);
5709 static void test_create_remove_shortcut(void)
5711 UINT r;
5713 if (is_process_limited())
5715 skip("process is limited\n");
5716 return;
5719 create_test_files();
5720 create_file("msitest\\target.txt", 1000);
5721 create_database(msifile, crs_tables, ARRAY_SIZE(crs_tables));
5723 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5725 r = MsiInstallProductA(msifile, NULL);
5726 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5728 skip("Not enough rights to perform tests\n");
5729 goto error;
5731 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5733 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5734 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5736 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5737 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5739 ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n");
5740 ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n");
5741 todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5743 error:
5744 DeleteFileA("msitest\\target.txt");
5745 delete_test_files();
5746 DeleteFileA(msifile);
5749 static void test_publish_components(void)
5751 static const char keypath[] =
5752 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5753 static const char keypath2[] =
5754 "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5756 UINT r;
5757 LONG res;
5758 HKEY key;
5759 BYTE *data;
5760 DWORD size;
5762 if (is_process_limited())
5764 skip("process is limited\n");
5765 return;
5768 create_test_files();
5769 create_file("msitest\\english.txt", 1000);
5770 create_database(msifile, pub_tables, ARRAY_SIZE(pub_tables));
5772 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5774 r = MsiInstallProductA(msifile, NULL);
5775 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5777 skip("Not enough rights to perform tests\n");
5778 goto error;
5780 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5782 size = 0;
5783 r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5784 "english.txt", INSTALLMODE_DEFAULT, NULL, &size);
5785 ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
5787 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5788 ok(res == ERROR_SUCCESS, "components key not created %ld\n", res);
5790 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, &size);
5791 ok(res == ERROR_SUCCESS, "value not found %ld\n", res);
5793 data = malloc(size);
5794 res = RegQueryValueExA(key, "english.txt", NULL, NULL, data, &size);
5795 ok(res == ERROR_SUCCESS, "value not found %ld\n", res);
5796 RegCloseKey(key);
5798 res = RegDeleteKeyA(HKEY_CURRENT_USER, keypath);
5799 ok(res == ERROR_SUCCESS, "RegDeleteKey failed %ld\n", res);
5801 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath2, 0, NULL, REG_OPTION_NON_VOLATILE,
5802 MAXIMUM_ALLOWED | KEY_WOW64_64KEY, NULL, &key, NULL );
5803 ok(res == ERROR_SUCCESS, "RegCreateKeyEx failed %ld\n", res);
5804 res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size);
5805 ok(res == ERROR_SUCCESS, "RegSetValueEx failed %ld\n", res);
5806 RegCloseKey(key);
5808 size = 0;
5809 r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5810 "english.txt", INSTALLMODE_DEFAULT, NULL, &size);
5811 ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
5813 if (pRegDeleteKeyExA)
5814 res = pRegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0);
5815 else
5816 res = RegDeleteKeyA(HKEY_LOCAL_MACHINE, keypath2);
5817 ok(res == ERROR_SUCCESS, "RegDeleteKey failed %ld\n", res);
5819 res = RegCreateKeyA(HKEY_CURRENT_USER, keypath, &key);
5820 ok(res == ERROR_SUCCESS, "RegCreateKey failed %ld\n", res);
5822 res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size);
5823 ok(res == ERROR_SUCCESS, "RegSetValueEx failed %ld\n", res);
5824 free(data);
5825 RegCloseKey(key);
5827 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5828 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5830 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5831 ok(res == ERROR_FILE_NOT_FOUND, "unexpected result %ld\n", res);
5833 ok(!delete_pf("msitest\\english.txt", TRUE), "file not removed\n");
5834 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5836 error:
5837 DeleteFileA("msitest\\english.txt");
5838 delete_test_files();
5839 DeleteFileA(msifile);
5842 static void test_remove_duplicate_files(void)
5844 UINT r;
5846 if (is_process_limited())
5848 skip("process is limited\n");
5849 return;
5852 create_test_files();
5853 create_file("msitest\\original.txt", 1000);
5854 create_file("msitest\\original2.txt", 1000);
5855 create_file("msitest\\original3.txt", 1000);
5856 create_database(msifile, rd_tables, ARRAY_SIZE(rd_tables));
5858 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5860 r = MsiInstallProductA(msifile, NULL);
5861 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5863 skip("Not enough rights to perform tests\n");
5864 goto error;
5866 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5868 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5869 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5870 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5871 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5872 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5874 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5875 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5877 ok(delete_pf("msitest\\original.txt", TRUE), "file removed\n");
5878 ok(!delete_pf("msitest\\original2.txt", TRUE), "file not removed\n");
5879 ok(!delete_pf("msitest\\original3.txt", TRUE), "file not removed\n");
5880 ok(!delete_pf("msitest\\duplicate.txt", TRUE), "file not removed\n");
5881 ok(!delete_pf("msitest\\duplicate2.txt", TRUE), "file not removed\n");
5882 ok(delete_pf("msitest", FALSE), "directory removed\n");
5884 error:
5885 DeleteFileA("msitest\\original.txt");
5886 DeleteFileA("msitest\\original2.txt");
5887 DeleteFileA("msitest\\original3.txt");
5888 delete_test_files();
5889 DeleteFileA(msifile);
5892 static void test_find_related_products(void)
5894 UINT r;
5896 if (is_process_limited())
5898 skip("process is limited\n");
5899 return;
5902 create_test_files();
5903 create_file("msitest\\product.txt", 1000);
5904 create_database(msifile, frp_tables, ARRAY_SIZE(frp_tables));
5906 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5908 r = MsiInstallProductA(msifile, NULL);
5909 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5911 skip("Not enough rights to perform tests\n");
5912 goto error;
5914 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5916 /* install again, so it finds the upgrade code */
5917 r = MsiInstallProductA(msifile, NULL);
5918 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5920 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5921 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5923 ok(!delete_pf("msitest\\product.txt", TRUE), "file not removed\n");
5924 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5926 error:
5927 DeleteFileA("msitest\\product.txt");
5928 delete_test_files();
5929 DeleteFileA(msifile);
5932 static void test_ini_values(void)
5934 UINT r;
5935 DWORD len;
5936 char inifile[MAX_PATH], buf[0x10];
5937 HANDLE file;
5938 BOOL ret;
5940 if (is_process_limited())
5942 skip("process is limited\n");
5943 return;
5946 create_test_files();
5947 create_file("msitest\\inifile.txt", 1000);
5948 create_database(msifile, ini_tables, ARRAY_SIZE(ini_tables));
5950 lstrcpyA(inifile, PROG_FILES_DIR);
5951 lstrcatA(inifile, "\\msitest");
5952 ret = CreateDirectoryA(inifile, NULL);
5953 if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
5955 skip("Not enough rights to perform tests\n");
5956 goto error;
5958 lstrcatA(inifile, "\\test.ini");
5959 file = CreateFileA(inifile, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0, NULL);
5960 CloseHandle(file);
5962 ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile);
5963 ok(ret, "failed to write profile string %lu\n", GetLastError());
5965 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5967 r = MsiInstallProductA(msifile, NULL);
5968 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5970 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5971 ok(len == 6, "got %lu expected 6\n", len);
5973 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5974 ok(!len, "got %lu expected 0\n", len);
5976 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5977 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5979 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5980 ok(!len, "got %lu expected 0\n", len);
5982 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5983 ok(!len, "got %lu expected 0\n", len);
5985 todo_wine ok(!delete_pf("msitest\\test.ini", TRUE), "file removed\n");
5986 ok(!delete_pf("msitest\\inifile.txt", TRUE), "file not removed\n");
5987 ok(delete_pf("msitest", FALSE), "directory removed\n");
5989 error:
5990 DeleteFileA("msitest\\inifile.txt");
5991 delete_test_files();
5992 DeleteFileA(msifile);
5995 static void test_register_class_info(void)
5997 UINT r;
5998 LONG res;
5999 HKEY hkey;
6001 if (is_process_limited())
6003 skip("process is limited\n");
6004 return;
6007 create_test_files();
6008 create_file("msitest\\class.txt", 1000);
6009 create_database(msifile, rci_tables, ARRAY_SIZE(rci_tables));
6011 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6013 r = MsiInstallProductA(msifile, NULL);
6014 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6016 skip("Not enough rights to perform tests\n");
6017 goto error;
6019 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6021 if (is_64bit)
6022 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6023 else
6024 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6025 ok(res == ERROR_SUCCESS, "key not created\n");
6026 RegCloseKey(hkey);
6028 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6029 ok(res == ERROR_SUCCESS, "key not created\n");
6030 RegCloseKey(hkey);
6032 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
6033 ok(res == ERROR_SUCCESS, "key not created\n");
6034 RegCloseKey(hkey);
6036 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6037 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6039 if (is_64bit)
6040 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6041 else
6042 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6043 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6045 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6046 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6048 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
6049 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6051 ok(!delete_pf("msitest\\class.txt", TRUE), "file not removed\n");
6052 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6054 error:
6055 DeleteFileA("msitest\\class.txt");
6056 delete_test_files();
6057 DeleteFileA(msifile);
6060 static void test_register_extension_info(void)
6062 UINT r;
6063 LONG res;
6064 HKEY hkey;
6066 if (is_process_limited())
6068 skip("process is limited\n");
6069 return;
6072 create_test_files();
6073 create_file("msitest\\extension.txt", 1000);
6074 create_database(msifile, rei_tables, ARRAY_SIZE(rei_tables));
6076 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6078 r = MsiInstallProductA(msifile, NULL);
6079 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6081 skip("Not enough rights to perform tests\n");
6082 goto error;
6084 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6086 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
6087 ok(res == ERROR_SUCCESS, "key not created\n");
6088 RegCloseKey(hkey);
6090 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &hkey);
6091 ok(res == ERROR_SUCCESS, "key not created\n");
6092 RegCloseKey(hkey);
6094 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6095 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6097 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
6098 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6100 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1", &hkey);
6101 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6103 ok(!delete_pf("msitest\\extension.txt", TRUE), "file not removed\n");
6104 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6106 error:
6107 DeleteFileA("msitest\\extension.txt");
6108 delete_test_files();
6109 DeleteFileA(msifile);
6112 static void test_register_progid_info(void)
6114 UINT r;
6115 LONG res;
6116 HKEY hkey;
6118 if (is_process_limited())
6120 skip("process is limited\n");
6121 return;
6124 create_test_files();
6125 create_file("msitest\\progid.txt", 1000);
6126 create_database(msifile, rpi_tables, ARRAY_SIZE(rpi_tables));
6128 res = RegCreateKeyExA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", 0, NULL, 0,
6129 KEY_ALL_ACCESS, NULL, &hkey, NULL);
6130 ok(res == ERROR_SUCCESS, "key not created\n");
6131 RegCloseKey(hkey);
6133 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6135 r = MsiInstallProductA(msifile, NULL);
6136 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6138 skip("Not enough rights to perform tests\n");
6139 goto error;
6141 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6143 if (is_64bit)
6144 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6145 else
6146 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6147 ok(res == ERROR_SUCCESS, "key not created\n");
6148 RegCloseKey(hkey);
6150 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &hkey);
6151 ok(res == ERROR_SUCCESS, "key not created\n");
6152 RegCloseKey(hkey);
6154 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &hkey);
6155 ok(res == ERROR_SUCCESS, "key not created\n");
6156 RegCloseKey(hkey);
6158 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &hkey);
6159 ok(res == ERROR_SUCCESS, "key not created\n");
6160 RegCloseKey(hkey);
6162 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass.1", &hkey);
6163 ok(res == ERROR_SUCCESS, "key not created\n");
6164 RegCloseKey(hkey);
6166 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass", &hkey);
6167 ok(res == ERROR_SUCCESS, "key not created\n");
6168 RegCloseKey(hkey);
6170 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass.1", &hkey);
6171 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6172 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6174 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass", &hkey);
6175 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6177 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", &hkey);
6178 ok(res == ERROR_SUCCESS, "key deleted\n");
6179 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6181 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned2", &hkey);
6182 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6184 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Extension", &hkey);
6185 ok(res == ERROR_SUCCESS, "key not created\n");
6186 RegCloseKey(hkey);
6188 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6189 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6191 if (is_64bit)
6192 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6193 else
6194 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6195 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6197 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &hkey);
6198 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6200 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &hkey);
6201 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6203 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &hkey);
6204 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6206 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass.1", &hkey);
6207 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6209 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass", &hkey);
6210 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6212 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass.1", &hkey);
6213 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6215 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass", &hkey);
6216 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6218 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", &hkey);
6219 ok(res == ERROR_SUCCESS, "key deleted\n");
6220 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6222 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned2", &hkey);
6223 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6225 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Extension", &hkey);
6226 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6228 ok(!delete_pf("msitest\\progid.txt", TRUE), "file not removed\n");
6229 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6231 error:
6232 DeleteFileA("msitest\\progid.txt");
6233 delete_test_files();
6234 DeleteFileA(msifile);
6235 RegDeleteKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned");
6238 static void test_register_mime_info(void)
6240 UINT r;
6241 LONG res;
6242 HKEY hkey;
6244 if (is_process_limited())
6246 skip("process is limited\n");
6247 return;
6250 create_test_files();
6251 create_file("msitest\\mime.txt", 1000);
6252 create_database(msifile, rmi_tables, ARRAY_SIZE(rmi_tables));
6254 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6256 r = MsiInstallProductA(msifile, NULL);
6257 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6259 skip("Not enough rights to perform tests\n");
6260 goto error;
6262 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6264 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
6265 ok(res == ERROR_SUCCESS, "key not created\n");
6266 RegCloseKey(hkey);
6268 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6269 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6271 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
6272 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6274 ok(!delete_pf("msitest\\mime.txt", TRUE), "file not removed\n");
6275 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6277 error:
6278 DeleteFileA("msitest\\mime.txt");
6279 delete_test_files();
6280 DeleteFileA(msifile);
6283 static void test_publish_assemblies(void)
6285 static const char manifest[] =
6286 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6287 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6288 "processorArchitecture=\"x86\"/>";
6289 static const char manifest_local[] =
6290 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6291 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6292 "processorArchitecture=\"x86\"/>";
6293 static const char classes_path_dotnet[] =
6294 "Installer\\Assemblies\\Global";
6295 static const char classes_path_dotnet_local[] =
6296 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6297 static const char classes_path_dotnet_local_wow64[] =
6298 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6299 static const char classes_path_fake_local[] =
6300 "Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt";
6301 static const char classes_path_fake_local_wow64[] =
6302 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt";
6303 static const char classes_path_win32[] =
6304 "Installer\\Win32Assemblies\\Global";
6305 static const char classes_path_win32_local[] =
6306 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6307 static const char classes_path_win32_local_wow64[] =
6308 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6309 static const char path_dotnet[] =
6310 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6311 static const char path_dotnet_local[] =
6312 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6313 static const char path_dotnet_local_wow64[] =
6314 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6315 static const char path_fake_local[] =
6316 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt";
6317 static const char path_fake_local_wow64[] =
6318 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt";
6319 static const char path_win32[] =
6320 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6321 static const char path_win32_local[] =
6322 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6323 static const char path_win32_local_wow64[] =
6324 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6325 static const char name_dotnet[] =
6326 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6327 "version=\"1.0.0.0\",culture=\"neutral\"";
6328 static const char name_dotnet_local[] =
6329 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6330 "version=\"1.0.0.0\",culture=\"neutral\"";
6331 static const char name_win32[] =
6332 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6333 "type=\"win32\",version=\"1.0.0.0\"";
6334 static const char name_win32_local[] =
6335 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6336 "type=\"win32\",version=\"1.0.0.0\"";
6337 UINT r;
6338 LONG res;
6339 HKEY hkey;
6340 const char *path;
6341 int access;
6343 if (is_process_limited())
6345 skip("process is limited\n");
6346 return;
6349 create_test_files();
6350 create_file("msitest\\win32.txt", 1000);
6351 create_file("msitest\\win32_local.txt", 1000);
6352 create_file("msitest\\dotnet.txt", 1000);
6353 create_file("msitest\\dotnet_local.txt", 1000);
6354 create_file_data("msitest\\manifest.txt", manifest, 0);
6355 create_file_data("msitest\\manifest_local.txt", manifest_local, 0);
6356 create_file("msitest\\application_win32.txt", 1000);
6357 create_file("msitest\\application_dotnet.txt", 1000);
6358 create_file("msitest\\fake_local.txt", 1000);
6359 create_database(msifile, pa_tables, ARRAY_SIZE(pa_tables));
6361 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6363 r = MsiInstallProductA(msifile, NULL);
6364 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6366 skip("Not enough rights to perform tests\n");
6367 goto done;
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, "Expected ERROR_SUCCESS, got %ld\n", res);
6373 CHECK_REG_MULTI(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]\0");
6374 RegCloseKey(hkey);
6376 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6377 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6378 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6379 CHECK_REG_MULTI(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox\0");
6380 RegCloseKey(hkey);
6382 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6383 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6384 CHECK_REG_MULTI(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%\0");
6385 RegCloseKey(hkey);
6387 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6388 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6389 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6390 CHECK_REG_MULTI(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!\0");
6391 RegCloseKey(hkey);
6393 /* No registration is done for a local assembly with no matching file */
6394 path = (is_wow64 || is_64bit) ? path_fake_local_wow64 : path_fake_local;
6395 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6396 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
6398 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6399 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6401 res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey);
6402 if (res == ERROR_SUCCESS)
6404 res = RegDeleteValueA(hkey, name_dotnet);
6405 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6406 RegCloseKey(hkey);
6409 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6410 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6411 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6413 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6414 if (res == ERROR_SUCCESS)
6416 res = RegDeleteValueA(hkey, name_win32);
6417 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6418 RegCloseKey(hkey);
6421 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6422 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6423 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6425 r = MsiInstallProductA(msifile, "ALLUSERS=1");
6426 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6428 access = KEY_QUERY_VALUE;
6429 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6430 if (res == ERROR_FILE_NOT_FOUND && is_wow64) /* Vista WOW64 */
6432 trace("Using 64-bit registry view for HKCR\\Installer\n");
6433 access = KEY_QUERY_VALUE | KEY_WOW64_64KEY;
6434 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6436 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6437 CHECK_REG_MULTI(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]\0");
6438 RegCloseKey(hkey);
6440 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6441 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6442 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6443 CHECK_REG_MULTI(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox\0");
6444 RegCloseKey(hkey);
6446 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_win32, 0, access, &hkey);
6447 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6448 CHECK_REG_MULTI(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%\0");
6449 RegCloseKey(hkey);
6451 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6452 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6453 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6454 CHECK_REG_MULTI(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!\0");
6455 RegCloseKey(hkey);
6457 /* No registration is done for a local assembly with no matching file */
6458 path = (is_wow64 || is_64bit) ? classes_path_fake_local_wow64 : classes_path_fake_local;
6459 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6460 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
6462 r = MsiInstallProductA(msifile, "REMOVE=ALL ALLUSERS=1");
6463 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6465 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_dotnet, &hkey);
6466 if (res == ERROR_SUCCESS)
6468 res = RegDeleteValueA(hkey, name_dotnet);
6469 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6470 RegCloseKey(hkey);
6473 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6474 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6475 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6477 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_win32, &hkey);
6478 if (res == ERROR_SUCCESS)
6480 res = RegDeleteValueA(hkey, name_win32);
6481 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6482 RegCloseKey(hkey);
6485 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6486 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6487 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6489 done:
6490 DeleteFileA("msitest\\win32.txt");
6491 DeleteFileA("msitest\\win32_local.txt");
6492 DeleteFileA("msitest\\dotnet.txt");
6493 DeleteFileA("msitest\\dotnet_local.txt");
6494 DeleteFileA("msitest\\manifest.txt");
6495 DeleteFileA("msitest\\manifest_local.txt");
6496 DeleteFileA("msitest\\application_win32.txt");
6497 DeleteFileA("msitest\\application_dotnet.txt");
6498 DeleteFileA("msitest\\fake_local.txt");
6499 delete_test_files();
6500 DeleteFileA(msifile);
6503 static void test_remove_existing_products(void)
6505 UINT r;
6507 if (is_process_limited())
6509 skip("process is limited\n");
6510 return;
6513 create_test_files();
6514 create_file("msitest\\rep.txt", 1000);
6515 create_database(msifile, rep_tables, ARRAY_SIZE(rep_tables));
6517 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6519 r = MsiInstallProductA(msifile, NULL);
6520 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6522 skip("Not enough rights to perform tests\n");
6523 goto error;
6525 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6527 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6528 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6530 ok(!delete_pf("msitest\\rep.txt", TRUE), "file not removed\n");
6531 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6533 error:
6534 DeleteFileA("msitest\\rep.txt");
6535 delete_test_files();
6536 DeleteFileA(msifile);
6539 START_TEST(action)
6541 DWORD len;
6542 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6543 STATEMGRSTATUS status;
6544 BOOL ret = FALSE;
6546 init_functionpointers();
6547 subtest("custom");
6549 if (pIsWow64Process)
6550 pIsWow64Process(GetCurrentProcess(), &is_wow64);
6552 GetCurrentDirectoryA(MAX_PATH, prev_path);
6553 GetTempPathA(MAX_PATH, temp_path);
6554 SetCurrentDirectoryA(temp_path);
6556 lstrcpyA(CURR_DIR, temp_path);
6557 len = lstrlenA(CURR_DIR);
6559 if(len && (CURR_DIR[len - 1] == '\\'))
6560 CURR_DIR[len - 1] = 0;
6562 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6563 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6565 /* Create a restore point ourselves so we circumvent the multitude of restore points
6566 * that would have been created by all the installation and removal tests.
6568 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6569 * creation of restore points.
6571 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
6573 memset(&status, 0, sizeof(status));
6574 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
6577 /* Create only one log file and don't append. We have to pass something
6578 * for the log mode for this to work. The logfile needs to have an absolute
6579 * path otherwise we still end up with some extra logfiles as some tests
6580 * change the current directory.
6582 lstrcpyA(log_file, temp_path);
6583 lstrcatA(log_file, "\\msitest.log");
6584 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
6586 test_register_product();
6587 test_publish_product();
6588 test_publish_features();
6589 test_register_user();
6590 test_process_components();
6591 test_publish();
6592 test_publish_sourcelist();
6593 test_remove_files();
6594 test_move_files();
6595 test_duplicate_files();
6596 test_write_registry_values();
6597 test_envvar();
6598 test_create_remove_folder();
6599 test_start_stop_services();
6600 test_delete_services();
6601 test_install_services();
6602 test_self_registration();
6603 test_register_font();
6604 test_validate_product_id();
6605 test_install_remove_odbc();
6606 test_register_typelib();
6607 test_create_remove_shortcut();
6608 test_publish_components();
6609 test_remove_duplicate_files();
6610 test_find_related_products();
6611 test_ini_values();
6612 test_register_class_info();
6613 test_register_extension_info();
6614 test_register_progid_info();
6615 test_register_mime_info();
6616 test_publish_assemblies();
6617 test_remove_existing_products();
6619 DeleteFileA(log_file);
6621 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
6623 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
6624 if (ret)
6625 remove_restore_point(status.llSequenceNumber);
6628 SetCurrentDirectoryA(prev_path);