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