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