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