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