4ff1ab8e9514ed3d960b8af1d9eec2d61225d4b7
[reactos.git] / rostests / winetests / msi / action.c
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
25 #include <windows.h>
26 #include <msiquery.h>
27 #include <msidefs.h>
28 #include <msi.h>
29 #include <fci.h>
30 #include <srrestoreptapi.h>
31
32 #include "wine/test.h"
33
34 static UINT (WINAPI *pMsiQueryComponentStateA)
35 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
36 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
37 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
38 static UINT (WINAPI *pMsiSourceListGetInfoA)
39 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
40 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
41 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
42 static UINT (WINAPI *pMsiQueryFeatureStateExA)
43 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
44
45 static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL);
46 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
47 static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE);
48 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
49 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
50
51 static HMODULE hsrclient;
52 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
53 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
54
55 static BOOL is_wow64;
56 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
57
58 static const char *msifile = "msitest.msi";
59 static CHAR CURR_DIR[MAX_PATH];
60 static CHAR PROG_FILES_DIR[MAX_PATH];
61 static CHAR COMMON_FILES_DIR[MAX_PATH];
62 static CHAR APP_DATA_DIR[MAX_PATH];
63 static CHAR WINDOWS_DIR[MAX_PATH];
64
65 /* msi database data */
66
67 static const char component_dat[] =
68 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
69 "s72\tS38\ts72\ti2\tS255\tS72\n"
70 "Component\tComponent\n"
71 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
72 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
73 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
74 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
75 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
76 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
77 "component\t\tMSITESTDIR\t0\t1\tfile\n"
78 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
79 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
80 "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
81
82 static const char directory_dat[] =
83 "Directory\tDirectory_Parent\tDefaultDir\n"
84 "s72\tS72\tl255\n"
85 "Directory\tDirectory\n"
86 "CABOUTDIR\tMSITESTDIR\tcabout\n"
87 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
88 "FIRSTDIR\tMSITESTDIR\tfirst\n"
89 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
90 "NEWDIR\tCABOUTDIR\tnew\n"
91 "ProgramFilesFolder\tTARGETDIR\t.\n"
92 "TARGETDIR\t\tSourceDir";
93
94 static const char feature_dat[] =
95 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
96 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
97 "Feature\tFeature\n"
98 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
99 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
100 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
101 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
102 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
103 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
104 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
105
106 static const char feature_comp_dat[] =
107 "Feature_\tComponent_\n"
108 "s38\ts72\n"
109 "FeatureComponents\tFeature_\tComponent_\n"
110 "Five\tFive\n"
111 "Four\tFour\n"
112 "One\tOne\n"
113 "Three\tThree\n"
114 "Two\tTwo\n"
115 "feature\tcomponent\n"
116 "service_feature\tservice_comp\n"
117 "service_feature\tservice_comp2\n"
118 "service_feature\tservice_comp3";
119
120 static const char file_dat[] =
121 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
122 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
123 "File\tFile\n"
124 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
125 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
126 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
127 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
128 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
129 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
130 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
131 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
132
133 static const char install_exec_seq_dat[] =
134 "Action\tCondition\tSequence\n"
135 "s72\tS255\tI2\n"
136 "InstallExecuteSequence\tAction\n"
137 "AllocateRegistrySpace\tNOT Installed\t1550\n"
138 "CostFinalize\t\t1000\n"
139 "CostInitialize\t\t800\n"
140 "FileCost\t\t900\n"
141 "ResolveSource\t\t950\n"
142 "MoveFiles\t\t1700\n"
143 "InstallFiles\t\t4000\n"
144 "DuplicateFiles\t\t4500\n"
145 "WriteEnvironmentStrings\t\t4550\n"
146 "CreateShortcuts\t\t4600\n"
147 "InstallServices\t\t5000\n"
148 "InstallFinalize\t\t6600\n"
149 "InstallInitialize\t\t1500\n"
150 "InstallValidate\t\t1400\n"
151 "LaunchConditions\t\t100\n"
152 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
153
154 static const char media_dat[] =
155 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
156 "i2\ti4\tL64\tS255\tS32\tS72\n"
157 "Media\tDiskId\n"
158 "1\t3\t\t\tDISK1\t\n"
159 "2\t7\t\tmsitest.cab\tDISK2\t\n";
160
161 static const char property_dat[] =
162 "Property\tValue\n"
163 "s72\tl0\n"
164 "Property\tProperty\n"
165 "DefaultUIFont\tDlgFont8\n"
166 "HASUIRUN\t0\n"
167 "INSTALLLEVEL\t3\n"
168 "InstallMode\tTypical\n"
169 "Manufacturer\tWine\n"
170 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
171 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
172 "ProductID\tnone\n"
173 "ProductLanguage\t1033\n"
174 "ProductName\tMSITEST\n"
175 "ProductVersion\t1.1.1\n"
176 "PROMPTROLLBACKCOST\tP\n"
177 "Setup\tSetup\n"
178 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
179 "AdminProperties\tPOSTADMIN\n"
180 "ROOTDRIVE\tC:\\\n"
181 "SERVNAME\tTestService\n"
182 "SERVNAME2\tTestService2\n"
183 "SERVDISP\tTestServiceDisp\n"
184 "SERVDISP2\tTestServiceDisp2\n"
185 "MSIFASTINSTALL\t1\n"
186 "regdata15\t#x01\n";
187
188 static const char environment_dat[] =
189 "Environment\tName\tValue\tComponent_\n"
190 "s72\tl255\tL255\ts72\n"
191 "Environment\tEnvironment\n"
192 "Var1\t=-MSITESTVAR1\t1\tOne\n"
193 "Var2\tMSITESTVAR2\t1\tOne\n"
194 "Var3\t=-MSITESTVAR3\t1\tOne\n"
195 "Var4\tMSITESTVAR4\t1\tOne\n"
196 "Var5\t-MSITESTVAR5\t\tOne\n"
197 "Var6\tMSITESTVAR6\t\tOne\n"
198 "Var7\t!-MSITESTVAR7\t\tOne\n"
199 "Var8\t!-*MSITESTVAR8\t\tOne\n"
200 "Var9\t=-MSITESTVAR9\t\tOne\n"
201 "Var10\t=MSITESTVAR10\t\tOne\n"
202 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
203 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
204 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
205 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
206 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
207 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
208 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
209 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
210 "Var19\t+-MSITESTVAR17\t1\tOne\n"
211 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
212 "Var21\t+-MSITESTVAR18\t1\tOne\n"
213 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
214 "Var23\t+-MSITESTVAR19\t1\tOne\n"
215 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
216 "Var25\t+-MSITESTVAR20\t1\tOne\n"
217 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n";
218
219 static const char service_install_dat[] =
220 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
221 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
222 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
223 "ServiceInstall\tServiceInstall\n"
224 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
225 "TestService2\tSERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription";
226
227 static const char service_install2_dat[] =
228 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
229 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
230 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
231 "ServiceInstall\tServiceInstall\n"
232 "TestService\tTestService\tTestService\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\n"
233 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
234
235 static const char service_control_dat[] =
236 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
237 "s72\tl255\ti2\tL255\tI2\ts72\n"
238 "ServiceControl\tServiceControl\n"
239 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
240 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
241
242 static const char sss_service_control_dat[] =
243 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
244 "s72\tl255\ti2\tL255\tI2\ts72\n"
245 "ServiceControl\tServiceControl\n"
246 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
247 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
248 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
249 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
250
251 static const char sss_install_exec_seq_dat[] =
252 "Action\tCondition\tSequence\n"
253 "s72\tS255\tI2\n"
254 "InstallExecuteSequence\tAction\n"
255 "LaunchConditions\t\t100\n"
256 "CostInitialize\t\t800\n"
257 "FileCost\t\t900\n"
258 "ResolveSource\t\t950\n"
259 "CostFinalize\t\t1000\n"
260 "InstallValidate\t\t1400\n"
261 "InstallInitialize\t\t1500\n"
262 "StopServices\t\t4000\n"
263 "DeleteServices\t\t5000\n"
264 "MoveFiles\t\t5100\n"
265 "InstallFiles\t\t5200\n"
266 "DuplicateFiles\t\t5300\n"
267 "StartServices\t\t5400\n"
268 "RegisterProduct\t\t5500\n"
269 "PublishFeatures\t\t5600\n"
270 "PublishProduct\t\t5700\n"
271 "InstallFinalize\t\t6000\n";
272
273 static const char sds_install_exec_seq_dat[] =
274 "Action\tCondition\tSequence\n"
275 "s72\tS255\tI2\n"
276 "InstallExecuteSequence\tAction\n"
277 "LaunchConditions\t\t100\n"
278 "CostInitialize\t\t800\n"
279 "FileCost\t\t900\n"
280 "ResolveSource\t\t950\n"
281 "CostFinalize\t\t1000\n"
282 "InstallValidate\t\t1400\n"
283 "InstallInitialize\t\t1500\n"
284 "StopServices\t\t5000\n"
285 "DeleteServices\t\t5050\n"
286 "MoveFiles\t\t5100\n"
287 "InstallFiles\t\t5200\n"
288 "DuplicateFiles\t\t5300\n"
289 "InstallServices\t\t5400\n"
290 "StartServices\t\t5450\n"
291 "RegisterProduct\t\t5500\n"
292 "PublishFeatures\t\t5600\n"
293 "PublishProduct\t\t5700\n"
294 "InstallFinalize\t\t6000\n";
295
296 static const char rof_component_dat[] =
297 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
298 "s72\tS38\ts72\ti2\tS255\tS72\n"
299 "Component\tComponent\n"
300 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
301
302 static const char rof_feature_dat[] =
303 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
304 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
305 "Feature\tFeature\n"
306 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
307 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
308
309 static const char rof_feature_comp_dat[] =
310 "Feature_\tComponent_\n"
311 "s38\ts72\n"
312 "FeatureComponents\tFeature_\tComponent_\n"
313 "feature\tmaximus\n"
314 "montecristo\tmaximus";
315
316 static const char rof_file_dat[] =
317 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
318 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
319 "File\tFile\n"
320 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
321
322 static const char rof_media_dat[] =
323 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
324 "i2\ti4\tL64\tS255\tS32\tS72\n"
325 "Media\tDiskId\n"
326 "1\t1\t\t\tDISK1\t\n";
327
328 static const char ci2_feature_comp_dat[] =
329 "Feature_\tComponent_\n"
330 "s38\ts72\n"
331 "FeatureComponents\tFeature_\tComponent_\n"
332 "feature\taugustus";
333
334 static const char ci2_file_dat[] =
335 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
336 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
337 "File\tFile\n"
338 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
339
340 static const char pp_install_exec_seq_dat[] =
341 "Action\tCondition\tSequence\n"
342 "s72\tS255\tI2\n"
343 "InstallExecuteSequence\tAction\n"
344 "ValidateProductID\t\t700\n"
345 "CostInitialize\t\t800\n"
346 "FileCost\t\t900\n"
347 "CostFinalize\t\t1000\n"
348 "InstallValidate\t\t1400\n"
349 "InstallInitialize\t\t1500\n"
350 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
351 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
352 "RemoveFiles\t\t3500\n"
353 "InstallFiles\t\t4000\n"
354 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
355 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
356 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
357 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
358 "InstallFinalize\t\t6600";
359
360 static const char pp_component_dat[] =
361 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
362 "s72\tS38\ts72\ti2\tS255\tS72\n"
363 "Component\tComponent\n"
364 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
365
366 static const char ppc_component_dat[] =
367 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
368 "s72\tS38\ts72\ti2\tS255\tS72\n"
369 "Component\tComponent\n"
370 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
371 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
372
373 static const char ppc_file_dat[] =
374 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
375 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
376 "File\tFile\n"
377 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
378 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
379
380 static const char ppc_media_dat[] =
381 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
382 "i2\ti4\tL64\tS255\tS32\tS72\n"
383 "Media\tDiskId\n"
384 "1\t2\t\t\tDISK1\t\n";
385
386 static const char ppc_feature_comp_dat[] =
387 "Feature_\tComponent_\n"
388 "s38\ts72\n"
389 "FeatureComponents\tFeature_\tComponent_\n"
390 "feature\tmaximus\n"
391 "feature\taugustus\n"
392 "montecristo\tmaximus";
393
394 static const char cwd_component_dat[] =
395 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
396 "s72\tS38\ts72\ti2\tS255\tS72\n"
397 "Component\tComponent\n"
398 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
399
400 static const char rem_component_dat[] =
401 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
402 "s72\tS38\ts72\ti2\tS255\tS72\n"
403 "Component\tComponent\n"
404 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
405 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
406 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
407
408 static const char rem_feature_comp_dat[] =
409 "Feature_\tComponent_\n"
410 "s38\ts72\n"
411 "FeatureComponents\tFeature_\tComponent_\n"
412 "feature\thydrogen\n"
413 "feature\thelium\n"
414 "feature\tlithium";
415
416 static const char rem_file_dat[] =
417 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
418 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
419 "File\tFile\n"
420 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
421 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
422 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
423
424 static const char rem_install_exec_seq_dat[] =
425 "Action\tCondition\tSequence\n"
426 "s72\tS255\tI2\n"
427 "InstallExecuteSequence\tAction\n"
428 "ValidateProductID\t\t700\n"
429 "CostInitialize\t\t800\n"
430 "FileCost\t\t900\n"
431 "CostFinalize\t\t1000\n"
432 "InstallValidate\t\t1400\n"
433 "InstallInitialize\t\t1500\n"
434 "ProcessComponents\t\t1600\n"
435 "UnpublishFeatures\t\t1800\n"
436 "RemoveFiles\t\t3500\n"
437 "InstallFiles\t\t4000\n"
438 "RegisterProduct\t\t6100\n"
439 "PublishFeatures\t\t6300\n"
440 "PublishProduct\t\t6400\n"
441 "InstallFinalize\t\t6600";
442
443 static const char rem_remove_files_dat[] =
444 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
445 "s72\ts72\tS255\ts72\tI2\n"
446 "RemoveFile\tFileKey\n"
447 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
448 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
449 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
450 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
451 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
452 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
453 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
454 "block\thelium\tblock\tMSITESTDIR\t3\n"
455 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
456 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
457
458 static const char mov_move_file_dat[] =
459 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
460 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
461 "MoveFile\tFileKey\n"
462 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
463 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
464 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
465 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
466 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
467 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
468 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
469 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
470 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
471 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
472 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
473 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
474 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
475 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
476 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
477 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
478 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
479 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
480
481 static const char df_directory_dat[] =
482 "Directory\tDirectory_Parent\tDefaultDir\n"
483 "s72\tS72\tl255\n"
484 "Directory\tDirectory\n"
485 "THIS\tMSITESTDIR\tthis\n"
486 "DOESNOT\tTHIS\tdoesnot\n"
487 "NONEXISTENT\tDOESNOT\texist\n"
488 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
489 "ProgramFilesFolder\tTARGETDIR\t.\n"
490 "TARGETDIR\t\tSourceDir";
491
492 static const char df_duplicate_file_dat[] =
493 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
494 "s72\ts72\ts72\tS255\tS72\n"
495 "DuplicateFile\tFileKey\n"
496 "maximus\tmaximus\tmaximus\taugustus\t\n"
497 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
498 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
499
500 static const char wrv_component_dat[] =
501 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
502 "s72\tS38\ts72\ti2\tS255\tS72\n"
503 "Component\tComponent\n"
504 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
505
506 static const char wrv_registry_dat[] =
507 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
508 "s72\ti2\tl255\tL255\tL0\ts72\n"
509 "Registry\tRegistry\n"
510 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
511 "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
512 "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
513 "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
514 "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"
515 "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
516 "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
517 "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
518 "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
519 "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
520 "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
521 "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
522 "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
523 "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
524 "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
525 "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n";
526
527 static const char cf_directory_dat[] =
528 "Directory\tDirectory_Parent\tDefaultDir\n"
529 "s72\tS72\tl255\n"
530 "Directory\tDirectory\n"
531 "FIRSTDIR\tMSITESTDIR\tfirst\n"
532 "SECONDDIR\tMSITESTDIR\tsecond\n"
533 "THIRDDIR\tMSITESTDIR\tthird\n"
534 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
535 "ProgramFilesFolder\tTARGETDIR\t.\n"
536 "TARGETDIR\t\tSourceDir";
537
538 static const char cf_component_dat[] =
539 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
540 "s72\tS38\ts72\ti2\tS255\tS72\n"
541 "Component\tComponent\n"
542 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
543 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
544
545 static const char cf_feature_dat[] =
546 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
547 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
548 "Feature\tFeature\n"
549 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
550 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
551
552 static const char cf_feature_comp_dat[] =
553 "Feature_\tComponent_\n"
554 "s38\ts72\n"
555 "FeatureComponents\tFeature_\tComponent_\n"
556 "One\tOne\n"
557 "Two\tTwo\n";
558
559 static const char cf_file_dat[] =
560 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
561 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
562 "File\tFile\n"
563 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
564 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
565
566 static const char cf_create_folders_dat[] =
567 "Directory_\tComponent_\n"
568 "s72\ts72\n"
569 "CreateFolder\tDirectory_\tComponent_\n"
570 "FIRSTDIR\tOne\n"
571 "SECONDDIR\tTwo\n"
572 "THIRDDIR\tTwo\n";
573
574 static const char cf_install_exec_seq_dat[] =
575 "Action\tCondition\tSequence\n"
576 "s72\tS255\tI2\n"
577 "InstallExecuteSequence\tAction\n"
578 "CostFinalize\t\t1000\n"
579 "ValidateProductID\t\t700\n"
580 "CostInitialize\t\t800\n"
581 "FileCost\t\t900\n"
582 "RemoveFiles\t\t3500\n"
583 "CreateFolders\t\t3700\n"
584 "RemoveFolders\t\t3800\n"
585 "InstallFiles\t\t4000\n"
586 "RegisterUser\t\t6000\n"
587 "RegisterProduct\t\t6100\n"
588 "PublishFeatures\t\t6300\n"
589 "PublishProduct\t\t6400\n"
590 "InstallFinalize\t\t6600\n"
591 "InstallInitialize\t\t1500\n"
592 "ProcessComponents\t\t1600\n"
593 "UnpublishFeatures\t\t1800\n"
594 "InstallValidate\t\t1400\n"
595 "LaunchConditions\t\t100\n";
596
597 static const char sr_selfreg_dat[] =
598 "File_\tCost\n"
599 "s72\tI2\n"
600 "SelfReg\tFile_\n"
601 "one.txt\t1\n";
602
603 static const char sr_install_exec_seq_dat[] =
604 "Action\tCondition\tSequence\n"
605 "s72\tS255\tI2\n"
606 "InstallExecuteSequence\tAction\n"
607 "CostFinalize\t\t1000\n"
608 "CostInitialize\t\t800\n"
609 "FileCost\t\t900\n"
610 "ResolveSource\t\t950\n"
611 "MoveFiles\t\t1700\n"
612 "SelfUnregModules\t\t3900\n"
613 "InstallFiles\t\t4000\n"
614 "DuplicateFiles\t\t4500\n"
615 "WriteEnvironmentStrings\t\t4550\n"
616 "CreateShortcuts\t\t4600\n"
617 "InstallFinalize\t\t6600\n"
618 "InstallInitialize\t\t1500\n"
619 "InstallValidate\t\t1400\n"
620 "LaunchConditions\t\t100\n";
621
622 static const char font_media_dat[] =
623 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
624 "i2\ti4\tL64\tS255\tS32\tS72\n"
625 "Media\tDiskId\n"
626 "1\t3\t\t\tDISK1\t\n";
627
628 static const char font_file_dat[] =
629 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
630 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
631 "File\tFile\n"
632 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
633
634 static const char font_feature_dat[] =
635 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
636 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
637 "Feature\tFeature\n"
638 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
639
640 static const char font_component_dat[] =
641 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
642 "s72\tS38\ts72\ti2\tS255\tS72\n"
643 "Component\tComponent\n"
644 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
645
646 static const char font_feature_comp_dat[] =
647 "Feature_\tComponent_\n"
648 "s38\ts72\n"
649 "FeatureComponents\tFeature_\tComponent_\n"
650 "fonts\tfonts\n";
651
652 static const char font_dat[] =
653 "File_\tFontTitle\n"
654 "s72\tS128\n"
655 "Font\tFile_\n"
656 "font.ttf\tmsi test font\n";
657
658 static const char font_install_exec_seq_dat[] =
659 "Action\tCondition\tSequence\n"
660 "s72\tS255\tI2\n"
661 "InstallExecuteSequence\tAction\n"
662 "ValidateProductID\t\t700\n"
663 "CostInitialize\t\t800\n"
664 "FileCost\t\t900\n"
665 "CostFinalize\t\t1000\n"
666 "InstallValidate\t\t1400\n"
667 "InstallInitialize\t\t1500\n"
668 "ProcessComponents\t\t1600\n"
669 "UnpublishFeatures\t\t1800\n"
670 "RemoveFiles\t\t3500\n"
671 "InstallFiles\t\t4000\n"
672 "RegisterFonts\t\t4100\n"
673 "UnregisterFonts\t\t4200\n"
674 "RegisterUser\t\t6000\n"
675 "RegisterProduct\t\t6100\n"
676 "PublishFeatures\t\t6300\n"
677 "PublishProduct\t\t6400\n"
678 "InstallFinalize\t\t6600";
679
680 static const char vp_property_dat[] =
681 "Property\tValue\n"
682 "s72\tl0\n"
683 "Property\tProperty\n"
684 "HASUIRUN\t0\n"
685 "INSTALLLEVEL\t3\n"
686 "InstallMode\tTypical\n"
687 "Manufacturer\tWine\n"
688 "PIDTemplate\t###-#######\n"
689 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
690 "ProductLanguage\t1033\n"
691 "ProductName\tMSITEST\n"
692 "ProductVersion\t1.1.1\n"
693 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
694 "MSIFASTINSTALL\t1\n";
695
696 static const char vp_custom_action_dat[] =
697 "Action\tType\tSource\tTarget\tISComments\n"
698 "s72\ti2\tS64\tS0\tS255\n"
699 "CustomAction\tAction\n"
700 "SetProductID1\t51\tProductID\t1\t\n"
701 "SetProductID2\t51\tProductID\t2\t\n"
702 "TestProductID1\t19\t\t\tHalts installation\n"
703 "TestProductID2\t19\t\t\tHalts installation\n";
704
705 static const char vp_install_exec_seq_dat[] =
706 "Action\tCondition\tSequence\n"
707 "s72\tS255\tI2\n"
708 "InstallExecuteSequence\tAction\n"
709 "LaunchConditions\t\t100\n"
710 "CostInitialize\t\t800\n"
711 "FileCost\t\t900\n"
712 "CostFinalize\t\t1000\n"
713 "InstallValidate\t\t1400\n"
714 "InstallInitialize\t\t1500\n"
715 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
716 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
717 "ValidateProductID\t\t3200\n"
718 "InstallExecute\t\t3300\n"
719 "TestProductID1\tProductID=1\t3400\n"
720 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
721 "InstallFiles\t\t4000\n"
722 "InstallFinalize\t\t6000\n";
723
724 static const char odbc_file_dat[] =
725 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
726 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
727 "File\tFile\n"
728 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
729 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
730 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
731 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
732 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
733
734 static const char odbc_feature_dat[] =
735 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
736 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
737 "Feature\tFeature\n"
738 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
739
740 static const char odbc_feature_comp_dat[] =
741 "Feature_\tComponent_\n"
742 "s38\ts72\n"
743 "FeatureComponents\tFeature_\tComponent_\n"
744 "odbc\todbc\n";
745
746 static const char odbc_component_dat[] =
747 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
748 "s72\tS38\ts72\ti2\tS255\tS72\n"
749 "Component\tComponent\n"
750 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
751
752 static const char odbc_driver_dat[] =
753 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
754 "s72\ts72\ts255\ts72\tS72\n"
755 "ODBCDriver\tDriver\n"
756 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
757 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
758
759 static const char odbc_translator_dat[] =
760 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
761 "s72\ts72\ts255\ts72\tS72\n"
762 "ODBCTranslator\tTranslator\n"
763 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
764 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
765
766 static const char odbc_datasource_dat[] =
767 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
768 "s72\ts72\ts255\ts255\ti2\n"
769 "ODBCDataSource\tDataSource\n"
770 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
771
772 static const char odbc_install_exec_seq_dat[] =
773 "Action\tCondition\tSequence\n"
774 "s72\tS255\tI2\n"
775 "InstallExecuteSequence\tAction\n"
776 "LaunchConditions\t\t100\n"
777 "CostInitialize\t\t800\n"
778 "FileCost\t\t900\n"
779 "CostFinalize\t\t1000\n"
780 "InstallValidate\t\t1400\n"
781 "InstallInitialize\t\t1500\n"
782 "ProcessComponents\t\t1600\n"
783 "InstallODBC\t\t3000\n"
784 "RemoveODBC\t\t3100\n"
785 "RemoveFiles\t\t3900\n"
786 "InstallFiles\t\t4000\n"
787 "RegisterProduct\t\t5000\n"
788 "PublishFeatures\t\t5100\n"
789 "PublishProduct\t\t5200\n"
790 "InstallFinalize\t\t6000\n";
791
792 static const char odbc_media_dat[] =
793 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
794 "i2\ti4\tL64\tS255\tS32\tS72\n"
795 "Media\tDiskId\n"
796 "1\t5\t\t\tDISK1\t\n";
797
798 static const char tl_file_dat[] =
799 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
800 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
801 "File\tFile\n"
802 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
803
804 static const char tl_feature_dat[] =
805 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
806 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
807 "Feature\tFeature\n"
808 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
809
810 static const char tl_feature_comp_dat[] =
811 "Feature_\tComponent_\n"
812 "s38\ts72\n"
813 "FeatureComponents\tFeature_\tComponent_\n"
814 "typelib\ttypelib\n";
815
816 static const char tl_component_dat[] =
817 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
818 "s72\tS38\ts72\ti2\tS255\tS72\n"
819 "Component\tComponent\n"
820 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
821
822 static const char tl_typelib_dat[] =
823 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
824 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
825 "TypeLib\tLibID\tLanguage\tComponent_\n"
826 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
827
828 static const char tl_install_exec_seq_dat[] =
829 "Action\tCondition\tSequence\n"
830 "s72\tS255\tI2\n"
831 "InstallExecuteSequence\tAction\n"
832 "LaunchConditions\t\t100\n"
833 "CostInitialize\t\t800\n"
834 "FileCost\t\t900\n"
835 "CostFinalize\t\t1000\n"
836 "InstallValidate\t\t1400\n"
837 "InstallInitialize\t\t1500\n"
838 "ProcessComponents\t\t1600\n"
839 "RemoveFiles\t\t1700\n"
840 "InstallFiles\t\t2000\n"
841 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
842 "UnregisterTypeLibraries\t\t3100\n"
843 "RegisterProduct\t\t5100\n"
844 "PublishFeatures\t\t5200\n"
845 "PublishProduct\t\t5300\n"
846 "InstallFinalize\t\t6000\n";
847
848 static const char crs_file_dat[] =
849 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
850 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
851 "File\tFile\n"
852 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
853
854 static const char crs_feature_dat[] =
855 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
856 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
857 "Feature\tFeature\n"
858 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
859
860 static const char crs_feature_comp_dat[] =
861 "Feature_\tComponent_\n"
862 "s38\ts72\n"
863 "FeatureComponents\tFeature_\tComponent_\n"
864 "shortcut\tshortcut\n";
865
866 static const char crs_component_dat[] =
867 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
868 "s72\tS38\ts72\ti2\tS255\tS72\n"
869 "Component\tComponent\n"
870 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
871
872 static const char crs_shortcut_dat[] =
873 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
874 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
875 "Shortcut\tShortcut\n"
876 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
877
878 static const char crs_install_exec_seq_dat[] =
879 "Action\tCondition\tSequence\n"
880 "s72\tS255\tI2\n"
881 "InstallExecuteSequence\tAction\n"
882 "LaunchConditions\t\t100\n"
883 "CostInitialize\t\t800\n"
884 "FileCost\t\t900\n"
885 "CostFinalize\t\t1000\n"
886 "InstallValidate\t\t1400\n"
887 "InstallInitialize\t\t1500\n"
888 "ProcessComponents\t\t1600\n"
889 "RemoveFiles\t\t1700\n"
890 "InstallFiles\t\t2000\n"
891 "RemoveShortcuts\t\t3000\n"
892 "CreateShortcuts\t\t3100\n"
893 "RegisterProduct\t\t5000\n"
894 "PublishFeatures\t\t5100\n"
895 "PublishProduct\t\t5200\n"
896 "InstallFinalize\t\t6000\n";
897
898 static const char pub_file_dat[] =
899 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
900 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
901 "File\tFile\n"
902 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
903
904 static const char pub_feature_dat[] =
905 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
906 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
907 "Feature\tFeature\n"
908 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
909
910 static const char pub_feature_comp_dat[] =
911 "Feature_\tComponent_\n"
912 "s38\ts72\n"
913 "FeatureComponents\tFeature_\tComponent_\n"
914 "publish\tpublish\n";
915
916 static const char pub_component_dat[] =
917 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
918 "s72\tS38\ts72\ti2\tS255\tS72\n"
919 "Component\tComponent\n"
920 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
921
922 static const char pub_publish_component_dat[] =
923 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
924 "s38\ts255\ts72\tL255\ts38\n"
925 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
926 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
927
928 static const char pub_install_exec_seq_dat[] =
929 "Action\tCondition\tSequence\n"
930 "s72\tS255\tI2\n"
931 "InstallExecuteSequence\tAction\n"
932 "LaunchConditions\t\t100\n"
933 "CostInitialize\t\t800\n"
934 "FileCost\t\t900\n"
935 "CostFinalize\t\t1000\n"
936 "InstallValidate\t\t1400\n"
937 "InstallInitialize\t\t1500\n"
938 "ProcessComponents\t\t1600\n"
939 "RemoveFiles\t\t1700\n"
940 "InstallFiles\t\t2000\n"
941 "PublishComponents\t\t3000\n"
942 "UnpublishComponents\t\t3100\n"
943 "RegisterProduct\t\t5000\n"
944 "PublishFeatures\t\t5100\n"
945 "PublishProduct\t\t5200\n"
946 "InstallFinalize\t\t6000\n";
947
948 static const char rd_file_dat[] =
949 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
950 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
951 "File\tFile\n"
952 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
953 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
954 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
955
956 static const char rd_feature_dat[] =
957 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
958 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
959 "Feature\tFeature\n"
960 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
961
962 static const char rd_feature_comp_dat[] =
963 "Feature_\tComponent_\n"
964 "s38\ts72\n"
965 "FeatureComponents\tFeature_\tComponent_\n"
966 "duplicate\tduplicate\n";
967
968 static const char rd_component_dat[] =
969 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
970 "s72\tS38\ts72\ti2\tS255\tS72\n"
971 "Component\tComponent\n"
972 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
973 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
974
975 static const char rd_duplicate_file_dat[] =
976 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
977 "s72\ts72\ts72\tS255\tS72\n"
978 "DuplicateFile\tFileKey\n"
979 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
980 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
981 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
982
983 static const char rd_install_exec_seq_dat[] =
984 "Action\tCondition\tSequence\n"
985 "s72\tS255\tI2\n"
986 "InstallExecuteSequence\tAction\n"
987 "LaunchConditions\t\t100\n"
988 "CostInitialize\t\t800\n"
989 "FileCost\t\t900\n"
990 "CostFinalize\t\t1000\n"
991 "InstallValidate\t\t1400\n"
992 "InstallInitialize\t\t1500\n"
993 "ProcessComponents\t\t1600\n"
994 "RemoveDuplicateFiles\t\t1900\n"
995 "InstallFiles\t\t2000\n"
996 "DuplicateFiles\t\t2100\n"
997 "RegisterProduct\t\t5000\n"
998 "PublishFeatures\t\t5100\n"
999 "PublishProduct\t\t5200\n"
1000 "InstallFinalize\t\t6000\n";
1001
1002 static const char rrv_file_dat[] =
1003 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1004 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1005 "File\tFile\n"
1006 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1007
1008 static const char rrv_feature_dat[] =
1009 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1010 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1011 "Feature\tFeature\n"
1012 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1013
1014 static const char rrv_feature_comp_dat[] =
1015 "Feature_\tComponent_\n"
1016 "s38\ts72\n"
1017 "FeatureComponents\tFeature_\tComponent_\n"
1018 "registry\tregistry\n";
1019
1020 static const char rrv_component_dat[] =
1021 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1022 "s72\tS38\ts72\ti2\tS255\tS72\n"
1023 "Component\tComponent\n"
1024 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1025
1026 static const char rrv_registry_dat[] =
1027 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1028 "s72\ti2\tl255\tL255\tL0\ts72\n"
1029 "Registry\tRegistry\n"
1030 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1031 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1032 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1033
1034 static const char rrv_remove_registry_dat[] =
1035 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1036 "s72\ti2\tl255\tL255\ts72\n"
1037 "RemoveRegistry\tRemoveRegistry\n"
1038 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1039 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1040 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1041
1042 static const char rrv_install_exec_seq_dat[] =
1043 "Action\tCondition\tSequence\n"
1044 "s72\tS255\tI2\n"
1045 "InstallExecuteSequence\tAction\n"
1046 "LaunchConditions\t\t100\n"
1047 "CostInitialize\t\t800\n"
1048 "FileCost\t\t900\n"
1049 "CostFinalize\t\t1000\n"
1050 "InstallValidate\t\t1400\n"
1051 "InstallInitialize\t\t1500\n"
1052 "ProcessComponents\t\t1600\n"
1053 "RemoveFiles\t\t1700\n"
1054 "InstallFiles\t\t2000\n"
1055 "RemoveRegistryValues\t\t3000\n"
1056 "RegisterProduct\t\t5000\n"
1057 "PublishFeatures\t\t5100\n"
1058 "PublishProduct\t\t5200\n"
1059 "InstallFinalize\t\t6000\n";
1060
1061 static const char frp_file_dat[] =
1062 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1063 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1064 "File\tFile\n"
1065 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1066
1067 static const char frp_feature_dat[] =
1068 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1069 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1070 "Feature\tFeature\n"
1071 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1072
1073 static const char frp_feature_comp_dat[] =
1074 "Feature_\tComponent_\n"
1075 "s38\ts72\n"
1076 "FeatureComponents\tFeature_\tComponent_\n"
1077 "product\tproduct\n";
1078
1079 static const char frp_component_dat[] =
1080 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1081 "s72\tS38\ts72\ti2\tS255\tS72\n"
1082 "Component\tComponent\n"
1083 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1084
1085 static const char frp_custom_action_dat[] =
1086 "Action\tType\tSource\tTarget\tISComments\n"
1087 "s72\ti2\tS64\tS0\tS255\n"
1088 "CustomAction\tAction\n"
1089 "TestProp\t19\t\t\tPROP set\n";
1090
1091 static const char frp_upgrade_dat[] =
1092 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1093 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1094 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1095 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1096
1097 static const char frp_install_exec_seq_dat[] =
1098 "Action\tCondition\tSequence\n"
1099 "s72\tS255\tI2\n"
1100 "InstallExecuteSequence\tAction\n"
1101 "FindRelatedProducts\t\t50\n"
1102 "TestProp\tPROP AND NOT REMOVE\t51\n"
1103 "LaunchConditions\t\t100\n"
1104 "CostInitialize\t\t800\n"
1105 "FileCost\t\t900\n"
1106 "CostFinalize\t\t1000\n"
1107 "InstallValidate\t\t1400\n"
1108 "InstallInitialize\t\t1500\n"
1109 "ProcessComponents\t\t1600\n"
1110 "RemoveFiles\t\t1700\n"
1111 "InstallFiles\t\t2000\n"
1112 "RegisterProduct\t\t5000\n"
1113 "PublishFeatures\t\t5100\n"
1114 "PublishProduct\t\t5200\n"
1115 "InstallFinalize\t\t6000\n";
1116
1117 static const char riv_file_dat[] =
1118 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1119 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1120 "File\tFile\n"
1121 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1122
1123 static const char riv_feature_dat[] =
1124 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1125 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1126 "Feature\tFeature\n"
1127 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1128
1129 static const char riv_feature_comp_dat[] =
1130 "Feature_\tComponent_\n"
1131 "s38\ts72\n"
1132 "FeatureComponents\tFeature_\tComponent_\n"
1133 "inifile\tinifile\n";
1134
1135 static const char riv_component_dat[] =
1136 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1137 "s72\tS38\ts72\ti2\tS255\tS72\n"
1138 "Component\tComponent\n"
1139 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1140
1141 static const char riv_ini_file_dat[] =
1142 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1143 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1144 "IniFile\tIniFile\n"
1145 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1146
1147 static const char riv_remove_ini_file_dat[] =
1148 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1149 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1150 "RemoveIniFile\tRemoveIniFile\n"
1151 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1152
1153 static const char riv_install_exec_seq_dat[] =
1154 "Action\tCondition\tSequence\n"
1155 "s72\tS255\tI2\n"
1156 "InstallExecuteSequence\tAction\n"
1157 "LaunchConditions\t\t100\n"
1158 "CostInitialize\t\t800\n"
1159 "FileCost\t\t900\n"
1160 "CostFinalize\t\t1000\n"
1161 "InstallValidate\t\t1400\n"
1162 "InstallInitialize\t\t1500\n"
1163 "ProcessComponents\t\t1600\n"
1164 "RemoveFiles\t\t1700\n"
1165 "InstallFiles\t\t2000\n"
1166 "RemoveIniValues\t\t3000\n"
1167 "RegisterProduct\t\t5000\n"
1168 "PublishFeatures\t\t5100\n"
1169 "PublishProduct\t\t5200\n"
1170 "InstallFinalize\t\t6000\n";
1171
1172 static const char res_file_dat[] =
1173 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1174 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1175 "File\tFile\n"
1176 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1177
1178 static const char res_feature_dat[] =
1179 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1180 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1181 "Feature\tFeature\n"
1182 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1183
1184 static const char res_feature_comp_dat[] =
1185 "Feature_\tComponent_\n"
1186 "s38\ts72\n"
1187 "FeatureComponents\tFeature_\tComponent_\n"
1188 "envvar\tenvvar\n";
1189
1190 static const char res_component_dat[] =
1191 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1192 "s72\tS38\ts72\ti2\tS255\tS72\n"
1193 "Component\tComponent\n"
1194 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1195
1196 static const char res_environment_dat[] =
1197 "Environment\tName\tValue\tComponent_\n"
1198 "s72\tl255\tL255\ts72\n"
1199 "Environment\tEnvironment\n"
1200 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1201 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1202 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1203 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1204 "var5\t=MSITESTVAR5\t\tenvvar\n";
1205
1206 static const char res_install_exec_seq_dat[] =
1207 "Action\tCondition\tSequence\n"
1208 "s72\tS255\tI2\n"
1209 "InstallExecuteSequence\tAction\n"
1210 "LaunchConditions\t\t100\n"
1211 "CostInitialize\t\t800\n"
1212 "FileCost\t\t900\n"
1213 "CostFinalize\t\t1000\n"
1214 "InstallValidate\t\t1400\n"
1215 "InstallInitialize\t\t1500\n"
1216 "ProcessComponents\t\t1600\n"
1217 "RemoveFiles\t\t1700\n"
1218 "InstallFiles\t\t2000\n"
1219 "RemoveEnvironmentStrings\t\t3000\n"
1220 "RegisterProduct\t\t5000\n"
1221 "PublishFeatures\t\t5100\n"
1222 "PublishProduct\t\t5200\n"
1223 "InstallFinalize\t\t6000\n";
1224
1225 static const char rci_file_dat[] =
1226 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1227 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1228 "File\tFile\n"
1229 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1230
1231 static const char rci_feature_dat[] =
1232 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1233 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1234 "Feature\tFeature\n"
1235 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1236
1237 static const char rci_feature_comp_dat[] =
1238 "Feature_\tComponent_\n"
1239 "s38\ts72\n"
1240 "FeatureComponents\tFeature_\tComponent_\n"
1241 "class\tclass\n";
1242
1243 static const char rci_component_dat[] =
1244 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1245 "s72\tS38\ts72\ti2\tS255\tS72\n"
1246 "Component\tComponent\n"
1247 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1248
1249 static const char rci_appid_dat[] =
1250 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1251 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1252 "AppId\tAppId\n"
1253 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1254
1255 static const char rci_class_dat[] =
1256 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1257 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1258 "Class\tCLSID\tContext\tComponent_\n"
1259 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1260
1261 static const char rci_install_exec_seq_dat[] =
1262 "Action\tCondition\tSequence\n"
1263 "s72\tS255\tI2\n"
1264 "InstallExecuteSequence\tAction\n"
1265 "LaunchConditions\t\t100\n"
1266 "CostInitialize\t\t800\n"
1267 "FileCost\t\t900\n"
1268 "CostFinalize\t\t1000\n"
1269 "InstallValidate\t\t1400\n"
1270 "InstallInitialize\t\t1500\n"
1271 "ProcessComponents\t\t1600\n"
1272 "RemoveFiles\t\t1700\n"
1273 "InstallFiles\t\t2000\n"
1274 "UnregisterClassInfo\t\t3000\n"
1275 "RegisterClassInfo\t\t4000\n"
1276 "RegisterProduct\t\t5000\n"
1277 "PublishFeatures\t\t5100\n"
1278 "PublishProduct\t\t5200\n"
1279 "InstallFinalize\t\t6000\n";
1280
1281 static const char rei_file_dat[] =
1282 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1283 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1284 "File\tFile\n"
1285 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1286
1287 static const char rei_feature_dat[] =
1288 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1289 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1290 "Feature\tFeature\n"
1291 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1292
1293 static const char rei_feature_comp_dat[] =
1294 "Feature_\tComponent_\n"
1295 "s38\ts72\n"
1296 "FeatureComponents\tFeature_\tComponent_\n"
1297 "extension\textension\n";
1298
1299 static const char rei_component_dat[] =
1300 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1301 "s72\tS38\ts72\ti2\tS255\tS72\n"
1302 "Component\tComponent\n"
1303 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1304
1305 static const char rei_extension_dat[] =
1306 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1307 "s255\ts72\tS255\tS64\ts38\n"
1308 "Extension\tExtension\tComponent_\n"
1309 "extension\textension\tProg.Id.1\t\textension\n";
1310
1311 static const char rei_verb_dat[] =
1312 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1313 "s255\ts32\tI2\tL255\tL255\n"
1314 "Verb\tExtension_\tVerb\n"
1315 "extension\tOpen\t1\t&Open\t/argument\n";
1316
1317 static const char rei_progid_dat[] =
1318 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1319 "s255\tS255\tS38\tL255\tS72\tI2\n"
1320 "ProgId\tProgId\n"
1321 "Prog.Id.1\t\t\tdescription\t\t\n";
1322
1323 static const char rei_install_exec_seq_dat[] =
1324 "Action\tCondition\tSequence\n"
1325 "s72\tS255\tI2\n"
1326 "InstallExecuteSequence\tAction\n"
1327 "LaunchConditions\t\t100\n"
1328 "CostInitialize\t\t800\n"
1329 "FileCost\t\t900\n"
1330 "CostFinalize\t\t1000\n"
1331 "InstallValidate\t\t1400\n"
1332 "InstallInitialize\t\t1500\n"
1333 "ProcessComponents\t\t1600\n"
1334 "RemoveFiles\t\t1700\n"
1335 "InstallFiles\t\t2000\n"
1336 "UnregisterExtensionInfo\t\t3000\n"
1337 "RegisterExtensionInfo\t\t4000\n"
1338 "RegisterProduct\t\t5000\n"
1339 "PublishFeatures\t\t5100\n"
1340 "PublishProduct\t\t5200\n"
1341 "InstallFinalize\t\t6000\n";
1342
1343 static const char rpi_file_dat[] =
1344 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1345 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1346 "File\tFile\n"
1347 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1348
1349 static const char rpi_feature_dat[] =
1350 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1351 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1352 "Feature\tFeature\n"
1353 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1354
1355 static const char rpi_feature_comp_dat[] =
1356 "Feature_\tComponent_\n"
1357 "s38\ts72\n"
1358 "FeatureComponents\tFeature_\tComponent_\n"
1359 "progid\tprogid\n";
1360
1361 static const char rpi_component_dat[] =
1362 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1363 "s72\tS38\ts72\ti2\tS255\tS72\n"
1364 "Component\tComponent\n"
1365 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1366
1367 static const char rpi_appid_dat[] =
1368 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1369 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1370 "AppId\tAppId\n"
1371 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1372
1373 static const char rpi_class_dat[] =
1374 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1375 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1376 "Class\tCLSID\tContext\tComponent_\n"
1377 "{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"
1378 "{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"
1379 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1380
1381 static const char rpi_extension_dat[] =
1382 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1383 "s255\ts72\tS255\tS64\ts38\n"
1384 "Extension\tExtension\tComponent_\n"
1385 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1386
1387 static const char rpi_verb_dat[] =
1388 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1389 "s255\ts32\tI2\tL255\tL255\n"
1390 "Verb\tExtension_\tVerb\n"
1391 "winetest\tOpen\t1\t&Open\t/argument\n";
1392
1393 static const char rpi_progid_dat[] =
1394 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1395 "s255\tS255\tS38\tL255\tS72\tI2\n"
1396 "ProgId\tProgId\n"
1397 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1398 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1399 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1400 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1401 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1402 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1403 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1404 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1405 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1406 "Winetest.Extension\t\t\tdescription\t\t\n";
1407
1408 static const char rpi_install_exec_seq_dat[] =
1409 "Action\tCondition\tSequence\n"
1410 "s72\tS255\tI2\n"
1411 "InstallExecuteSequence\tAction\n"
1412 "LaunchConditions\t\t100\n"
1413 "CostInitialize\t\t800\n"
1414 "FileCost\t\t900\n"
1415 "CostFinalize\t\t1000\n"
1416 "InstallValidate\t\t1400\n"
1417 "InstallInitialize\t\t1500\n"
1418 "ProcessComponents\t\t1600\n"
1419 "RemoveFiles\t\t1700\n"
1420 "UnregisterClassInfo\t\t3000\n"
1421 "UnregisterExtensionInfo\t\t3200\n"
1422 "UnregisterProgIdInfo\t\t3400\n"
1423 "InstallFiles\t\t3600\n"
1424 "RegisterClassInfo\t\t4000\n"
1425 "RegisterExtensionInfo\t\t4200\n"
1426 "RegisterProgIdInfo\t\t4400\n"
1427 "RegisterProduct\t\t5000\n"
1428 "PublishFeatures\t\t5100\n"
1429 "PublishProduct\t\t5200\n"
1430 "InstallFinalize\t\t6000\n";
1431
1432 static const char rmi_file_dat[] =
1433 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1434 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1435 "File\tFile\n"
1436 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1437
1438 static const char rmi_feature_dat[] =
1439 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1440 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1441 "Feature\tFeature\n"
1442 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1443
1444 static const char rmi_feature_comp_dat[] =
1445 "Feature_\tComponent_\n"
1446 "s38\ts72\n"
1447 "FeatureComponents\tFeature_\tComponent_\n"
1448 "mime\tmime\n";
1449
1450 static const char rmi_component_dat[] =
1451 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1452 "s72\tS38\ts72\ti2\tS255\tS72\n"
1453 "Component\tComponent\n"
1454 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1455
1456 static const char rmi_extension_dat[] =
1457 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1458 "s255\ts72\tS255\tS64\ts38\n"
1459 "Extension\tExtension\tComponent_\n"
1460 "mime\tmime\t\tmime/type\tmime\n";
1461
1462 static const char rmi_verb_dat[] =
1463 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1464 "s255\ts32\tI2\tL255\tL255\n"
1465 "Verb\tExtension_\tVerb\n"
1466 "mime\tOpen\t1\t&Open\t/argument\n";
1467
1468 static const char rmi_mime_dat[] =
1469 "ContentType\tExtension_\tCLSID\n"
1470 "s64\ts255\tS38\n"
1471 "MIME\tContentType\n"
1472 "mime/type\tmime\t\n";
1473
1474 static const char rmi_install_exec_seq_dat[] =
1475 "Action\tCondition\tSequence\n"
1476 "s72\tS255\tI2\n"
1477 "InstallExecuteSequence\tAction\n"
1478 "LaunchConditions\t\t100\n"
1479 "CostInitialize\t\t800\n"
1480 "FileCost\t\t900\n"
1481 "CostFinalize\t\t1000\n"
1482 "InstallValidate\t\t1400\n"
1483 "InstallInitialize\t\t1500\n"
1484 "ProcessComponents\t\t1600\n"
1485 "RemoveFiles\t\t1700\n"
1486 "InstallFiles\t\t2000\n"
1487 "UnregisterExtensionInfo\t\t3000\n"
1488 "UnregisterMIMEInfo\t\t3500\n"
1489 "RegisterExtensionInfo\t\t4000\n"
1490 "RegisterMIMEInfo\t\t4500\n"
1491 "RegisterProduct\t\t5000\n"
1492 "PublishFeatures\t\t5100\n"
1493 "PublishProduct\t\t5200\n"
1494 "InstallFinalize\t\t6000\n";
1495
1496 static const char pa_file_dat[] =
1497 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1498 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1499 "File\tFile\n"
1500 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1501 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1502 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1503 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1504 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1505 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1506 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1507 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1508
1509 static const char pa_feature_dat[] =
1510 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1511 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1512 "Feature\tFeature\n"
1513 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1514
1515 static const char pa_feature_comp_dat[] =
1516 "Feature_\tComponent_\n"
1517 "s38\ts72\n"
1518 "FeatureComponents\tFeature_\tComponent_\n"
1519 "assembly\twin32\n"
1520 "assembly\twin32_local\n"
1521 "assembly\tdotnet\n"
1522 "assembly\tdotnet_local\n";
1523
1524 static const char pa_component_dat[] =
1525 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1526 "s72\tS38\ts72\ti2\tS255\tS72\n"
1527 "Component\tComponent\n"
1528 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1529 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1530 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1531 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1532
1533 static const char pa_msi_assembly_dat[] =
1534 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1535 "s72\ts38\tS72\tS72\tI2\n"
1536 "MsiAssembly\tComponent_\n"
1537 "win32\tassembly\tmanifest.txt\t\t1\n"
1538 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1539 "dotnet\tassembly\t\t\t0\n"
1540 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1541
1542 static const char pa_msi_assembly_name_dat[] =
1543 "Component_\tName\tValue\n"
1544 "s72\ts255\ts255\n"
1545 "MsiAssemblyName\tComponent_\tName\n"
1546 "win32\tName\tWine.Win32.Assembly\n"
1547 "win32\tprocessorArchitecture\tx86\n"
1548 "win32\tpublicKeyToken\tabcdef0123456789\n"
1549 "win32\ttype\twin32\n"
1550 "win32\tversion\t1.0.0.0\n"
1551 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1552 "win32_local\tprocessorArchitecture\tx86\n"
1553 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1554 "win32_local\ttype\twin32\n"
1555 "win32_local\tversion\t1.0.0.0\n"
1556 "dotnet\tName\tWine.Dotnet.Assembly\n"
1557 "dotnet\tprocessorArchitecture\tMSIL\n"
1558 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1559 "dotnet\tculture\tneutral\n"
1560 "dotnet\tversion\t1.0.0.0\n"
1561 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1562 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1563 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1564 "dotnet_local\tculture\tneutral\n"
1565 "dotnet_local\tversion\t1.0.0.0\n";
1566
1567 static const char pa_install_exec_seq_dat[] =
1568 "Action\tCondition\tSequence\n"
1569 "s72\tS255\tI2\n"
1570 "InstallExecuteSequence\tAction\n"
1571 "LaunchConditions\t\t100\n"
1572 "CostInitialize\t\t800\n"
1573 "FileCost\t\t900\n"
1574 "CostFinalize\t\t1000\n"
1575 "InstallValidate\t\t1400\n"
1576 "InstallInitialize\t\t1500\n"
1577 "ProcessComponents\t\t1600\n"
1578 "MsiPublishAssemblies\t\t3000\n"
1579 "MsiUnpublishAssemblies\t\t4000\n"
1580 "RegisterProduct\t\t5000\n"
1581 "PublishFeatures\t\t5100\n"
1582 "PublishProduct\t\t5200\n"
1583 "InstallFinalize\t\t6000\n";
1584
1585 static const char rep_file_dat[] =
1586 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1587 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1588 "File\tFile\n"
1589 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1590
1591 static const char rep_feature_dat[] =
1592 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1593 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1594 "Feature\tFeature\n"
1595 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1596
1597 static const char rep_feature_comp_dat[] =
1598 "Feature_\tComponent_\n"
1599 "s38\ts72\n"
1600 "FeatureComponents\tFeature_\tComponent_\n"
1601 "rep\trep\n";
1602
1603 static const char rep_component_dat[] =
1604 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1605 "s72\tS38\ts72\ti2\tS255\tS72\n"
1606 "Component\tComponent\n"
1607 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1608
1609 static const char rep_upgrade_dat[] =
1610 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1611 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1612 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1613 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1614
1615 static const char rep_property_dat[] =
1616 "Property\tValue\n"
1617 "s72\tl0\n"
1618 "Property\tProperty\n"
1619 "HASUIRUN\t0\n"
1620 "INSTALLLEVEL\t3\n"
1621 "InstallMode\tTypical\n"
1622 "Manufacturer\tWine\n"
1623 "PIDTemplate\t###-#######\n"
1624 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1625 "ProductLanguage\t1033\n"
1626 "ProductName\tMSITEST\n"
1627 "ProductVersion\t1.1.1\n"
1628 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1629 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1630 "MSIFASTINSTALL\t1\n";
1631
1632 static const char rep_install_exec_seq_dat[] =
1633 "Action\tCondition\tSequence\n"
1634 "s72\tS255\tI2\n"
1635 "InstallExecuteSequence\tAction\n"
1636 "FindRelatedProducts\t\t100\n"
1637 "CostInitialize\t\t800\n"
1638 "FileCost\t\t900\n"
1639 "CostFinalize\t\t1000\n"
1640 "InstallValidate\t\t1400\n"
1641 "RemoveExistingProducts\t\t1499\n"
1642 "InstallInitialize\t\t1500\n"
1643 "ProcessComponents\t\t1600\n"
1644 "RemoveFiles\t\t1700\n"
1645 "InstallFiles\t\t2000\n"
1646 "UnregisterExtensionInfo\t\t3000\n"
1647 "UnregisterMIMEInfo\t\t3500\n"
1648 "RegisterExtensionInfo\t\t4000\n"
1649 "RegisterMIMEInfo\t\t4500\n"
1650 "RegisterProduct\t\t5000\n"
1651 "PublishFeatures\t\t5100\n"
1652 "PublishProduct\t\t5200\n"
1653 "InstallFinalize\t\t6000\n";
1654
1655 typedef struct _msi_table
1656 {
1657 const char *filename;
1658 const char *data;
1659 unsigned int size;
1660 } msi_table;
1661
1662 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1663
1664 static const msi_table env_tables[] =
1665 {
1666 ADD_TABLE(component),
1667 ADD_TABLE(directory),
1668 ADD_TABLE(feature),
1669 ADD_TABLE(feature_comp),
1670 ADD_TABLE(file),
1671 ADD_TABLE(install_exec_seq),
1672 ADD_TABLE(media),
1673 ADD_TABLE(property),
1674 ADD_TABLE(environment)
1675 };
1676
1677 static const msi_table pp_tables[] =
1678 {
1679 ADD_TABLE(pp_component),
1680 ADD_TABLE(directory),
1681 ADD_TABLE(rof_feature),
1682 ADD_TABLE(rof_feature_comp),
1683 ADD_TABLE(rof_file),
1684 ADD_TABLE(pp_install_exec_seq),
1685 ADD_TABLE(rof_media),
1686 ADD_TABLE(property),
1687 };
1688
1689 static const msi_table ppc_tables[] =
1690 {
1691 ADD_TABLE(ppc_component),
1692 ADD_TABLE(directory),
1693 ADD_TABLE(rof_feature),
1694 ADD_TABLE(ppc_feature_comp),
1695 ADD_TABLE(ppc_file),
1696 ADD_TABLE(pp_install_exec_seq),
1697 ADD_TABLE(ppc_media),
1698 ADD_TABLE(property),
1699 };
1700
1701 static const msi_table rem_tables[] =
1702 {
1703 ADD_TABLE(rem_component),
1704 ADD_TABLE(directory),
1705 ADD_TABLE(rof_feature),
1706 ADD_TABLE(rem_feature_comp),
1707 ADD_TABLE(rem_file),
1708 ADD_TABLE(rem_install_exec_seq),
1709 ADD_TABLE(rof_media),
1710 ADD_TABLE(property),
1711 ADD_TABLE(rem_remove_files),
1712 };
1713
1714 static const msi_table mov_tables[] =
1715 {
1716 ADD_TABLE(cwd_component),
1717 ADD_TABLE(directory),
1718 ADD_TABLE(rof_feature),
1719 ADD_TABLE(ci2_feature_comp),
1720 ADD_TABLE(ci2_file),
1721 ADD_TABLE(install_exec_seq),
1722 ADD_TABLE(rof_media),
1723 ADD_TABLE(property),
1724 ADD_TABLE(mov_move_file),
1725 };
1726
1727 static const msi_table df_tables[] =
1728 {
1729 ADD_TABLE(rof_component),
1730 ADD_TABLE(df_directory),
1731 ADD_TABLE(rof_feature),
1732 ADD_TABLE(rof_feature_comp),
1733 ADD_TABLE(rof_file),
1734 ADD_TABLE(install_exec_seq),
1735 ADD_TABLE(rof_media),
1736 ADD_TABLE(property),
1737 ADD_TABLE(df_duplicate_file),
1738 };
1739
1740 static const msi_table wrv_tables[] =
1741 {
1742 ADD_TABLE(wrv_component),
1743 ADD_TABLE(directory),
1744 ADD_TABLE(rof_feature),
1745 ADD_TABLE(ci2_feature_comp),
1746 ADD_TABLE(ci2_file),
1747 ADD_TABLE(install_exec_seq),
1748 ADD_TABLE(rof_media),
1749 ADD_TABLE(property),
1750 ADD_TABLE(wrv_registry),
1751 };
1752
1753 static const msi_table cf_tables[] =
1754 {
1755 ADD_TABLE(cf_component),
1756 ADD_TABLE(cf_directory),
1757 ADD_TABLE(cf_feature),
1758 ADD_TABLE(cf_feature_comp),
1759 ADD_TABLE(cf_file),
1760 ADD_TABLE(cf_create_folders),
1761 ADD_TABLE(cf_install_exec_seq),
1762 ADD_TABLE(media),
1763 ADD_TABLE(property)
1764 };
1765
1766 static const msi_table sss_tables[] =
1767 {
1768 ADD_TABLE(component),
1769 ADD_TABLE(directory),
1770 ADD_TABLE(feature),
1771 ADD_TABLE(feature_comp),
1772 ADD_TABLE(file),
1773 ADD_TABLE(sss_install_exec_seq),
1774 ADD_TABLE(sss_service_control),
1775 ADD_TABLE(media),
1776 ADD_TABLE(property)
1777 };
1778
1779 static const msi_table sds_tables[] =
1780 {
1781 ADD_TABLE(component),
1782 ADD_TABLE(directory),
1783 ADD_TABLE(feature),
1784 ADD_TABLE(feature_comp),
1785 ADD_TABLE(file),
1786 ADD_TABLE(sds_install_exec_seq),
1787 ADD_TABLE(service_control),
1788 ADD_TABLE(service_install),
1789 ADD_TABLE(media),
1790 ADD_TABLE(property)
1791 };
1792
1793 static const msi_table sis_tables[] =
1794 {
1795 ADD_TABLE(component),
1796 ADD_TABLE(directory),
1797 ADD_TABLE(feature),
1798 ADD_TABLE(feature_comp),
1799 ADD_TABLE(file),
1800 ADD_TABLE(sds_install_exec_seq),
1801 ADD_TABLE(service_install2),
1802 ADD_TABLE(media),
1803 ADD_TABLE(property)
1804 };
1805
1806 static const msi_table sr_tables[] =
1807 {
1808 ADD_TABLE(component),
1809 ADD_TABLE(directory),
1810 ADD_TABLE(feature),
1811 ADD_TABLE(feature_comp),
1812 ADD_TABLE(file),
1813 ADD_TABLE(sr_selfreg),
1814 ADD_TABLE(sr_install_exec_seq),
1815 ADD_TABLE(media),
1816 ADD_TABLE(property)
1817 };
1818
1819 static const msi_table font_tables[] =
1820 {
1821 ADD_TABLE(font_component),
1822 ADD_TABLE(directory),
1823 ADD_TABLE(font_feature),
1824 ADD_TABLE(font_feature_comp),
1825 ADD_TABLE(font_file),
1826 ADD_TABLE(font),
1827 ADD_TABLE(font_install_exec_seq),
1828 ADD_TABLE(font_media),
1829 ADD_TABLE(property)
1830 };
1831
1832 static const msi_table vp_tables[] =
1833 {
1834 ADD_TABLE(component),
1835 ADD_TABLE(directory),
1836 ADD_TABLE(feature),
1837 ADD_TABLE(feature_comp),
1838 ADD_TABLE(file),
1839 ADD_TABLE(vp_custom_action),
1840 ADD_TABLE(vp_install_exec_seq),
1841 ADD_TABLE(media),
1842 ADD_TABLE(vp_property)
1843 };
1844
1845 static const msi_table odbc_tables[] =
1846 {
1847 ADD_TABLE(odbc_component),
1848 ADD_TABLE(directory),
1849 ADD_TABLE(odbc_feature),
1850 ADD_TABLE(odbc_feature_comp),
1851 ADD_TABLE(odbc_file),
1852 ADD_TABLE(odbc_driver),
1853 ADD_TABLE(odbc_translator),
1854 ADD_TABLE(odbc_datasource),
1855 ADD_TABLE(odbc_install_exec_seq),
1856 ADD_TABLE(odbc_media),
1857 ADD_TABLE(property)
1858 };
1859
1860 static const msi_table tl_tables[] =
1861 {
1862 ADD_TABLE(tl_component),
1863 ADD_TABLE(directory),
1864 ADD_TABLE(tl_feature),
1865 ADD_TABLE(tl_feature_comp),
1866 ADD_TABLE(tl_file),
1867 ADD_TABLE(tl_typelib),
1868 ADD_TABLE(tl_install_exec_seq),
1869 ADD_TABLE(media),
1870 ADD_TABLE(property)
1871 };
1872
1873 static const msi_table crs_tables[] =
1874 {
1875 ADD_TABLE(crs_component),
1876 ADD_TABLE(directory),
1877 ADD_TABLE(crs_feature),
1878 ADD_TABLE(crs_feature_comp),
1879 ADD_TABLE(crs_file),
1880 ADD_TABLE(crs_shortcut),
1881 ADD_TABLE(crs_install_exec_seq),
1882 ADD_TABLE(media),
1883 ADD_TABLE(property)
1884 };
1885
1886 static const msi_table pub_tables[] =
1887 {
1888 ADD_TABLE(directory),
1889 ADD_TABLE(pub_component),
1890 ADD_TABLE(pub_feature),
1891 ADD_TABLE(pub_feature_comp),
1892 ADD_TABLE(pub_file),
1893 ADD_TABLE(pub_publish_component),
1894 ADD_TABLE(pub_install_exec_seq),
1895 ADD_TABLE(media),
1896 ADD_TABLE(property)
1897 };
1898
1899 static const msi_table rd_tables[] =
1900 {
1901 ADD_TABLE(directory),
1902 ADD_TABLE(rd_component),
1903 ADD_TABLE(rd_feature),
1904 ADD_TABLE(rd_feature_comp),
1905 ADD_TABLE(rd_file),
1906 ADD_TABLE(rd_duplicate_file),
1907 ADD_TABLE(rd_install_exec_seq),
1908 ADD_TABLE(media),
1909 ADD_TABLE(property)
1910 };
1911
1912 static const msi_table rrv_tables[] =
1913 {
1914 ADD_TABLE(directory),
1915 ADD_TABLE(rrv_component),
1916 ADD_TABLE(rrv_feature),
1917 ADD_TABLE(rrv_feature_comp),
1918 ADD_TABLE(rrv_file),
1919 ADD_TABLE(rrv_registry),
1920 ADD_TABLE(rrv_remove_registry),
1921 ADD_TABLE(rrv_install_exec_seq),
1922 ADD_TABLE(media),
1923 ADD_TABLE(property)
1924 };
1925
1926 static const msi_table frp_tables[] =
1927 {
1928 ADD_TABLE(directory),
1929 ADD_TABLE(frp_component),
1930 ADD_TABLE(frp_feature),
1931 ADD_TABLE(frp_feature_comp),
1932 ADD_TABLE(frp_file),
1933 ADD_TABLE(frp_upgrade),
1934 ADD_TABLE(frp_custom_action),
1935 ADD_TABLE(frp_install_exec_seq),
1936 ADD_TABLE(media),
1937 ADD_TABLE(property)
1938 };
1939
1940 static const msi_table riv_tables[] =
1941 {
1942 ADD_TABLE(directory),
1943 ADD_TABLE(riv_component),
1944 ADD_TABLE(riv_feature),
1945 ADD_TABLE(riv_feature_comp),
1946 ADD_TABLE(riv_file),
1947 ADD_TABLE(riv_ini_file),
1948 ADD_TABLE(riv_remove_ini_file),
1949 ADD_TABLE(riv_install_exec_seq),
1950 ADD_TABLE(media),
1951 ADD_TABLE(property)
1952 };
1953
1954 static const msi_table res_tables[] =
1955 {
1956 ADD_TABLE(directory),
1957 ADD_TABLE(res_component),
1958 ADD_TABLE(res_feature),
1959 ADD_TABLE(res_feature_comp),
1960 ADD_TABLE(res_file),
1961 ADD_TABLE(res_environment),
1962 ADD_TABLE(res_install_exec_seq),
1963 ADD_TABLE(media),
1964 ADD_TABLE(property)
1965 };
1966
1967 static const msi_table rci_tables[] =
1968 {
1969 ADD_TABLE(directory),
1970 ADD_TABLE(rci_component),
1971 ADD_TABLE(rci_feature),
1972 ADD_TABLE(rci_feature_comp),
1973 ADD_TABLE(rci_file),
1974 ADD_TABLE(rci_appid),
1975 ADD_TABLE(rci_class),
1976 ADD_TABLE(rci_install_exec_seq),
1977 ADD_TABLE(media),
1978 ADD_TABLE(property)
1979 };
1980
1981 static const msi_table rei_tables[] =
1982 {
1983 ADD_TABLE(directory),
1984 ADD_TABLE(rei_component),
1985 ADD_TABLE(rei_feature),
1986 ADD_TABLE(rei_feature_comp),
1987 ADD_TABLE(rei_file),
1988 ADD_TABLE(rei_extension),
1989 ADD_TABLE(rei_verb),
1990 ADD_TABLE(rei_progid),
1991 ADD_TABLE(rei_install_exec_seq),
1992 ADD_TABLE(media),
1993 ADD_TABLE(property)
1994 };
1995
1996 static const msi_table rpi_tables[] =
1997 {
1998 ADD_TABLE(directory),
1999 ADD_TABLE(rpi_component),
2000 ADD_TABLE(rpi_feature),
2001 ADD_TABLE(rpi_feature_comp),
2002 ADD_TABLE(rpi_file),
2003 ADD_TABLE(rpi_appid),
2004 ADD_TABLE(rpi_class),
2005 ADD_TABLE(rpi_extension),
2006 ADD_TABLE(rpi_verb),
2007 ADD_TABLE(rpi_progid),
2008 ADD_TABLE(rpi_install_exec_seq),
2009 ADD_TABLE(media),
2010 ADD_TABLE(property)
2011 };
2012
2013 static const msi_table rmi_tables[] =
2014 {
2015 ADD_TABLE(directory),
2016 ADD_TABLE(rmi_component),
2017 ADD_TABLE(rmi_feature),
2018 ADD_TABLE(rmi_feature_comp),
2019 ADD_TABLE(rmi_file),
2020 ADD_TABLE(rmi_extension),
2021 ADD_TABLE(rmi_verb),
2022 ADD_TABLE(rmi_mime),
2023 ADD_TABLE(rmi_install_exec_seq),
2024 ADD_TABLE(media),
2025 ADD_TABLE(property)
2026 };
2027
2028 static const msi_table pa_tables[] =
2029 {
2030 ADD_TABLE(directory),
2031 ADD_TABLE(pa_component),
2032 ADD_TABLE(pa_feature),
2033 ADD_TABLE(pa_feature_comp),
2034 ADD_TABLE(pa_file),
2035 ADD_TABLE(pa_msi_assembly),
2036 ADD_TABLE(pa_msi_assembly_name),
2037 ADD_TABLE(pa_install_exec_seq),
2038 ADD_TABLE(media),
2039 ADD_TABLE(property)
2040 };
2041
2042 static const msi_table rep_tables[] =
2043 {
2044 ADD_TABLE(directory),
2045 ADD_TABLE(rep_component),
2046 ADD_TABLE(rep_feature),
2047 ADD_TABLE(rep_feature_comp),
2048 ADD_TABLE(rep_file),
2049 ADD_TABLE(rep_upgrade),
2050 ADD_TABLE(rep_property),
2051 ADD_TABLE(rep_install_exec_seq),
2052 ADD_TABLE(media)
2053 };
2054
2055 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2056 static LSTATUS action_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey, REGSAM access)
2057 {
2058 LONG ret;
2059 DWORD dwMaxSubkeyLen, dwMaxValueLen;
2060 DWORD dwMaxLen, dwSize;
2061 char szNameBuf[MAX_PATH], *lpszName = szNameBuf;
2062 HKEY hSubKey = hKey;
2063
2064 if(lpszSubKey)
2065 {
2066 ret = RegOpenKeyExA(hKey, lpszSubKey, 0, access, &hSubKey);
2067 if (ret) return ret;
2068 }
2069
2070 ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
2071 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
2072 if (ret) goto cleanup;
2073
2074 dwMaxSubkeyLen++;
2075 dwMaxValueLen++;
2076 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
2077 if (dwMaxLen > sizeof(szNameBuf))
2078 {
2079 /* Name too big: alloc a buffer for it */
2080 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen)))
2081 {
2082 ret = ERROR_NOT_ENOUGH_MEMORY;
2083 goto cleanup;
2084 }
2085 }
2086
2087 /* Recursively delete all the subkeys */
2088 while (TRUE)
2089 {
2090 dwSize = dwMaxLen;
2091 if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
2092 NULL, NULL, NULL)) break;
2093
2094 ret = action_RegDeleteTreeA(hSubKey, lpszName, access);
2095 if (ret) goto cleanup;
2096 }
2097
2098 if (lpszSubKey)
2099 {
2100 if (pRegDeleteKeyExA)
2101 ret = pRegDeleteKeyExA(hKey, lpszSubKey, access, 0);
2102 else
2103 ret = RegDeleteKeyA(hKey, lpszSubKey);
2104 }
2105 else
2106 while (TRUE)
2107 {
2108 dwSize = dwMaxLen;
2109 if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
2110 NULL, NULL, NULL, NULL)) break;
2111
2112 ret = RegDeleteValueA(hKey, lpszName);
2113 if (ret) goto cleanup;
2114 }
2115
2116 cleanup:
2117 if (lpszName != szNameBuf)
2118 HeapFree(GetProcessHeap(), 0, lpszName);
2119 if(lpszSubKey)
2120 RegCloseKey(hSubKey);
2121 return ret;
2122 }
2123
2124 /* cabinet definitions */
2125
2126 /* make the max size large so there is only one cab file */
2127 #define MEDIA_SIZE 0x7FFFFFFF
2128 #define FOLDER_THRESHOLD 900000
2129
2130 /* the FCI callbacks */
2131
2132 static void * CDECL mem_alloc(ULONG cb)
2133 {
2134 return HeapAlloc(GetProcessHeap(), 0, cb);
2135 }
2136
2137 static void CDECL mem_free(void *memory)
2138 {
2139 HeapFree(GetProcessHeap(), 0, memory);
2140 }
2141
2142 static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
2143 {
2144 sprintf(pccab->szCab, pv, pccab->iCab);
2145 return TRUE;
2146 }
2147
2148 static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
2149 {
2150 return 0;
2151 }
2152
2153 static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
2154 BOOL fContinuation, void *pv)
2155 {
2156 return 0;
2157 }
2158
2159 static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
2160 {
2161 HANDLE handle;
2162 DWORD dwAccess = 0;
2163 DWORD dwShareMode = 0;
2164 DWORD dwCreateDisposition = OPEN_EXISTING;
2165
2166 dwAccess = GENERIC_READ | GENERIC_WRITE;
2167 dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
2168
2169 if (GetFileAttributesA(pszFile) != INVALID_FILE_ATTRIBUTES)
2170 dwCreateDisposition = OPEN_EXISTING;
2171 else
2172 dwCreateDisposition = CREATE_NEW;
2173
2174 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
2175 dwCreateDisposition, 0, NULL);
2176
2177 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
2178
2179 return (INT_PTR)handle;
2180 }
2181
2182 static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2183 {
2184 HANDLE handle = (HANDLE)hf;
2185 DWORD dwRead;
2186 BOOL res;
2187
2188 res = ReadFile(handle, memory, cb, &dwRead, NULL);
2189 ok(res, "Failed to ReadFile\n");
2190
2191 return dwRead;
2192 }
2193
2194 static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
2195 {
2196 HANDLE handle = (HANDLE)hf;
2197 DWORD dwWritten;
2198 BOOL res;
2199
2200 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
2201 ok(res, "Failed to WriteFile\n");
2202
2203 return dwWritten;
2204 }
2205
2206 static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
2207 {
2208 HANDLE handle = (HANDLE)hf;
2209 ok(CloseHandle(handle), "Failed to CloseHandle\n");
2210
2211 return 0;
2212 }
2213
2214 static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
2215 {
2216 HANDLE handle = (HANDLE)hf;
2217 DWORD ret;
2218
2219 ret = SetFilePointer(handle, dist, NULL, seektype);
2220 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
2221
2222 return ret;
2223 }
2224
2225 static int CDECL fci_delete(char *pszFile, int *err, void *pv)
2226 {
2227 BOOL ret = DeleteFileA(pszFile);
2228 ok(ret, "Failed to DeleteFile %s\n", pszFile);
2229
2230 return 0;
2231 }
2232
2233 static void init_functionpointers(void)
2234 {
2235 HMODULE hmsi = GetModuleHandleA("msi.dll");
2236 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2237 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2238
2239 #define GET_PROC(mod, func) \
2240 p ## func = (void*)GetProcAddress(mod, #func); \
2241 if(!p ## func) \
2242 trace("GetProcAddress(%s) failed\n", #func);
2243
2244 GET_PROC(hmsi, MsiQueryComponentStateA);
2245 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
2246 GET_PROC(hmsi, MsiSourceListGetInfoA);
2247 GET_PROC(hmsi, MsiGetComponentPathExA);
2248 GET_PROC(hmsi, MsiQueryFeatureStateExA);
2249
2250 GET_PROC(hadvapi32, CheckTokenMembership);
2251 GET_PROC(hadvapi32, ConvertSidToStringSidA);
2252 GET_PROC(hadvapi32, OpenProcessToken);
2253 GET_PROC(hadvapi32, RegDeleteKeyExA)
2254 GET_PROC(hkernel32, IsWow64Process)
2255
2256 hsrclient = LoadLibraryA("srclient.dll");
2257 GET_PROC(hsrclient, SRRemoveRestorePoint);
2258 GET_PROC(hsrclient, SRSetRestorePointA);
2259
2260 #undef GET_PROC
2261 }
2262
2263 static BOOL is_process_limited(void)
2264 {
2265 SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
2266 PSID Group = NULL;
2267 BOOL IsInGroup;
2268 HANDLE token;
2269
2270 if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
2271
2272 if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
2273 DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
2274 !pCheckTokenMembership(NULL, Group, &IsInGroup))
2275 {
2276 trace("Could not check if the current user is an administrator\n");
2277 FreeSid(Group);
2278 return FALSE;
2279 }
2280 FreeSid(Group);
2281
2282 if (!IsInGroup)
2283 {
2284 /* Only administrators have enough privileges for these tests */
2285 return TRUE;
2286 }
2287
2288 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
2289 {
2290 BOOL ret;
2291 TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
2292 DWORD size;
2293
2294 ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
2295 CloseHandle(token);
2296 return (ret && type == TokenElevationTypeLimited);
2297 }
2298 return FALSE;
2299 }
2300
2301 static char *get_user_sid(void)
2302 {
2303 HANDLE token;
2304 DWORD size = 0;
2305 TOKEN_USER *user;
2306 char *usersid = NULL;
2307
2308 if (!pConvertSidToStringSidA)
2309 {
2310 win_skip("ConvertSidToStringSidA is not available\n");
2311 return NULL;
2312 }
2313 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
2314 GetTokenInformation(token, TokenUser, NULL, size, &size);
2315
2316 user = HeapAlloc(GetProcessHeap(), 0, size);
2317 GetTokenInformation(token, TokenUser, user, size, &size);
2318 pConvertSidToStringSidA(user->User.Sid, &usersid);
2319 HeapFree(GetProcessHeap(), 0, user);
2320
2321 CloseHandle(token);
2322 return usersid;
2323 }
2324
2325 static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
2326 {
2327 LPSTR tempname;
2328
2329 tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
2330 GetTempFileNameA(".", "xx", 0, tempname);
2331
2332 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2333 {
2334 lstrcpyA(pszTempName, tempname);
2335 HeapFree(GetProcessHeap(), 0, tempname);
2336 return TRUE;
2337 }
2338
2339 HeapFree(GetProcessHeap(), 0, tempname);
2340
2341 return FALSE;
2342 }
2343
2344 static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
2345 USHORT *pattribs, int *err, void *pv)
2346 {
2347 BY_HANDLE_FILE_INFORMATION finfo;
2348 FILETIME filetime;
2349 HANDLE handle;
2350 DWORD attrs;
2351 BOOL res;
2352
2353 handle = CreateFileA(pszName, GENERIC_READ, FILE_SHARE_READ, NULL,
2354 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
2355
2356 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2357
2358 res = GetFileInformationByHandle(handle, &finfo);
2359 ok(res, "Expected GetFileInformationByHandle to succeed\n");
2360
2361 FileTimeToLocalFileTime(&finfo.ftLastWriteTime, &filetime);
2362 FileTimeToDosDateTime(&filetime, pdate, ptime);
2363
2364 attrs = GetFileAttributesA(pszName);
2365 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2366
2367 return (INT_PTR)handle;
2368 }
2369
2370 static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
2371 {
2372 char path[MAX_PATH];
2373 char filename[MAX_PATH];
2374
2375 lstrcpyA(path, CURR_DIR);
2376 lstrcatA(path, "\\");
2377 lstrcatA(path, file);
2378
2379 lstrcpyA(filename, file);
2380
2381 return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
2382 progress, get_open_info, compress);
2383 }
2384
2385 static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
2386 {
2387 ZeroMemory(pCabParams, sizeof(CCAB));
2388
2389 pCabParams->cb = max_size;
2390 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2391 pCabParams->setID = 0xbeef;
2392 pCabParams->iCab = 1;
2393 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2394 lstrcatA(pCabParams->szCabPath, "\\");
2395 lstrcpyA(pCabParams->szCab, name);
2396 }
2397
2398 static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
2399 {
2400 CCAB cabParams;
2401 LPCSTR ptr;
2402 HFCI hfci;
2403 ERF erf;
2404 BOOL res;
2405
2406 set_cab_parameters(&cabParams, name, max_size);
2407
2408 hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
2409 fci_read, fci_write, fci_close, fci_seek, fci_delete,
2410 get_temp_file, &cabParams, NULL);
2411
2412 ok(hfci != NULL, "Failed to create an FCI context\n");
2413
2414 ptr = files;
2415 while (*ptr)
2416 {
2417 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2418 ok(res, "Failed to add file: %s\n", ptr);
2419 ptr += lstrlenA(ptr) + 1;
2420 }
2421
2422 res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
2423 ok(res, "Failed to flush the cabinet\n");
2424
2425 res = FCIDestroy(hfci);
2426 ok(res, "Failed to destroy the cabinet\n");
2427 }
2428
2429 static BOOL get_user_dirs(void)
2430 {
2431 HKEY hkey;
2432 DWORD type, size;
2433
2434 if (RegOpenKeyA(HKEY_CURRENT_USER,
2435 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey))
2436 return FALSE;
2437
2438 size = MAX_PATH;
2439 if (RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size))
2440 {
2441 RegCloseKey(hkey);
2442 return FALSE;
2443 }
2444
2445 RegCloseKey(hkey);
2446 return TRUE;
2447 }
2448
2449 static BOOL get_system_dirs(void)
2450 {
2451 HKEY hkey;
2452 DWORD type, size;
2453
2454 if (RegOpenKeyA(HKEY_LOCAL_MACHINE,
2455 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
2456 return FALSE;
2457
2458 size = MAX_PATH;
2459 if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
2460 RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size))
2461 {
2462 RegCloseKey(hkey);
2463 return FALSE;
2464 }
2465
2466 size = MAX_PATH;
2467 if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
2468 RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size))
2469 {
2470 RegCloseKey(hkey);
2471 return FALSE;
2472 }
2473
2474 RegCloseKey(hkey);
2475
2476 if (!GetWindowsDirectoryA(WINDOWS_DIR, MAX_PATH))
2477 return FALSE;
2478
2479 return TRUE;
2480 }
2481
2482 static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
2483 {
2484 HANDLE file;
2485 DWORD written;
2486
2487 file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
2488 if (file == INVALID_HANDLE_VALUE)
2489 return;
2490
2491 WriteFile(file, data, strlen(data), &written, NULL);
2492
2493 if (size)
2494 {
2495 SetFilePointer(file, size, NULL, FILE_BEGIN);
2496 SetEndOfFile(file);
2497 }
2498
2499 CloseHandle(file);
2500 }
2501
2502 #define create_file(name, size) create_file_data(name, name, size)
2503
2504 static void create_test_files(void)
2505 {
2506 CreateDirectoryA("msitest", NULL);
2507 create_file("msitest\\one.txt", 100);
2508 CreateDirectoryA("msitest\\first", NULL);
2509 create_file("msitest\\first\\two.txt", 100);
2510 CreateDirectoryA("msitest\\second", NULL);
2511 create_file("msitest\\second\\three.txt", 100);
2512
2513 create_file("four.txt", 100);
2514 create_file("five.txt", 100);
2515 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2516
2517 create_file("msitest\\filename", 100);
2518 create_file("msitest\\service.exe", 100);
2519 create_file("msitest\\service2.exe", 100);
2520
2521 DeleteFileA("four.txt");
2522 DeleteFileA("five.txt");
2523 }
2524
2525 static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
2526 {
2527 CHAR path[MAX_PATH];
2528
2529 lstrcpyA(path, PROG_FILES_DIR);
2530 lstrcatA(path, "\\");
2531 lstrcatA(path, rel_path);
2532
2533 if (is_file)
2534 return DeleteFileA(path);
2535 else
2536 return RemoveDirectoryA(path);
2537 }
2538
2539 static void delete_test_files(void)
2540 {
2541 DeleteFileA("msitest.msi");
2542 DeleteFileA("msitest.cab");
2543 DeleteFileA("msitest\\second\\three.txt");
2544 DeleteFileA("msitest\\first\\two.txt");
2545 DeleteFileA("msitest\\one.txt");
2546 DeleteFileA("msitest\\service.exe");
2547 DeleteFileA("msitest\\service2.exe");
2548 DeleteFileA("msitest\\filename");
2549 RemoveDirectoryA("msitest\\second");
2550 RemoveDirectoryA("msitest\\first");
2551 RemoveDirectoryA("msitest");
2552 }
2553
2554 static void write_file(const CHAR *filename, const char *data, int data_size)
2555 {
2556 DWORD size;
2557 HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
2558 WriteFile(hf, data, data_size, &size, NULL);
2559 CloseHandle(hf);
2560 }
2561
2562 static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template)
2563 {
2564 MSIHANDLE summary;
2565 UINT r;
2566
2567 r = MsiGetSummaryInformationA(db, NULL, 5, &summary);
2568 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2569
2570 r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template);
2571 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2572
2573 r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL,
2574 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2575 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2576
2577 r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, version, NULL, NULL);
2578 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2579
2580 r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL);
2581 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2582
2583 r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST");
2584 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2585
2586 /* write the summary changes back to the stream */
2587 r = MsiSummaryInfoPersist(summary);
2588 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2589
2590 MsiCloseHandle(summary);
2591 }
2592
2593 #define create_database(name, tables, num_tables) \
2594 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2595
2596 #define create_database_template(name, tables, num_tables, version, template) \
2597 create_database_wordcount(name, tables, num_tables, version, 0, template);
2598
2599 static void create_database_wordcount(const CHAR *name, const msi_table *tables,
2600 int num_tables, INT version, INT wordcount,
2601 const char *template)
2602 {
2603 MSIHANDLE db;
2604 UINT r;
2605 WCHAR *nameW;
2606 int j, len;
2607
2608 len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
2609 if (!(nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return;
2610 MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
2611
2612 r = MsiOpenDatabaseW(nameW, MSIDBOPEN_CREATE, &db);
2613 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2614
2615 /* import the tables into the database */
2616 for (j = 0; j < num_tables; j++)
2617 {
2618 const msi_table *table = &tables[j];
2619
2620 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2621
2622 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2623 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2624
2625 DeleteFileA(table->filename);
2626 }
2627
2628 write_msi_summary_info(db, version, wordcount, template);
2629
2630 r = MsiDatabaseCommit(db);
2631 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2632
2633 MsiCloseHandle(db);
2634 HeapFree( GetProcessHeap(), 0, nameW );
2635 }
2636
2637 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
2638 {
2639 RESTOREPOINTINFOA spec;
2640
2641 spec.dwEventType = event_type;
2642 spec.dwRestorePtType = APPLICATION_INSTALL;
2643 spec.llSequenceNumber = status->llSequenceNumber;
2644 lstrcpyA(spec.szDescription, "msitest restore point");
2645
2646 return pSRSetRestorePointA(&spec, status);
2647 }
2648
2649 static void remove_restore_point(DWORD seq_number)
2650 {
2651 DWORD res;
2652
2653 res = pSRRemoveRestorePoint(seq_number);
2654 if (res != ERROR_SUCCESS)
2655 trace("Failed to remove the restore point : %08x\n", res);
2656 }
2657
2658 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
2659 {
2660 if (pRegDeleteKeyExA)
2661 return pRegDeleteKeyExA( key, subkey, access, 0 );
2662 return RegDeleteKeyA( key, subkey );
2663 }
2664
2665 static BOOL file_exists(LPCSTR file)
2666 {
2667 return GetFileAttributesA(file) != INVALID_FILE_ATTRIBUTES;
2668 }
2669
2670 static BOOL pf_exists(LPCSTR file)
2671 {
2672 CHAR path[MAX_PATH];
2673
2674 lstrcpyA(path, PROG_FILES_DIR);
2675 lstrcatA(path, "\\");
2676 lstrcatA(path, file);
2677
2678 return file_exists(path);
2679 }
2680
2681 static void delete_pfmsitest_files(void)
2682 {
2683 SHFILEOPSTRUCTA shfl;
2684 CHAR path[MAX_PATH+11];
2685
2686 lstrcpyA(path, PROG_FILES_DIR);
2687 lstrcatA(path, "\\msitest\\*");
2688 path[strlen(path) + 1] = '\0';
2689
2690 shfl.hwnd = NULL;
2691 shfl.wFunc = FO_DELETE;
2692 shfl.pFrom = path;
2693 shfl.pTo = NULL;
2694 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
2695
2696 SHFileOperationA(&shfl);
2697
2698 lstrcpyA(path, PROG_FILES_DIR);
2699 lstrcatA(path, "\\msitest");
2700 RemoveDirectoryA(path);
2701 }
2702
2703 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, DWORD line)
2704 {
2705 char val[MAX_PATH];
2706 DWORD size, type;
2707 LONG res;
2708
2709 size = MAX_PATH;
2710 val[0] = '\0';
2711 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)val, &size);
2712
2713 if (res != ERROR_SUCCESS ||
2714 (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_MULTI_SZ))
2715 {
2716 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2717 return;
2718 }
2719
2720 if (!expected)
2721 ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val);
2722 else
2723 {
2724 if (bcase)
2725 ok_(__FILE__, line)(!lstrcmpA(val, expected), "Expected %s, got %s\n", expected, val);
2726 else
2727 ok_(__FILE__, line)(!lstrcmpiA(val, expected), "Expected %s, got %s\n", expected, val);
2728 }
2729 }
2730
2731 static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line)
2732 {
2733 DWORD val, size, type;
2734 LONG res;
2735
2736 size = sizeof(DWORD);
2737 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2738
2739 if (res != ERROR_SUCCESS || type != REG_DWORD)
2740 {
2741 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2742 return;
2743 }
2744
2745 ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val);
2746 }
2747
2748 static void check_reg_dword4(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD expected3,
2749 DWORD expected4, DWORD line)
2750 {
2751 DWORD val, size, type;
2752 LONG res;
2753
2754 size = sizeof(DWORD);
2755 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2756
2757 if (res != ERROR_SUCCESS || type != REG_DWORD)
2758 {
2759 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2760 return;
2761 }
2762
2763 ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3 || val == expected4,
2764 "Expected %d, %d, %d or %d, got %d\n", expected1, expected2, expected3, expected4, val);
2765 }
2766
2767 static void check_reg_dword5(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD expected3,
2768 DWORD expected4, DWORD expected5, DWORD line)
2769 {
2770 DWORD val, size, type;
2771 LONG res;
2772
2773 size = sizeof(DWORD);
2774 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2775
2776 if (res != ERROR_SUCCESS || type != REG_DWORD)
2777 {
2778 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2779 return;
2780 }
2781
2782 ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3 || val == expected4 ||
2783 val == expected5,
2784 "Expected %d, %d, %d, %d or %d, got %d\n", expected1, expected2, expected3, expected4, expected5, val);
2785 }
2786
2787 #define CHECK_REG_STR(prodkey, name, expected) \
2788 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2789
2790 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2791 do { \
2792 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2793 RegDeleteValueA(prodkey, name); \
2794 } while(0)
2795
2796 #define CHECK_REG_ISTR(prodkey, name, expected) \
2797 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2798
2799 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2800 do { \
2801 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2802 RegDeleteValueA(prodkey, name); \
2803 } while(0)
2804
2805 #define CHECK_REG_DWORD(prodkey, name, expected) \
2806 check_reg_dword(prodkey, name, expected, __LINE__);
2807
2808 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2809 do { \
2810 check_reg_dword(prodkey, name, expected, __LINE__); \
2811 RegDeleteValueA(prodkey, name); \
2812 } while(0)
2813
2814 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
2815 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
2816
2817 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
2818 do { \
2819 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
2820 RegDeleteValueA(prodkey, name); \
2821 } while(0)
2822
2823 #define CHECK_REG_DWORD4(prodkey, name, expected1, expected2, expected3, expected4) \
2824 check_reg_dword4(prodkey, name, expected1, expected2, expected3, expected4, __LINE__);
2825
2826 #define CHECK_DEL_REG_DWORD5(prodkey, name, expected1, expected2, expected3, expected4 ,expected5) \
2827 do { \
2828 check_reg_dword5(prodkey, name, expected1, expected2, expected3, expected4, expected5, __LINE__); \
2829 RegDeleteValueA(prodkey, name); \
2830 } while(0)
2831
2832 static void get_date_str(LPSTR date)
2833 {
2834 SYSTEMTIME systime;
2835
2836 static const char date_fmt[] = "%d%02d%02d";
2837 GetLocalTime(&systime);
2838 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
2839 }
2840
2841 static void test_register_product(void)
2842 {
2843 UINT r;
2844 LONG res;
2845 HKEY hkey, props, usage;
2846 LPSTR usersid;
2847 char date[MAX_PATH], temp[MAX_PATH], keypath[MAX_PATH], path[MAX_PATH];
2848 DWORD size, type;
2849 REGSAM access = KEY_ALL_ACCESS;
2850
2851 static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2852 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2853 static const CHAR uninstall_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2854 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2855 static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2856 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2857 static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2858 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2859 static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2860 "\\51AAE0C44620A5E4788506E91F249BD2";
2861
2862 if (is_process_limited())
2863 {
2864 skip("process is limited\n");
2865 return;
2866 }
2867
2868 if (!(usersid = get_user_sid()))
2869 return;
2870
2871 get_date_str(date);
2872 GetTempPathA(MAX_PATH, temp);
2873
2874 CreateDirectoryA("msitest", NULL);
2875 create_file("msitest\\maximus", 500);
2876
2877 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2878
2879 if (is_wow64)
2880 access |= KEY_WOW64_64KEY;
2881
2882 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2883
2884 /* RegisterProduct */
2885 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
2886 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2887 {
2888 skip("Not enough rights to perform tests\n");
2889 goto error;
2890 }
2891 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2892 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2893 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2894
2895 res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
2896 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2897
2898 if (is_64bit)
2899 {
2900 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall_32node, 0, KEY_ALL_ACCESS, &hkey);
2901 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2902 }
2903 else
2904 {
2905 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_ALL_ACCESS, &hkey);
2906 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2907 }
2908
2909 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2910 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2911 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2912 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2913 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2914 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2915 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2916 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2917 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2918 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2919 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2920 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2921 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2922 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2923 CHECK_DEL_REG_STR(hkey, "Size", NULL);
2924 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2925 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2926 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2927 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2928 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2929 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2930 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2931 todo_wine
2932 {
2933 CHECK_DEL_REG_DWORD5(hkey, "EstimatedSize", 12, -12, 4, 10, 24);
2934 }
2935
2936 delete_key(hkey, "", access);
2937 RegCloseKey(hkey);
2938
2939 sprintf(keypath, userdata, usersid);
2940 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
2941 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2942
2943 res = RegOpenKeyExA(hkey