ReactOS  0.4.13-dev-73-gcfe54aa
action.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 James Hawkins
3  * Copyright 2010 Hans Leidekker for CodeWeavers
4  *
5  * Tests concentrating on standard actions
6  *
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.
11  *
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.
16  *
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
20  */
21 
22 #define _WIN32_MSI 300
23 #include <stdio.h>
24 #include <stdlib.h>
25 
26 #include <windows.h>
27 #include <msiquery.h>
28 #include <msidefs.h>
29 #include <msi.h>
30 #include <fci.h>
31 #include <srrestoreptapi.h>
32 #include <wtypes.h>
33 #include <shellapi.h>
34 #include <winsvc.h>
35 
36 #include "wine/test.h"
37 
38 static UINT (WINAPI *pMsiQueryComponentStateA)
40 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
42 static UINT (WINAPI *pMsiSourceListGetInfoA)
44 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
46 static UINT (WINAPI *pMsiQueryFeatureStateExA)
48 
49 static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL);
50 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
51 static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE);
52 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
53 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
54 
56 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
57 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
58 
59 static BOOL is_wow64;
60 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
61 
62 static const char *msifile = "msitest.msi";
68 
69 /* msi database data */
70 
71 static const char component_dat[] =
72  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
73  "s72\tS38\ts72\ti2\tS255\tS72\n"
74  "Component\tComponent\n"
75  "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
76  "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
77  "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
78  "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
79  "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
80  "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
81  "component\t\tMSITESTDIR\t0\t1\tfile\n"
82  "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
83  "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
84  "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
85 
86 static const char directory_dat[] =
87  "Directory\tDirectory_Parent\tDefaultDir\n"
88  "s72\tS72\tl255\n"
89  "Directory\tDirectory\n"
90  "CABOUTDIR\tMSITESTDIR\tcabout\n"
91  "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
92  "FIRSTDIR\tMSITESTDIR\tfirst\n"
93  "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
94  "NEWDIR\tCABOUTDIR\tnew\n"
95  "ProgramFilesFolder\tTARGETDIR\t.\n"
96  "TARGETDIR\t\tSourceDir";
97 
98 static const char feature_dat[] =
99  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
100  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
101  "Feature\tFeature\n"
102  "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
103  "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
104  "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
105  "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
106  "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
107  "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
108  "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
109 
110 static const char feature_comp_dat[] =
111  "Feature_\tComponent_\n"
112  "s38\ts72\n"
113  "FeatureComponents\tFeature_\tComponent_\n"
114  "Five\tFive\n"
115  "Four\tFour\n"
116  "One\tOne\n"
117  "Three\tThree\n"
118  "Two\tTwo\n"
119  "feature\tcomponent\n"
120  "service_feature\tservice_comp\n"
121  "service_feature\tservice_comp2\n"
122  "service_feature\tservice_comp3";
123 
124 static const char file_dat[] =
125  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
126  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
127  "File\tFile\n"
128  "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
129  "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
130  "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
131  "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
132  "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
133  "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
134  "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
135  "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
136 
137 static const char install_exec_seq_dat[] =
138  "Action\tCondition\tSequence\n"
139  "s72\tS255\tI2\n"
140  "InstallExecuteSequence\tAction\n"
141  "AllocateRegistrySpace\tNOT Installed\t1550\n"
142  "CostFinalize\t\t1000\n"
143  "CostInitialize\t\t800\n"
144  "FileCost\t\t900\n"
145  "ResolveSource\t\t950\n"
146  "MoveFiles\t\t1700\n"
147  "InstallFiles\t\t4000\n"
148  "DuplicateFiles\t\t4500\n"
149  "WriteEnvironmentStrings\t\t4550\n"
150  "CreateShortcuts\t\t4600\n"
151  "InstallServices\t\t5000\n"
152  "InstallFinalize\t\t6600\n"
153  "InstallInitialize\t\t1500\n"
154  "InstallValidate\t\t1400\n"
155  "LaunchConditions\t\t100\n"
156  "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
157 
158 static const char media_dat[] =
159  "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
160  "i2\ti4\tL64\tS255\tS32\tS72\n"
161  "Media\tDiskId\n"
162  "1\t3\t\t\tDISK1\t\n"
163  "2\t7\t\tmsitest.cab\tDISK2\t\n";
164 
165 static const char property_dat[] =
166  "Property\tValue\n"
167  "s72\tl0\n"
168  "Property\tProperty\n"
169  "DefaultUIFont\tDlgFont8\n"
170  "HASUIRUN\t0\n"
171  "INSTALLLEVEL\t3\n"
172  "InstallMode\tTypical\n"
173  "Manufacturer\tWine\n"
174  "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
175  "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
176  "ProductID\tnone\n"
177  "ProductLanguage\t1033\n"
178  "ProductName\tMSITEST\n"
179  "ProductVersion\t1.1.1\n"
180  "PROMPTROLLBACKCOST\tP\n"
181  "Setup\tSetup\n"
182  "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
183  "AdminProperties\tPOSTADMIN\n"
184  "ROOTDRIVE\tC:\\\n"
185  "SERVNAME\tTestService\n"
186  "SERVNAME2\tTestService2\n"
187  "SERVDISP\tTestServiceDisp\n"
188  "SERVDISP2\tTestServiceDisp2\n"
189  "MSIFASTINSTALL\t1\n"
190  "regdata15\t#x01\n";
191 
192 static const char environment_dat[] =
193  "Environment\tName\tValue\tComponent_\n"
194  "s72\tl255\tL255\ts72\n"
195  "Environment\tEnvironment\n"
196  "Var1\t=-MSITESTVAR1\t1\tOne\n"
197  "Var2\tMSITESTVAR2\t1\tOne\n"
198  "Var3\t=-MSITESTVAR3\t1\tOne\n"
199  "Var4\tMSITESTVAR4\t1\tOne\n"
200  "Var5\t-MSITESTVAR5\t\tOne\n"
201  "Var6\tMSITESTVAR6\t\tOne\n"
202  "Var7\t!-MSITESTVAR7\t\tOne\n"
203  "Var8\t!-*MSITESTVAR8\t\tOne\n"
204  "Var9\t=-MSITESTVAR9\t\tOne\n"
205  "Var10\t=MSITESTVAR10\t\tOne\n"
206  "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
207  "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
208  "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
209  "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
210  "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
211  "Var16\t=MSITESTVAR14\t;1;\tOne\n"
212  "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
213  "Var18\t=MSITESTVAR16\t 1 \tOne\n"
214  "Var19\t+-MSITESTVAR17\t1\tOne\n"
215  "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
216  "Var21\t+-MSITESTVAR18\t1\tOne\n"
217  "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
218  "Var23\t+-MSITESTVAR19\t1\tOne\n"
219  "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
220  "Var25\t+-MSITESTVAR20\t1\tOne\n"
221  "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"
222  "Var27\t+-MSITESTVAR21\t[~];1\tOne\n";
223 
224 static const char service_install_dat[] =
225  "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
226  "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
227  "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
228  "ServiceInstall\tServiceInstall\n"
229  "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
230  "TestService2\t[SERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription\n";
231 
232 static const char service_install2_dat[] =
233  "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
234  "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
235  "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
236  "ServiceInstall\tServiceInstall\n"
237  "TestService\tTestService\tTestService\t2\t3\t32768\t\t\tTestService\t\t\tservice_comp\t\n"
238  "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
239 
240 static const char service_control_dat[] =
241  "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
242  "s72\tl255\ti2\tL255\tI2\ts72\n"
243  "ServiceControl\tServiceControl\n"
244  "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
245  "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
246 
247 static const char sss_service_control_dat[] =
248  "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
249  "s72\tl255\ti2\tL255\tI2\ts72\n"
250  "ServiceControl\tServiceControl\n"
251  "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
252  "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
253  "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
254  "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
255 
256 static const char sss_install_exec_seq_dat[] =
257  "Action\tCondition\tSequence\n"
258  "s72\tS255\tI2\n"
259  "InstallExecuteSequence\tAction\n"
260  "LaunchConditions\t\t100\n"
261  "CostInitialize\t\t800\n"
262  "FileCost\t\t900\n"
263  "ResolveSource\t\t950\n"
264  "CostFinalize\t\t1000\n"
265  "InstallValidate\t\t1400\n"
266  "InstallInitialize\t\t1500\n"
267  "StopServices\t\t4000\n"
268  "DeleteServices\t\t5000\n"
269  "MoveFiles\t\t5100\n"
270  "InstallFiles\t\t5200\n"
271  "DuplicateFiles\t\t5300\n"
272  "StartServices\t\t5400\n"
273  "RegisterProduct\t\t5500\n"
274  "PublishFeatures\t\t5600\n"
275  "PublishProduct\t\t5700\n"
276  "InstallFinalize\t\t6000\n";
277 
278 static const char sds_install_exec_seq_dat[] =
279  "Action\tCondition\tSequence\n"
280  "s72\tS255\tI2\n"
281  "InstallExecuteSequence\tAction\n"
282  "LaunchConditions\t\t100\n"
283  "CostInitialize\t\t800\n"
284  "FileCost\t\t900\n"
285  "ResolveSource\t\t950\n"
286  "CostFinalize\t\t1000\n"
287  "InstallValidate\t\t1400\n"
288  "InstallInitialize\t\t1500\n"
289  "StopServices\t\t5000\n"
290  "DeleteServices\t\t5050\n"
291  "MoveFiles\t\t5100\n"
292  "InstallFiles\t\t5200\n"
293  "DuplicateFiles\t\t5300\n"
294  "InstallServices\t\t5400\n"
295  "StartServices\t\t5450\n"
296  "RegisterProduct\t\t5500\n"
297  "PublishFeatures\t\t5600\n"
298  "PublishProduct\t\t5700\n"
299  "InstallFinalize\t\t6000\n";
300 
301 static const char rof_component_dat[] =
302  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
303  "s72\tS38\ts72\ti2\tS255\tS72\n"
304  "Component\tComponent\n"
305  "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
306 
307 static const char rof_feature_dat[] =
308  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
309  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
310  "Feature\tFeature\n"
311  "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
312  "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
313 
314 static const char rof_feature_comp_dat[] =
315  "Feature_\tComponent_\n"
316  "s38\ts72\n"
317  "FeatureComponents\tFeature_\tComponent_\n"
318  "feature\tmaximus\n"
319  "montecristo\tmaximus";
320 
321 static const char rof_file_dat[] =
322  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
323  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
324  "File\tFile\n"
325  "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
326 
327 static const char rof_media_dat[] =
328  "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
329  "i2\ti4\tL64\tS255\tS32\tS72\n"
330  "Media\tDiskId\n"
331  "1\t1\t\t\tDISK1\t\n";
332 
333 static const char ci2_feature_comp_dat[] =
334  "Feature_\tComponent_\n"
335  "s38\ts72\n"
336  "FeatureComponents\tFeature_\tComponent_\n"
337  "feature\taugustus";
338 
339 static const char ci2_file_dat[] =
340  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
341  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
342  "File\tFile\n"
343  "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
344 
345 static const char pp_install_exec_seq_dat[] =
346  "Action\tCondition\tSequence\n"
347  "s72\tS255\tI2\n"
348  "InstallExecuteSequence\tAction\n"
349  "ValidateProductID\t\t700\n"
350  "CostInitialize\t\t800\n"
351  "FileCost\t\t900\n"
352  "CostFinalize\t\t1000\n"
353  "InstallValidate\t\t1400\n"
354  "InstallInitialize\t\t1500\n"
355  "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
356  "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
357  "RemoveFiles\t\t3500\n"
358  "InstallFiles\t\t4000\n"
359  "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
360  "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
361  "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
362  "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
363  "InstallFinalize\t\t6600";
364 
365 static const char pp_component_dat[] =
366  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
367  "s72\tS38\ts72\ti2\tS255\tS72\n"
368  "Component\tComponent\n"
369  "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
370 
371 static const char ppc_component_dat[] =
372  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
373  "s72\tS38\ts72\ti2\tS255\tS72\n"
374  "Component\tComponent\n"
375  "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
376  "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
377 
378 static const char ppc_file_dat[] =
379  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
380  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
381  "File\tFile\n"
382  "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
383  "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
384 
385 static const char ppc_media_dat[] =
386  "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
387  "i2\ti4\tL64\tS255\tS32\tS72\n"
388  "Media\tDiskId\n"
389  "1\t2\t\t\tDISK1\t\n";
390 
391 static const char ppc_feature_comp_dat[] =
392  "Feature_\tComponent_\n"
393  "s38\ts72\n"
394  "FeatureComponents\tFeature_\tComponent_\n"
395  "feature\tmaximus\n"
396  "feature\taugustus\n"
397  "montecristo\tmaximus";
398 
399 static const char cwd_component_dat[] =
400  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
401  "s72\tS38\ts72\ti2\tS255\tS72\n"
402  "Component\tComponent\n"
403  "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
404 
405 static const char rem_component_dat[] =
406  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
407  "s72\tS38\ts72\ti2\tS255\tS72\n"
408  "Component\tComponent\n"
409  "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
410  "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
411  "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
412 
413 static const char rem_feature_comp_dat[] =
414  "Feature_\tComponent_\n"
415  "s38\ts72\n"
416  "FeatureComponents\tFeature_\tComponent_\n"
417  "feature\thydrogen\n"
418  "feature\thelium\n"
419  "feature\tlithium";
420 
421 static const char rem_file_dat[] =
422  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
423  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
424  "File\tFile\n"
425  "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
426  "helium\thelium\thelium\t0\t\t\t8192\t1\n"
427  "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
428 
429 static const char rem_install_exec_seq_dat[] =
430  "Action\tCondition\tSequence\n"
431  "s72\tS255\tI2\n"
432  "InstallExecuteSequence\tAction\n"
433  "ValidateProductID\t\t700\n"
434  "CostInitialize\t\t800\n"
435  "FileCost\t\t900\n"
436  "CostFinalize\t\t1000\n"
437  "InstallValidate\t\t1400\n"
438  "InstallInitialize\t\t1500\n"
439  "ProcessComponents\t\t1600\n"
440  "UnpublishFeatures\t\t1800\n"
441  "RemoveFiles\t\t3500\n"
442  "InstallFiles\t\t4000\n"
443  "RegisterProduct\t\t6100\n"
444  "PublishFeatures\t\t6300\n"
445  "PublishProduct\t\t6400\n"
446  "InstallFinalize\t\t6600";
447 
448 static const char rem_remove_files_dat[] =
449  "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
450  "s72\ts72\tS255\ts72\tI2\n"
451  "RemoveFile\tFileKey\n"
452  "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
453  "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
454  "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
455  "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
456  "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
457  "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
458  "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
459  "block\thelium\tblock\tMSITESTDIR\t3\n"
460  "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
461  "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
462 
463 static const char mov_move_file_dat[] =
464  "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
465  "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
466  "MoveFile\tFileKey\n"
467  "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
468  "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
469  "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
470  "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
471  "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
472  "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
473  "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
474  "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
475  "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
476  "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
477  "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
478  "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
479  "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
480  "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
481  "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
482  "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
483  "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
484  "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
485 
486 static const char df_directory_dat[] =
487  "Directory\tDirectory_Parent\tDefaultDir\n"
488  "s72\tS72\tl255\n"
489  "Directory\tDirectory\n"
490  "THIS\tMSITESTDIR\tthis\n"
491  "DOESNOT\tTHIS\tdoesnot\n"
492  "NONEXISTENT\tDOESNOT\texist\n"
493  "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
494  "ProgramFilesFolder\tTARGETDIR\t.\n"
495  "TARGETDIR\t\tSourceDir";
496 
497 static const char df_duplicate_file_dat[] =
498  "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
499  "s72\ts72\ts72\tS255\tS72\n"
500  "DuplicateFile\tFileKey\n"
501  "maximus\tmaximus\tmaximus\taugustus\t\n"
502  "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
503  "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
504 
505 static const char wrv_component_dat[] =
506  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
507  "s72\tS38\ts72\ti2\tS255\tS72\n"
508  "Component\tComponent\n"
509  "augustus\t\tMSITESTDIR\t0\t\taugustus\n"
510  "caesar\t\tMSITESTDIR\t1\t\t\n";
511 
512 static const char wrv_feature_dat[] =
513  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
514  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
515  "Feature\tFeature\n"
516  "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
517  "feature2\t\tFeature2\tFeature2\t2\t1\tTARGETDIR\t1";
518 
519 static const char wrv_feature_comp_dat[] =
520  "Feature_\tComponent_\n"
521  "s38\ts72\n"
522  "FeatureComponents\tFeature_\tComponent_\n"
523  "feature\taugustus\n"
524  "feature2\tcaesar";
525 
526 static const char wrv_registry_dat[] =
527  "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
528  "s72\ti2\tl255\tL255\tL0\ts72\n"
529  "Registry\tRegistry\n"
530  "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
531  "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
532  "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
533  "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
534  "regdata4\t2\tSOFTWARE\\Wine\\msitest\\VisualStudio\\10.0\\AD7Metrics\\Exception\\{049EC4CC-30D2-4032-9256-EE18EB41B62B}\\Common Language Runtime Exceptions\\System.Workflow.ComponentModel.Serialization\\System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException\tlong\tkey\taugustus\n"
535  "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
536  "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
537  "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
538  "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
539  "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
540  "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
541  "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
542  "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
543  "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
544  "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
545  "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n"
546  "regdata16\t2\tSOFTWARE\\Wine\\msitest\tValue12\t#1\tcaesar\n";
547 
548 static const char cf_directory_dat[] =
549  "Directory\tDirectory_Parent\tDefaultDir\n"
550  "s72\tS72\tl255\n"
551  "Directory\tDirectory\n"
552  "FIRSTDIR\tMSITESTDIR\tfirst\n"
553  "SECONDDIR\tMSITESTDIR\tsecond\n"
554  "THIRDDIR\tMSITESTDIR\tthird\n"
555  "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
556  "ProgramFilesFolder\tTARGETDIR\t.\n"
557  "TARGETDIR\t\tSourceDir";
558 
559 static const char cf_component_dat[] =
560  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
561  "s72\tS38\ts72\ti2\tS255\tS72\n"
562  "Component\tComponent\n"
563  "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
564  "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
565 
566 static const char cf_feature_dat[] =
567  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
568  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
569  "Feature\tFeature\n"
570  "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
571  "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
572 
573 static const char cf_feature_comp_dat[] =
574  "Feature_\tComponent_\n"
575  "s38\ts72\n"
576  "FeatureComponents\tFeature_\tComponent_\n"
577  "One\tOne\n"
578  "Two\tTwo\n";
579 
580 static const char cf_file_dat[] =
581  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
582  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
583  "File\tFile\n"
584  "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
585  "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
586 
587 static const char cf_create_folders_dat[] =
588  "Directory_\tComponent_\n"
589  "s72\ts72\n"
590  "CreateFolder\tDirectory_\tComponent_\n"
591  "FIRSTDIR\tOne\n"
592  "SECONDDIR\tTwo\n"
593  "THIRDDIR\tTwo\n";
594 
595 static const char cf_install_exec_seq_dat[] =
596  "Action\tCondition\tSequence\n"
597  "s72\tS255\tI2\n"
598  "InstallExecuteSequence\tAction\n"
599  "CostFinalize\t\t1000\n"
600  "ValidateProductID\t\t700\n"
601  "CostInitialize\t\t800\n"
602  "FileCost\t\t900\n"
603  "RemoveFiles\t\t3500\n"
604  "CreateFolders\t\t3700\n"
605  "RemoveFolders\t\t3800\n"
606  "InstallFiles\t\t4000\n"
607  "RegisterUser\t\t6000\n"
608  "RegisterProduct\t\t6100\n"
609  "PublishFeatures\t\t6300\n"
610  "PublishProduct\t\t6400\n"
611  "InstallFinalize\t\t6600\n"
612  "InstallInitialize\t\t1500\n"
613  "ProcessComponents\t\t1600\n"
614  "UnpublishFeatures\t\t1800\n"
615  "InstallValidate\t\t1400\n"
616  "LaunchConditions\t\t100\n";
617 
618 static const char sr_selfreg_dat[] =
619  "File_\tCost\n"
620  "s72\tI2\n"
621  "SelfReg\tFile_\n"
622  "one.txt\t1\n";
623 
624 static const char sr_install_exec_seq_dat[] =
625  "Action\tCondition\tSequence\n"
626  "s72\tS255\tI2\n"
627  "InstallExecuteSequence\tAction\n"
628  "CostFinalize\t\t1000\n"
629  "CostInitialize\t\t800\n"
630  "FileCost\t\t900\n"
631  "ResolveSource\t\t950\n"
632  "MoveFiles\t\t1700\n"
633  "SelfUnregModules\t\t3900\n"
634  "InstallFiles\t\t4000\n"
635  "DuplicateFiles\t\t4500\n"
636  "WriteEnvironmentStrings\t\t4550\n"
637  "CreateShortcuts\t\t4600\n"
638  "InstallFinalize\t\t6600\n"
639  "InstallInitialize\t\t1500\n"
640  "InstallValidate\t\t1400\n"
641  "LaunchConditions\t\t100\n";
642 
643 static const char font_media_dat[] =
644  "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
645  "i2\ti4\tL64\tS255\tS32\tS72\n"
646  "Media\tDiskId\n"
647  "1\t3\t\t\tDISK1\t\n";
648 
649 static const char font_file_dat[] =
650  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
651  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
652  "File\tFile\n"
653  "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
654 
655 static const char font_feature_dat[] =
656  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
657  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
658  "Feature\tFeature\n"
659  "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
660 
661 static const char font_component_dat[] =
662  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
663  "s72\tS38\ts72\ti2\tS255\tS72\n"
664  "Component\tComponent\n"
665  "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
666 
667 static const char font_feature_comp_dat[] =
668  "Feature_\tComponent_\n"
669  "s38\ts72\n"
670  "FeatureComponents\tFeature_\tComponent_\n"
671  "fonts\tfonts\n";
672 
673 static const char font_dat[] =
674  "File_\tFontTitle\n"
675  "s72\tS128\n"
676  "Font\tFile_\n"
677  "font.ttf\tmsi test font\n";
678 
679 static const char font_install_exec_seq_dat[] =
680  "Action\tCondition\tSequence\n"
681  "s72\tS255\tI2\n"
682  "InstallExecuteSequence\tAction\n"
683  "ValidateProductID\t\t700\n"
684  "CostInitialize\t\t800\n"
685  "FileCost\t\t900\n"
686  "CostFinalize\t\t1000\n"
687  "InstallValidate\t\t1400\n"
688  "InstallInitialize\t\t1500\n"
689  "ProcessComponents\t\t1600\n"
690  "UnpublishFeatures\t\t1800\n"
691  "RemoveFiles\t\t3500\n"
692  "InstallFiles\t\t4000\n"
693  "RegisterFonts\t\t4100\n"
694  "UnregisterFonts\t\t4200\n"
695  "RegisterUser\t\t6000\n"
696  "RegisterProduct\t\t6100\n"
697  "PublishFeatures\t\t6300\n"
698  "PublishProduct\t\t6400\n"
699  "InstallFinalize\t\t6600";
700 
701 static const char vp_property_dat[] =
702  "Property\tValue\n"
703  "s72\tl0\n"
704  "Property\tProperty\n"
705  "HASUIRUN\t0\n"
706  "INSTALLLEVEL\t3\n"
707  "InstallMode\tTypical\n"
708  "Manufacturer\tWine\n"
709  "PIDTemplate\t###-#######\n"
710  "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
711  "ProductLanguage\t1033\n"
712  "ProductName\tMSITEST\n"
713  "ProductVersion\t1.1.1\n"
714  "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
715  "MSIFASTINSTALL\t1\n";
716 
717 static const char vp_custom_action_dat[] =
718  "Action\tType\tSource\tTarget\tISComments\n"
719  "s72\ti2\tS64\tS0\tS255\n"
720  "CustomAction\tAction\n"
721  "SetProductID1\t51\tProductID\t1\t\n"
722  "SetProductID2\t51\tProductID\t2\t\n"
723  "TestProductID1\t19\t\t\tHalts installation\n"
724  "TestProductID2\t19\t\t\tHalts installation\n";
725 
726 static const char vp_install_exec_seq_dat[] =
727  "Action\tCondition\tSequence\n"
728  "s72\tS255\tI2\n"
729  "InstallExecuteSequence\tAction\n"
730  "LaunchConditions\t\t100\n"
731  "CostInitialize\t\t800\n"
732  "FileCost\t\t900\n"
733  "CostFinalize\t\t1000\n"
734  "InstallValidate\t\t1400\n"
735  "InstallInitialize\t\t1500\n"
736  "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
737  "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
738  "ValidateProductID\t\t3200\n"
739  "InstallExecute\t\t3300\n"
740  "TestProductID1\tProductID=1\t3400\n"
741  "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
742  "InstallFiles\t\t4000\n"
743  "InstallFinalize\t\t6000\n";
744 
745 static const char odbc_file_dat[] =
746  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
747  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
748  "File\tFile\n"
749  "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
750  "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
751  "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
752  "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
753  "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
754 
755 static const char odbc_feature_dat[] =
756  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
757  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
758  "Feature\tFeature\n"
759  "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
760 
761 static const char odbc_feature_comp_dat[] =
762  "Feature_\tComponent_\n"
763  "s38\ts72\n"
764  "FeatureComponents\tFeature_\tComponent_\n"
765  "odbc\todbc\n";
766 
767 static const char odbc_component_dat[] =
768  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
769  "s72\tS38\ts72\ti2\tS255\tS72\n"
770  "Component\tComponent\n"
771  "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
772 
773 static const char odbc_driver_dat[] =
774  "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
775  "s72\ts72\ts255\ts72\tS72\n"
776  "ODBCDriver\tDriver\n"
777  "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
778  "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
779 
780 static const char odbc_translator_dat[] =
781  "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
782  "s72\ts72\ts255\ts72\tS72\n"
783  "ODBCTranslator\tTranslator\n"
784  "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
785  "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
786 
787 static const char odbc_datasource_dat[] =
788  "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
789  "s72\ts72\ts255\ts255\ti2\n"
790  "ODBCDataSource\tDataSource\n"
791  "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
792 
793 static const char odbc_install_exec_seq_dat[] =
794  "Action\tCondition\tSequence\n"
795  "s72\tS255\tI2\n"
796  "InstallExecuteSequence\tAction\n"
797  "LaunchConditions\t\t100\n"
798  "CostInitialize\t\t800\n"
799  "FileCost\t\t900\n"
800  "CostFinalize\t\t1000\n"
801  "InstallValidate\t\t1400\n"
802  "InstallInitialize\t\t1500\n"
803  "ProcessComponents\t\t1600\n"
804  "InstallODBC\t\t3000\n"
805  "RemoveODBC\t\t3100\n"
806  "RemoveFiles\t\t3900\n"
807  "InstallFiles\t\t4000\n"
808  "RegisterProduct\t\t5000\n"
809  "PublishFeatures\t\t5100\n"
810  "PublishProduct\t\t5200\n"
811  "InstallFinalize\t\t6000\n";
812 
813 static const char odbc_media_dat[] =
814  "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
815  "i2\ti4\tL64\tS255\tS32\tS72\n"
816  "Media\tDiskId\n"
817  "1\t5\t\t\tDISK1\t\n";
818 
819 static const char tl_file_dat[] =
820  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
821  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
822  "File\tFile\n"
823  "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
824 
825 static const char tl_feature_dat[] =
826  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
827  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
828  "Feature\tFeature\n"
829  "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
830 
831 static const char tl_feature_comp_dat[] =
832  "Feature_\tComponent_\n"
833  "s38\ts72\n"
834  "FeatureComponents\tFeature_\tComponent_\n"
835  "typelib\ttypelib\n";
836 
837 static const char tl_component_dat[] =
838  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
839  "s72\tS38\ts72\ti2\tS255\tS72\n"
840  "Component\tComponent\n"
841  "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
842 
843 static const char tl_typelib_dat[] =
844  "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
845  "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
846  "TypeLib\tLibID\tLanguage\tComponent_\n"
847  "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
848 
849 static const char tl_install_exec_seq_dat[] =
850  "Action\tCondition\tSequence\n"
851  "s72\tS255\tI2\n"
852  "InstallExecuteSequence\tAction\n"
853  "LaunchConditions\t\t100\n"
854  "CostInitialize\t\t800\n"
855  "FileCost\t\t900\n"
856  "CostFinalize\t\t1000\n"
857  "InstallValidate\t\t1400\n"
858  "InstallInitialize\t\t1500\n"
859  "ProcessComponents\t\t1600\n"
860  "RemoveFiles\t\t1700\n"
861  "InstallFiles\t\t2000\n"
862  "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
863  "UnregisterTypeLibraries\t\t3100\n"
864  "RegisterProduct\t\t5100\n"
865  "PublishFeatures\t\t5200\n"
866  "PublishProduct\t\t5300\n"
867  "InstallFinalize\t\t6000\n";
868 
869 static const char crs_file_dat[] =
870  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
871  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
872  "File\tFile\n"
873  "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
874 
875 static const char crs_feature_dat[] =
876  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
877  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
878  "Feature\tFeature\n"
879  "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
880 
881 static const char crs_feature_comp_dat[] =
882  "Feature_\tComponent_\n"
883  "s38\ts72\n"
884  "FeatureComponents\tFeature_\tComponent_\n"
885  "shortcut\tshortcut\n";
886 
887 static const char crs_component_dat[] =
888  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
889  "s72\tS38\ts72\ti2\tS255\tS72\n"
890  "Component\tComponent\n"
891  "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
892 
893 static const char crs_shortcut_dat[] =
894  "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
895  "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
896  "Shortcut\tShortcut\n"
897  "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
898 
899 static const char crs_install_exec_seq_dat[] =
900  "Action\tCondition\tSequence\n"
901  "s72\tS255\tI2\n"
902  "InstallExecuteSequence\tAction\n"
903  "LaunchConditions\t\t100\n"
904  "CostInitialize\t\t800\n"
905  "FileCost\t\t900\n"
906  "CostFinalize\t\t1000\n"
907  "InstallValidate\t\t1400\n"
908  "InstallInitialize\t\t1500\n"
909  "ProcessComponents\t\t1600\n"
910  "RemoveFiles\t\t1700\n"
911  "InstallFiles\t\t2000\n"
912  "RemoveShortcuts\t\t3000\n"
913  "CreateShortcuts\t\t3100\n"
914  "RegisterProduct\t\t5000\n"
915  "PublishFeatures\t\t5100\n"
916  "PublishProduct\t\t5200\n"
917  "InstallFinalize\t\t6000\n";
918 
919 static const char pub_file_dat[] =
920  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
921  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
922  "File\tFile\n"
923  "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
924 
925 static const char pub_feature_dat[] =
926  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
927  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
928  "Feature\tFeature\n"
929  "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
930 
931 static const char pub_feature_comp_dat[] =
932  "Feature_\tComponent_\n"
933  "s38\ts72\n"
934  "FeatureComponents\tFeature_\tComponent_\n"
935  "publish\tpublish\n";
936 
937 static const char pub_component_dat[] =
938  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
939  "s72\tS38\ts72\ti2\tS255\tS72\n"
940  "Component\tComponent\n"
941  "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
942 
943 static const char pub_publish_component_dat[] =
944  "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
945  "s38\ts255\ts72\tL255\ts38\n"
946  "PublishComponent\tComponentId\tQualifier\tComponent_\n"
947  "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
948 
949 static const char pub_install_exec_seq_dat[] =
950  "Action\tCondition\tSequence\n"
951  "s72\tS255\tI2\n"
952  "InstallExecuteSequence\tAction\n"
953  "LaunchConditions\t\t100\n"
954  "CostInitialize\t\t800\n"
955  "FileCost\t\t900\n"
956  "CostFinalize\t\t1000\n"
957  "InstallValidate\t\t1400\n"
958  "InstallInitialize\t\t1500\n"
959  "ProcessComponents\t\t1600\n"
960  "RemoveFiles\t\t1700\n"
961  "InstallFiles\t\t2000\n"
962  "PublishComponents\t\t3000\n"
963  "UnpublishComponents\t\t3100\n"
964  "RegisterProduct\t\t5000\n"
965  "PublishFeatures\t\t5100\n"
966  "PublishProduct\t\t5200\n"
967  "InstallFinalize\t\t6000\n";
968 
969 static const char rd_file_dat[] =
970  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
971  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
972  "File\tFile\n"
973  "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
974  "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
975  "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
976 
977 static const char rd_feature_dat[] =
978  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
979  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
980  "Feature\tFeature\n"
981  "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
982 
983 static const char rd_feature_comp_dat[] =
984  "Feature_\tComponent_\n"
985  "s38\ts72\n"
986  "FeatureComponents\tFeature_\tComponent_\n"
987  "duplicate\tduplicate\n";
988 
989 static const char rd_component_dat[] =
990  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
991  "s72\tS38\ts72\ti2\tS255\tS72\n"
992  "Component\tComponent\n"
993  "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
994  "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
995 
996 static const char rd_duplicate_file_dat[] =
997  "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
998  "s72\ts72\ts72\tS255\tS72\n"
999  "DuplicateFile\tFileKey\n"
1000  "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
1001  "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
1002  "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
1003 
1004 static const char rd_install_exec_seq_dat[] =
1005  "Action\tCondition\tSequence\n"
1006  "s72\tS255\tI2\n"
1007  "InstallExecuteSequence\tAction\n"
1008  "LaunchConditions\t\t100\n"
1009  "CostInitialize\t\t800\n"
1010  "FileCost\t\t900\n"
1011  "CostFinalize\t\t1000\n"
1012  "InstallValidate\t\t1400\n"
1013  "InstallInitialize\t\t1500\n"
1014  "ProcessComponents\t\t1600\n"
1015  "RemoveDuplicateFiles\t\t1900\n"
1016  "InstallFiles\t\t2000\n"
1017  "DuplicateFiles\t\t2100\n"
1018  "RegisterProduct\t\t5000\n"
1019  "PublishFeatures\t\t5100\n"
1020  "PublishProduct\t\t5200\n"
1021  "InstallFinalize\t\t6000\n";
1022 
1023 static const char rrv_file_dat[] =
1024  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1025  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1026  "File\tFile\n"
1027  "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1028 
1029 static const char rrv_feature_dat[] =
1030  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1031  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1032  "Feature\tFeature\n"
1033  "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1034 
1035 static const char rrv_feature_comp_dat[] =
1036  "Feature_\tComponent_\n"
1037  "s38\ts72\n"
1038  "FeatureComponents\tFeature_\tComponent_\n"
1039  "registry\tregistry\n";
1040 
1041 static const char rrv_component_dat[] =
1042  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1043  "s72\tS38\ts72\ti2\tS255\tS72\n"
1044  "Component\tComponent\n"
1045  "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1046 
1047 static const char rrv_registry_dat[] =
1048  "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1049  "s72\ti2\tl255\tL255\tL0\ts72\n"
1050  "Registry\tRegistry\n"
1051  "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1052  "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1053  "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1054 
1055 static const char rrv_remove_registry_dat[] =
1056  "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1057  "s72\ti2\tl255\tL255\ts72\n"
1058  "RemoveRegistry\tRemoveRegistry\n"
1059  "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1060  "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1061  "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1062 
1063 static const char rrv_install_exec_seq_dat[] =
1064  "Action\tCondition\tSequence\n"
1065  "s72\tS255\tI2\n"
1066  "InstallExecuteSequence\tAction\n"
1067  "LaunchConditions\t\t100\n"
1068  "CostInitialize\t\t800\n"
1069  "FileCost\t\t900\n"
1070  "CostFinalize\t\t1000\n"
1071  "InstallValidate\t\t1400\n"
1072  "InstallInitialize\t\t1500\n"
1073  "ProcessComponents\t\t1600\n"
1074  "RemoveFiles\t\t1700\n"
1075  "InstallFiles\t\t2000\n"
1076  "RemoveRegistryValues\t\t3000\n"
1077  "RegisterProduct\t\t5000\n"
1078  "PublishFeatures\t\t5100\n"
1079  "PublishProduct\t\t5200\n"
1080  "InstallFinalize\t\t6000\n";
1081 
1082 static const char frp_file_dat[] =
1083  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1084  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1085  "File\tFile\n"
1086  "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1087 
1088 static const char frp_feature_dat[] =
1089  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1090  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1091  "Feature\tFeature\n"
1092  "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1093 
1094 static const char frp_feature_comp_dat[] =
1095  "Feature_\tComponent_\n"
1096  "s38\ts72\n"
1097  "FeatureComponents\tFeature_\tComponent_\n"
1098  "product\tproduct\n";
1099 
1100 static const char frp_component_dat[] =
1101  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1102  "s72\tS38\ts72\ti2\tS255\tS72\n"
1103  "Component\tComponent\n"
1104  "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1105 
1106 static const char frp_custom_action_dat[] =
1107  "Action\tType\tSource\tTarget\tISComments\n"
1108  "s72\ti2\tS64\tS0\tS255\n"
1109  "CustomAction\tAction\n"
1110  "TestProp\t19\t\t\tPROP set\n";
1111 
1112 static const char frp_upgrade_dat[] =
1113  "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1114  "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1115  "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1116  "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1117 
1118 static const char frp_install_exec_seq_dat[] =
1119  "Action\tCondition\tSequence\n"
1120  "s72\tS255\tI2\n"
1121  "InstallExecuteSequence\tAction\n"
1122  "FindRelatedProducts\t\t50\n"
1123  "TestProp\tPROP AND NOT REMOVE\t51\n"
1124  "LaunchConditions\t\t100\n"
1125  "CostInitialize\t\t800\n"
1126  "FileCost\t\t900\n"
1127  "CostFinalize\t\t1000\n"
1128  "InstallValidate\t\t1400\n"
1129  "InstallInitialize\t\t1500\n"
1130  "ProcessComponents\t\t1600\n"
1131  "RemoveFiles\t\t1700\n"
1132  "InstallFiles\t\t2000\n"
1133  "RegisterProduct\t\t5000\n"
1134  "PublishFeatures\t\t5100\n"
1135  "PublishProduct\t\t5200\n"
1136  "InstallFinalize\t\t6000\n";
1137 
1138 static const char riv_file_dat[] =
1139  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1140  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1141  "File\tFile\n"
1142  "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1143 
1144 static const char riv_feature_dat[] =
1145  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1146  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1147  "Feature\tFeature\n"
1148  "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1149 
1150 static const char riv_feature_comp_dat[] =
1151  "Feature_\tComponent_\n"
1152  "s38\ts72\n"
1153  "FeatureComponents\tFeature_\tComponent_\n"
1154  "inifile\tinifile\n";
1155 
1156 static const char riv_component_dat[] =
1157  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1158  "s72\tS38\ts72\ti2\tS255\tS72\n"
1159  "Component\tComponent\n"
1160  "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1161 
1162 static const char riv_ini_file_dat[] =
1163  "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1164  "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1165  "IniFile\tIniFile\n"
1166  "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1167 
1168 static const char riv_remove_ini_file_dat[] =
1169  "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1170  "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1171  "RemoveIniFile\tRemoveIniFile\n"
1172  "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1173 
1174 static const char riv_install_exec_seq_dat[] =
1175  "Action\tCondition\tSequence\n"
1176  "s72\tS255\tI2\n"
1177  "InstallExecuteSequence\tAction\n"
1178  "LaunchConditions\t\t100\n"
1179  "CostInitialize\t\t800\n"
1180  "FileCost\t\t900\n"
1181  "CostFinalize\t\t1000\n"
1182  "InstallValidate\t\t1400\n"
1183  "InstallInitialize\t\t1500\n"
1184  "ProcessComponents\t\t1600\n"
1185  "RemoveFiles\t\t1700\n"
1186  "InstallFiles\t\t2000\n"
1187  "RemoveIniValues\t\t3000\n"
1188  "RegisterProduct\t\t5000\n"
1189  "PublishFeatures\t\t5100\n"
1190  "PublishProduct\t\t5200\n"
1191  "InstallFinalize\t\t6000\n";
1192 
1193 static const char res_file_dat[] =
1194  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1195  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1196  "File\tFile\n"
1197  "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1198 
1199 static const char res_feature_dat[] =
1200  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1201  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1202  "Feature\tFeature\n"
1203  "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1204 
1205 static const char res_feature_comp_dat[] =
1206  "Feature_\tComponent_\n"
1207  "s38\ts72\n"
1208  "FeatureComponents\tFeature_\tComponent_\n"
1209  "envvar\tenvvar\n";
1210 
1211 static const char res_component_dat[] =
1212  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1213  "s72\tS38\ts72\ti2\tS255\tS72\n"
1214  "Component\tComponent\n"
1215  "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1216 
1217 static const char res_environment_dat[] =
1218  "Environment\tName\tValue\tComponent_\n"
1219  "s72\tl255\tL255\ts72\n"
1220  "Environment\tEnvironment\n"
1221  "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1222  "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1223  "var3\t=MSITESTVAR3\t1\tenvvar\n"
1224  "var4\t=-MSITESTVAR4\t\tenvvar\n"
1225  "var5\t=MSITESTVAR5\t\tenvvar\n"
1226  "Var6\t-MSITESTVAR6\t1;[~]\tenvvar\n"
1227  "Var7\t-MSITESTVAR7\t[~];1\tenvvar\n"
1228  "Var8\t-MSITESTVAR8\t1;[~]\tenvvar\n"
1229  "Var9\t-MSITESTVAR9\t[~];1\tenvvar\n"
1230  "Var10\t-MSITESTVAR10\t1\tenvvar\n"
1231  "Var11\t-MSITESTVAR11\t2\tenvvar\n";
1232 
1233 static const char res_install_exec_seq_dat[] =
1234  "Action\tCondition\tSequence\n"
1235  "s72\tS255\tI2\n"
1236  "InstallExecuteSequence\tAction\n"
1237  "LaunchConditions\t\t100\n"
1238  "CostInitialize\t\t800\n"
1239  "FileCost\t\t900\n"
1240  "CostFinalize\t\t1000\n"
1241  "InstallValidate\t\t1400\n"
1242  "InstallInitialize\t\t1500\n"
1243  "ProcessComponents\t\t1600\n"
1244  "RemoveFiles\t\t1700\n"
1245  "InstallFiles\t\t2000\n"
1246  "RemoveEnvironmentStrings\t\t3000\n"
1247  "RegisterProduct\t\t5000\n"
1248  "PublishFeatures\t\t5100\n"
1249  "PublishProduct\t\t5200\n"
1250  "InstallFinalize\t\t6000\n";
1251 
1252 static const char rci_file_dat[] =
1253  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1254  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1255  "File\tFile\n"
1256  "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1257 
1258 static const char rci_feature_dat[] =
1259  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1260  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1261  "Feature\tFeature\n"
1262  "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1263 
1264 static const char rci_feature_comp_dat[] =
1265  "Feature_\tComponent_\n"
1266  "s38\ts72\n"
1267  "FeatureComponents\tFeature_\tComponent_\n"
1268  "class\tclass\n";
1269 
1270 static const char rci_component_dat[] =
1271  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1272  "s72\tS38\ts72\ti2\tS255\tS72\n"
1273  "Component\tComponent\n"
1274  "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1275 
1276 static const char rci_appid_dat[] =
1277  "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1278  "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1279  "AppId\tAppId\n"
1280  "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1281 
1282 static const char rci_class_dat[] =
1283  "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1284  "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1285  "Class\tCLSID\tContext\tComponent_\n"
1286  "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1287 
1288 static const char rci_install_exec_seq_dat[] =
1289  "Action\tCondition\tSequence\n"
1290  "s72\tS255\tI2\n"
1291  "InstallExecuteSequence\tAction\n"
1292  "LaunchConditions\t\t100\n"
1293  "CostInitialize\t\t800\n"
1294  "FileCost\t\t900\n"
1295  "CostFinalize\t\t1000\n"
1296  "InstallValidate\t\t1400\n"
1297  "InstallInitialize\t\t1500\n"
1298  "ProcessComponents\t\t1600\n"
1299  "RemoveFiles\t\t1700\n"
1300  "InstallFiles\t\t2000\n"
1301  "UnregisterClassInfo\t\t3000\n"
1302  "RegisterClassInfo\t\t4000\n"
1303  "RegisterProduct\t\t5000\n"
1304  "PublishFeatures\t\t5100\n"
1305  "PublishProduct\t\t5200\n"
1306  "InstallFinalize\t\t6000\n";
1307 
1308 static const char rei_file_dat[] =
1309  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1310  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1311  "File\tFile\n"
1312  "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1313 
1314 static const char rei_feature_dat[] =
1315  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1316  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1317  "Feature\tFeature\n"
1318  "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1319 
1320 static const char rei_feature_comp_dat[] =
1321  "Feature_\tComponent_\n"
1322  "s38\ts72\n"
1323  "FeatureComponents\tFeature_\tComponent_\n"
1324  "extension\textension\n";
1325 
1326 static const char rei_component_dat[] =
1327  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1328  "s72\tS38\ts72\ti2\tS255\tS72\n"
1329  "Component\tComponent\n"
1330  "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1331 
1332 static const char rei_extension_dat[] =
1333  "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1334  "s255\ts72\tS255\tS64\ts38\n"
1335  "Extension\tExtension\tComponent_\n"
1336  "extension\textension\tProg.Id.1\t\textension\n";
1337 
1338 static const char rei_verb_dat[] =
1339  "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1340  "s255\ts32\tI2\tL255\tL255\n"
1341  "Verb\tExtension_\tVerb\n"
1342  "extension\tOpen\t1\t&Open\t/argument\n";
1343 
1344 static const char rei_progid_dat[] =
1345  "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1346  "s255\tS255\tS38\tL255\tS72\tI2\n"
1347  "ProgId\tProgId\n"
1348  "Prog.Id.1\t\t\tdescription\t\t\n";
1349 
1350 static const char rei_install_exec_seq_dat[] =
1351  "Action\tCondition\tSequence\n"
1352  "s72\tS255\tI2\n"
1353  "InstallExecuteSequence\tAction\n"
1354  "LaunchConditions\t\t100\n"
1355  "CostInitialize\t\t800\n"
1356  "FileCost\t\t900\n"
1357  "CostFinalize\t\t1000\n"
1358  "InstallValidate\t\t1400\n"
1359  "InstallInitialize\t\t1500\n"
1360  "ProcessComponents\t\t1600\n"
1361  "RemoveFiles\t\t1700\n"
1362  "InstallFiles\t\t2000\n"
1363  "UnregisterExtensionInfo\t\t3000\n"
1364  "RegisterExtensionInfo\t\t4000\n"
1365  "RegisterProduct\t\t5000\n"
1366  "PublishFeatures\t\t5100\n"
1367  "PublishProduct\t\t5200\n"
1368  "InstallFinalize\t\t6000\n";
1369 
1370 static const char rpi_file_dat[] =
1371  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1372  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1373  "File\tFile\n"
1374  "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1375 
1376 static const char rpi_feature_dat[] =
1377  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1378  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1379  "Feature\tFeature\n"
1380  "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1381 
1382 static const char rpi_feature_comp_dat[] =
1383  "Feature_\tComponent_\n"
1384  "s38\ts72\n"
1385  "FeatureComponents\tFeature_\tComponent_\n"
1386  "progid\tprogid\n";
1387 
1388 static const char rpi_component_dat[] =
1389  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1390  "s72\tS38\ts72\ti2\tS255\tS72\n"
1391  "Component\tComponent\n"
1392  "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1393 
1394 static const char rpi_appid_dat[] =
1395  "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1396  "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1397  "AppId\tAppId\n"
1398  "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1399 
1400 static const char rpi_class_dat[] =
1401  "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1402  "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1403  "Class\tCLSID\tContext\tComponent_\n"
1404  "{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"
1405  "{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"
1406  "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1407 
1408 static const char rpi_extension_dat[] =
1409  "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1410  "s255\ts72\tS255\tS64\ts38\n"
1411  "Extension\tExtension\tComponent_\n"
1412  "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1413 
1414 static const char rpi_verb_dat[] =
1415  "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1416  "s255\ts32\tI2\tL255\tL255\n"
1417  "Verb\tExtension_\tVerb\n"
1418  "winetest\tOpen\t1\t&Open\t/argument\n";
1419 
1420 static const char rpi_progid_dat[] =
1421  "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1422  "s255\tS255\tS38\tL255\tS72\tI2\n"
1423  "ProgId\tProgId\n"
1424  "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1425  "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1426  "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1427  "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1428  "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1429  "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1430  "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1431  "Winetest.Orphaned\t\t\tdescription\t\t\n"
1432  "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1433  "Winetest.Extension\t\t\tdescription\t\t\n";
1434 
1435 static const char rpi_install_exec_seq_dat[] =
1436  "Action\tCondition\tSequence\n"
1437  "s72\tS255\tI2\n"
1438  "InstallExecuteSequence\tAction\n"
1439  "LaunchConditions\t\t100\n"
1440  "CostInitialize\t\t800\n"
1441  "FileCost\t\t900\n"
1442  "CostFinalize\t\t1000\n"
1443  "InstallValidate\t\t1400\n"
1444  "InstallInitialize\t\t1500\n"
1445  "ProcessComponents\t\t1600\n"
1446  "RemoveFiles\t\t1700\n"
1447  "UnregisterClassInfo\t\t3000\n"
1448  "UnregisterExtensionInfo\t\t3200\n"
1449  "UnregisterProgIdInfo\t\t3400\n"
1450  "InstallFiles\t\t3600\n"
1451  "RegisterClassInfo\t\t4000\n"
1452  "RegisterExtensionInfo\t\t4200\n"
1453  "RegisterProgIdInfo\t\t4400\n"
1454  "RegisterProduct\t\t5000\n"
1455  "PublishFeatures\t\t5100\n"
1456  "PublishProduct\t\t5200\n"
1457  "InstallFinalize\t\t6000\n";
1458 
1459 static const char rmi_file_dat[] =
1460  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1461  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1462  "File\tFile\n"
1463  "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1464 
1465 static const char rmi_feature_dat[] =
1466  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1467  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1468  "Feature\tFeature\n"
1469  "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1470 
1471 static const char rmi_feature_comp_dat[] =
1472  "Feature_\tComponent_\n"
1473  "s38\ts72\n"
1474  "FeatureComponents\tFeature_\tComponent_\n"
1475  "mime\tmime\n";
1476 
1477 static const char rmi_component_dat[] =
1478  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1479  "s72\tS38\ts72\ti2\tS255\tS72\n"
1480  "Component\tComponent\n"
1481  "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1482 
1483 static const char rmi_extension_dat[] =
1484  "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1485  "s255\ts72\tS255\tS64\ts38\n"
1486  "Extension\tExtension\tComponent_\n"
1487  "mime\tmime\t\tmime/type\tmime\n";
1488 
1489 static const char rmi_verb_dat[] =
1490  "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1491  "s255\ts32\tI2\tL255\tL255\n"
1492  "Verb\tExtension_\tVerb\n"
1493  "mime\tOpen\t1\t&Open\t/argument\n";
1494 
1495 static const char rmi_mime_dat[] =
1496  "ContentType\tExtension_\tCLSID\n"
1497  "s64\ts255\tS38\n"
1498  "MIME\tContentType\n"
1499  "mime/type\tmime\t\n";
1500 
1501 static const char rmi_install_exec_seq_dat[] =
1502  "Action\tCondition\tSequence\n"
1503  "s72\tS255\tI2\n"
1504  "InstallExecuteSequence\tAction\n"
1505  "LaunchConditions\t\t100\n"
1506  "CostInitialize\t\t800\n"
1507  "FileCost\t\t900\n"
1508  "CostFinalize\t\t1000\n"
1509  "InstallValidate\t\t1400\n"
1510  "InstallInitialize\t\t1500\n"
1511  "ProcessComponents\t\t1600\n"
1512  "RemoveFiles\t\t1700\n"
1513  "InstallFiles\t\t2000\n"
1514  "UnregisterExtensionInfo\t\t3000\n"
1515  "UnregisterMIMEInfo\t\t3500\n"
1516  "RegisterExtensionInfo\t\t4000\n"
1517  "RegisterMIMEInfo\t\t4500\n"
1518  "RegisterProduct\t\t5000\n"
1519  "PublishFeatures\t\t5100\n"
1520  "PublishProduct\t\t5200\n"
1521  "InstallFinalize\t\t6000\n";
1522 
1523 static const char pa_file_dat[] =
1524  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1525  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1526  "File\tFile\n"
1527  "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1528  "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1529  "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1530  "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1531  "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1532  "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1533  "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1534  "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1535 
1536 static const char pa_feature_dat[] =
1537  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1538  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1539  "Feature\tFeature\n"
1540  "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1541 
1542 static const char pa_feature_comp_dat[] =
1543  "Feature_\tComponent_\n"
1544  "s38\ts72\n"
1545  "FeatureComponents\tFeature_\tComponent_\n"
1546  "assembly\twin32\n"
1547  "assembly\twin32_local\n"
1548  "assembly\tdotnet\n"
1549  "assembly\tdotnet_local\n";
1550 
1551 static const char pa_component_dat[] =
1552  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1553  "s72\tS38\ts72\ti2\tS255\tS72\n"
1554  "Component\tComponent\n"
1555  "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1556  "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1557  "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1558  "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1559 
1560 static const char pa_msi_assembly_dat[] =
1561  "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1562  "s72\ts38\tS72\tS72\tI2\n"
1563  "MsiAssembly\tComponent_\n"
1564  "win32\tassembly\tmanifest.txt\t\t1\n"
1565  "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1566  "dotnet\tassembly\t\t\t0\n"
1567  "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1568 
1569 static const char pa_msi_assembly_name_dat[] =
1570  "Component_\tName\tValue\n"
1571  "s72\ts255\ts255\n"
1572  "MsiAssemblyName\tComponent_\tName\n"
1573  "win32\tName\tWine.Win32.Assembly\n"
1574  "win32\tprocessorArchitecture\tx86\n"
1575  "win32\tpublicKeyToken\tabcdef0123456789\n"
1576  "win32\ttype\twin32\n"
1577  "win32\tversion\t1.0.0.0\n"
1578  "win32_local\tName\tWine.Win32.Local.Assembly\n"
1579  "win32_local\tprocessorArchitecture\tx86\n"
1580  "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1581  "win32_local\ttype\twin32\n"
1582  "win32_local\tversion\t1.0.0.0\n"
1583  "dotnet\tName\tWine.Dotnet.Assembly\n"
1584  "dotnet\tprocessorArchitecture\tMSIL\n"
1585  "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1586  "dotnet\tculture\tneutral\n"
1587  "dotnet\tversion\t1.0.0.0\n"
1588  "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1589  "dotnet_local\tprocessorArchitecture\tMSIL\n"
1590  "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1591  "dotnet_local\tculture\tneutral\n"
1592  "dotnet_local\tversion\t1.0.0.0\n";
1593 
1594 static const char pa_install_exec_seq_dat[] =
1595  "Action\tCondition\tSequence\n"
1596  "s72\tS255\tI2\n"
1597  "InstallExecuteSequence\tAction\n"
1598  "LaunchConditions\t\t100\n"
1599  "CostInitialize\t\t800\n"
1600  "FileCost\t\t900\n"
1601  "CostFinalize\t\t1000\n"
1602  "InstallValidate\t\t1400\n"
1603  "InstallInitialize\t\t1500\n"
1604  "ProcessComponents\t\t1600\n"
1605  "MsiPublishAssemblies\t\t3000\n"
1606  "MsiUnpublishAssemblies\t\t4000\n"
1607  "RegisterProduct\t\t5000\n"
1608  "PublishFeatures\t\t5100\n"
1609  "PublishProduct\t\t5200\n"
1610  "InstallFinalize\t\t6000\n";
1611 
1612 static const char rep_file_dat[] =
1613  "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1614  "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1615  "File\tFile\n"
1616  "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1617 
1618 static const char rep_feature_dat[] =
1619  "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1620  "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1621  "Feature\tFeature\n"
1622  "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1623 
1624 static const char rep_feature_comp_dat[] =
1625  "Feature_\tComponent_\n"
1626  "s38\ts72\n"
1627  "FeatureComponents\tFeature_\tComponent_\n"
1628  "rep\trep\n";
1629 
1630 static const char rep_component_dat[] =
1631  "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1632  "s72\tS38\ts72\ti2\tS255\tS72\n"
1633  "Component\tComponent\n"
1634  "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1635 
1636 static const char rep_upgrade_dat[] =
1637  "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1638  "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1639  "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1640  "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1641 
1642 static const char rep_property_dat[] =
1643  "Property\tValue\n"
1644  "s72\tl0\n"
1645  "Property\tProperty\n"
1646  "HASUIRUN\t0\n"
1647  "INSTALLLEVEL\t3\n"
1648  "InstallMode\tTypical\n"
1649  "Manufacturer\tWine\n"
1650  "PIDTemplate\t###-#######\n"
1651  "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1652  "ProductLanguage\t1033\n"
1653  "ProductName\tMSITEST\n"
1654  "ProductVersion\t1.1.1\n"
1655  "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1656  "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1657  "MSIFASTINSTALL\t1\n";
1658 
1659 static const char rep_install_exec_seq_dat[] =
1660  "Action\tCondition\tSequence\n"
1661  "s72\tS255\tI2\n"
1662  "InstallExecuteSequence\tAction\n"
1663  "FindRelatedProducts\t\t100\n"
1664  "CostInitialize\t\t800\n"
1665  "FileCost\t\t900\n"
1666  "CostFinalize\t\t1000\n"
1667  "InstallValidate\t\t1400\n"
1668  "RemoveExistingProducts\t\t1499\n"
1669  "InstallInitialize\t\t1500\n"
1670  "ProcessComponents\t\t1600\n"
1671  "RemoveFiles\t\t1700\n"
1672  "InstallFiles\t\t2000\n"
1673  "UnregisterExtensionInfo\t\t3000\n"
1674  "UnregisterMIMEInfo\t\t3500\n"
1675  "RegisterExtensionInfo\t\t4000\n"
1676  "RegisterMIMEInfo\t\t4500\n"
1677  "RegisterProduct\t\t5000\n"
1678  "PublishFeatures\t\t5100\n"
1679  "PublishProduct\t\t5200\n"
1680  "InstallFinalize\t\t6000\n";
1681 
1682 typedef struct _msi_table
1683 {
1684  const char *filename;
1685  const char *data;
1686  unsigned int size;
1687 } msi_table;
1688 
1689 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1690 
1691 static const msi_table env_tables[] =
1692 {
1693  ADD_TABLE(component),
1695  ADD_TABLE(feature),
1696  ADD_TABLE(feature_comp),
1697  ADD_TABLE(file),
1698  ADD_TABLE(install_exec_seq),
1699  ADD_TABLE(media),
1701  ADD_TABLE(environment)
1702 };
1703 
1704 static const msi_table pp_tables[] =
1705 {
1706  ADD_TABLE(pp_component),
1708  ADD_TABLE(rof_feature),
1709  ADD_TABLE(rof_feature_comp),
1710  ADD_TABLE(rof_file),
1711  ADD_TABLE(pp_install_exec_seq),
1712  ADD_TABLE(rof_media),
1714 };
1715 
1716 static const msi_table ppc_tables[] =
1717 {
1718  ADD_TABLE(ppc_component),
1720  ADD_TABLE(rof_feature),
1721  ADD_TABLE(ppc_feature_comp),
1722  ADD_TABLE(ppc_file),
1723  ADD_TABLE(pp_install_exec_seq),
1724  ADD_TABLE(ppc_media),
1726 };
1727 
1728 static const msi_table rem_tables[] =
1729 {
1730  ADD_TABLE(rem_component),
1732  ADD_TABLE(rof_feature),
1733  ADD_TABLE(rem_feature_comp),
1734  ADD_TABLE(rem_file),
1735  ADD_TABLE(rem_install_exec_seq),
1736  ADD_TABLE(rof_media),
1738  ADD_TABLE(rem_remove_files),
1739 };
1740 
1741 static const msi_table mov_tables[] =
1742 {
1743  ADD_TABLE(cwd_component),
1745  ADD_TABLE(rof_feature),
1746  ADD_TABLE(ci2_feature_comp),
1747  ADD_TABLE(ci2_file),
1748  ADD_TABLE(install_exec_seq),
1749  ADD_TABLE(rof_media),
1751  ADD_TABLE(mov_move_file),
1752 };
1753 
1754 static const msi_table df_tables[] =
1755 {
1756  ADD_TABLE(rof_component),
1757  ADD_TABLE(df_directory),
1758  ADD_TABLE(rof_feature),
1759  ADD_TABLE(rof_feature_comp),
1760  ADD_TABLE(rof_file),
1761  ADD_TABLE(install_exec_seq),
1762  ADD_TABLE(rof_media),
1764  ADD_TABLE(df_duplicate_file),
1765 };
1766 
1767 static const msi_table wrv_tables[] =
1768 {
1769  ADD_TABLE(wrv_component),
1771  ADD_TABLE(wrv_feature),
1772  ADD_TABLE(wrv_feature_comp),
1773  ADD_TABLE(ci2_file),
1774  ADD_TABLE(install_exec_seq),
1775  ADD_TABLE(rof_media),
1777  ADD_TABLE(wrv_registry),
1778 };
1779 
1780 static const msi_table cf_tables[] =
1781 {
1782  ADD_TABLE(cf_component),
1783  ADD_TABLE(cf_directory),
1784  ADD_TABLE(cf_feature),
1785  ADD_TABLE(cf_feature_comp),
1786  ADD_TABLE(cf_file),
1787  ADD_TABLE(cf_create_folders),
1788  ADD_TABLE(cf_install_exec_seq),
1789  ADD_TABLE(media),
1791 };
1792 
1793 static const msi_table sss_tables[] =
1794 {
1795  ADD_TABLE(component),
1797  ADD_TABLE(feature),
1798  ADD_TABLE(feature_comp),
1799  ADD_TABLE(file),
1800  ADD_TABLE(sss_install_exec_seq),
1801  ADD_TABLE(sss_service_control),
1802  ADD_TABLE(media),
1804 };
1805 
1806 static const msi_table sds_tables[] =
1807 {
1808  ADD_TABLE(component),
1810  ADD_TABLE(feature),
1811  ADD_TABLE(feature_comp),
1812  ADD_TABLE(file),
1813  ADD_TABLE(sds_install_exec_seq),
1814  ADD_TABLE(service_control),
1815  ADD_TABLE(service_install),
1816  ADD_TABLE(media),
1818 };
1819 
1820 static const msi_table sis_tables[] =
1821 {
1822  ADD_TABLE(component),
1824  ADD_TABLE(feature),
1825  ADD_TABLE(feature_comp),
1826  ADD_TABLE(file),
1827  ADD_TABLE(sds_install_exec_seq),
1828  ADD_TABLE(service_install2),
1829  ADD_TABLE(media),
1831 };
1832 
1833 static const msi_table sr_tables[] =
1834 {
1835  ADD_TABLE(component),
1837  ADD_TABLE(feature),
1838  ADD_TABLE(feature_comp),
1839  ADD_TABLE(file),
1840  ADD_TABLE(sr_selfreg),
1841  ADD_TABLE(sr_install_exec_seq),
1842  ADD_TABLE(media),
1844 };
1845 
1846 static const msi_table font_tables[] =
1847 {
1848  ADD_TABLE(font_component),
1850  ADD_TABLE(font_feature),
1851  ADD_TABLE(font_feature_comp),
1852  ADD_TABLE(font_file),
1853  ADD_TABLE(font),
1854  ADD_TABLE(font_install_exec_seq),
1855  ADD_TABLE(font_media),
1857 };
1858 
1859 static const msi_table vp_tables[] =
1860 {
1861  ADD_TABLE(component),
1863  ADD_TABLE(feature),
1864  ADD_TABLE(feature_comp),
1865  ADD_TABLE(file),
1866  ADD_TABLE(vp_custom_action),
1867  ADD_TABLE(vp_install_exec_seq),
1868  ADD_TABLE(media),
1869  ADD_TABLE(vp_property)
1870 };
1871 
1872 static const msi_table odbc_tables[] =
1873 {
1874  ADD_TABLE(odbc_component),
1876  ADD_TABLE(odbc_feature),
1877  ADD_TABLE(odbc_feature_comp),
1878  ADD_TABLE(odbc_file),
1879  ADD_TABLE(odbc_driver),
1880  ADD_TABLE(odbc_translator),
1881  ADD_TABLE(odbc_datasource),
1882  ADD_TABLE(odbc_install_exec_seq),
1883  ADD_TABLE(odbc_media),
1885 };
1886 
1887 static const msi_table tl_tables[] =
1888 {
1889  ADD_TABLE(tl_component),
1891  ADD_TABLE(tl_feature),
1892  ADD_TABLE(tl_feature_comp),
1893  ADD_TABLE(tl_file),
1894  ADD_TABLE(tl_typelib),
1895  ADD_TABLE(tl_install_exec_seq),
1896  ADD_TABLE(media),
1898 };
1899 
1900 static const msi_table crs_tables[] =
1901 {
1902  ADD_TABLE(crs_component),
1904  ADD_TABLE(crs_feature),
1905  ADD_TABLE(crs_feature_comp),
1906  ADD_TABLE(crs_file),
1907  ADD_TABLE(crs_shortcut),
1908  ADD_TABLE(crs_install_exec_seq),
1909  ADD_TABLE(media),
1911 };
1912 
1913 static const msi_table pub_tables[] =
1914 {
1916  ADD_TABLE(pub_component),
1917  ADD_TABLE(pub_feature),
1918  ADD_TABLE(pub_feature_comp),
1919  ADD_TABLE(pub_file),
1920  ADD_TABLE(pub_publish_component),
1921  ADD_TABLE(pub_install_exec_seq),
1922  ADD_TABLE(media),
1924 };
1925 
1926 static const msi_table rd_tables[] =
1927 {
1929  ADD_TABLE(rd_component),
1930  ADD_TABLE(rd_feature),
1931  ADD_TABLE(rd_feature_comp),
1932  ADD_TABLE(rd_file),
1933  ADD_TABLE(rd_duplicate_file),
1934  ADD_TABLE(rd_install_exec_seq),
1935  ADD_TABLE(media),
1937 };
1938 
1939 static const msi_table rrv_tables[] =
1940 {
1942  ADD_TABLE(rrv_component),
1943  ADD_TABLE(rrv_feature),
1944  ADD_TABLE(rrv_feature_comp),
1945  ADD_TABLE(rrv_file),
1946  ADD_TABLE(rrv_registry),
1947  ADD_TABLE(rrv_remove_registry),
1948  ADD_TABLE(rrv_install_exec_seq),
1949  ADD_TABLE(media),
1951 };
1952 
1953 static const msi_table frp_tables[] =
1954 {
1956  ADD_TABLE(frp_component),
1957  ADD_TABLE(frp_feature),
1958  ADD_TABLE(frp_feature_comp),
1959  ADD_TABLE(frp_file),
1960  ADD_TABLE(frp_upgrade),
1961  ADD_TABLE(frp_custom_action),
1962  ADD_TABLE(frp_install_exec_seq),
1963  ADD_TABLE(media),
1965 };
1966 
1967 static const msi_table riv_tables[] =
1968 {
1970  ADD_TABLE(riv_component),
1971  ADD_TABLE(riv_feature),
1972  ADD_TABLE(riv_feature_comp),
1973  ADD_TABLE(riv_file),
1974  ADD_TABLE(riv_ini_file),
1975  ADD_TABLE(riv_remove_ini_file),
1976  ADD_TABLE(riv_install_exec_seq),
1977  ADD_TABLE(media),
1979 };
1980 
1981 static const msi_table res_tables[] =
1982 {
1984  ADD_TABLE(res_component),
1985  ADD_TABLE(res_feature),
1986  ADD_TABLE(res_feature_comp),
1987  ADD_TABLE(res_file),
1988  ADD_TABLE(res_environment),
1989  ADD_TABLE(res_install_exec_seq),
1990  ADD_TABLE(media),
1992 };
1993 
1994 static const msi_table rci_tables[] =
1995 {
1997  ADD_TABLE(rci_component),
1998  ADD_TABLE(rci_feature),
1999  ADD_TABLE(rci_feature_comp),
2000  ADD_TABLE(rci_file),
2001  ADD_TABLE(rci_appid),
2002  ADD_TABLE(rci_class),
2003  ADD_TABLE(rci_install_exec_seq),
2004  ADD_TABLE(media),
2006 };
2007 
2008 static const msi_table rei_tables[] =
2009 {
2011  ADD_TABLE(rei_component),
2012  ADD_TABLE(rei_feature),
2013  ADD_TABLE(rei_feature_comp),
2014  ADD_TABLE(rei_file),
2015  ADD_TABLE(rei_extension),
2016  ADD_TABLE(rei_verb),
2017  ADD_TABLE(rei_progid),
2018  ADD_TABLE(rei_install_exec_seq),
2019  ADD_TABLE(media),
2021 };
2022 
2023 static const msi_table rpi_tables[] =
2024 {
2026  ADD_TABLE(rpi_component),
2027  ADD_TABLE(rpi_feature),
2028  ADD_TABLE(rpi_feature_comp),
2029  ADD_TABLE(rpi_file),
2030  ADD_TABLE(rpi_appid),
2031  ADD_TABLE(rpi_class),
2032  ADD_TABLE(rpi_extension),
2033  ADD_TABLE(rpi_verb),
2034  ADD_TABLE(rpi_progid),
2035  ADD_TABLE(rpi_install_exec_seq),
2036  ADD_TABLE(media),
2038 };
2039 
2040 static const msi_table rmi_tables[] =
2041 {
2043  ADD_TABLE(rmi_component),
2044  ADD_TABLE(rmi_feature),
2045  ADD_TABLE(rmi_feature_comp),
2046  ADD_TABLE(rmi_file),
2047  ADD_TABLE(rmi_extension),
2048  ADD_TABLE(rmi_verb),
2049  ADD_TABLE(rmi_mime),
2050  ADD_TABLE(rmi_install_exec_seq),
2051  ADD_TABLE(media),
2053 };
2054 
2055 static const msi_table pa_tables[] =
2056 {
2058  ADD_TABLE(pa_component),
2059  ADD_TABLE(pa_feature),
2060  ADD_TABLE(pa_feature_comp),
2061  ADD_TABLE(pa_file),
2062  ADD_TABLE(pa_msi_assembly),
2063  ADD_TABLE(pa_msi_assembly_name),
2064  ADD_TABLE(pa_install_exec_seq),
2065  ADD_TABLE(media),
2067 };
2068 
2069 static const msi_table rep_tables[] =
2070 {
2072  ADD_TABLE(rep_component),
2073  ADD_TABLE(rep_feature),
2074  ADD_TABLE(rep_feature_comp),
2075  ADD_TABLE(rep_file),
2076  ADD_TABLE(rep_upgrade),
2077  ADD_TABLE(rep_property),
2078  ADD_TABLE(rep_install_exec_seq),
2079  ADD_TABLE(media)
2080 };
2081 
2082 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2084 {
2085  LONG ret;
2086  DWORD dwMaxSubkeyLen, dwMaxValueLen;
2087  DWORD dwMaxLen, dwSize;
2088  char szNameBuf[MAX_PATH], *lpszName = szNameBuf;
2089  HKEY hSubKey = hKey;
2090 
2091  if(lpszSubKey)
2092  {
2093  ret = RegOpenKeyExA(hKey, lpszSubKey, 0, access, &hSubKey);
2094  if (ret) return ret;
2095  }
2096 
2097  ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
2098  &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
2099  if (ret) goto cleanup;
2100 
2101  dwMaxSubkeyLen++;
2102  dwMaxValueLen++;
2103  dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
2104  if (dwMaxLen > sizeof(szNameBuf))
2105  {
2106  /* Name too big: alloc a buffer for it */
2107  if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen)))
2108  {
2110  goto cleanup;
2111  }
2112  }
2113 
2114  /* Recursively delete all the subkeys */
2115  while (TRUE)
2116  {
2117  dwSize = dwMaxLen;
2118  if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
2119  NULL, NULL, NULL)) break;
2120 
2121  ret = action_RegDeleteTreeA(hSubKey, lpszName, access);
2122  if (ret) goto cleanup;
2123  }
2124 
2125  if (lpszSubKey)
2126  {
2127  if (pRegDeleteKeyExA)
2128  ret = pRegDeleteKeyExA(hKey, lpszSubKey, access, 0);
2129  else
2130  ret = RegDeleteKeyA(hKey, lpszSubKey);
2131  }
2132  else
2133  while (TRUE)
2134  {
2135  dwSize = dwMaxLen;
2136  if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
2137  NULL, NULL, NULL, NULL)) break;
2138 
2139  ret = RegDeleteValueA(hKey, lpszName);
2140  if (ret) goto cleanup;
2141  }
2142 
2143 cleanup:
2144  if (lpszName != szNameBuf)
2145  HeapFree(GetProcessHeap(), 0, lpszName);
2146  if(lpszSubKey)
2147  RegCloseKey(hSubKey);
2148  return ret;
2149 }
2150 
2151 /* cabinet definitions */
2152 
2153 /* make the max size large so there is only one cab file */
2154 #define MEDIA_SIZE 0x7FFFFFFF
2155 #define FOLDER_THRESHOLD 900000
2156 
2157 /* the FCI callbacks */
2158 
2159 static void * CDECL mem_alloc(ULONG cb)
2160 {
2161  return HeapAlloc(GetProcessHeap(), 0, cb);
2162 }
2163 
2164 static void CDECL mem_free(void *memory)
2165 {
2167 }
2168 
2169 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
2170 {
2171  sprintf(pccab->szCab, pv, pccab->iCab);
2172  return TRUE;
2173 }
2174 
2175 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
2176 {
2177  return 0;
2178 }
2179 
2180 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
2181  BOOL fContinuation, void *pv)
2182 {
2183  return 0;
2184 }
2185 
2186 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
2187 {
2188  HANDLE handle;
2189  DWORD dwAccess = 0;
2190  DWORD dwShareMode = 0;
2191  DWORD dwCreateDisposition = OPEN_EXISTING;
2192 
2193  dwAccess = GENERIC_READ | GENERIC_WRITE;
2195 
2197  dwCreateDisposition = OPEN_EXISTING;
2198  else
2199  dwCreateDisposition = CREATE_NEW;
2200 
2201  handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
2202  dwCreateDisposition, 0, NULL);
2203 
2204  ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
2205 
2206  return (INT_PTR)handle;
2207 }
2208 
2209 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2210 {
2211  HANDLE handle = (HANDLE)hf;
2212  DWORD dwRead;
2213  BOOL res;
2214 
2215  res = ReadFile(handle, memory, cb, &dwRead, NULL);
2216  ok(res, "Failed to ReadFile\n");
2217 
2218  return dwRead;
2219 }
2220 
2221 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2222 {
2223  HANDLE handle = (HANDLE)hf;
2224  DWORD dwWritten;
2225  BOOL res;
2226 
2227  res = WriteFile(handle, memory, cb, &dwWritten, NULL);
2228  ok(res, "Failed to WriteFile\n");
2229 
2230  return dwWritten;
2231 }
2232 
2233 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
2234 {
2235  HANDLE handle = (HANDLE)hf;
2236  ok(CloseHandle(handle), "Failed to CloseHandle\n");
2237 
2238  return 0;
2239 }
2240 
2241 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
2242 {
2243  HANDLE handle = (HANDLE)hf;
2244  DWORD ret;
2245 
2246  ret = SetFilePointer(handle, dist, NULL, seektype);
2247  ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
2248 
2249  return ret;
2250 }
2251 
2252 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
2253 {
2254  BOOL ret = DeleteFileA(pszFile);
2255  ok(ret, "Failed to DeleteFile %s\n", pszFile);
2256 
2257  return 0;
2258 }
2259 
2260 static void init_functionpointers(void)
2261 {
2262  HMODULE hmsi = GetModuleHandleA("msi.dll");
2263  HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2264  HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2265 
2266 #define GET_PROC(mod, func) \
2267  p ## func = (void*)GetProcAddress(mod, #func); \
2268  if(!p ## func) \
2269  trace("GetProcAddress(%s) failed\n", #func);
2270 
2276 
2277  GET_PROC(hadvapi32, CheckTokenMembership);
2278  GET_PROC(hadvapi32, ConvertSidToStringSidA);
2279  GET_PROC(hadvapi32, OpenProcessToken);
2280  GET_PROC(hadvapi32, RegDeleteKeyExA)
2282 
2283  hsrclient = LoadLibraryA("srclient.dll");
2286 
2287 #undef GET_PROC
2288 }
2289 
2291 {
2293  PSID Group = NULL;
2294  BOOL IsInGroup;
2295  HANDLE token;
2296 
2297  if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
2298 
2300  DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
2301  !pCheckTokenMembership(NULL, Group, &IsInGroup))
2302  {
2303  trace("Could not check if the current user is an administrator\n");
2304  FreeSid(Group);
2305  return FALSE;
2306  }
2307  FreeSid(Group);
2308 
2309  if (!IsInGroup)
2310  {
2311  /* Only administrators have enough privileges for these tests */
2312  return TRUE;
2313  }
2314 
2315  if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
2316  {
2317  BOOL ret;
2319  DWORD size;
2320 
2322  CloseHandle(token);
2323  return (ret && type == TokenElevationTypeLimited);
2324  }
2325  return FALSE;
2326 }
2327 
2328 static char *get_user_sid(void)
2329 {
2330  HANDLE token;
2331  DWORD size = 0;
2332  TOKEN_USER *user;
2333  char *usersid = NULL;
2334 
2335  if (!pConvertSidToStringSidA)
2336  {
2337  win_skip("ConvertSidToStringSidA is not available\n");
2338  return NULL;
2339  }
2342 
2343  user = HeapAlloc(GetProcessHeap(), 0, size);
2345  pConvertSidToStringSidA(user->User.Sid, &usersid);
2346  HeapFree(GetProcessHeap(), 0, user);
2347 
2348  CloseHandle(token);
2349  return usersid;
2350 }
2351 
2352 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
2353 {
2354  LPSTR tempname;
2355 
2356  tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
2357  GetTempFileNameA(".", "xx", 0, tempname);
2358 
2359  if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2360  {
2361  lstrcpyA(pszTempName, tempname);
2362  HeapFree(GetProcessHeap(), 0, tempname);
2363  return TRUE;
2364  }
2365 
2366  HeapFree(GetProcessHeap(), 0, tempname);
2367 
2368  return FALSE;
2369 }
2370 
2371 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
2372  USHORT *pattribs, int *err, void *pv)
2373 {
2376  HANDLE handle;
2377  DWORD attrs;
2378  BOOL res;
2379 
2382 
2383  ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2384 
2386  ok(res, "Expected GetFileInformationByHandle to succeed\n");
2387 
2389  FileTimeToDosDateTime(&filetime, pdate, ptime);
2390 
2391  attrs = GetFileAttributesA(pszName);
2392  ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2393 
2394  return (INT_PTR)handle;
2395 }
2396 
2397 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
2398 {
2399  char path[MAX_PATH];
2400  char filename[MAX_PATH];
2401 
2403  lstrcatA(path, "\\");
2404  lstrcatA(path, file);
2405 
2407 
2408  return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
2410 }
2411 
2412 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
2413 {
2414  ZeroMemory(pCabParams, sizeof(CCAB));
2415 
2416  pCabParams->cb = max_size;
2417  pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2418  pCabParams->setID = 0xbeef;
2419  pCabParams->iCab = 1;
2420  lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2421  lstrcatA(pCabParams->szCabPath, "\\");
2422  lstrcpyA(pCabParams->szCab, name);
2423 }
2424 
2425 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
2426 {
2427  CCAB cabParams;
2428  LPCSTR ptr;
2429  HFCI hfci;
2430  ERF erf;
2431  BOOL res;
2432 
2433  set_cab_parameters(&cabParams, name, max_size);
2434 
2437  get_temp_file, &cabParams, NULL);
2438 
2439  ok(hfci != NULL, "Failed to create an FCI context\n");
2440 
2441  ptr = files;
2442  while (*ptr)
2443  {
2444  res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2445  ok(res, "Failed to add file: %s\n", ptr);
2446  ptr += lstrlenA(ptr) + 1;
2447  }
2448 
2450  ok(res, "Failed to flush the cabinet\n");
2451 
2452  res = FCIDestroy(hfci);
2453  ok(res, "Failed to destroy the cabinet\n");
2454 }
2455 
2456 static BOOL get_user_dirs(void)
2457 {
2458  HKEY hkey;
2459  DWORD type, size;
2460 
2462  "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey))
2463  return FALSE;
2464 
2465  size = MAX_PATH;
2466  if (RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size))
2467  {
2468  RegCloseKey(hkey);
2469  return FALSE;
2470  }
2471 
2472  RegCloseKey(hkey);
2473  return TRUE;
2474 }
2475 
2476 static BOOL get_system_dirs(void)
2477 {
2478  HKEY hkey;
2479  DWORD type, size;
2480 
2482  "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
2483  return FALSE;
2484 
2485  size = MAX_PATH;
2486  if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
2487  RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size))
2488  {
2489  RegCloseKey(hkey);
2490  return FALSE;
2491  }
2492 
2493  size = MAX_PATH;
2494  if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
2495  RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size))
2496  {
2497  RegCloseKey(hkey);
2498  return FALSE;
2499  }
2500 
2501  RegCloseKey(hkey);
2502 
2504  return FALSE;
2505 
2506  return TRUE;
2507 }
2508 
2510 {
2511  HANDLE file;
2512  DWORD written;
2513 
2515  if (file == INVALID_HANDLE_VALUE)
2516  return;
2517 
2518  WriteFile(file, data, strlen(data), &written, NULL);
2519 
2520  if (size)
2521  {
2523  SetEndOfFile(file);
2524  }
2525 
2526  CloseHandle(file);
2527 }
2528 
2529 #define create_file(name, size) create_file_data(name, name, size)
2530 
2531 static void create_test_files(void)
2532 {
2533  CreateDirectoryA("msitest", NULL);
2534  create_file("msitest\\one.txt", 100);
2535  CreateDirectoryA("msitest\\first", NULL);
2536  create_file("msitest\\first\\two.txt", 100);
2537  CreateDirectoryA("msitest\\second", NULL);
2538  create_file("msitest\\second\\three.txt", 100);
2539 
2540  create_file("four.txt", 100);
2541  create_file("five.txt", 100);
2542  create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2543 
2544  create_file("msitest\\filename", 100);
2545  create_file("msitest\\service.exe", 100);
2546  create_file("msitest\\service2.exe", 100);
2547 
2548  DeleteFileA("four.txt");
2549  DeleteFileA("five.txt");
2550 }
2551 
2552 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
2553 {
2554  CHAR path[MAX_PATH];
2555 
2557  lstrcatA(path, "\\");
2558  lstrcatA(path, rel_path);
2559 
2560  if (is_file)
2561  return DeleteFileA(path);
2562  else
2563  return RemoveDirectoryA(path);
2564 }
2565 
2566 static void delete_test_files(void)
2567 {
2568  DeleteFileA("msitest.msi");
2569  DeleteFileA("msitest.cab");
2570  DeleteFileA("msitest\\second\\three.txt");
2571  DeleteFileA("msitest\\first\\two.txt");
2572  DeleteFileA("msitest\\one.txt");
2573  DeleteFileA("msitest\\service.exe");
2574  DeleteFileA("msitest\\service2.exe");
2575  DeleteFileA("msitest\\filename");
2576  RemoveDirectoryA("msitest\\second");
2577  RemoveDirectoryA("msitest\\first");
2578  RemoveDirectoryA("msitest");
2579 }
2580 
2581 static void write_file(const CHAR *filename, const char *data, int data_size)
2582 {
2583  DWORD size;
2585  WriteFile(hf, data, data_size, &size, NULL);
2586  CloseHandle(hf);
2587 }
2588 
2589 static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template)
2590 {
2591  MSIHANDLE summary;
2592  UINT r;
2593 
2594  r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
2595  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2596 
2597  r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template);
2598  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2599 
2601  "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2602  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2603 
2605  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2606 
2607  r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
2608  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2609 
2610  r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
2611  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2612 
2613  /* write the summary changes back to the stream */
2614  r = MsiSummaryInfoPersist(summary);
2615  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2616 
2617  MsiCloseHandle(summary);
2618 }
2619 
2620 #define create_database(name, tables, num_tables) \
2621  create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2622 
2623 #define create_database_template(name, tables, num_tables, version, template) \
2624  create_database_wordcount(name, tables, num_tables, version, 0, template);
2625 
2627  int num_tables, INT version, INT wordcount,
2628  const char *template)
2629 {
2630  MSIHANDLE db;
2631  UINT r;
2632  WCHAR *nameW;
2633  int j, len;
2634 
2635  len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
2636  if (!(nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return;
2637  MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
2638 
2640  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2641 
2642  /* import the tables into the database */
2643  for (j = 0; j < num_tables; j++)
2644  {
2645  const msi_table *table = &tables[j];
2646 
2647  write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2648 
2649  r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2650  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2651 
2652  DeleteFileA(table->filename);
2653  }
2654 
2655  write_msi_summary_info(db, version, wordcount, template);
2656 
2657  r = MsiDatabaseCommit(db);
2658  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2659 
2660  MsiCloseHandle(db);
2661  HeapFree( GetProcessHeap(), 0, nameW );
2662 }
2663 
2665 {
2666  RESTOREPOINTINFOA spec;
2667 
2668  spec.dwEventType = event_type;
2670  spec.llSequenceNumber = status->llSequenceNumber;
2671  lstrcpyA(spec.szDescription, "msitest restore point");
2672 
2673  return pSRSetRestorePointA(&spec, status);
2674 }
2675 
2676 static void remove_restore_point(DWORD seq_number)
2677 {
2678  DWORD res;
2679 
2680  res = pSRRemoveRestorePoint(seq_number);
2681  if (res != ERROR_SUCCESS)
2682  trace("Failed to remove the restore point : %08x\n", res);
2683 }
2684 
2686 {
2687  if (pRegDeleteKeyExA)
2688  return pRegDeleteKeyExA( key, subkey, access, 0 );
2689  return RegDeleteKeyA( key, subkey );
2690 }
2691 
2693 {
2695 }
2696 
2698 {
2699  CHAR path[MAX_PATH];
2700 
2702  lstrcatA(path, "\\");
2703  lstrcatA(path, file);
2704 
2705  return file_exists(path);
2706 }
2707 
2708 static void delete_pfmsitest_files(void)
2709 {
2710  SHFILEOPSTRUCTA shfl;
2711  CHAR path[MAX_PATH+11];
2712 
2714  lstrcatA(path, "\\msitest\\*");
2715  path[strlen(path) + 1] = '\0';
2716 
2717  shfl.hwnd = NULL;
2718  shfl.wFunc = FO_DELETE;
2719  shfl.pFrom = path;
2720  shfl.pTo = NULL;
2722 
2723  SHFileOperationA(&shfl);
2724 
2726  lstrcatA(path, "\\msitest");
2728 }
2729 
2730 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, DWORD line)
2731 {
2732  char val[MAX_PATH];
2733  DWORD size, type;
2734  LONG res;
2735 
2736  size = MAX_PATH;
2737  val[0] = '\0';
2738  res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)val, &size);
2739 
2740  if (res != ERROR_SUCCESS ||
2741  (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_MULTI_SZ))
2742  {
2743  ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2744  return;
2745  }
2746 
2747  if (!expected)
2748  ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val);
2749  else
2750  {
2751  if (bcase)
2752  ok_(__FILE__, line)(!lstrcmpA(val, expected), "Expected %s, got %s\n", expected, val);
2753  else
2754  ok_(__FILE__, line)(!lstrcmpiA(val, expected), "Expected %s, got %s\n", expected, val);
2755  }
2756 }
2757 
2759 {
2760  DWORD val, size, type;
2761  LONG res;
2762 
2763  size = sizeof(DWORD);
2764  res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2765 
2766  if (res != ERROR_SUCCESS || type != REG_DWORD)
2767  {
2768  ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2769  return;
2770  }
2771 
2772  ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val);
2773 }
2774 
2777 {
2778  DWORD val, size, type;
2779  LONG res;
2780 
2781  size = sizeof(DWORD);
2782  res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2783 
2784  if (res != ERROR_SUCCESS || type != REG_DWORD)
2785  {
2786  ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2787  return;
2788  }
2789 
2790  ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3 || val == expected4,
2791  "Expected %d, %d, %d or %d, got %d\n", expected1, expected2, expected3, expected4, val);
2792 }
2793 
2796 {
2797  DWORD val, size, type;
2798  LONG res;
2799 
2800  size = sizeof(DWORD);
2801  res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2802 
2803  if (res != ERROR_SUCCESS || type != REG_DWORD)
2804  {
2805  ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2806  return;
2807  }
2808 
2809  ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3 || val == expected4 ||
2810  val == expected5,
2811  "Expected %d, %d, %d, %d or %d, got %d\n", expected1, expected2, expected3, expected4, expected5, val);
2812 }
2813 
2814 #define CHECK_REG_STR(prodkey, name, expected) \
2815  check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2816 
2817 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2818  do { \
2819  check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2820  RegDeleteValueA(prodkey, name); \
2821  } while(0)
2822 
2823 #define CHECK_REG_ISTR(prodkey, name, expected) \
2824  check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2825 
2826 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2827  do { \
2828  check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2829  RegDeleteValueA(prodkey, name); \
2830  } while(0)
2831 
2832 #define CHECK_REG_DWORD(prodkey, name, expected) \
2833  check_reg_dword(prodkey, name, expected, __LINE__);
2834 
2835 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2836  do { \
2837  check_reg_dword(prodkey, name, expected, __LINE__); \
2838  RegDeleteValueA(prodkey, name); \
2839  } while(0)
2840 
2841 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
2842  check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
2843 
2844 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
2845  do { \
2846  check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
2847  RegDeleteValueA(prodkey, name); \
2848  } while(0)
2849 
2850 #define CHECK_REG_DWORD4(prodkey, name, expected1, expected2, expected3, expected4) \
2851  check_reg_dword4(prodkey, name, expected1, expected2, expected3, expected4, __LINE__);
2852 
2853 #define CHECK_DEL_REG_DWORD5(prodkey, name, expected1, expected2, expected3, expected4 ,expected5) \
2854  do { \
2855  check_reg_dword5(prodkey, name, expected1, expected2, expected3, expected4, expected5, __LINE__); \
2856  RegDeleteValueA(prodkey, name); \
2857  } while(0)
2858 
2860 {
2861  SYSTEMTIME systime;
2862 
2863  static const char date_fmt[] = "%d%02d%02d";
2864  GetLocalTime(&systime);
2865  sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
2866 }
2867 
2868 static void test_register_product(void)
2869 {
2870  UINT r;
2871  LONG res;
2872  HKEY hkey, props, usage;
2873  LPSTR usersid;
2874  char date[MAX_PATH], temp[MAX_PATH], keypath[MAX_PATH], path[MAX_PATH];
2875  DWORD size, type;
2877 
2878  static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2879  "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2880  static const CHAR uninstall_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2881  "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2882  static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2883  "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2884  static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2885  "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2886  static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2887  "\\51AAE0C44620A5E4788506E91F249BD2";
2888 
2889  if (is_process_limited())
2890  {
2891  skip("process is limited\n");
2892  return;
2893  }
2894 
2895  if (!(usersid = get_user_sid()))
2896  return;
2897 
2898  get_date_str(date);
2900 
2901  CreateDirectoryA("msitest", NULL);
2902  create_file("msitest\\maximus", 500);
2903 
2904  create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2905 
2906  if (is_wow64)
2908 
2910 
2911  /* RegisterProduct */
2912  r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
2914  {
2915  skip("Not enough rights to perform tests\n");
2916  goto error;
2917  }
2918  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2919  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2920  ok(delete_pf("msitest", FALSE), "Directory not created\n");
2921 
2922  res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
2923  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2924 
2925  if (is_64bit)
2926  {
2927  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
2928  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2929  }
2930  else
2931  {
2932  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
2933  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2934  }
2935 
2936  CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2937  CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2938  CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2939  CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2940  CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2941  CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2942  CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2943  CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2944  CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2945  CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2946  CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2947  CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2948  CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2949  CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2950  CHECK_DEL_REG_STR(hkey, "Size", NULL);
2951  CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2952  CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2953  CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2954  CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2955  CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2956  CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2957  CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2958  todo_wine
2959  {
2960  CHECK_DEL_REG_DWORD5(hkey, "EstimatedSize", 12, -12, 4, 10, 24);
2961  }
2962 
2963  delete_key(hkey, "", access);
2964  RegCloseKey(hkey);
2965 
2966  sprintf(keypath, userdata, usersid);
2967  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2968  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2969 
2970  res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
2971  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2972 
2973  size = sizeof(path);
2974  RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2975  DeleteFileA(path);
2976  RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2977 
2978  CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2979  CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2980  CHECK_DEL_REG_STR(props, "InstallDate", date);
2981  CHECK_DEL_REG_STR(props, "InstallSource", temp);
2982  CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2983  CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2984  CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2985  CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
2986  CHECK_DEL_REG_STR(props, "Comments", NULL);
2987  CHECK_DEL_REG_STR(props, "Contact", NULL);
2988  CHECK_DEL_REG_STR(props, "HelpLink", NULL);
2989  CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
2990  CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
2991  CHECK_DEL_REG_STR(props, "Readme", NULL);
2992  CHECK_DEL_REG_STR(props, "Size", NULL);
2993  CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
2994  CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
2995  CHECK_DEL_REG_DWORD(props, "Language", 1033);
2996  CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2997  CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2998  CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2999  CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
3000  todo_wine
3001  {
3002  CHECK_DEL_REG_DWORD5(props, "EstimatedSize", 12, -12, 4, 10, 24);
3003  }
3004 
3005  delete_key(props, "", access);
3006  RegCloseKey(props);
3007 
3008  res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
3009  todo_wine
3010  {
3011  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3012  }
3013 
3014  delete_key(usage, "", access);
3015  RegCloseKey(usage);
3016  delete_key(hkey, "", access);
3017  RegCloseKey(hkey);
3018 
3019  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
3020  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3021 
3022  CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
3023 
3024  delete_key(hkey, "", access);
3025  RegCloseKey(hkey);
3026 
3027  /* RegisterProduct, machine */
3028  r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1");
3029  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3030  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3031  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3032 
3033  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, access, &hkey);
3034  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3035 
3036  if (is_64bit)
3037  {
3038  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
3039  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3040  }
3041  else
3042  {
3043  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
3044  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3045  }
3046 
3047  CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
3048  CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
3049  CHECK_DEL_REG_STR(hkey, "InstallDate", date);
3050  CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
3051  CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3052  CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
3053  CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3054  CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
3055  CHECK_DEL_REG_STR(hkey, "Comments", NULL);
3056  CHECK_DEL_REG_STR(hkey, "Contact", NULL);
3057  CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
3058  CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
3059  CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
3060  CHECK_DEL_REG_STR(hkey, "Readme", NULL);
3061  CHECK_DEL_REG_STR(hkey, "Size", NULL);
3062  CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
3063  CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
3064  CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
3065  CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
3066  CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
3067  CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
3068  CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
3069  todo_wine
3070  {
3071  CHECK_DEL_REG_DWORD5(hkey, "EstimatedSize", 12, -12, 4, 10, 24);
3072  }
3073 
3074  delete_key(hkey, "", access);
3075  RegCloseKey(hkey);
3076 
3077  sprintf(keypath, userdata, "S-1-5-18");
3078  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3079  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3080 
3081  res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
3082  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3083 
3084  size = sizeof(path);
3085  RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
3086  DeleteFileA(path);
3087  RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
3088 
3089  CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
3090  CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
3091  CHECK_DEL_REG_STR(props, "InstallDate", date);
3092  CHECK_DEL_REG_STR(props, "InstallSource", temp);
3093  CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3094  CHECK_DEL_REG_STR(props, "Publisher", "Wine");
3095  CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3096  CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
3097  CHECK_DEL_REG_STR(props, "Comments", NULL);
3098  CHECK_DEL_REG_STR(props, "Contact", NULL);
3099  CHECK_DEL_REG_STR(props, "HelpLink", NULL);
3100  CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
3101  CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
3102  CHECK_DEL_REG_STR(props, "Readme", NULL);
3103  CHECK_DEL_REG_STR(props, "Size", NULL);
3104  CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
3105  CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
3106  CHECK_DEL_REG_DWORD(props, "Language", 1033);
3107  CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
3108  CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
3109  CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
3110  CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
3111  todo_wine
3112  {
3113  CHECK_DEL_REG_DWORD5(props, "EstimatedSize", 12, -12, 4, 10, 24);
3114  }
3115 
3116  delete_key(props, "", access);
3117  RegCloseKey(props);
3118 
3119  res = RegOpenKeyExA(hkey, "Usage", 0, access, &usage);
3120  todo_wine
3121  {
3122  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3123  }
3124 
3125  delete_key(usage, "", access);
3126  RegCloseKey(usage);
3127  delete_key(hkey, "", access);
3128  RegCloseKey(hkey);
3129 
3130  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, access, &hkey);
3131  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3132 
3133  CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
3134 
3135  delete_key(hkey, "", access);
3136  RegCloseKey(hkey);
3137 
3138 error:
3140  DeleteFileA("msitest\\maximus");
3141  RemoveDirectoryA("msitest");
3142  HeapFree(GetProcessHeap(), 0, usersid);
3143 }
3144 
3145 static void test_publish_product(void)
3146 {
3147  static const char prodpath[] =
3148  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3149  "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3150  static const char cuprodpath[] =
3151  "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3152  static const char cuupgrades[] =
3153  "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3154  static const char badprod[] =
3155  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
3156  "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3157  static const char machprod[] =
3158  "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3159  static const char machup[] =
3160  "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3161  UINT r;
3162  LONG res;
3163  LPSTR usersid;
3164  HKEY sourcelist, net, props;
3165  HKEY hkey, patches, media;
3166  CHAR keypath[MAX_PATH];
3167  CHAR temp[MAX_PATH];
3168  CHAR path[MAX_PATH];
3169  BOOL old_installer = FALSE;
3171 
3172  if (is_process_limited())
3173  {
3174  skip("process is limited\n");
3175  return;
3176  }
3177 
3178  if (!(usersid = get_user_sid()))
3179  return;
3180 
3182 
3183  CreateDirectoryA("msitest", NULL);
3184  create_file("msitest\\maximus", 500);
3185 
3186  create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3187 
3188  if (is_wow64)
3190 
3192 
3193  /* PublishProduct, current user */
3194  r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
3196  {
3197  skip("Not enough rights to perform tests\n");
3198  goto error;
3199  }
3200  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3201  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3202  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3203 
3204  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
3205  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3206 
3207  sprintf(keypath, prodpath, usersid);
3208  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3209  if (res == ERROR_FILE_NOT_FOUND)
3210  {
3211  res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
3212  if (res == ERROR_SUCCESS)
3213  {
3214  win_skip("Windows Installer < 3.0 detected\n");
3215  RegCloseKey(hkey);
3216  old_installer = TRUE;
3217  goto currentuser;
3218  }
3219  else
3220  {
3221  win_skip("Install failed, no need to continue\n");
3222  return;
3223  }
3224  }
3225  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3226 
3227  res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
3228  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3229 
3230  res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
3231  todo_wine
3232  {
3233  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3234  CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
3235  }
3236 
3237  delete_key(patches, "", access);
3238  RegCloseKey(patches);
3239  delete_key(hkey, "", access);
3240  RegCloseKey(hkey);
3241 
3242 currentuser:
3243  res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
3244  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3245 
3246  CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
3247  CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3248  CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
3249  CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
3250  if (!old_installer)
3251  CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
3252  CHECK_DEL_REG_DWORD(hkey, "Assignment", 0);
3253  CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
3254  CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
3255  CHECK_DEL_REG_STR(hkey, "Clients", ":");
3256 
3257  res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
3258  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3259 
3260  lstrcpyA(path, "n;1;");
3261  lstrcatA(path, temp);
3262  CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
3263  CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
3264 
3265  res = RegOpenKeyA(sourcelist, "Net", &net);
3266  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3267 
3268  CHECK_DEL_REG_STR(net, "1", temp);
3269 
3270  RegDeleteKeyA(net, "");
3271  RegCloseKey(net);
3272 
3273  res = RegOpenKeyA(sourcelist, "Media", &media);
3274  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3275 
3276  CHECK_DEL_REG_STR(media, "1", "DISK1;");
3277 
3278  RegDeleteKeyA(media, "");
3279  RegCloseKey(media);
3280  RegDeleteKeyA(sourcelist, "");
3281  RegCloseKey(sourcelist);
3282  RegDeleteKeyA(hkey, "");
3283  RegCloseKey(hkey);
3284 
3285  res = RegOpenKeyA(HKEY_CURRENT_USER, cuupgrades, &hkey);
3286  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3287 
3288  CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
3289 
3290  RegDeleteKeyA(hkey, "");
3291  RegCloseKey(hkey);
3292 
3293  /* PublishProduct, machine */
3294  r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3295  if (old_installer)
3296  goto machprod;
3297  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3298  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3299  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3300 
3301  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
3302  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3303 
3304  sprintf(keypath, prodpath, "S-1-5-18");
3305  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3306  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3307 
3308  res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
3309  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3310 
3311  res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
3312  todo_wine
3313  {
3314  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3315  CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
3316  }
3317 
3318  delete_key(patches, "", access);
3319  RegCloseKey(patches);
3320  delete_key(hkey, "", access);
3321  RegCloseKey(hkey);
3322 
3323 machprod:
3324  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machprod, 0, access, &hkey);
3325  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3326 
3327  CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
3328  CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3329  CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
3330  CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
3331  if (!old_installer)
3332  CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
3333  todo_wine CHECK_DEL_REG_DWORD(hkey, "Assignment", 1);
3334  CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
3335  CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
3336  CHECK_DEL_REG_STR(hkey, "Clients", ":");
3337 
3338  res = RegOpenKeyExA(hkey, "SourceList", 0, access, &sourcelist);
3339  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3340 
3341  lstrcpyA(path, "n;1;");
3342  lstrcatA(path, temp);
3343  CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
3344  CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
3345 
3346  res = RegOpenKeyExA(sourcelist, "Net", 0, access, &net);
3347  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3348 
3349  CHECK_DEL_REG_STR(net, "1", temp);
3350 
3351  res = delete_key(net, "", access);
3352  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3353  RegCloseKey(net);
3354 
3355  res = RegOpenKeyExA(sourcelist, "Media", 0, access, &media);
3356  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3357 
3358  CHECK_DEL_REG_STR(media, "1", "DISK1;");
3359 
3360  res = delete_key(media, "", access);
3361  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3362  RegCloseKey(media);
3363  res = delete_key(sourcelist, "", access);
3364  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3365  RegCloseKey(sourcelist);
3366  res = delete_key(hkey, "", access);
3367  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3368  RegCloseKey(hkey);
3369 
3370  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machup, 0, access, &hkey);
3371  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3372 
3373  CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
3374 
3375  res = delete_key(hkey, "", access);
3376  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3377  RegCloseKey(hkey);
3378 
3379 error:
3381  DeleteFileA("msitest\\maximus");
3382  RemoveDirectoryA("msitest");
3383  HeapFree(GetProcessHeap(), 0, usersid);
3384 }
3385 
3386 static void test_publish_features(void)
3387 {
3388  static const char cupath[] =
3389  "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3390  static const char udfeatpath[] =
3391  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3392  "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3393  static const char udpridpath[] =
3394  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3395  "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3396  static const char featkey[] =
3397  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3398  static const char classfeat[] =
3399  "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3400  UINT r;
3401  LONG res;
3402  HKEY hkey;
3403  LPSTR usersid;
3404  CHAR keypath[MAX_PATH];
3406 
3407  if (is_process_limited())
3408  {
3409  skip("process is limited\n");
3410  return;
3411  }
3412 
3413  if (!(usersid = get_user_sid()))
3414  return;
3415 
3416  CreateDirectoryA("msitest", NULL);
3417  create_file("msitest\\maximus", 500);
3418 
3419  create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3420 
3421  if (is_wow64)
3423 
3425 
3426  /* PublishFeatures, current user */
3427  r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
3429  {
3430  skip("Not enough rights to perform tests\n");
3431  goto error;
3432  }
3433  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3434  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3435  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3436 
3437  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3438  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3439 
3440  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3441  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3442 
3443  res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3444  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3445 
3446  CHECK_REG_STR(hkey, "feature", "");
3447  CHECK_REG_STR(hkey, "montecristo", "");
3448 
3449  RegDeleteValueA(hkey, "feature");
3450  RegDeleteValueA(hkey, "montecristo");
3451  delete_key(hkey, "", access);
3452  RegCloseKey(hkey);
3453 
3454  sprintf(keypath, udfeatpath, usersid);
3455  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3456  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3457 
3458  CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3459  CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3460 
3461  RegDeleteValueA(hkey, "feature");
3462  RegDeleteValueA(hkey, "montecristo");
3463  delete_key(hkey, "", access);
3464  RegCloseKey(hkey);
3465  sprintf(keypath, udpridpath, usersid);
3467 
3468  /* PublishFeatures, machine */
3469  r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
3470  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3471  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3472  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3473 
3474  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3475  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3476 
3477  res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3478  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3479  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3480  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3481 
3482  CHECK_REG_STR(hkey, "feature", "");
3483  CHECK_REG_STR(hkey, "montecristo", "");
3484 
3485  RegDeleteValueA(hkey, "feature");
3486  RegDeleteValueA(hkey, "montecristo");
3487  delete_key(hkey, "", access);
3488  RegCloseKey(hkey);
3489 
3490  sprintf(keypath, udfeatpath, "S-1-5-18");
3491  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3492  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3493 
3494  CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3495  CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3496 
3497  RegDeleteValueA(hkey, "feature");
3498  RegDeleteValueA(hkey, "montecristo");
3499  delete_key(hkey, "", access);
3500  RegCloseKey(hkey);
3501  sprintf(keypath, udpridpath, "S-1-5-18");
3503 
3504 error:
3506  DeleteFileA("msitest\\maximus");
3507  RemoveDirectoryA("msitest");
3508  HeapFree(GetProcessHeap(), 0, usersid);
3509 }
3510 
3512 {
3513  DWORD len = 0;
3514  LPSTR val;
3515  LONG r;
3516 
3517  r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
3518  if (r != ERROR_SUCCESS)
3519  return NULL;
3520 
3521  len += sizeof (WCHAR);
3522  val = HeapAlloc(GetProcessHeap(), 0, len);
3523  if (!val) return NULL;
3524  val[0] = 0;
3525  RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len);
3526  return val;
3527 }
3528 
3529 static void get_owner_company(LPSTR *owner, LPSTR *company)
3530 {
3531  LONG res;
3532  HKEY hkey;
3534 
3535  *owner = *company = NULL;
3536 
3537  if (is_wow64)
3539 
3541  "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
3542  if (res == ERROR_SUCCESS)
3543  {
3544  *owner = reg_get_val_str(hkey, "DefName");
3545  *company = reg_get_val_str(hkey, "DefCompany");
3546  RegCloseKey(hkey);
3547  }
3548 
3549  if (!*owner || !*company)
3550  {
3552  "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
3553  if (res == ERROR_SUCCESS)
3554  {
3555  *owner = reg_get_val_str(hkey, "RegisteredOwner");
3556  *company = reg_get_val_str(hkey, "RegisteredOrganization");
3557  RegCloseKey(hkey);
3558  }
3559  }
3560 
3561  if (!*owner || !*company)
3562  {
3564  "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
3565  if (res == ERROR_SUCCESS)
3566  {
3567  *owner = reg_get_val_str(hkey, "RegisteredOwner");
3568  *company = reg_get_val_str(hkey, "RegisteredOrganization");
3569  RegCloseKey(hkey);
3570  }
3571  }
3572 }
3573 
3574 static void test_register_user(void)
3575 {
3576  UINT r;
3577  LONG res;
3578  HKEY props;
3579  LPSTR usersid;
3580  LPSTR owner, company;
3581  CHAR keypath[MAX_PATH];
3583 
3584  static const CHAR keypropsfmt[] =
3585  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3586  "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3587  static const CHAR keypridfmt[] =
3588  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3589  "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3590 
3591  if (is_process_limited())
3592  {
3593  skip("process is limited\n");
3594  return;
3595  }
3596 
3597  if (!(usersid = get_user_sid()))
3598  return;
3599 
3600  get_owner_company(&owner, &company);
3601 
3602  CreateDirectoryA("msitest", NULL);
3603  create_file("msitest\\maximus", 500);
3604 
3605  create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3606 
3607  if (is_wow64)
3609 
3611 
3612  /* RegisterUser, per-user */
3613  r = MsiInstallProductA(msifile, "REGISTER_USER=1");
3615  {
3616  skip("Not enough rights to perform tests\n");
3617  goto error;
3618  }
3619  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3620  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3621  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3622 
3623  sprintf(keypath, keypropsfmt, usersid);
3624  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3625  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3626 
3627  CHECK_REG_STR(props, "ProductID", "none");
3628  CHECK_REG_STR(props, "RegCompany", company);
3629  CHECK_REG_STR(props, "RegOwner", owner);
3630 
3631  RegDeleteValueA(props, "ProductID");
3632  RegDeleteValueA(props, "RegCompany");
3633  RegDeleteValueA(props, "RegOwner");
3634  delete_key(props, "", access);
3635  RegCloseKey(props);
3636  sprintf(keypath, keypridfmt, usersid);
3638 
3639  /* RegisterUser, machine */
3640  r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
3641  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3642  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3643  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3644 
3645  sprintf(keypath, keypropsfmt, "S-1-5-18");
3646  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3647  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3648 
3649  CHECK_REG_STR(props, "ProductID", "none");
3650  CHECK_REG_STR(props, "RegCompany", company);
3651  CHECK_REG_STR(props, "RegOwner", owner);
3652 
3653  RegDeleteValueA(props, "ProductID");
3654  RegDeleteValueA(props, "RegCompany");
3655  RegDeleteValueA(props, "RegOwner");
3656  delete_key(props, "", access);
3657  RegCloseKey(props);
3658  sprintf(keypath, keypridfmt, "S-1-5-18");
3660 
3661 error:
3662  HeapFree(GetProcessHeap(), 0, company);
3663  HeapFree(GetProcessHeap(), 0, owner);
3664 
3666  DeleteFileA("msitest\\maximus");
3667  RemoveDirectoryA("msitest");
3668  LocalFree(usersid);
3669 }
3670 
3671 static void test_process_components(void)
3672 {
3673  static const char keyfmt[] =
3674  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3675  static const char compkey[] =
3676  "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3677  UINT r;
3678  LONG res;
3679  DWORD size;
3680  HKEY comp, hkey;
3681  LPSTR usersid;
3682  CHAR val[MAX_PATH];
3683  CHAR keypath[MAX_PATH];
3684  CHAR program_files_maximus[MAX_PATH];
3686 
3687  if (is_process_limited())
3688  {
3689  skip("process is limited\n");
3690  return;
3691  }
3692 
3693  if (!(usersid = get_user_sid()))
3694  return;
3695 
3696  CreateDirectoryA("msitest", NULL);
3697  create_file("msitest\\maximus", 500);
3698 
3699  create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table));
3700 
3701  if (is_wow64)
3703 
3705 
3706  /* ProcessComponents, per-user */
3707  r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
3709  {
3710  skip("Not enough rights to perform tests\n");
3711  goto error;
3712  }
3713  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3714  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3715  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3716 
3717  sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
3718  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3719  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3720 
3721  size = MAX_PATH;
3722  res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3723  NULL, NULL, (LPBYTE)val, &size);
3724  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3725 
3726  lstrcpyA(program_files_maximus,PROG_FILES_DIR);
3727  lstrcatA(program_files_maximus,"\\msitest\\maximus");
3728 
3729  ok(!lstrcmpiA(val, program_files_maximus),
3730  "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3731 
3732  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3733  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3734 
3735  RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3736  delete_key(comp, "", access);
3737  RegCloseKey(comp);
3738 
3739  sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
3740  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3741  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3742 
3743  size = MAX_PATH;
3744  res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3745  NULL, NULL, (LPBYTE)val, &size);
3746  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3747  ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3748  "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3749 
3750  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3751  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3752 
3753  RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3754  delete_key(comp, "", access);
3755  RegCloseKey(comp);
3756 
3757  /* ProcessComponents, machine */
3758  r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3759  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3760  ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3761  ok(delete_pf("msitest", FALSE), "Directory not created\n");
3762 
3763  sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3764  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3765  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3766 
3767  size = MAX_PATH;
3768  res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3769  NULL, NULL, (LPBYTE)val, &size);
3770  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3771  ok(!lstrcmpiA(val, program_files_maximus),
3772  "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3773 
3774  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3775  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3776 
3777  RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3778  delete_key(comp, "", access);
3779  RegCloseKey(comp);
3780 
3781  sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3782  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3783  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3784 
3785  size = MAX_PATH;
3786  res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3787  NULL, NULL, (LPBYTE)val, &size);
3788  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3789  ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3790  "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3791 
3792  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3793  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3794 
3795  RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3796  delete_key(comp, "", access);
3797  RegCloseKey(comp);
3798 
3799 error:
3801  DeleteFileA("msitest\\maximus");
3802  RemoveDirectoryA("msitest");
3803  LocalFree(usersid);
3804 }
3805 
3806 static void test_publish(void)
3807 {
3808  static const char subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3809  static const char subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3810  UINT r;
3811  LONG res;
3812  HKEY uninstall, prodkey, uninstall_32node = NULL;
3814  char date[MAX_PATH], temp[MAX_PATH], prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3816  DWORD error;
3817 
3818  if (!pMsiQueryFeatureStateExA)
3819  {
3820  win_skip("MsiQueryFeatureStateExA is not available\n");
3821  return;
3822  }
3823  if (is_process_limited())
3824  {
3825  skip("process is limited\n");
3826  return;
3827  }
3828 
3829  get_date_str(date);
3831 
3832  if (is_wow64)
3834 
3835  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
3836  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3837 
3838  if (is_64bit)
3839  {
3840  res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
3841  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3842  }
3843 
3844  CreateDirectoryA("msitest", NULL);
3845  create_file("msitest\\maximus", 500);
3846 
3847  create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3848 
3850 
3851  state = MsiQueryProductStateA(prodcode);
3852  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3853 
3854  state = MsiQueryFeatureStateA(prodcode, "feature");
3855  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3856 
3857  state = 0xdead;
3858  SetLastError(0xdeadbeef);
3859  r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3860  error = GetLastError();
3861  ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3862  ok(state == 0xdead, "got %d\n", state);
3863  ok(error == 0xdeadbeef, "got %u\n", error);
3864 
3865  state = 0xdead;
3866  SetLastError(0xdeadbeef);
3867  r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3868  error = GetLastError();
3869  ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3870  ok(state == 0xdead, "got %d\n", state);
3871  ok(error == ERROR_SUCCESS, "got %u\n", error);
3872 
3873  state = 0xdead;
3874  SetLastError(0xdeadbeef);
3875  r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3876  error = GetLastError();
3877  ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3878  ok(state == 0xdead, "got %d\n", state);
3879  ok(error == ERROR_SUCCESS, "got %u\n", error);
3880 
3881  state = MsiQueryFeatureStateA(prodcode, "feature");
3882  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3883 
3884  state = MsiQueryFeatureStateA(prodcode, "montecristo");
3885  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3886 
3887  r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3888  "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3889  ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3890  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3891 
3892  res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3893  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3894 
3895  /* nothing published */
3898  {
3899  skip("Not enough rights to perform tests\n");
3900  goto error;
3901  }
3902  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3903  ok(pf_exists("msitest\\maximus"), "File not installed\n");
3904  ok(pf_exists("msitest"), "File not installed\n");
3905 
3906  state = MsiQueryProductStateA(prodcode);
3907  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3908 
3909  state = MsiQueryFeatureStateA(prodcode, "feature");
3910  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3911 
3912  state = MsiQueryFeatureStateA(prodcode, "montecristo");
3913  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3914 
3915  r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3916  "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3917  ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3918  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3919 
3920  res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3921  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3922 
3923  /* PublishProduct and RegisterProduct */
3924  r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3925  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3926  ok(pf_exists("msitest\\maximus"), "File not installed\n");
3927  ok(pf_exists("msitest"), "File not installed\n");
3928 
3929  state = MsiQueryProductStateA(prodcode);
3930  ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3931 
3932  state = MsiQueryFeatureStateA(prodcode, "feature");
3933  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3934 
3935  state = MsiQueryFeatureStateA(prodcode, "montecristo");
3936  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3937 
3938  r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3939  "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3940  ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
3941  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3942 
3943  if (is_64bit)
3944  {
3945  res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3946  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3947  }
3948  else
3949  {
3950  res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3951  if (is_wow64 && res == ERROR_FILE_NOT_FOUND) /* XP - Vista, Wow64 */
3952  res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3953  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3954  }
3955 
3956  CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3957  CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3958  CHECK_REG_STR(prodkey, "InstallDate", date);
3959  CHECK_REG_STR(prodkey, "InstallSource", temp);
3960  CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3961  CHECK_REG_STR(prodkey, "Publisher", "Wine");
3962  CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3963  CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3964  CHECK_REG_STR(prodkey, "Comments", NULL);
3965  CHECK_REG_STR(prodkey, "Contact", NULL);
3966  CHECK_REG_STR(prodkey, "HelpLink", NULL);
3967  CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3968  CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3969  CHECK_REG_STR(prodkey, "Readme", NULL);
3970  CHECK_REG_STR(prodkey, "Size", NULL);
3971  CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3972  CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3973  CHECK_REG_DWORD(prodkey, "Language", 1033);
3974  CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3975  CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3976  CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3977  CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3978  todo_wine
3979  {
3980  CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -12, 10, 24);
3981  }
3982 
3983  RegCloseKey(prodkey);
3984 
3985  r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3986  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3987  ok(pf_exists("msitest\\maximus"), "File deleted\n");
3988  ok(pf_exists("msitest"), "File deleted\n");
3989 
3990  state = MsiQueryProductStateA(prodcode);
3991  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3992 
3993  state = MsiQueryFeatureStateA(prodcode, "feature");
3994  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3995 
3996  state = MsiQueryFeatureStateA(prodcode, "montecristo");
3997  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3998 
3999  r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4000  "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4001  ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4002  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4003 
4004  res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4005  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4006 
4007  /* complete install */
4008  r = MsiInstallProductA(msifile, "FULL=1");
4009  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4010  ok(pf_exists("msitest\\maximus"), "File not installed\n");
4011  ok(pf_exists("msitest"), "File not installed\n");
4012 
4013  state = MsiQueryProductStateA(prodcode);
4014  ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4015 
4016  state = MsiQueryFeatureStateA(prodcode, "feature");
4017  ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4018 
4019  state = 0xdead;
4020  SetLastError(0xdeadbeef);
4021  r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
4022  error = GetLastError();
4023  ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
4024  ok(state == 0xdead, "got %d\n", state);
4025  ok(error == 0xdeadbeef, "got %u\n", error);
4026 
4027  state = 0xdead;
4028  SetLastError(0xdeadbeef);
4029  r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
4030  error = GetLastError();
4031  ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
4032  ok(state == 0xdead, "got %d\n", state);
4033  ok(error == ERROR_SUCCESS, "got %u\n", error);
4034 
4035  state = 0xdead;
4036  SetLastError(0xdeadbeef);
4037  r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
4038  error = GetLastError();
4039  ok(r == ERROR_SUCCESS, "got %u\n", r);
4040  ok(state == INSTALLSTATE_LOCAL, "got %d\n", state);
4041  ok(error == ERROR_SUCCESS, "got %u\n", error);
4042 
4043  state = MsiQueryFeatureStateA(prodcode, "montecristo");
4044  ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4045 
4046  r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4047  "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4048  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4049  ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4050 
4051  if (is_64bit)
4052  {
4053  res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4054  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4055  }
4056  else
4057  {
4058  res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4059  ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4060  }
4061 
4062  CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4063  CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4064  CHECK_REG_STR(prodkey, "InstallDate", date);
4065  CHECK_REG_STR(prodkey, "InstallSource", temp);
4066  CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4067  CHECK_REG_STR(prodkey, "Publisher", "Wine");
4068  CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4069  CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
4070  CHECK_REG_STR(prodkey, "Comments", NULL);
4071  CHECK_REG_STR(prodkey, "Contact", NULL);
4072  CHECK_REG_STR(prodkey, "HelpLink", NULL);
4073  CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
4074  CHECK_REG_STR(prodkey, "InstallLocation", NULL);
4075  CHECK_REG_STR(prodkey, "Readme", NULL);
4076  CHECK_REG_STR(prodkey, "Size", NULL);
4077  CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
4078  CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
4079  CHECK_REG_DWORD(prodkey, "Language", 1033);
4080  CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4081  CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4082  CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4083  CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4084  todo_wine
4085  {
4086  CHECK_REG_DWORD4(prodkey, "EstimatedSize", 12, -12, 10, 24);
4087  }
4088 
4089  RegCloseKey(prodkey);
4090 
4091  /* no UnpublishFeatures */
4092  r = MsiInstallProductA(msifile, "REMOVE=ALL");
4093  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4094  ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4095  ok(!pf_exists("msitest"), "Directory not deleted\n");
4096 
4097  state = MsiQueryProductStateA(prodcode);
4098  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4099 
4100  state = MsiQueryFeatureStateA(prodcode, "feature");
4101  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4102 
4103  state = MsiQueryFeatureStateA(prodcode, "montecristo");
4104  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4105 
4106  r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4107  "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4108  ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4109  ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4110 
4111  res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4112  ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4113 
4114  /* complete install */
4115  r = MsiInstallProductA(msifile, "FULL=1");
4116  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4117  ok(pf_exists("msitest\\maximus"), "File not installed\n");
4118  ok(pf_exists("msitest"), "File not installed\n");
4119 
4120  state = MsiQueryProductStateA(prodcode);
4121  ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4122 
4123  state = MsiQueryFeatureStateA(prodcode, "feature");
4124  ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4125 
4126  state = MsiQueryFeatureStateA(prodcode, "montecristo");
4127  ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4128 
4129  r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4130  "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4131  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4132  ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4133 
4134  if (is_64bit)