msi/tests: Test self-registration of a valid DLL.
[wine.git] / dlls / msi / tests / action.c
blob9dfa623758895e3f9bae8811727658665c77f7a0
1 /*
2 * Copyright (C) 2006 James Hawkins
3 * Copyright 2010 Hans Leidekker for CodeWeavers
5 * Tests concentrating on standard actions
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.
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.
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
22 #define _WIN32_MSI 300
23 #include <stdio.h>
24 #include <stdlib.h>
26 #define COBJMACROS
27 #include <windows.h>
28 #include <msiquery.h>
29 #include <msidefs.h>
30 #include <msi.h>
31 #include <fci.h>
32 #include <srrestoreptapi.h>
33 #include <wtypes.h>
34 #include <shellapi.h>
35 #include <winsvc.h>
36 #include <odbcinst.h>
38 #include "wine/test.h"
39 #include "utils.h"
40 #include "typelib.h"
42 static UINT (WINAPI *pMsiQueryComponentStateA)
43 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
44 static UINT (WINAPI *pMsiSourceListEnumSourcesA)
45 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
46 static UINT (WINAPI *pMsiSourceListGetInfoA)
47 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
48 static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
49 (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
50 static UINT (WINAPI *pMsiQueryFeatureStateExA)
51 (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
53 static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
54 static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
55 static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
57 static HMODULE hsrclient;
58 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
59 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
61 static BOOL is_wow64;
62 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
64 static const char *msifile = "msitest.msi";
66 /* msi database data */
68 static const char component_dat[] =
69 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
70 "s72\tS38\ts72\ti2\tS255\tS72\n"
71 "Component\tComponent\n"
72 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
73 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
74 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
75 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
76 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
77 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
78 "component\t\tMSITESTDIR\t0\t1\tfile\n"
79 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
80 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
81 "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
83 static const char directory_dat[] =
84 "Directory\tDirectory_Parent\tDefaultDir\n"
85 "s72\tS72\tl255\n"
86 "Directory\tDirectory\n"
87 "CABOUTDIR\tMSITESTDIR\tcabout\n"
88 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
89 "FIRSTDIR\tMSITESTDIR\tfirst\n"
90 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
91 "NEWDIR\tCABOUTDIR\tnew\n"
92 "ProgramFilesFolder\tTARGETDIR\t.\n"
93 "TARGETDIR\t\tSourceDir";
95 static const char feature_dat[] =
96 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
97 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
98 "Feature\tFeature\n"
99 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
100 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
101 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
102 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
103 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
104 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
105 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
107 static const char feature_comp_dat[] =
108 "Feature_\tComponent_\n"
109 "s38\ts72\n"
110 "FeatureComponents\tFeature_\tComponent_\n"
111 "Five\tFive\n"
112 "Four\tFour\n"
113 "One\tOne\n"
114 "Three\tThree\n"
115 "Two\tTwo\n"
116 "feature\tcomponent\n"
117 "service_feature\tservice_comp\n"
118 "service_feature\tservice_comp2\n"
119 "service_feature\tservice_comp3";
121 static const char file_dat[] =
122 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
123 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
124 "File\tFile\n"
125 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
126 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
127 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
128 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
129 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
130 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
131 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
132 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
134 static const char install_exec_seq_dat[] =
135 "Action\tCondition\tSequence\n"
136 "s72\tS255\tI2\n"
137 "InstallExecuteSequence\tAction\n"
138 "AllocateRegistrySpace\tNOT Installed\t1550\n"
139 "CostFinalize\t\t1000\n"
140 "CostInitialize\t\t800\n"
141 "FileCost\t\t900\n"
142 "ResolveSource\t\t950\n"
143 "MoveFiles\t\t1700\n"
144 "InstallFiles\t\t4000\n"
145 "DuplicateFiles\t\t4500\n"
146 "WriteEnvironmentStrings\t\t4550\n"
147 "CreateShortcuts\t\t4600\n"
148 "InstallServices\t\t5000\n"
149 "InstallFinalize\t\t6600\n"
150 "InstallInitialize\t\t1500\n"
151 "InstallValidate\t\t1400\n"
152 "LaunchConditions\t\t100\n"
153 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
155 static const char media_dat[] =
156 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
157 "i2\ti4\tL64\tS255\tS32\tS72\n"
158 "Media\tDiskId\n"
159 "1\t3\t\t\tDISK1\t\n"
160 "2\t7\t\tmsitest.cab\tDISK2\t\n";
162 static const char property_dat[] =
163 "Property\tValue\n"
164 "s72\tl0\n"
165 "Property\tProperty\n"
166 "DefaultUIFont\tDlgFont8\n"
167 "HASUIRUN\t0\n"
168 "INSTALLLEVEL\t3\n"
169 "InstallMode\tTypical\n"
170 "Manufacturer\tWine\n"
171 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
172 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
173 "ProductID\tnone\n"
174 "ProductLanguage\t1033\n"
175 "ProductName\tMSITEST\n"
176 "ProductVersion\t1.1.1\n"
177 "PROMPTROLLBACKCOST\tP\n"
178 "Setup\tSetup\n"
179 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
180 "AdminProperties\tPOSTADMIN\n"
181 "ROOTDRIVE\tC:\\\n"
182 "SERVNAME\tTestService\n"
183 "SERVNAME2\tTestService2\n"
184 "SERVDISP\tTestServiceDisp\n"
185 "SERVDISP2\tTestServiceDisp2\n"
186 "MSIFASTINSTALL\t1\n"
187 "regdata15\t#x01\n";
189 static const char environment_dat[] =
190 "Environment\tName\tValue\tComponent_\n"
191 "s72\tl255\tL255\ts72\n"
192 "Environment\tEnvironment\n"
193 "Var1\t=-MSITESTVAR1\t1\tOne\n"
194 "Var2\tMSITESTVAR2\t1\tOne\n"
195 "Var3\t=-MSITESTVAR3\t1\tOne\n"
196 "Var4\tMSITESTVAR4\t1\tOne\n"
197 "Var5\t-MSITESTVAR5\t\tOne\n"
198 "Var6\tMSITESTVAR6\t\tOne\n"
199 "Var7\t!-MSITESTVAR7\t\tOne\n"
200 "Var8\t!-*MSITESTVAR8\t\tOne\n"
201 "Var9\t=-MSITESTVAR9\t\tOne\n"
202 "Var10\t=MSITESTVAR10\t\tOne\n"
203 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
204 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
205 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
206 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
207 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
208 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
209 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
210 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
211 "Var19\t+-MSITESTVAR17\t1\tOne\n"
212 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
213 "Var21\t+-MSITESTVAR18\t1\tOne\n"
214 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
215 "Var23\t+-MSITESTVAR19\t1\tOne\n"
216 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
217 "Var25\t+-MSITESTVAR20\t1\tOne\n"
218 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"
219 "Var27\t+-MSITESTVAR21\t[~];1\tOne\n";
221 static const char service_install_dat[] =
222 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
223 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
224 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
225 "ServiceInstall\tServiceInstall\n"
226 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
227 "TestService2\t[SERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription\n";
229 static const char service_install2_dat[] =
230 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
231 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
232 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
233 "ServiceInstall\tServiceInstall\n"
234 "TestService\tTestService\tTestService\t2\t3\t32768\t\t\tTestService\t\t\tservice_comp\t\n"
235 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
237 static const char service_control_dat[] =
238 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
239 "s72\tl255\ti2\tL255\tI2\ts72\n"
240 "ServiceControl\tServiceControl\n"
241 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
242 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
244 static const char sss_service_control_dat[] =
245 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
246 "s72\tl255\ti2\tL255\tI2\ts72\n"
247 "ServiceControl\tServiceControl\n"
248 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
249 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
250 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
251 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
253 static const char sss_install_exec_seq_dat[] =
254 "Action\tCondition\tSequence\n"
255 "s72\tS255\tI2\n"
256 "InstallExecuteSequence\tAction\n"
257 "LaunchConditions\t\t100\n"
258 "CostInitialize\t\t800\n"
259 "FileCost\t\t900\n"
260 "ResolveSource\t\t950\n"
261 "CostFinalize\t\t1000\n"
262 "InstallValidate\t\t1400\n"
263 "InstallInitialize\t\t1500\n"
264 "StopServices\t\t4000\n"
265 "stop_immediate\tNOT REMOVE\t4001\n"
266 "stop_deferred\tNOT REMOVE\t4002\n"
267 "DeleteServices\t\t5000\n"
268 "MoveFiles\t\t5100\n"
269 "InstallFiles\t\t5200\n"
270 "DuplicateFiles\t\t5300\n"
271 "StartServices\t\t5400\n"
272 "start_deferred\tNOT REMOVE\t5401\n"
273 "RegisterProduct\t\t5500\n"
274 "PublishFeatures\t\t5600\n"
275 "PublishProduct\t\t5700\n"
276 "InstallFinalize\t\t6000\n";
278 static const char sss_custom_action_dat[] =
279 "Action\tType\tSource\tTarget\n"
280 "s72\ti2\tS64\tS0\n"
281 "CustomAction\tAction\n"
282 "stop_immediate\t1\tcustom.dll\tsss_started\n"
283 "stop_deferred\t1025\tcustom.dll\tsss_stopped\n"
284 "start_deferred\t1025\tcustom.dll\tsss_started\n";
286 static const char sds_install_exec_seq_dat[] =
287 "Action\tCondition\tSequence\n"
288 "s72\tS255\tI2\n"
289 "InstallExecuteSequence\tAction\n"
290 "LaunchConditions\t\t100\n"
291 "CostInitialize\t\t800\n"
292 "FileCost\t\t900\n"
293 "ResolveSource\t\t950\n"
294 "CostFinalize\t\t1000\n"
295 "InstallValidate\t\t1400\n"
296 "InstallInitialize\t\t1500\n"
297 "StopServices\t\t5000\n"
298 "DeleteServices\t\t5050\n"
299 "sds_immediate\tNOT REMOVE\t5051\n"
300 "sds_deferred\tNOT REMOVE\t5052\n"
301 "MoveFiles\t\t5100\n"
302 "InstallFiles\t\t5200\n"
303 "DuplicateFiles\t\t5300\n"
304 "InstallServices\t\t5400\n"
305 "StartServices\t\t5450\n"
306 "RegisterProduct\t\t5500\n"
307 "PublishFeatures\t\t5600\n"
308 "PublishProduct\t\t5700\n"
309 "InstallFinalize\t\t6000\n";
311 static const char sds_custom_action_dat[] =
312 "Action\tType\tSource\tTarget\n"
313 "s72\ti2\tS64\tS0\n"
314 "CustomAction\tAction\n"
315 "sds_immediate\t1\tcustom.dll\tsds_present\n"
316 "sds_deferred\t1025\tcustom.dll\tsds_absent\n";
318 static const char sis_install_exec_seq_dat[] =
319 "Action\tCondition\tSequence\n"
320 "s72\tS255\tI2\n"
321 "InstallExecuteSequence\tAction\n"
322 "CostInitialize\t\t800\n"
323 "FileCost\t\t900\n"
324 "CostFinalize\t\t1000\n"
325 "InstallValidate\t\t1400\n"
326 "InstallInitialize\t\t1500\n"
327 "StopServices\t\t5000\n"
328 "DeleteServices\t\t5050\n"
329 "InstallFiles\t\t5200\n"
330 "InstallServices\t\t5400\n"
331 "sis_immediate\tNOT REMOVE\t5401\n"
332 "sis_deferred\tNOT REMOVE\t5402\n"
333 "StartServices\t\t5450\n"
334 "RegisterProduct\t\t5500\n"
335 "PublishFeatures\t\t5600\n"
336 "PublishProduct\t\t5700\n"
337 "InstallFinalize\t\t6000\n";
339 static const char sis_custom_action_dat[] =
340 "Action\tType\tSource\tTarget\n"
341 "s72\ti2\tS64\tS0\n"
342 "CustomAction\tAction\n"
343 "sis_immediate\t1\tcustom.dll\tsis_absent\n"
344 "sis_deferred\t1025\tcustom.dll\tsis_present\n";
346 static const char rof_component_dat[] =
347 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
348 "s72\tS38\ts72\ti2\tS255\tS72\n"
349 "Component\tComponent\n"
350 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
352 static const char rof_feature_dat[] =
353 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
354 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
355 "Feature\tFeature\n"
356 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
357 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
359 static const char rof_feature_comp_dat[] =
360 "Feature_\tComponent_\n"
361 "s38\ts72\n"
362 "FeatureComponents\tFeature_\tComponent_\n"
363 "feature\tmaximus\n"
364 "montecristo\tmaximus";
366 static const char rof_file_dat[] =
367 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
368 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
369 "File\tFile\n"
370 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
372 static const char rof_media_dat[] =
373 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
374 "i2\ti4\tL64\tS255\tS32\tS72\n"
375 "Media\tDiskId\n"
376 "1\t1\t\t\tDISK1\t\n";
378 static const char ci2_feature_comp_dat[] =
379 "Feature_\tComponent_\n"
380 "s38\ts72\n"
381 "FeatureComponents\tFeature_\tComponent_\n"
382 "feature\taugustus";
384 static const char ci2_file_dat[] =
385 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
386 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
387 "File\tFile\n"
388 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
390 static const char pp_install_exec_seq_dat[] =
391 "Action\tCondition\tSequence\n"
392 "s72\tS255\tI2\n"
393 "InstallExecuteSequence\tAction\n"
394 "ValidateProductID\t\t700\n"
395 "CostInitialize\t\t800\n"
396 "FileCost\t\t900\n"
397 "CostFinalize\t\t1000\n"
398 "InstallValidate\t\t1400\n"
399 "InstallInitialize\t\t1500\n"
400 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
401 "ppc_immediate\tPROCESS_COMPONENTS AND ALLUSERS\t1601\n"
402 "ppc_deferred\tPROCESS_COMPONENTS AND ALLUSERS\t1602\n"
403 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
404 "uf_immediate\tUNPUBLISH_FEATURES AND ALLUSERS\t1801\n"
405 "uf_deferred\tUNPUBLISH_FEATURES AND ALLUSERS\t1802\n"
406 "RemoveFiles\t\t3500\n"
407 "InstallFiles\t\t4000\n"
408 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
409 "ru_immediate\tREGISTER_USER AND ALLUSERS\t6001\n"
410 "ru_deferred\tREGISTER_USER AND ALLUSERS\t6002\n"
411 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
412 "rp_immediate\tREGISTER_PRODUCT AND ALLUSERS\t6101\n"
413 "rp_deferred\tREGISTER_PRODUCT AND ALLUSERS\t6102\n"
414 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
415 "pf_immediate\tPUBLISH_FEATURES AND ALLUSERS\t6301\n"
416 "pf_deferred\tPUBLISH_FEATURES AND ALLUSERS\t6302\n"
417 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
418 "pp_immediate\tPUBLISH_PRODUCT AND ALLUSERS\t6401\n"
419 "pp_deferred\tPUBLISH_PRODUCT AND ALLUSERS\t6402\n"
420 "InstallFinalize\t\t6600";
422 static const char pp_custom_action_dat[] =
423 "Action\tType\tSource\tTarget\n"
424 "s72\ti2\tS64\tS0\n"
425 "CustomAction\tAction\n"
426 "pf_immediate\t1\tcustom.dll\tpf_absent\n"
427 "pf_deferred\t1025\tcustom.dll\tpf_present\n"
428 "uf_immediate\t1\tcustom.dll\tpf_present\n"
429 "uf_deferred\t1025\tcustom.dll\tpf_absent\n"
430 "pp_immediate\t1\tcustom.dll\tpp_absent\n"
431 "pp_deferred\t1025\tcustom.dll\tpp_present\n"
432 "rp_immediate\t1\tcustom.dll\trp_absent\n"
433 "rp_deferred\t1025\tcustom.dll\trp_present\n"
434 "ru_immediate\t1\tcustom.dll\tru_absent\n"
435 "ru_deferred\t1025\tcustom.dll\tru_present\n"
436 "ppc_immediate\t1\tcustom.dll\tppc_absent\n"
437 "ppc_deferred\t1025\tcustom.dll\tppc_present\n";
439 static const char pp_component_dat[] =
440 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
441 "s72\tS38\ts72\ti2\tS255\tS72\n"
442 "Component\tComponent\n"
443 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
445 static const char ppc_component_dat[] =
446 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
447 "s72\tS38\ts72\ti2\tS255\tS72\n"
448 "Component\tComponent\n"
449 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
450 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
452 static const char ppc_file_dat[] =
453 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
454 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
455 "File\tFile\n"
456 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
457 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
459 static const char ppc_media_dat[] =
460 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
461 "i2\ti4\tL64\tS255\tS32\tS72\n"
462 "Media\tDiskId\n"
463 "1\t2\t\t\tDISK1\t\n";
465 static const char ppc_feature_comp_dat[] =
466 "Feature_\tComponent_\n"
467 "s38\ts72\n"
468 "FeatureComponents\tFeature_\tComponent_\n"
469 "feature\tmaximus\n"
470 "feature\taugustus\n"
471 "montecristo\tmaximus";
473 static const char cwd_component_dat[] =
474 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
475 "s72\tS38\ts72\ti2\tS255\tS72\n"
476 "Component\tComponent\n"
477 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
479 static const char rem_component_dat[] =
480 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
481 "s72\tS38\ts72\ti2\tS255\tS72\n"
482 "Component\tComponent\n"
483 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
484 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
485 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
487 static const char rem_feature_comp_dat[] =
488 "Feature_\tComponent_\n"
489 "s38\ts72\n"
490 "FeatureComponents\tFeature_\tComponent_\n"
491 "feature\thydrogen\n"
492 "feature\thelium\n"
493 "feature\tlithium";
495 static const char rem_file_dat[] =
496 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
497 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
498 "File\tFile\n"
499 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
500 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
501 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
503 static const char rem_install_exec_seq_dat[] =
504 "Action\tCondition\tSequence\n"
505 "s72\tS255\tI2\n"
506 "InstallExecuteSequence\tAction\n"
507 "ValidateProductID\t\t700\n"
508 "CostInitialize\t\t800\n"
509 "FileCost\t\t900\n"
510 "CostFinalize\t\t1000\n"
511 "InstallValidate\t\t1400\n"
512 "InstallInitialize\t\t1500\n"
513 "ProcessComponents\t\t1600\n"
514 "UnpublishFeatures\t\t1800\n"
515 "RemoveFiles\t\t3500\n"
516 "InstallFiles\t\t4000\n"
517 "RegisterProduct\t\t6100\n"
518 "PublishFeatures\t\t6300\n"
519 "PublishProduct\t\t6400\n"
520 "InstallFinalize\t\t6600";
522 static const char rem_remove_files_dat[] =
523 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
524 "s72\ts72\tS255\ts72\tI2\n"
525 "RemoveFile\tFileKey\n"
526 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
527 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
528 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
529 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
530 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
531 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
532 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
533 "block\thelium\tblock\tMSITESTDIR\t3\n"
534 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
535 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
537 static const char mov_move_file_dat[] =
538 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
539 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
540 "MoveFile\tFileKey\n"
541 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
542 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
543 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
544 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
545 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
546 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
547 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
548 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
549 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
550 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
551 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
552 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
553 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
554 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
555 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
556 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
557 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
558 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
560 static const char mov_install_exec_seq_dat[] =
561 "Action\tCondition\tSequence\n"
562 "s72\tS255\tI2\n"
563 "InstallExecuteSequence\tAction\n"
564 "CostInitialize\t\t100\n"
565 "FileCost\t\t200\n"
566 "ResolveSource\t\t300\n"
567 "CostFinalize\t\t400\n"
568 "InstallValidate\t\t500\n"
569 "InstallInitialize\t\t600\n"
570 "MoveFiles\t\t700\n"
571 "mov_immediate\t\t701\n"
572 "mov_deferred\t\t702\n"
573 "InstallFiles\t\t800\n"
574 "InstallFinalize\t\t900\n";
576 static const char mov_custom_action_dat[] =
577 "Action\tType\tSource\tTarget\n"
578 "s72\ti2\tS64\tS0\n"
579 "CustomAction\tAction\n"
580 "mov_immediate\t1\tcustom.dll\tmov_absent\n"
581 "mov_deferred\t1025\tcustom.dll\tmov_present\n";
583 static const char df_directory_dat[] =
584 "Directory\tDirectory_Parent\tDefaultDir\n"
585 "s72\tS72\tl255\n"
586 "Directory\tDirectory\n"
587 "THIS\tMSITESTDIR\tthis\n"
588 "DOESNOT\tTHIS\tdoesnot\n"
589 "NONEXISTENT\tDOESNOT\texist\n"
590 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
591 "ProgramFilesFolder\tTARGETDIR\t.\n"
592 "TARGETDIR\t\tSourceDir";
594 static const char df_duplicate_file_dat[] =
595 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
596 "s72\ts72\ts72\tS255\tS72\n"
597 "DuplicateFile\tFileKey\n"
598 "maximus\tmaximus\tmaximus\taugustus\t\n"
599 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
600 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
602 static const char wrv_component_dat[] =
603 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
604 "s72\tS38\ts72\ti2\tS255\tS72\n"
605 "Component\tComponent\n"
606 "augustus\t\tMSITESTDIR\t0\t\taugustus\n"
607 "caesar\t\tMSITESTDIR\t1\t\t\n";
609 static const char wrv_feature_dat[] =
610 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
611 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
612 "Feature\tFeature\n"
613 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
614 "feature2\t\tFeature2\tFeature2\t2\t1\tTARGETDIR\t1";
616 static const char wrv_feature_comp_dat[] =
617 "Feature_\tComponent_\n"
618 "s38\ts72\n"
619 "FeatureComponents\tFeature_\tComponent_\n"
620 "feature\taugustus\n"
621 "feature2\tcaesar";
623 static const char wrv_registry_dat[] =
624 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
625 "s72\ti2\tl255\tL255\tL0\ts72\n"
626 "Registry\tRegistry\n"
627 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
628 "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
629 "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
630 "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
631 "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"
632 "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
633 "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
634 "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
635 "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
636 "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
637 "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
638 "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
639 "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
640 "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
641 "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
642 "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n"
643 "regdata16\t2\tSOFTWARE\\Wine\\msitest\tValue12\t#1\tcaesar\n";
645 static const char cf_directory_dat[] =
646 "Directory\tDirectory_Parent\tDefaultDir\n"
647 "s72\tS72\tl255\n"
648 "Directory\tDirectory\n"
649 "FIRSTDIR\tMSITESTDIR\tfirst\n"
650 "SECONDDIR\tMSITESTDIR\tsecond\n"
651 "THIRDDIR\tMSITESTDIR\tthird\n"
652 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
653 "ProgramFilesFolder\tTARGETDIR\t.\n"
654 "TARGETDIR\t\tSourceDir";
656 static const char cf_component_dat[] =
657 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
658 "s72\tS38\ts72\ti2\tS255\tS72\n"
659 "Component\tComponent\n"
660 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
661 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
663 static const char cf_feature_dat[] =
664 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
665 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
666 "Feature\tFeature\n"
667 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
668 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
670 static const char cf_feature_comp_dat[] =
671 "Feature_\tComponent_\n"
672 "s38\ts72\n"
673 "FeatureComponents\tFeature_\tComponent_\n"
674 "One\tOne\n"
675 "Two\tTwo\n";
677 static const char cf_file_dat[] =
678 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
679 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
680 "File\tFile\n"
681 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
682 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
684 static const char cf_create_folders_dat[] =
685 "Directory_\tComponent_\n"
686 "s72\ts72\n"
687 "CreateFolder\tDirectory_\tComponent_\n"
688 "FIRSTDIR\tOne\n"
689 "SECONDDIR\tTwo\n"
690 "THIRDDIR\tTwo\n";
692 static const char cf_install_exec_seq_dat[] =
693 "Action\tCondition\tSequence\n"
694 "s72\tS255\tI2\n"
695 "InstallExecuteSequence\tAction\n"
696 "CostFinalize\t\t1000\n"
697 "ValidateProductID\t\t700\n"
698 "CostInitialize\t\t800\n"
699 "FileCost\t\t900\n"
700 "RemoveFiles\t\t3500\n"
701 "rfi_immediate\tREMOVE\t3501\n"
702 "rfi_deferred\tREMOVE\t3502\n"
703 "CreateFolders\t\t3700\n"
704 "cf_immediate\tNOT REMOVE\t3701\n"
705 "cf_deferred\tNOT REMOVE\t3702\n"
706 "RemoveFolders\t\t3800\n"
707 "rf_immediate\tREMOVE\t3801\n"
708 "rf_deferred\tREMOVE\t3802\n"
709 "InstallFiles\t\t4000\n"
710 "ifi_immediate\tNOT REMOVE\t4001\n"
711 "ifi_deferred\tNOT REMOVE\t4002\n"
712 "RegisterUser\t\t6000\n"
713 "RegisterProduct\t\t6100\n"
714 "PublishFeatures\t\t6300\n"
715 "PublishProduct\t\t6400\n"
716 "InstallFinalize\t\t6600\n"
717 "InstallInitialize\t\t1500\n"
718 "ProcessComponents\t\t1600\n"
719 "UnpublishFeatures\t\t1800\n"
720 "InstallValidate\t\t1400\n"
721 "LaunchConditions\t\t100\n";
723 static const char cf_custom_action_dat[] =
724 "Action\tType\tSource\tTarget\n"
725 "s72\ti2\tS64\tS0\n"
726 "CustomAction\tAction\n"
727 "ifi_immediate\t1\tcustom.dll\tfile_absent\n"
728 "ifi_deferred\t1025\tcustom.dll\tfile_present\n"
729 "rfi_immediate\t1\tcustom.dll\tfile_present\n"
730 "rfi_deferred\t1025\tcustom.dll\tfile_absent\n"
731 "cf_immediate\t1\tcustom.dll\tcf_absent\n"
732 "cf_deferred\t1025\tcustom.dll\tcf_present\n"
733 "rf_immediate\t1\tcustom.dll\tcf_present\n"
734 "rf_deferred\t1025\tcustom.dll\tcf_absent\n";
736 static const char sr_file_dat[] =
737 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
738 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
739 "File\tFile\n"
740 "selfreg.dll\tselfreg\tselfreg.dll\t1000\t\t\t8192\t1\n";
742 static const char sr_feature_dat[] =
743 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
744 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
745 "Feature\tFeature\n"
746 "selfreg\t\t\tselfreg feature\t1\t2\tMSITESTDIR\t0\n";
748 static const char sr_feature_comp_dat[] =
749 "Feature_\tComponent_\n"
750 "s38\ts72\n"
751 "FeatureComponents\tFeature_\tComponent_\n"
752 "selfreg\tselfreg\n";
754 static const char sr_component_dat[] =
755 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
756 "s72\tS38\ts72\ti2\tS255\tS72\n"
757 "Component\tComponent\n"
758 "selfreg\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\tselfreg.dll\n";
760 static const char sr_selfreg_dat[] =
761 "File_\tCost\n"
762 "s72\tI2\n"
763 "SelfReg\tFile_\n"
764 "selfreg.dll\t\n";
766 static const char sr_install_exec_seq_dat[] =
767 "Action\tCondition\tSequence\n"
768 "s72\tS255\tI2\n"
769 "InstallExecuteSequence\tAction\n"
770 "CostInitialize\t\t800\n"
771 "FileCost\t\t900\n"
772 "CostFinalize\t\t1000\n"
773 "InstallValidate\t\t1400\n"
774 "InstallInitialize\t\t1500\n"
775 "ProcessComponents\t\t1600\n"
776 "SelfUnregModules\t\t3800\n"
777 "RemoveFiles\t\t3900\n"
778 "InstallFiles\t\t4000\n"
779 "SelfRegModules\t\t4100\n"
780 "CreateShortcuts\t\t4600\n"
781 "RegisterProduct\t\t5100\n"
782 "PublishFeatures\t\t5200\n"
783 "PublishProduct\t\t5300\n"
784 "InstallFinalize\t\t6600\n";
786 static const char font_media_dat[] =
787 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
788 "i2\ti4\tL64\tS255\tS32\tS72\n"
789 "Media\tDiskId\n"
790 "1\t3\t\t\tDISK1\t\n";
792 static const char font_file_dat[] =
793 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
794 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
795 "File\tFile\n"
796 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
798 static const char font_feature_dat[] =
799 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
800 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
801 "Feature\tFeature\n"
802 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
804 static const char font_component_dat[] =
805 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
806 "s72\tS38\ts72\ti2\tS255\tS72\n"
807 "Component\tComponent\n"
808 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
810 static const char font_feature_comp_dat[] =
811 "Feature_\tComponent_\n"
812 "s38\ts72\n"
813 "FeatureComponents\tFeature_\tComponent_\n"
814 "fonts\tfonts\n";
816 static const char font_dat[] =
817 "File_\tFontTitle\n"
818 "s72\tS128\n"
819 "Font\tFile_\n"
820 "font.ttf\tmsi test font\n";
822 static const char font_install_exec_seq_dat[] =
823 "Action\tCondition\tSequence\n"
824 "s72\tS255\tI2\n"
825 "InstallExecuteSequence\tAction\n"
826 "ValidateProductID\t\t700\n"
827 "CostInitialize\t\t800\n"
828 "FileCost\t\t900\n"
829 "CostFinalize\t\t1000\n"
830 "InstallValidate\t\t1400\n"
831 "InstallInitialize\t\t1500\n"
832 "ProcessComponents\t\t1600\n"
833 "UnpublishFeatures\t\t1800\n"
834 "RemoveFiles\t\t3500\n"
835 "InstallFiles\t\t4000\n"
836 "RegisterFonts\t\t4100\n"
837 "rf_immediate\tNOT REMOVE\t4101\n"
838 "rf_deferred\tNOT REMOVE\t4102\n"
839 "UnregisterFonts\t\t4200\n"
840 "uf_immediate\tREMOVE\t4201\n"
841 "uf_deferred\tREMOVE\t4202\n"
842 "RegisterUser\t\t6000\n"
843 "RegisterProduct\t\t6100\n"
844 "PublishFeatures\t\t6300\n"
845 "PublishProduct\t\t6400\n"
846 "InstallFinalize\t\t6600";
848 static const char font_custom_action_dat[] =
849 "Action\tType\tSource\tTarget\n"
850 "s72\ti2\tS64\tS0\n"
851 "CustomAction\tAction\n"
852 "rf_immediate\t1\tcustom.dll\tfont_absent\n"
853 "rf_deferred\t1025\tcustom.dll\tfont_present\n"
854 "uf_immediate\t1\tcustom.dll\tfont_present\n"
855 "uf_deferred\t1025\tcustom.dll\tfont_absent\n";
857 static const char vp_property_dat[] =
858 "Property\tValue\n"
859 "s72\tl0\n"
860 "Property\tProperty\n"
861 "HASUIRUN\t0\n"
862 "INSTALLLEVEL\t3\n"
863 "InstallMode\tTypical\n"
864 "Manufacturer\tWine\n"
865 "PIDTemplate\t###-#######\n"
866 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
867 "ProductLanguage\t1033\n"
868 "ProductName\tMSITEST\n"
869 "ProductVersion\t1.1.1\n"
870 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
871 "MSIFASTINSTALL\t1\n";
873 static const char vp_custom_action_dat[] =
874 "Action\tType\tSource\tTarget\tISComments\n"
875 "s72\ti2\tS64\tS0\tS255\n"
876 "CustomAction\tAction\n"
877 "SetProductID1\t51\tProductID\t1\t\n"
878 "SetProductID2\t51\tProductID\t2\t\n"
879 "TestProductID1\t19\t\t\tHalts installation\n"
880 "TestProductID2\t19\t\t\tHalts installation\n";
882 static const char vp_install_exec_seq_dat[] =
883 "Action\tCondition\tSequence\n"
884 "s72\tS255\tI2\n"
885 "InstallExecuteSequence\tAction\n"
886 "LaunchConditions\t\t100\n"
887 "CostInitialize\t\t800\n"
888 "FileCost\t\t900\n"
889 "CostFinalize\t\t1000\n"
890 "InstallValidate\t\t1400\n"
891 "InstallInitialize\t\t1500\n"
892 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
893 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
894 "ValidateProductID\t\t3200\n"
895 "InstallExecute\t\t3300\n"
896 "TestProductID1\tProductID=1\t3400\n"
897 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
898 "InstallFiles\t\t4000\n"
899 "InstallFinalize\t\t6000\n";
901 static const char odbc_file_dat[] =
902 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
903 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
904 "File\tFile\n"
905 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
906 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
907 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
908 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
909 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
911 static const char odbc_feature_dat[] =
912 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
913 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
914 "Feature\tFeature\n"
915 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
917 static const char odbc_feature_comp_dat[] =
918 "Feature_\tComponent_\n"
919 "s38\ts72\n"
920 "FeatureComponents\tFeature_\tComponent_\n"
921 "odbc\todbc64\n"
922 "odbc\todbc\n";
924 static const char odbc_component_dat[] =
925 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
926 "s72\tS38\ts72\ti2\tS255\tS72\n"
927 "Component\tComponent\n"
928 "odbc64\t{B6F3E4AF-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t256\tMsix64\tODBCdriver.dll\n"
929 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
931 static const char odbc_driver_dat[] =
932 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
933 "s72\ts72\ts255\ts72\tS72\n"
934 "ODBCDriver\tDriver\n"
935 "64-bit driver\todbc64\tODBC test driver\tODBCdriver.dll\t\n"
936 "64-bit driver2\todbc64\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n"
937 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
938 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
940 static const char odbc_translator_dat[] =
941 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
942 "s72\ts72\ts255\ts72\tS72\n"
943 "ODBCTranslator\tTranslator\n"
944 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
945 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
947 static const char odbc_datasource_dat[] =
948 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
949 "s72\ts72\ts255\ts255\ti2\n"
950 "ODBCDataSource\tDataSource\n"
951 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
953 static const char odbc_install_exec_seq_dat[] =
954 "Action\tCondition\tSequence\n"
955 "s72\tS255\tI2\n"
956 "InstallExecuteSequence\tAction\n"
957 "LaunchConditions\t\t100\n"
958 "CostInitialize\t\t800\n"
959 "FileCost\t\t900\n"
960 "CostFinalize\t\t1000\n"
961 "InstallValidate\t\t1400\n"
962 "InstallInitialize\t\t1500\n"
963 "ProcessComponents\t\t1600\n"
964 "InstallODBC\t\t3000\n"
965 "io_immediate\tNOT REMOVE\t3001\n"
966 "io_deferred\tNOT REMOVE\t3002\n"
967 "RemoveODBC\t\t3100\n"
968 "ro_immediate\tREMOVE\t3101\n"
969 "ro_deferred\tREMOVE\t3102\n"
970 "RemoveFiles\t\t3900\n"
971 "InstallFiles\t\t4000\n"
972 "RegisterProduct\t\t5000\n"
973 "PublishFeatures\t\t5100\n"
974 "PublishProduct\t\t5200\n"
975 "InstallFinalize\t\t6000\n";
977 static const char odbc_custom_action_dat[] =
978 "Action\tType\tSource\tTarget\n"
979 "s72\ti2\tS64\tS0\n"
980 "CustomAction\tAction\n"
981 "io_immediate\t1\tcustom.dll\todbc_absent\n"
982 "io_deferred\t1025\tcustom.dll\todbc_present\n"
983 "ro_immediate\t1\tcustom.dll\todbc_present\n"
984 "ro_deferred\t1025\tcustom.dll\todbc_absent\n";
986 static const char odbc_media_dat[] =
987 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
988 "i2\ti4\tL64\tS255\tS32\tS72\n"
989 "Media\tDiskId\n"
990 "1\t5\t\t\tDISK1\t\n";
992 static const char tl_file_dat[] =
993 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
994 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
995 "File\tFile\n"
996 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
998 static const char tl_feature_dat[] =
999 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1000 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1001 "Feature\tFeature\n"
1002 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
1004 static const char tl_feature_comp_dat[] =
1005 "Feature_\tComponent_\n"
1006 "s38\ts72\n"
1007 "FeatureComponents\tFeature_\tComponent_\n"
1008 "typelib\ttypelib\n";
1010 static const char tl_component_dat[] =
1011 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1012 "s72\tS38\ts72\ti2\tS255\tS72\n"
1013 "Component\tComponent\n"
1014 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
1016 static const char tl_typelib_dat[] =
1017 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
1018 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
1019 "TypeLib\tLibID\tLanguage\tComponent_\n"
1020 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
1022 static const char tl_install_exec_seq_dat[] =
1023 "Action\tCondition\tSequence\n"
1024 "s72\tS255\tI2\n"
1025 "InstallExecuteSequence\tAction\n"
1026 "LaunchConditions\t\t100\n"
1027 "CostInitialize\t\t800\n"
1028 "FileCost\t\t900\n"
1029 "CostFinalize\t\t1000\n"
1030 "InstallValidate\t\t1400\n"
1031 "InstallInitialize\t\t1500\n"
1032 "ProcessComponents\t\t1600\n"
1033 "UnregisterTypeLibraries\t\t3100\n"
1034 "ut_immediate\tREMOVE\t3101\n"
1035 "ut_deferred\tREMOVE\t3102\n"
1036 "RemoveFiles\t\t3200\n"
1037 "InstallFiles\t\t3300\n"
1038 "RegisterTypeLibraries\t\t3400\n"
1039 "rt_immediate\tNOT REMOVE\t3401\n"
1040 "rt_deferred\tNOT REMOVE\t3402\n"
1041 "RegisterProduct\t\t5100\n"
1042 "PublishFeatures\t\t5200\n"
1043 "PublishProduct\t\t5300\n"
1044 "InstallFinalize\t\t6000\n";
1046 static const char tl_custom_action_dat[] =
1047 "Action\tType\tSource\tTarget\n"
1048 "s72\ti2\tS64\tS0\n"
1049 "CustomAction\tAction\n"
1050 "rt_immediate\t1\tcustom.dll\ttl_absent\n"
1051 "rt_deferred\t1025\tcustom.dll\ttl_present\n"
1052 "ut_immediate\t1\tcustom.dll\ttl_present\n"
1053 "ut_deferred\t1025\tcustom.dll\ttl_absent\n";
1055 static const char crs_file_dat[] =
1056 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1057 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1058 "File\tFile\n"
1059 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
1061 static const char crs_feature_dat[] =
1062 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1063 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1064 "Feature\tFeature\n"
1065 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
1067 static const char crs_feature_comp_dat[] =
1068 "Feature_\tComponent_\n"
1069 "s38\ts72\n"
1070 "FeatureComponents\tFeature_\tComponent_\n"
1071 "shortcut\tshortcut\n";
1073 static const char crs_component_dat[] =
1074 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1075 "s72\tS38\ts72\ti2\tS255\tS72\n"
1076 "Component\tComponent\n"
1077 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
1079 static const char crs_shortcut_dat[] =
1080 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
1081 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
1082 "Shortcut\tShortcut\n"
1083 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
1085 static const char crs_install_exec_seq_dat[] =
1086 "Action\tCondition\tSequence\n"
1087 "s72\tS255\tI2\n"
1088 "InstallExecuteSequence\tAction\n"
1089 "LaunchConditions\t\t100\n"
1090 "CostInitialize\t\t800\n"
1091 "FileCost\t\t900\n"
1092 "CostFinalize\t\t1000\n"
1093 "InstallValidate\t\t1400\n"
1094 "InstallInitialize\t\t1500\n"
1095 "ProcessComponents\t\t1600\n"
1096 "RemoveFiles\t\t1700\n"
1097 "InstallFiles\t\t2000\n"
1098 "RemoveShortcuts\t\t3000\n"
1099 "rs_immediate\tREMOVE\t3001\n"
1100 "rs_deferred\tREMOVE\t3002\n"
1101 "CreateShortcuts\t\t3100\n"
1102 "cs_immediate\tNOT REMOVE\t3101\n"
1103 "cs_deferred\tNOT REMOVE\t3102\n"
1104 "RegisterProduct\t\t5000\n"
1105 "PublishFeatures\t\t5100\n"
1106 "PublishProduct\t\t5200\n"
1107 "InstallFinalize\t\t6000\n";
1109 static const char crs_custom_action_dat[] =
1110 "Action\tType\tSource\tTarget\n"
1111 "s72\ti2\tS64\tS0\n"
1112 "CustomAction\tAction\n"
1113 "cs_immediate\t1\tcustom.dll\tcrs_absent\n"
1114 "cs_deferred\t1025\tcustom.dll\tcrs_present\n"
1115 "rs_immediate\t1\tcustom.dll\tcrs_present\n"
1116 "rs_deferred\t1025\tcustom.dll\tcrs_absent\n";
1118 static const char pub_file_dat[] =
1119 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1120 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1121 "File\tFile\n"
1122 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
1124 static const char pub_feature_dat[] =
1125 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1126 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1127 "Feature\tFeature\n"
1128 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
1130 static const char pub_feature_comp_dat[] =
1131 "Feature_\tComponent_\n"
1132 "s38\ts72\n"
1133 "FeatureComponents\tFeature_\tComponent_\n"
1134 "publish\tpublish\n";
1136 static const char pub_component_dat[] =
1137 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1138 "s72\tS38\ts72\ti2\tS255\tS72\n"
1139 "Component\tComponent\n"
1140 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
1142 static const char pub_publish_component_dat[] =
1143 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
1144 "s38\ts255\ts72\tL255\ts38\n"
1145 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
1146 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
1148 static const char pub_install_exec_seq_dat[] =
1149 "Action\tCondition\tSequence\n"
1150 "s72\tS255\tI2\n"
1151 "InstallExecuteSequence\tAction\n"
1152 "LaunchConditions\t\t100\n"
1153 "CostInitialize\t\t800\n"
1154 "FileCost\t\t900\n"
1155 "CostFinalize\t\t1000\n"
1156 "InstallValidate\t\t1400\n"
1157 "InstallInitialize\t\t1500\n"
1158 "ProcessComponents\t\t1600\n"
1159 "RemoveFiles\t\t1700\n"
1160 "InstallFiles\t\t2000\n"
1161 "PublishComponents\t\t3000\n"
1162 "pub_immediate\tNOT REMOVE\t3001\n"
1163 "pub_deferred\tNOT REMOVE\t3002\n"
1164 "UnpublishComponents\t\t3100\n"
1165 "unp_immediate\tREMOVE\t3101\n"
1166 "unp_deferred\tREMOVE\t3102\n"
1167 "RegisterProduct\t\t5000\n"
1168 "PublishFeatures\t\t5100\n"
1169 "PublishProduct\t\t5200\n"
1170 "InstallFinalize\t\t6000\n";
1172 static const char pub_custom_action_dat[] =
1173 "Action\tType\tSource\tTarget\n"
1174 "s72\ti2\tS64\tS0\n"
1175 "CustomAction\tAction\n"
1176 "pub_immediate\t1\tcustom.dll\tpub_absent\n"
1177 "pub_deferred\t1025\tcustom.dll\tpub_present\n"
1178 "unp_immediate\t1\tcustom.dll\tpub_present\n"
1179 "unp_deferred\t1025\tcustom.dll\tpub_absent\n";
1181 static const char rd_file_dat[] =
1182 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1183 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1184 "File\tFile\n"
1185 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
1186 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
1187 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
1189 static const char rd_feature_dat[] =
1190 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1191 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1192 "Feature\tFeature\n"
1193 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
1195 static const char rd_feature_comp_dat[] =
1196 "Feature_\tComponent_\n"
1197 "s38\ts72\n"
1198 "FeatureComponents\tFeature_\tComponent_\n"
1199 "duplicate\tduplicate\n";
1201 static const char rd_component_dat[] =
1202 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1203 "s72\tS38\ts72\ti2\tS255\tS72\n"
1204 "Component\tComponent\n"
1205 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
1206 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
1208 static const char rd_duplicate_file_dat[] =
1209 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
1210 "s72\ts72\ts72\tS255\tS72\n"
1211 "DuplicateFile\tFileKey\n"
1212 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
1213 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
1214 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
1216 static const char rd_install_exec_seq_dat[] =
1217 "Action\tCondition\tSequence\n"
1218 "s72\tS255\tI2\n"
1219 "InstallExecuteSequence\tAction\n"
1220 "LaunchConditions\t\t100\n"
1221 "CostInitialize\t\t800\n"
1222 "FileCost\t\t900\n"
1223 "CostFinalize\t\t1000\n"
1224 "InstallValidate\t\t1400\n"
1225 "InstallInitialize\t\t1500\n"
1226 "ProcessComponents\t\t1600\n"
1227 "RemoveDuplicateFiles\t\t1900\n"
1228 "rd_immediate\tREMOVE\t1901\n"
1229 "rd_deferred\tREMOVE\t1902\n"
1230 "InstallFiles\t\t2000\n"
1231 "DuplicateFiles\t\t2100\n"
1232 "df_immediate\tNOT REMOVE\t2101\n"
1233 "df_deferred\tNOT REMOVE\t2102\n"
1234 "RegisterProduct\t\t5000\n"
1235 "PublishFeatures\t\t5100\n"
1236 "PublishProduct\t\t5200\n"
1237 "InstallFinalize\t\t6000\n";
1239 static const char rd_custom_action_dat[] =
1240 "Action\tType\tSource\tTarget\n"
1241 "s72\ti2\tS64\tS0\n"
1242 "CustomAction\tAction\n"
1243 "df_immediate\t1\tcustom.dll\trd_absent\n"
1244 "df_deferred\t1025\tcustom.dll\trd_present\n"
1245 "rd_immediate\t1\tcustom.dll\trd_present\n"
1246 "rd_deferred\t1025\tcustom.dll\trd_absent\n";
1248 static const char rrv_file_dat[] =
1249 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1250 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1251 "File\tFile\n"
1252 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
1254 static const char rrv_feature_dat[] =
1255 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1256 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1257 "Feature\tFeature\n"
1258 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1260 static const char rrv_feature_comp_dat[] =
1261 "Feature_\tComponent_\n"
1262 "s38\ts72\n"
1263 "FeatureComponents\tFeature_\tComponent_\n"
1264 "registry\tregistry\n";
1266 static const char rrv_component_dat[] =
1267 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1268 "s72\tS38\ts72\ti2\tS255\tS72\n"
1269 "Component\tComponent\n"
1270 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1272 static const char rrv_registry_dat[] =
1273 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1274 "s72\ti2\tl255\tL255\tL0\ts72\n"
1275 "Registry\tRegistry\n"
1276 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1277 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1278 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1280 static const char rrv_remove_registry_dat[] =
1281 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1282 "s72\ti2\tl255\tL255\ts72\n"
1283 "RemoveRegistry\tRemoveRegistry\n"
1284 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1285 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1286 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1288 static const char rrv_install_exec_seq_dat[] =
1289 "Action\tCondition\tSequence\n"
1290 "s72\tS255\tI2\n"
1291 "InstallExecuteSequence\tAction\n"
1292 "LaunchConditions\t\t100\n"
1293 "CostInitialize\t\t800\n"
1294 "FileCost\t\t900\n"
1295 "CostFinalize\t\t1000\n"
1296 "InstallValidate\t\t1400\n"
1297 "InstallInitialize\t\t1500\n"
1298 "ProcessComponents\t\t1600\n"
1299 "RemoveFiles\t\t1700\n"
1300 "InstallFiles\t\t2000\n"
1301 "RemoveRegistryValues\t\t3000\n"
1302 "RegisterProduct\t\t5000\n"
1303 "PublishFeatures\t\t5100\n"
1304 "PublishProduct\t\t5200\n"
1305 "InstallFinalize\t\t6000\n";
1307 static const char frp_file_dat[] =
1308 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1309 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1310 "File\tFile\n"
1311 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1313 static const char frp_feature_dat[] =
1314 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1315 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1316 "Feature\tFeature\n"
1317 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1319 static const char frp_feature_comp_dat[] =
1320 "Feature_\tComponent_\n"
1321 "s38\ts72\n"
1322 "FeatureComponents\tFeature_\tComponent_\n"
1323 "product\tproduct\n";
1325 static const char frp_component_dat[] =
1326 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1327 "s72\tS38\ts72\ti2\tS255\tS72\n"
1328 "Component\tComponent\n"
1329 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1331 static const char frp_custom_action_dat[] =
1332 "Action\tType\tSource\tTarget\tISComments\n"
1333 "s72\ti2\tS64\tS0\tS255\n"
1334 "CustomAction\tAction\n"
1335 "TestProp\t19\t\t\tPROP set\n";
1337 static const char frp_upgrade_dat[] =
1338 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1339 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1340 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1341 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1343 static const char frp_install_exec_seq_dat[] =
1344 "Action\tCondition\tSequence\n"
1345 "s72\tS255\tI2\n"
1346 "InstallExecuteSequence\tAction\n"
1347 "FindRelatedProducts\t\t50\n"
1348 "TestProp\tPROP AND NOT REMOVE\t51\n"
1349 "LaunchConditions\t\t100\n"
1350 "CostInitialize\t\t800\n"
1351 "FileCost\t\t900\n"
1352 "CostFinalize\t\t1000\n"
1353 "InstallValidate\t\t1400\n"
1354 "InstallInitialize\t\t1500\n"
1355 "ProcessComponents\t\t1600\n"
1356 "RemoveFiles\t\t1700\n"
1357 "InstallFiles\t\t2000\n"
1358 "RegisterProduct\t\t5000\n"
1359 "PublishFeatures\t\t5100\n"
1360 "PublishProduct\t\t5200\n"
1361 "InstallFinalize\t\t6000\n";
1363 static const char riv_file_dat[] =
1364 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1365 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1366 "File\tFile\n"
1367 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1369 static const char riv_feature_dat[] =
1370 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1371 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1372 "Feature\tFeature\n"
1373 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1375 static const char riv_feature_comp_dat[] =
1376 "Feature_\tComponent_\n"
1377 "s38\ts72\n"
1378 "FeatureComponents\tFeature_\tComponent_\n"
1379 "inifile\tinifile\n";
1381 static const char riv_component_dat[] =
1382 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1383 "s72\tS38\ts72\ti2\tS255\tS72\n"
1384 "Component\tComponent\n"
1385 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1387 static const char riv_ini_file_dat[] =
1388 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1389 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1390 "IniFile\tIniFile\n"
1391 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1393 static const char riv_remove_ini_file_dat[] =
1394 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1395 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1396 "RemoveIniFile\tRemoveIniFile\n"
1397 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1399 static const char riv_install_exec_seq_dat[] =
1400 "Action\tCondition\tSequence\n"
1401 "s72\tS255\tI2\n"
1402 "InstallExecuteSequence\tAction\n"
1403 "LaunchConditions\t\t100\n"
1404 "CostInitialize\t\t800\n"
1405 "FileCost\t\t900\n"
1406 "CostFinalize\t\t1000\n"
1407 "InstallValidate\t\t1400\n"
1408 "InstallInitialize\t\t1500\n"
1409 "ProcessComponents\t\t1600\n"
1410 "RemoveFiles\t\t1700\n"
1411 "InstallFiles\t\t2000\n"
1412 "RemoveIniValues\t\t3000\n"
1413 "RegisterProduct\t\t5000\n"
1414 "PublishFeatures\t\t5100\n"
1415 "PublishProduct\t\t5200\n"
1416 "InstallFinalize\t\t6000\n";
1418 static const char res_file_dat[] =
1419 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1420 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1421 "File\tFile\n"
1422 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1424 static const char res_feature_dat[] =
1425 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1426 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1427 "Feature\tFeature\n"
1428 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1430 static const char res_feature_comp_dat[] =
1431 "Feature_\tComponent_\n"
1432 "s38\ts72\n"
1433 "FeatureComponents\tFeature_\tComponent_\n"
1434 "envvar\tenvvar\n";
1436 static const char res_component_dat[] =
1437 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1438 "s72\tS38\ts72\ti2\tS255\tS72\n"
1439 "Component\tComponent\n"
1440 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1442 static const char res_environment_dat[] =
1443 "Environment\tName\tValue\tComponent_\n"
1444 "s72\tl255\tL255\ts72\n"
1445 "Environment\tEnvironment\n"
1446 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1447 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1448 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1449 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1450 "var5\t=MSITESTVAR5\t\tenvvar\n"
1451 "Var6\t-MSITESTVAR6\t1;[~]\tenvvar\n"
1452 "Var7\t-MSITESTVAR7\t[~];1\tenvvar\n"
1453 "Var8\t-MSITESTVAR8\t1;[~]\tenvvar\n"
1454 "Var9\t-MSITESTVAR9\t[~];1\tenvvar\n"
1455 "Var10\t-MSITESTVAR10\t1\tenvvar\n"
1456 "Var11\t-MSITESTVAR11\t2\tenvvar\n";
1458 static const char res_install_exec_seq_dat[] =
1459 "Action\tCondition\tSequence\n"
1460 "s72\tS255\tI2\n"
1461 "InstallExecuteSequence\tAction\n"
1462 "LaunchConditions\t\t100\n"
1463 "CostInitialize\t\t800\n"
1464 "FileCost\t\t900\n"
1465 "CostFinalize\t\t1000\n"
1466 "InstallValidate\t\t1400\n"
1467 "InstallInitialize\t\t1500\n"
1468 "ProcessComponents\t\t1600\n"
1469 "RemoveFiles\t\t1700\n"
1470 "InstallFiles\t\t2000\n"
1471 "RemoveEnvironmentStrings\t\t3000\n"
1472 "RegisterProduct\t\t5000\n"
1473 "PublishFeatures\t\t5100\n"
1474 "PublishProduct\t\t5200\n"
1475 "InstallFinalize\t\t6000\n";
1477 static const char rci_file_dat[] =
1478 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1479 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1480 "File\tFile\n"
1481 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1483 static const char rci_feature_dat[] =
1484 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1485 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1486 "Feature\tFeature\n"
1487 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1489 static const char rci_feature_comp_dat[] =
1490 "Feature_\tComponent_\n"
1491 "s38\ts72\n"
1492 "FeatureComponents\tFeature_\tComponent_\n"
1493 "class\tclass\n";
1495 static const char rci_component_dat[] =
1496 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1497 "s72\tS38\ts72\ti2\tS255\tS72\n"
1498 "Component\tComponent\n"
1499 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1501 static const char rci_appid_dat[] =
1502 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1503 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1504 "AppId\tAppId\n"
1505 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1507 static const char rci_class_dat[] =
1508 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1509 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1510 "Class\tCLSID\tContext\tComponent_\n"
1511 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1513 static const char rci_install_exec_seq_dat[] =
1514 "Action\tCondition\tSequence\n"
1515 "s72\tS255\tI2\n"
1516 "InstallExecuteSequence\tAction\n"
1517 "LaunchConditions\t\t100\n"
1518 "CostInitialize\t\t800\n"
1519 "FileCost\t\t900\n"
1520 "CostFinalize\t\t1000\n"
1521 "InstallValidate\t\t1400\n"
1522 "InstallInitialize\t\t1500\n"
1523 "ProcessComponents\t\t1600\n"
1524 "RemoveFiles\t\t1700\n"
1525 "InstallFiles\t\t2000\n"
1526 "UnregisterClassInfo\t\t3000\n"
1527 "uci_immediate\tREMOVE\t3001\n"
1528 "uci_deferred\tREMOVE\t3002\n"
1529 "RegisterClassInfo\t\t4000\n"
1530 "rci_immediate\tNOT REMOVE\t4001\n"
1531 "rci_deferred\tNOT REMOVE\t4002\n"
1532 "RegisterProduct\t\t5000\n"
1533 "PublishFeatures\t\t5100\n"
1534 "PublishProduct\t\t5200\n"
1535 "InstallFinalize\t\t6000\n";
1537 static const char rci_custom_action_dat[] =
1538 "Action\tType\tSource\tTarget\n"
1539 "s72\ti2\tS64\tS0\n"
1540 "CustomAction\tAction\n"
1541 "rci_immediate\t1\tcustom.dll\trci_absent\n"
1542 "rci_deferred\t1025\tcustom.dll\trci_present\n"
1543 "uci_immediate\t1\tcustom.dll\trci_present\n"
1544 "uci_deferred\t1025\tcustom.dll\trci_absent\n";
1546 static const char rei_file_dat[] =
1547 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1548 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1549 "File\tFile\n"
1550 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1552 static const char rei_feature_dat[] =
1553 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1554 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1555 "Feature\tFeature\n"
1556 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1558 static const char rei_feature_comp_dat[] =
1559 "Feature_\tComponent_\n"
1560 "s38\ts72\n"
1561 "FeatureComponents\tFeature_\tComponent_\n"
1562 "extension\textension\n";
1564 static const char rei_component_dat[] =
1565 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1566 "s72\tS38\ts72\ti2\tS255\tS72\n"
1567 "Component\tComponent\n"
1568 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1570 static const char rei_extension_dat[] =
1571 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1572 "s255\ts72\tS255\tS64\ts38\n"
1573 "Extension\tExtension\tComponent_\n"
1574 "extension\textension\tProg.Id.1\t\textension\n";
1576 static const char rei_verb_dat[] =
1577 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1578 "s255\ts32\tI2\tL255\tL255\n"
1579 "Verb\tExtension_\tVerb\n"
1580 "extension\tOpen\t1\t&Open\t/argument\n";
1582 static const char rei_progid_dat[] =
1583 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1584 "s255\tS255\tS38\tL255\tS72\tI2\n"
1585 "ProgId\tProgId\n"
1586 "Prog.Id.1\t\t\tdescription\t\t\n";
1588 static const char rei_install_exec_seq_dat[] =
1589 "Action\tCondition\tSequence\n"
1590 "s72\tS255\tI2\n"
1591 "InstallExecuteSequence\tAction\n"
1592 "LaunchConditions\t\t100\n"
1593 "CostInitialize\t\t800\n"
1594 "FileCost\t\t900\n"
1595 "CostFinalize\t\t1000\n"
1596 "InstallValidate\t\t1400\n"
1597 "InstallInitialize\t\t1500\n"
1598 "ProcessComponents\t\t1600\n"
1599 "RemoveFiles\t\t1700\n"
1600 "InstallFiles\t\t2000\n"
1601 "UnregisterExtensionInfo\t\t3000\n"
1602 "uei_immediate\tREMOVE\t3001\n"
1603 "uei_deferred\tREMOVE\t3002\n"
1604 "RegisterExtensionInfo\t\t4000\n"
1605 "rei_immediate\tNOT REMOVE\t4001\n"
1606 "rei_deferred\tNOT REMOVE\t4002\n"
1607 "RegisterProduct\t\t5000\n"
1608 "PublishFeatures\t\t5100\n"
1609 "PublishProduct\t\t5200\n"
1610 "InstallFinalize\t\t6000\n";
1612 static const char rei_custom_action_dat[] =
1613 "Action\tType\tSource\tTarget\n"
1614 "s72\ti2\tS64\tS0\n"
1615 "CustomAction\tAction\n"
1616 "rei_immediate\t1\tcustom.dll\trei_absent\n"
1617 "rei_deferred\t1025\tcustom.dll\trei_present\n"
1618 "uei_immediate\t1\tcustom.dll\trei_present\n"
1619 "uei_deferred\t1025\tcustom.dll\trei_absent\n";
1621 static const char rpi_file_dat[] =
1622 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1623 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1624 "File\tFile\n"
1625 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1627 static const char rpi_feature_dat[] =
1628 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1629 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1630 "Feature\tFeature\n"
1631 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1633 static const char rpi_feature_comp_dat[] =
1634 "Feature_\tComponent_\n"
1635 "s38\ts72\n"
1636 "FeatureComponents\tFeature_\tComponent_\n"
1637 "progid\tprogid\n";
1639 static const char rpi_component_dat[] =
1640 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1641 "s72\tS38\ts72\ti2\tS255\tS72\n"
1642 "Component\tComponent\n"
1643 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1645 static const char rpi_appid_dat[] =
1646 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1647 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1648 "AppId\tAppId\n"
1649 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1651 static const char rpi_class_dat[] =
1652 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1653 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1654 "Class\tCLSID\tContext\tComponent_\n"
1655 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tprogid\tWinetest.Class.1\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n"
1656 "{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tLocalServer\tprogid\tWinetest.VerClass\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n"
1657 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1659 static const char rpi_extension_dat[] =
1660 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1661 "s255\ts72\tS255\tS64\ts38\n"
1662 "Extension\tExtension\tComponent_\n"
1663 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1665 static const char rpi_verb_dat[] =
1666 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1667 "s255\ts32\tI2\tL255\tL255\n"
1668 "Verb\tExtension_\tVerb\n"
1669 "winetest\tOpen\t1\t&Open\t/argument\n";
1671 static const char rpi_progid_dat[] =
1672 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1673 "s255\tS255\tS38\tL255\tS72\tI2\n"
1674 "ProgId\tProgId\n"
1675 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1676 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1677 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1678 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1679 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1680 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1681 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1682 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1683 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1684 "Winetest.Extension\t\t\tdescription\t\t\n";
1686 static const char rpi_install_exec_seq_dat[] =
1687 "Action\tCondition\tSequence\n"
1688 "s72\tS255\tI2\n"
1689 "InstallExecuteSequence\tAction\n"
1690 "LaunchConditions\t\t100\n"
1691 "CostInitialize\t\t800\n"
1692 "FileCost\t\t900\n"
1693 "CostFinalize\t\t1000\n"
1694 "InstallValidate\t\t1400\n"
1695 "InstallInitialize\t\t1500\n"
1696 "ProcessComponents\t\t1600\n"
1697 "RemoveFiles\t\t1700\n"
1698 "UnregisterClassInfo\t\t3000\n"
1699 "UnregisterExtensionInfo\t\t3200\n"
1700 "UnregisterProgIdInfo\t\t3400\n"
1701 "upi_immediate\tREMOVE\t3401\n"
1702 "upi_deferred\tREMOVE\t3402\n"
1703 "InstallFiles\t\t3600\n"
1704 "RegisterClassInfo\t\t4000\n"
1705 "RegisterExtensionInfo\t\t4200\n"
1706 "RegisterProgIdInfo\t\t4400\n"
1707 "rpi_immediate\tNOT REMOVE\t4401\n"
1708 "rpi_deferred\tNOT REMOVE\t4402\n"
1709 "RegisterProduct\t\t5000\n"
1710 "PublishFeatures\t\t5100\n"
1711 "PublishProduct\t\t5200\n"
1712 "InstallFinalize\t\t6000\n";
1714 static const char rpi_custom_action_dat[] =
1715 "Action\tType\tSource\tTarget\n"
1716 "s72\ti2\tS64\tS0\n"
1717 "CustomAction\tAction\n"
1718 "rpi_immediate\t1\tcustom.dll\trpi_absent\n"
1719 "rpi_deferred\t1025\tcustom.dll\trpi_present\n"
1720 "upi_immediate\t1\tcustom.dll\trpi_present\n"
1721 "upi_deferred\t1025\tcustom.dll\trpi_absent\n";
1723 static const char rmi_file_dat[] =
1724 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1725 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1726 "File\tFile\n"
1727 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1729 static const char rmi_feature_dat[] =
1730 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1731 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1732 "Feature\tFeature\n"
1733 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1735 static const char rmi_feature_comp_dat[] =
1736 "Feature_\tComponent_\n"
1737 "s38\ts72\n"
1738 "FeatureComponents\tFeature_\tComponent_\n"
1739 "mime\tmime\n";
1741 static const char rmi_component_dat[] =
1742 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1743 "s72\tS38\ts72\ti2\tS255\tS72\n"
1744 "Component\tComponent\n"
1745 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1747 static const char rmi_extension_dat[] =
1748 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1749 "s255\ts72\tS255\tS64\ts38\n"
1750 "Extension\tExtension\tComponent_\n"
1751 "mime\tmime\t\tmime/type\tmime\n";
1753 static const char rmi_verb_dat[] =
1754 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1755 "s255\ts32\tI2\tL255\tL255\n"
1756 "Verb\tExtension_\tVerb\n"
1757 "mime\tOpen\t1\t&Open\t/argument\n";
1759 static const char rmi_mime_dat[] =
1760 "ContentType\tExtension_\tCLSID\n"
1761 "s64\ts255\tS38\n"
1762 "MIME\tContentType\n"
1763 "mime/type\tmime\t\n";
1765 static const char rmi_install_exec_seq_dat[] =
1766 "Action\tCondition\tSequence\n"
1767 "s72\tS255\tI2\n"
1768 "InstallExecuteSequence\tAction\n"
1769 "LaunchConditions\t\t100\n"
1770 "CostInitialize\t\t800\n"
1771 "FileCost\t\t900\n"
1772 "CostFinalize\t\t1000\n"
1773 "InstallValidate\t\t1400\n"
1774 "InstallInitialize\t\t1500\n"
1775 "ProcessComponents\t\t1600\n"
1776 "RemoveFiles\t\t1700\n"
1777 "InstallFiles\t\t2000\n"
1778 "UnregisterExtensionInfo\t\t3000\n"
1779 "UnregisterMIMEInfo\t\t3500\n"
1780 "umi_immediate\tREMOVE\t3501\n"
1781 "umi_deferred\tREMOVE\t3502\n"
1782 "RegisterExtensionInfo\t\t4000\n"
1783 "RegisterMIMEInfo\t\t4500\n"
1784 "rmi_immediate\tNOT REMOVE\t4501\n"
1785 "rmi_deferred\tNOT REMOVE\t4502\n"
1786 "RegisterProduct\t\t5000\n"
1787 "PublishFeatures\t\t5100\n"
1788 "PublishProduct\t\t5200\n"
1789 "InstallFinalize\t\t6000\n";
1791 static const char rmi_custom_action_dat[] =
1792 "Action\tType\tSource\tTarget\n"
1793 "s72\ti2\tS64\tS0\n"
1794 "CustomAction\tAction\n"
1795 "rmi_immediate\t1\tcustom.dll\trmi_absent\n"
1796 "rmi_deferred\t1025\tcustom.dll\trmi_present\n"
1797 "umi_immediate\t1\tcustom.dll\trmi_present\n"
1798 "umi_deferred\t1025\tcustom.dll\trmi_absent\n";
1800 static const char pa_file_dat[] =
1801 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1802 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1803 "File\tFile\n"
1804 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1805 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1806 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1807 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1808 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1809 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1810 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1811 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1813 static const char pa_feature_dat[] =
1814 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1815 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1816 "Feature\tFeature\n"
1817 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1819 static const char pa_feature_comp_dat[] =
1820 "Feature_\tComponent_\n"
1821 "s38\ts72\n"
1822 "FeatureComponents\tFeature_\tComponent_\n"
1823 "assembly\twin32\n"
1824 "assembly\twin32_local\n"
1825 "assembly\tdotnet\n"
1826 "assembly\tdotnet_local\n";
1828 static const char pa_component_dat[] =
1829 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1830 "s72\tS38\ts72\ti2\tS255\tS72\n"
1831 "Component\tComponent\n"
1832 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1833 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1834 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1835 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1837 static const char pa_msi_assembly_dat[] =
1838 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1839 "s72\ts38\tS72\tS72\tI2\n"
1840 "MsiAssembly\tComponent_\n"
1841 "win32\tassembly\tmanifest.txt\t\t1\n"
1842 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1843 "dotnet\tassembly\t\t\t0\n"
1844 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1846 static const char pa_msi_assembly_name_dat[] =
1847 "Component_\tName\tValue\n"
1848 "s72\ts255\ts255\n"
1849 "MsiAssemblyName\tComponent_\tName\n"
1850 "win32\tName\tWine.Win32.Assembly\n"
1851 "win32\tprocessorArchitecture\tx86\n"
1852 "win32\tpublicKeyToken\tabcdef0123456789\n"
1853 "win32\ttype\twin32\n"
1854 "win32\tversion\t1.0.0.0\n"
1855 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1856 "win32_local\tprocessorArchitecture\tx86\n"
1857 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1858 "win32_local\ttype\twin32\n"
1859 "win32_local\tversion\t1.0.0.0\n"
1860 "dotnet\tName\tWine.Dotnet.Assembly\n"
1861 "dotnet\tprocessorArchitecture\tMSIL\n"
1862 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1863 "dotnet\tculture\tneutral\n"
1864 "dotnet\tversion\t1.0.0.0\n"
1865 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1866 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1867 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1868 "dotnet_local\tculture\tneutral\n"
1869 "dotnet_local\tversion\t1.0.0.0\n";
1871 static const char pa_install_exec_seq_dat[] =
1872 "Action\tCondition\tSequence\n"
1873 "s72\tS255\tI2\n"
1874 "InstallExecuteSequence\tAction\n"
1875 "LaunchConditions\t\t100\n"
1876 "CostInitialize\t\t800\n"
1877 "FileCost\t\t900\n"
1878 "CostFinalize\t\t1000\n"
1879 "InstallValidate\t\t1400\n"
1880 "InstallInitialize\t\t1500\n"
1881 "ProcessComponents\t\t1600\n"
1882 "MsiPublishAssemblies\t\t3000\n"
1883 "pa_immediate\tNOT REMOVE AND NOT ALLUSERS\t3001\n"
1884 "pa_deferred\tNOT REMOVE AND NOT ALLUSERS\t3002\n"
1885 "MsiUnpublishAssemblies\t\t4000\n"
1886 "ua_immediate\tREMOVE AND NOT ALLUSERS\t4001\n"
1887 "ua_deferred\tREMOVE AND NOT ALLUSERS\t4002\n"
1888 "RegisterProduct\t\t5000\n"
1889 "PublishFeatures\t\t5100\n"
1890 "PublishProduct\t\t5200\n"
1891 "UnpublishFeatures\t\t5300\n"
1892 "InstallFinalize\t\t6000\n";
1894 static const char pa_custom_action_dat[] =
1895 "Action\tType\tSource\tTarget\n"
1896 "s72\ti2\tS64\tS0\n"
1897 "CustomAction\tAction\n"
1898 "pa_immediate\t1\tcustom.dll\tpa_absent\n"
1899 "pa_deferred\t1025\tcustom.dll\tpa_present\n"
1900 "ua_immediate\t1\tcustom.dll\tpa_present\n"
1901 "ua_deferred\t1025\tcustom.dll\tpa_absent\n";
1903 static const char rep_file_dat[] =
1904 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1905 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1906 "File\tFile\n"
1907 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1909 static const char rep_feature_dat[] =
1910 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1911 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1912 "Feature\tFeature\n"
1913 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1915 static const char rep_feature_comp_dat[] =
1916 "Feature_\tComponent_\n"
1917 "s38\ts72\n"
1918 "FeatureComponents\tFeature_\tComponent_\n"
1919 "rep\trep\n";
1921 static const char rep_component_dat[] =
1922 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1923 "s72\tS38\ts72\ti2\tS255\tS72\n"
1924 "Component\tComponent\n"
1925 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1927 static const char rep_upgrade_dat[] =
1928 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1929 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1930 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1931 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1933 static const char rep_property_dat[] =
1934 "Property\tValue\n"
1935 "s72\tl0\n"
1936 "Property\tProperty\n"
1937 "HASUIRUN\t0\n"
1938 "INSTALLLEVEL\t3\n"
1939 "InstallMode\tTypical\n"
1940 "Manufacturer\tWine\n"
1941 "PIDTemplate\t###-#######\n"
1942 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1943 "ProductLanguage\t1033\n"
1944 "ProductName\tMSITEST\n"
1945 "ProductVersion\t1.1.1\n"
1946 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1947 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1948 "MSIFASTINSTALL\t1\n";
1950 static const char rep_install_exec_seq_dat[] =
1951 "Action\tCondition\tSequence\n"
1952 "s72\tS255\tI2\n"
1953 "InstallExecuteSequence\tAction\n"
1954 "FindRelatedProducts\t\t100\n"
1955 "CostInitialize\t\t800\n"
1956 "FileCost\t\t900\n"
1957 "CostFinalize\t\t1000\n"
1958 "InstallValidate\t\t1400\n"
1959 "RemoveExistingProducts\t\t1499\n"
1960 "InstallInitialize\t\t1500\n"
1961 "ProcessComponents\t\t1600\n"
1962 "RemoveFiles\t\t1700\n"
1963 "InstallFiles\t\t2000\n"
1964 "UnregisterExtensionInfo\t\t3000\n"
1965 "UnregisterMIMEInfo\t\t3500\n"
1966 "RegisterExtensionInfo\t\t4000\n"
1967 "RegisterMIMEInfo\t\t4500\n"
1968 "RegisterProduct\t\t5000\n"
1969 "PublishFeatures\t\t5100\n"
1970 "PublishProduct\t\t5200\n"
1971 "InstallFinalize\t\t6000\n";
1973 static const msi_table env_tables[] =
1975 ADD_TABLE(component),
1976 ADD_TABLE(directory),
1977 ADD_TABLE(feature),
1978 ADD_TABLE(feature_comp),
1979 ADD_TABLE(file),
1980 ADD_TABLE(install_exec_seq),
1981 ADD_TABLE(media),
1982 ADD_TABLE(property),
1983 ADD_TABLE(environment)
1986 static const msi_table pp_tables[] =
1988 ADD_TABLE(pp_component),
1989 ADD_TABLE(directory),
1990 ADD_TABLE(rof_feature),
1991 ADD_TABLE(rof_feature_comp),
1992 ADD_TABLE(rof_file),
1993 ADD_TABLE(pp_install_exec_seq),
1994 ADD_TABLE(pp_custom_action),
1995 ADD_TABLE(rof_media),
1996 ADD_TABLE(property),
1999 static const msi_table ppc_tables[] =
2001 ADD_TABLE(ppc_component),
2002 ADD_TABLE(directory),
2003 ADD_TABLE(rof_feature),
2004 ADD_TABLE(ppc_feature_comp),
2005 ADD_TABLE(ppc_file),
2006 ADD_TABLE(pp_install_exec_seq),
2007 ADD_TABLE(pp_custom_action),
2008 ADD_TABLE(ppc_media),
2009 ADD_TABLE(property),
2012 static const msi_table rem_tables[] =
2014 ADD_TABLE(rem_component),
2015 ADD_TABLE(directory),
2016 ADD_TABLE(rof_feature),
2017 ADD_TABLE(rem_feature_comp),
2018 ADD_TABLE(rem_file),
2019 ADD_TABLE(rem_install_exec_seq),
2020 ADD_TABLE(rof_media),
2021 ADD_TABLE(property),
2022 ADD_TABLE(rem_remove_files),
2025 static const msi_table mov_tables[] =
2027 ADD_TABLE(cwd_component),
2028 ADD_TABLE(directory),
2029 ADD_TABLE(rof_feature),
2030 ADD_TABLE(ci2_feature_comp),
2031 ADD_TABLE(ci2_file),
2032 ADD_TABLE(mov_install_exec_seq),
2033 ADD_TABLE(mov_custom_action),
2034 ADD_TABLE(rof_media),
2035 ADD_TABLE(property),
2036 ADD_TABLE(mov_move_file),
2039 static const msi_table df_tables[] =
2041 ADD_TABLE(rof_component),
2042 ADD_TABLE(df_directory),
2043 ADD_TABLE(rof_feature),
2044 ADD_TABLE(rof_feature_comp),
2045 ADD_TABLE(rof_file),
2046 ADD_TABLE(install_exec_seq),
2047 ADD_TABLE(rof_media),
2048 ADD_TABLE(property),
2049 ADD_TABLE(df_duplicate_file),
2052 static const msi_table wrv_tables[] =
2054 ADD_TABLE(wrv_component),
2055 ADD_TABLE(directory),
2056 ADD_TABLE(wrv_feature),
2057 ADD_TABLE(wrv_feature_comp),
2058 ADD_TABLE(ci2_file),
2059 ADD_TABLE(install_exec_seq),
2060 ADD_TABLE(rof_media),
2061 ADD_TABLE(property),
2062 ADD_TABLE(wrv_registry),
2065 static const msi_table cf_tables[] =
2067 ADD_TABLE(cf_component),
2068 ADD_TABLE(cf_directory),
2069 ADD_TABLE(cf_feature),
2070 ADD_TABLE(cf_feature_comp),
2071 ADD_TABLE(cf_file),
2072 ADD_TABLE(cf_create_folders),
2073 ADD_TABLE(cf_install_exec_seq),
2074 ADD_TABLE(cf_custom_action),
2075 ADD_TABLE(media),
2076 ADD_TABLE(property)
2079 static const msi_table sss_tables[] =
2081 ADD_TABLE(component),
2082 ADD_TABLE(directory),
2083 ADD_TABLE(feature),
2084 ADD_TABLE(feature_comp),
2085 ADD_TABLE(file),
2086 ADD_TABLE(sss_install_exec_seq),
2087 ADD_TABLE(sss_service_control),
2088 ADD_TABLE(sss_custom_action),
2089 ADD_TABLE(media),
2090 ADD_TABLE(property)
2093 static const msi_table sds_tables[] =
2095 ADD_TABLE(component),
2096 ADD_TABLE(directory),
2097 ADD_TABLE(feature),
2098 ADD_TABLE(feature_comp),
2099 ADD_TABLE(file),
2100 ADD_TABLE(sds_install_exec_seq),
2101 ADD_TABLE(sds_custom_action),
2102 ADD_TABLE(service_control),
2103 ADD_TABLE(service_install),
2104 ADD_TABLE(media),
2105 ADD_TABLE(property)
2108 static const msi_table sis_tables[] =
2110 ADD_TABLE(component),
2111 ADD_TABLE(directory),
2112 ADD_TABLE(feature),
2113 ADD_TABLE(feature_comp),
2114 ADD_TABLE(file),
2115 ADD_TABLE(sis_install_exec_seq),
2116 ADD_TABLE(sis_custom_action),
2117 ADD_TABLE(service_install2),
2118 ADD_TABLE(media),
2119 ADD_TABLE(property)
2122 static const msi_table sr_tables[] =
2124 ADD_TABLE(sr_component),
2125 ADD_TABLE(directory),
2126 ADD_TABLE(sr_feature),
2127 ADD_TABLE(sr_feature_comp),
2128 ADD_TABLE(sr_file),
2129 ADD_TABLE(sr_selfreg),
2130 ADD_TABLE(sr_install_exec_seq),
2131 ADD_TABLE(media),
2132 ADD_TABLE(property)
2135 static const msi_table font_tables[] =
2137 ADD_TABLE(font_component),
2138 ADD_TABLE(directory),
2139 ADD_TABLE(font_feature),
2140 ADD_TABLE(font_feature_comp),
2141 ADD_TABLE(font_file),
2142 ADD_TABLE(font),
2143 ADD_TABLE(font_install_exec_seq),
2144 ADD_TABLE(font_custom_action),
2145 ADD_TABLE(font_media),
2146 ADD_TABLE(property)
2149 static const msi_table vp_tables[] =
2151 ADD_TABLE(component),
2152 ADD_TABLE(directory),
2153 ADD_TABLE(feature),
2154 ADD_TABLE(feature_comp),
2155 ADD_TABLE(file),
2156 ADD_TABLE(vp_custom_action),
2157 ADD_TABLE(vp_install_exec_seq),
2158 ADD_TABLE(media),
2159 ADD_TABLE(vp_property)
2162 static const msi_table odbc_tables[] =
2164 ADD_TABLE(odbc_component),
2165 ADD_TABLE(directory),
2166 ADD_TABLE(odbc_feature),
2167 ADD_TABLE(odbc_feature_comp),
2168 ADD_TABLE(odbc_file),
2169 ADD_TABLE(odbc_driver),
2170 ADD_TABLE(odbc_translator),
2171 ADD_TABLE(odbc_datasource),
2172 ADD_TABLE(odbc_install_exec_seq),
2173 ADD_TABLE(odbc_custom_action),
2174 ADD_TABLE(odbc_media),
2175 ADD_TABLE(property)
2178 static const msi_table tl_tables[] =
2180 ADD_TABLE(tl_component),
2181 ADD_TABLE(directory),
2182 ADD_TABLE(tl_feature),
2183 ADD_TABLE(tl_feature_comp),
2184 ADD_TABLE(tl_file),
2185 ADD_TABLE(tl_typelib),
2186 ADD_TABLE(tl_install_exec_seq),
2187 ADD_TABLE(tl_custom_action),
2188 ADD_TABLE(media),
2189 ADD_TABLE(property)
2192 static const msi_table crs_tables[] =
2194 ADD_TABLE(crs_component),
2195 ADD_TABLE(directory),
2196 ADD_TABLE(crs_feature),
2197 ADD_TABLE(crs_feature_comp),
2198 ADD_TABLE(crs_file),
2199 ADD_TABLE(crs_shortcut),
2200 ADD_TABLE(crs_install_exec_seq),
2201 ADD_TABLE(crs_custom_action),
2202 ADD_TABLE(media),
2203 ADD_TABLE(property)
2206 static const msi_table pub_tables[] =
2208 ADD_TABLE(directory),
2209 ADD_TABLE(pub_component),
2210 ADD_TABLE(pub_feature),
2211 ADD_TABLE(pub_feature_comp),
2212 ADD_TABLE(pub_file),
2213 ADD_TABLE(pub_publish_component),
2214 ADD_TABLE(pub_install_exec_seq),
2215 ADD_TABLE(pub_custom_action),
2216 ADD_TABLE(media),
2217 ADD_TABLE(property)
2220 static const msi_table rd_tables[] =
2222 ADD_TABLE(directory),
2223 ADD_TABLE(rd_component),
2224 ADD_TABLE(rd_feature),
2225 ADD_TABLE(rd_feature_comp),
2226 ADD_TABLE(rd_file),
2227 ADD_TABLE(rd_duplicate_file),
2228 ADD_TABLE(rd_install_exec_seq),
2229 ADD_TABLE(rd_custom_action),
2230 ADD_TABLE(media),
2231 ADD_TABLE(property)
2234 static const msi_table rrv_tables[] =
2236 ADD_TABLE(directory),
2237 ADD_TABLE(rrv_component),
2238 ADD_TABLE(rrv_feature),
2239 ADD_TABLE(rrv_feature_comp),
2240 ADD_TABLE(rrv_file),
2241 ADD_TABLE(rrv_registry),
2242 ADD_TABLE(rrv_remove_registry),
2243 ADD_TABLE(rrv_install_exec_seq),
2244 ADD_TABLE(media),
2245 ADD_TABLE(property)
2248 static const msi_table frp_tables[] =
2250 ADD_TABLE(directory),
2251 ADD_TABLE(frp_component),
2252 ADD_TABLE(frp_feature),
2253 ADD_TABLE(frp_feature_comp),
2254 ADD_TABLE(frp_file),
2255 ADD_TABLE(frp_upgrade),
2256 ADD_TABLE(frp_custom_action),
2257 ADD_TABLE(frp_install_exec_seq),
2258 ADD_TABLE(media),
2259 ADD_TABLE(property)
2262 static const msi_table riv_tables[] =
2264 ADD_TABLE(directory),
2265 ADD_TABLE(riv_component),
2266 ADD_TABLE(riv_feature),
2267 ADD_TABLE(riv_feature_comp),
2268 ADD_TABLE(riv_file),
2269 ADD_TABLE(riv_ini_file),
2270 ADD_TABLE(riv_remove_ini_file),
2271 ADD_TABLE(riv_install_exec_seq),
2272 ADD_TABLE(media),
2273 ADD_TABLE(property)
2276 static const msi_table res_tables[] =
2278 ADD_TABLE(directory),
2279 ADD_TABLE(res_component),
2280 ADD_TABLE(res_feature),
2281 ADD_TABLE(res_feature_comp),
2282 ADD_TABLE(res_file),
2283 ADD_TABLE(res_environment),
2284 ADD_TABLE(res_install_exec_seq),
2285 ADD_TABLE(media),
2286 ADD_TABLE(property)
2289 static const msi_table rci_tables[] =
2291 ADD_TABLE(directory),
2292 ADD_TABLE(rci_component),
2293 ADD_TABLE(rci_feature),
2294 ADD_TABLE(rci_feature_comp),
2295 ADD_TABLE(rci_file),
2296 ADD_TABLE(rci_appid),
2297 ADD_TABLE(rci_class),
2298 ADD_TABLE(rci_install_exec_seq),
2299 ADD_TABLE(rci_custom_action),
2300 ADD_TABLE(media),
2301 ADD_TABLE(property)
2304 static const msi_table rei_tables[] =
2306 ADD_TABLE(directory),
2307 ADD_TABLE(rei_component),
2308 ADD_TABLE(rei_feature),
2309 ADD_TABLE(rei_feature_comp),
2310 ADD_TABLE(rei_file),
2311 ADD_TABLE(rei_extension),
2312 ADD_TABLE(rei_verb),
2313 ADD_TABLE(rei_progid),
2314 ADD_TABLE(rei_install_exec_seq),
2315 ADD_TABLE(rei_custom_action),
2316 ADD_TABLE(media),
2317 ADD_TABLE(property)
2320 static const msi_table rpi_tables[] =
2322 ADD_TABLE(directory),
2323 ADD_TABLE(rpi_component),
2324 ADD_TABLE(rpi_feature),
2325 ADD_TABLE(rpi_feature_comp),
2326 ADD_TABLE(rpi_file),
2327 ADD_TABLE(rpi_appid),
2328 ADD_TABLE(rpi_class),
2329 ADD_TABLE(rpi_extension),
2330 ADD_TABLE(rpi_verb),
2331 ADD_TABLE(rpi_progid),
2332 ADD_TABLE(rpi_install_exec_seq),
2333 ADD_TABLE(rpi_custom_action),
2334 ADD_TABLE(media),
2335 ADD_TABLE(property)
2338 static const msi_table rmi_tables[] =
2340 ADD_TABLE(directory),
2341 ADD_TABLE(rmi_component),
2342 ADD_TABLE(rmi_feature),
2343 ADD_TABLE(rmi_feature_comp),
2344 ADD_TABLE(rmi_file),
2345 ADD_TABLE(rmi_extension),
2346 ADD_TABLE(rmi_verb),
2347 ADD_TABLE(rmi_mime),
2348 ADD_TABLE(rmi_install_exec_seq),
2349 ADD_TABLE(rmi_custom_action),
2350 ADD_TABLE(media),
2351 ADD_TABLE(property)
2354 static const msi_table pa_tables[] =
2356 ADD_TABLE(directory),
2357 ADD_TABLE(pa_component),
2358 ADD_TABLE(pa_feature),
2359 ADD_TABLE(pa_feature_comp),
2360 ADD_TABLE(pa_file),
2361 ADD_TABLE(pa_msi_assembly),
2362 ADD_TABLE(pa_msi_assembly_name),
2363 ADD_TABLE(pa_install_exec_seq),
2364 ADD_TABLE(pa_custom_action),
2365 ADD_TABLE(media),
2366 ADD_TABLE(property)
2369 static const msi_table rep_tables[] =
2371 ADD_TABLE(directory),
2372 ADD_TABLE(rep_component),
2373 ADD_TABLE(rep_feature),
2374 ADD_TABLE(rep_feature_comp),
2375 ADD_TABLE(rep_file),
2376 ADD_TABLE(rep_upgrade),
2377 ADD_TABLE(rep_property),
2378 ADD_TABLE(rep_install_exec_seq),
2379 ADD_TABLE(media)
2382 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2383 static LSTATUS action_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey, REGSAM access)
2385 LONG ret;
2386 DWORD dwMaxSubkeyLen, dwMaxValueLen;
2387 DWORD dwMaxLen, dwSize;
2388 char szNameBuf[MAX_PATH], *lpszName = szNameBuf;
2389 HKEY hSubKey = hKey;
2391 if(lpszSubKey)
2393 ret = RegOpenKeyExA(hKey, lpszSubKey, 0, access, &hSubKey);
2394 if (ret) return ret;
2397 ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
2398 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
2399 if (ret) goto cleanup;
2401 dwMaxSubkeyLen++;
2402 dwMaxValueLen++;
2403 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
2404 if (dwMaxLen > sizeof(szNameBuf))
2406 /* Name too big: alloc a buffer for it */
2407 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen)))
2409 ret = ERROR_NOT_ENOUGH_MEMORY;
2410 goto cleanup;
2414 /* Recursively delete all the subkeys */
2415 while (TRUE)
2417 dwSize = dwMaxLen;
2418 if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
2419 NULL, NULL, NULL)) break;
2421 ret = action_RegDeleteTreeA(hSubKey, lpszName, access);
2422 if (ret) goto cleanup;
2425 if (lpszSubKey)
2427 if (pRegDeleteKeyExA)
2428 ret = pRegDeleteKeyExA(hKey, lpszSubKey, access, 0);
2429 else
2430 ret = RegDeleteKeyA(hKey, lpszSubKey);
2432 else
2433 while (TRUE)
2435 dwSize = dwMaxLen;
2436 if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
2437 NULL, NULL, NULL, NULL)) break;
2439 ret = RegDeleteValueA(hKey, lpszName);
2440 if (ret) goto cleanup;
2443 cleanup:
2444 if (lpszName != szNameBuf)
2445 HeapFree(GetProcessHeap(), 0, lpszName);
2446 if(lpszSubKey)
2447 RegCloseKey(hSubKey);
2448 return ret;
2451 /* cabinet definitions */
2453 /* make the max size large so there is only one cab file */
2454 #define MEDIA_SIZE 0x7FFFFFFF
2456 static void init_functionpointers(void)
2458 HMODULE hmsi = GetModuleHandleA("msi.dll");
2459 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2460 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2462 #define GET_PROC(mod, func) \
2463 p ## func = (void*)GetProcAddress(mod, #func); \
2464 if(!p ## func) \
2465 trace("GetProcAddress(%s) failed\n", #func);
2467 GET_PROC(hmsi, MsiQueryComponentStateA);
2468 GET_PROC(hmsi, MsiSourceListEnumSourcesA);
2469 GET_PROC(hmsi, MsiSourceListGetInfoA);
2470 GET_PROC(hmsi, MsiGetComponentPathExA);
2471 GET_PROC(hmsi, MsiQueryFeatureStateExA);
2473 GET_PROC(hadvapi32, ConvertSidToStringSidA);
2474 GET_PROC(hadvapi32, RegDeleteKeyExA)
2475 GET_PROC(hkernel32, IsWow64Process)
2477 hsrclient = LoadLibraryA("srclient.dll");
2478 GET_PROC(hsrclient, SRRemoveRestorePoint);
2479 GET_PROC(hsrclient, SRSetRestorePointA);
2481 #undef GET_PROC
2484 static char *get_user_sid(void)
2486 HANDLE token;
2487 DWORD size = 0;
2488 TOKEN_USER *user;
2489 char *usersid = NULL;
2491 if (!pConvertSidToStringSidA)
2493 win_skip("ConvertSidToStringSidA is not available\n");
2494 return NULL;
2496 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
2497 GetTokenInformation(token, TokenUser, NULL, size, &size);
2499 user = HeapAlloc(GetProcessHeap(), 0, size);
2500 GetTokenInformation(token, TokenUser, user, size, &size);
2501 pConvertSidToStringSidA(user->User.Sid, &usersid);
2502 HeapFree(GetProcessHeap(), 0, user);
2504 CloseHandle(token);
2505 return usersid;
2508 static void create_test_files(void)
2510 CreateDirectoryA("msitest", NULL);
2511 create_file("msitest\\one.txt", 100);
2512 CreateDirectoryA("msitest\\first", NULL);
2513 create_file("msitest\\first\\two.txt", 100);
2514 CreateDirectoryA("msitest\\second", NULL);
2515 create_file("msitest\\second\\three.txt", 100);
2517 create_file("four.txt", 100);
2518 create_file("five.txt", 100);
2519 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2521 create_file("msitest\\filename", 100);
2522 create_file("msitest\\service.exe", 100);
2523 create_file("msitest\\service2.exe", 100);
2525 DeleteFileA("four.txt");
2526 DeleteFileA("five.txt");
2529 static void delete_test_files(void)
2531 DeleteFileA("msitest.msi");
2532 DeleteFileA("msitest.cab");
2533 DeleteFileA("msitest\\second\\three.txt");
2534 DeleteFileA("msitest\\first\\two.txt");
2535 DeleteFileA("msitest\\one.txt");
2536 DeleteFileA("msitest\\service.exe");
2537 DeleteFileA("msitest\\service2.exe");
2538 DeleteFileA("msitest\\filename");
2539 RemoveDirectoryA("msitest\\second");
2540 RemoveDirectoryA("msitest\\first");
2541 RemoveDirectoryA("msitest");
2544 static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
2546 RESTOREPOINTINFOA spec;
2548 spec.dwEventType = event_type;
2549 spec.dwRestorePtType = APPLICATION_INSTALL;
2550 spec.llSequenceNumber = status->llSequenceNumber;
2551 lstrcpyA(spec.szDescription, "msitest restore point");
2553 return pSRSetRestorePointA(&spec, status);
2556 static void remove_restore_point(DWORD seq_number)
2558 DWORD res;
2560 res = pSRRemoveRestorePoint(seq_number);
2561 if (res != ERROR_SUCCESS)
2562 trace("Failed to remove the restore point : %08x\n", res);
2565 static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
2567 if (pRegDeleteKeyExA)
2568 return pRegDeleteKeyExA( key, subkey, access, 0 );
2569 return RegDeleteKeyA( key, subkey );
2572 static void delete_pfmsitest_files(void)
2574 SHFILEOPSTRUCTA shfl;
2575 CHAR path[MAX_PATH+11];
2577 lstrcpyA(path, PROG_FILES_DIR);
2578 lstrcatA(path, "\\msitest\\*");
2579 path[strlen(path) + 1] = '\0';
2581 shfl.hwnd = NULL;
2582 shfl.wFunc = FO_DELETE;
2583 shfl.pFrom = path;
2584 shfl.pTo = NULL;
2585 shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI;
2587 SHFileOperationA(&shfl);
2589 lstrcpyA(path, PROG_FILES_DIR);
2590 lstrcatA(path, "\\msitest");
2591 RemoveDirectoryA(path);
2594 static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, DWORD line)
2596 char val[MAX_PATH];
2597 DWORD size, type;
2598 LONG res;
2600 size = MAX_PATH;
2601 val[0] = '\0';
2602 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)val, &size);
2604 if (res != ERROR_SUCCESS ||
2605 (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_MULTI_SZ))
2607 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2608 return;
2611 if (!expected)
2612 ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val);
2613 else
2615 if (bcase)
2616 ok_(__FILE__, line)(!lstrcmpA(val, expected), "Expected %s, got %s\n", expected, val);
2617 else
2618 ok_(__FILE__, line)(!lstrcmpiA(val, expected), "Expected %s, got %s\n", expected, val);
2622 static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line)
2624 DWORD val, size, type;
2625 LONG res;
2627 size = sizeof(DWORD);
2628 res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size);
2630 if (res != ERROR_SUCCESS || type != REG_DWORD)
2632 ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
2633 return;
2636 ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val);
2639 #define CHECK_REG_STR(prodkey, name, expected) \
2640 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2642 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2643 do { \
2644 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2645 RegDeleteValueA(prodkey, name); \
2646 } while(0)
2648 #define CHECK_REG_ISTR(prodkey, name, expected) \
2649 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2651 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2652 do { \
2653 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2654 RegDeleteValueA(prodkey, name); \
2655 } while(0)
2657 #define CHECK_REG_DWORD(prodkey, name, expected) \
2658 check_reg_dword(prodkey, name, expected, __LINE__);
2660 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2661 do { \
2662 check_reg_dword(prodkey, name, expected, __LINE__); \
2663 RegDeleteValueA(prodkey, name); \
2664 } while(0)
2666 static void get_date_str(LPSTR date)
2668 SYSTEMTIME systime;
2670 static const char date_fmt[] = "%d%02d%02d";
2671 GetLocalTime(&systime);
2672 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
2675 /* EstimatedSize is the size in KiB of .msi + installed files, rounded up to page size. */
2676 static DWORD get_estimated_size(void)
2678 SYSTEM_INFO si;
2679 HANDLE file;
2680 DWORD size;
2682 GetSystemInfo(&si);
2684 file = CreateFileA(msifile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
2685 size = ((GetFileSize(file, NULL) + si.dwPageSize - 1) / si.dwPageSize + 1);
2686 size = size * si.dwPageSize / 1024;
2687 CloseHandle(file);
2688 return size;
2691 static void extract_resource(const char *name, const char *type, const char *path)
2693 DWORD written;
2694 HANDLE file;
2695 HRSRC res;
2696 void *ptr;
2698 file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
2699 ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", path, GetLastError());
2701 res = FindResourceA(NULL, name, type);
2702 ok( res != 0, "couldn't find resource\n" );
2703 ptr = LockResource( LoadResource( GetModuleHandleA(NULL), res ));
2704 WriteFile( file, ptr, SizeofResource( GetModuleHandleA(NULL), res ), &written, NULL );
2705 ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" );
2706 CloseHandle( file );
2709 static void test_register_product(void)
2711 UINT r;
2712 LONG res;
2713 HKEY hkey, props, usage;
2714 LPSTR usersid;
2715 char date[MAX_PATH], temp[MAX_PATH], keypath[MAX_PATH], path[MAX_PATH];
2716 DWORD size, type;
2718 static const CHAR uninstall[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2719 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2720 static const CHAR userdata[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2721 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2722 static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2723 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2724 static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2725 "\\51AAE0C44620A5E4788506E91F249BD2";
2727 if (is_process_limited())
2729 skip("process is limited\n");
2730 return;
2733 if (!(usersid = get_user_sid()))
2734 return;
2736 get_date_str(date);
2737 GetTempPathA(MAX_PATH, temp);
2739 CreateDirectoryA("msitest", NULL);
2740 create_file("msitest\\maximus", 500);
2742 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
2744 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
2746 /* RegisterProduct */
2747 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
2748 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
2750 skip("Not enough rights to perform tests\n");
2751 goto error;
2753 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2754 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2755 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2757 res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
2758 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2760 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_READ | KEY_WOW64_32KEY, &hkey);
2761 ok(!res, "got %d\n", res);
2763 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2764 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2765 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2766 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2767 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2768 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2769 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2770 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2771 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2772 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2773 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2774 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2775 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2776 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2777 CHECK_DEL_REG_STR(hkey, "Size", NULL);
2778 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2779 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2780 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2781 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2782 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2783 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2784 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2785 todo_wine
2786 CHECK_DEL_REG_DWORD(hkey, "EstimatedSize", get_estimated_size());
2788 res = RegDeleteKeyA(hkey, "");
2789 ok(!res, "got %d\n", res);
2790 RegCloseKey(hkey);
2792 sprintf(keypath, userdata, usersid);
2793 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hkey);
2794 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2796 res = RegOpenKeyExA(hkey, "InstallProperties", 0, KEY_READ, &props);
2797 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2799 size = sizeof(path);
2800 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2801 DeleteFileA(path);
2802 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2804 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2805 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2806 CHECK_DEL_REG_STR(props, "InstallDate", date);
2807 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2808 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2809 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2810 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2811 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
2812 CHECK_DEL_REG_STR(props, "Comments", NULL);
2813 CHECK_DEL_REG_STR(props, "Contact", NULL);
2814 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
2815 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
2816 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
2817 CHECK_DEL_REG_STR(props, "Readme", NULL);
2818 CHECK_DEL_REG_STR(props, "Size", NULL);
2819 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
2820 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
2821 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2822 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2823 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2824 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2825 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2826 todo_wine
2827 CHECK_DEL_REG_DWORD(props, "EstimatedSize", get_estimated_size());
2829 res = RegDeleteKeyA(props, "");
2830 ok(!res, "got %d\n", res);
2831 RegCloseKey(props);
2833 res = RegOpenKeyExA(hkey, "Usage", 0, KEY_READ, &usage);
2834 todo_wine
2836 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2839 res = RegDeleteKeyA(usage, "");
2840 todo_wine
2841 ok(!res, "got %d\n", res);
2842 RegCloseKey(usage);
2843 res = RegDeleteKeyA(hkey, "");
2844 ok(!res, "got %d\n", res);
2845 RegCloseKey(hkey);
2847 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2848 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2850 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2852 res = RegDeleteKeyA(hkey, "");
2853 ok(!res, "got %d\n", res);
2854 RegCloseKey(hkey);
2856 /* RegisterProduct, machine */
2857 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 ALLUSERS=1");
2858 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2859 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
2860 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2862 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, userugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2863 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
2865 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, uninstall, 0, KEY_READ | KEY_WOW64_32KEY, &hkey);
2866 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2868 CHECK_DEL_REG_STR(hkey, "DisplayName", "MSITEST");
2869 CHECK_DEL_REG_STR(hkey, "DisplayVersion", "1.1.1");
2870 CHECK_DEL_REG_STR(hkey, "InstallDate", date);
2871 CHECK_DEL_REG_STR(hkey, "InstallSource", temp);
2872 CHECK_DEL_REG_ISTR(hkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2873 CHECK_DEL_REG_STR(hkey, "Publisher", "Wine");
2874 CHECK_DEL_REG_STR(hkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2875 CHECK_DEL_REG_STR(hkey, "AuthorizedCDFPrefix", NULL);
2876 CHECK_DEL_REG_STR(hkey, "Comments", NULL);
2877 CHECK_DEL_REG_STR(hkey, "Contact", NULL);
2878 CHECK_DEL_REG_STR(hkey, "HelpLink", NULL);
2879 CHECK_DEL_REG_STR(hkey, "HelpTelephone", NULL);
2880 CHECK_DEL_REG_STR(hkey, "InstallLocation", NULL);
2881 CHECK_DEL_REG_STR(hkey, "Readme", NULL);
2882 CHECK_DEL_REG_STR(hkey, "Size", NULL);
2883 CHECK_DEL_REG_STR(hkey, "URLInfoAbout", NULL);
2884 CHECK_DEL_REG_STR(hkey, "URLUpdateInfo", NULL);
2885 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
2886 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
2887 CHECK_DEL_REG_DWORD(hkey, "VersionMajor", 1);
2888 CHECK_DEL_REG_DWORD(hkey, "VersionMinor", 1);
2889 CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1);
2890 todo_wine
2891 CHECK_DEL_REG_DWORD(hkey, "EstimatedSize", get_estimated_size());
2893 res = RegDeleteKeyA(hkey, "");
2894 ok(!res, "got %d\n", res);
2895 RegCloseKey(hkey);
2897 sprintf(keypath, userdata, "S-1-5-18");
2898 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2899 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2901 res = RegOpenKeyExA(hkey, "InstallProperties", 0, KEY_READ, &props);
2902 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2904 size = sizeof(path);
2905 RegQueryValueExA(props, "LocalPackage", NULL, &type, (LPBYTE)path, &size);
2906 DeleteFileA(path);
2907 RegDeleteValueA(props, "LocalPackage"); /* LocalPackage is nondeterministic */
2909 CHECK_DEL_REG_STR(props, "DisplayName", "MSITEST");
2910 CHECK_DEL_REG_STR(props, "DisplayVersion", "1.1.1");
2911 CHECK_DEL_REG_STR(props, "InstallDate", date);
2912 CHECK_DEL_REG_STR(props, "InstallSource", temp);
2913 CHECK_DEL_REG_ISTR(props, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2914 CHECK_DEL_REG_STR(props, "Publisher", "Wine");
2915 CHECK_DEL_REG_STR(props, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2916 CHECK_DEL_REG_STR(props, "AuthorizedCDFPrefix", NULL);
2917 CHECK_DEL_REG_STR(props, "Comments", NULL);
2918 CHECK_DEL_REG_STR(props, "Contact", NULL);
2919 CHECK_DEL_REG_STR(props, "HelpLink", NULL);
2920 CHECK_DEL_REG_STR(props, "HelpTelephone", NULL);
2921 CHECK_DEL_REG_STR(props, "InstallLocation", NULL);
2922 CHECK_DEL_REG_STR(props, "Readme", NULL);
2923 CHECK_DEL_REG_STR(props, "Size", NULL);
2924 CHECK_DEL_REG_STR(props, "URLInfoAbout", NULL);
2925 CHECK_DEL_REG_STR(props, "URLUpdateInfo", NULL);
2926 CHECK_DEL_REG_DWORD(props, "Language", 1033);
2927 CHECK_DEL_REG_DWORD(props, "Version", 0x1010001);
2928 CHECK_DEL_REG_DWORD(props, "VersionMajor", 1);
2929 CHECK_DEL_REG_DWORD(props, "VersionMinor", 1);
2930 CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1);
2931 todo_wine
2932 CHECK_DEL_REG_DWORD(props, "EstimatedSize", get_estimated_size());
2934 res = RegDeleteKeyA(props, "");
2935 ok(!res, "got %d\n", res);
2936 RegCloseKey(props);
2938 res = RegOpenKeyExA(hkey, "Usage", 0, KEY_READ, &usage);
2939 todo_wine
2941 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2944 res = RegDeleteKeyA(usage, "");
2945 todo_wine
2946 ok(!res, "got %d\n", res);
2947 RegCloseKey(usage);
2948 res = RegDeleteKeyA(hkey, "");
2949 ok(!res, "got %d\n", res);
2950 RegCloseKey(hkey);
2952 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ugkey, 0, KEY_READ | KEY_WOW64_64KEY, &hkey);
2953 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
2955 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
2957 res = RegDeleteKeyA(hkey, "");
2958 ok(!res, "got %d\n", res);
2959 RegCloseKey(hkey);
2961 error:
2962 DeleteFileA(msifile);
2963 DeleteFileA("msitest\\maximus");
2964 RemoveDirectoryA("msitest");
2965 HeapFree(GetProcessHeap(), 0, usersid);
2968 static void test_publish_product(void)
2970 static const char prodpath[] =
2971 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
2972 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2973 static const char cuprodpath[] =
2974 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2975 static const char cuupgrades[] =
2976 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2977 static const char badprod[] =
2978 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
2979 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2980 static const char machprod[] =
2981 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2982 static const char machup[] =
2983 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2984 UINT r;
2985 LONG res;
2986 LPSTR usersid;
2987 HKEY sourcelist, net, props;
2988 HKEY hkey, patches, media;
2989 CHAR keypath[MAX_PATH];
2990 CHAR temp[MAX_PATH];
2991 CHAR path[MAX_PATH];
2992 BOOL old_installer = FALSE;
2993 REGSAM access = KEY_ALL_ACCESS;
2995 if (is_process_limited())
2997 skip("process is limited\n");
2998 return;
3001 if (!(usersid = get_user_sid()))
3002 return;
3004 GetTempPathA(MAX_PATH, temp);
3006 CreateDirectoryA("msitest", NULL);
3007 create_file("msitest\\maximus", 500);
3009 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3011 if (is_wow64)
3012 access |= KEY_WOW64_64KEY;
3014 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
3016 /* PublishProduct, current user */
3017 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
3018 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3020 skip("Not enough rights to perform tests\n");
3021 goto error;
3023 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3024 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3025 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3027 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
3028 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3030 sprintf(keypath, prodpath, usersid);
3031 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3032 if (res == ERROR_FILE_NOT_FOUND)
3034 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
3035 if (res == ERROR_SUCCESS)
3037 win_skip("Windows Installer < 3.0 detected\n");
3038 RegCloseKey(hkey);
3039 old_installer = TRUE;
3040 goto currentuser;
3042 else
3044 win_skip("Install failed, no need to continue\n");
3045 return;
3048 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3050 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
3051 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3053 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
3054 todo_wine
3056 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3057 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
3060 delete_key(patches, "", access);
3061 RegCloseKey(patches);
3062 delete_key(hkey, "", access);
3063 RegCloseKey(hkey);
3065 currentuser:
3066 res = RegOpenKeyA(HKEY_CURRENT_USER, cuprodpath, &hkey);
3067 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3069 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
3070 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3071 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
3072 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
3073 if (!old_installer)
3074 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
3075 CHECK_DEL_REG_DWORD(hkey, "Assignment", 0);
3076 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
3077 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
3078 CHECK_DEL_REG_STR(hkey, "Clients", ":");
3080 res = RegOpenKeyA(hkey, "SourceList", &sourcelist);
3081 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3083 lstrcpyA(path, "n;1;");
3084 lstrcatA(path, temp);
3085 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
3086 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
3088 res = RegOpenKeyA(sourcelist, "Net", &net);
3089 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3091 CHECK_DEL_REG_STR(net, "1", temp);
3093 RegDeleteKeyA(net, "");
3094 RegCloseKey(net);
3096 res = RegOpenKeyA(sourcelist, "Media", &media);
3097 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3099 CHECK_DEL_REG_STR(media, "1", "DISK1;");
3101 RegDeleteKeyA(media, "");
3102 RegCloseKey(media);
3103 RegDeleteKeyA(sourcelist, "");
3104 RegCloseKey(sourcelist);
3105 RegDeleteKeyA(hkey, "");
3106 RegCloseKey(hkey);
3108 res = RegOpenKeyA(HKEY_CURRENT_USER, cuupgrades, &hkey);
3109 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3111 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
3113 RegDeleteKeyA(hkey, "");
3114 RegCloseKey(hkey);
3116 /* PublishProduct, machine */
3117 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3118 if (old_installer)
3119 goto machprod;
3120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3121 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3122 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3124 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, badprod, 0, access, &hkey);
3125 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3127 sprintf(keypath, prodpath, "S-1-5-18");
3128 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3129 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3131 res = RegOpenKeyExA(hkey, "InstallProperties", 0, access, &props);
3132 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3134 res = RegOpenKeyExA(hkey, "Patches", 0, access, &patches);
3135 todo_wine
3137 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3138 CHECK_DEL_REG_STR(patches, "AllPatches", NULL);
3141 delete_key(patches, "", access);
3142 RegCloseKey(patches);
3143 delete_key(hkey, "", access);
3144 RegCloseKey(hkey);
3146 machprod:
3147 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machprod, 0, access, &hkey);
3148 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3150 CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
3151 CHECK_DEL_REG_STR(hkey, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3152 CHECK_DEL_REG_DWORD(hkey, "Language", 1033);
3153 CHECK_DEL_REG_DWORD(hkey, "Version", 0x1010001);
3154 if (!old_installer)
3155 CHECK_DEL_REG_DWORD(hkey, "AuthorizedLUAApp", 0);
3156 todo_wine CHECK_DEL_REG_DWORD(hkey, "Assignment", 1);
3157 CHECK_DEL_REG_DWORD(hkey, "AdvertiseFlags", 0x184);
3158 CHECK_DEL_REG_DWORD(hkey, "InstanceType", 0);
3159 CHECK_DEL_REG_STR(hkey, "Clients", ":");
3161 res = RegOpenKeyExA(hkey, "SourceList", 0, access, &sourcelist);
3162 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3164 lstrcpyA(path, "n;1;");
3165 lstrcatA(path, temp);
3166 CHECK_DEL_REG_STR(sourcelist, "LastUsedSource", path);
3167 CHECK_DEL_REG_STR(sourcelist, "PackageName", "msitest.msi");
3169 res = RegOpenKeyExA(sourcelist, "Net", 0, access, &net);
3170 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3172 CHECK_DEL_REG_STR(net, "1", temp);
3174 res = delete_key(net, "", access);
3175 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3176 RegCloseKey(net);
3178 res = RegOpenKeyExA(sourcelist, "Media", 0, access, &media);
3179 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3181 CHECK_DEL_REG_STR(media, "1", "DISK1;");
3183 res = delete_key(media, "", access);
3184 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3185 RegCloseKey(media);
3186 res = delete_key(sourcelist, "", access);
3187 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3188 RegCloseKey(sourcelist);
3189 res = delete_key(hkey, "", access);
3190 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3191 RegCloseKey(hkey);
3193 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machup, 0, access, &hkey);
3194 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3196 CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);
3198 res = delete_key(hkey, "", access);
3199 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3200 RegCloseKey(hkey);
3202 error:
3203 DeleteFileA(msifile);
3204 DeleteFileA("msitest\\maximus");
3205 RemoveDirectoryA("msitest");
3206 HeapFree(GetProcessHeap(), 0, usersid);
3209 static void test_publish_features(void)
3211 static const char cupath[] =
3212 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3213 static const char udfeatpath[] =
3214 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3215 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3216 static const char udpridpath[] =
3217 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3218 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3219 static const char featkey[] =
3220 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3221 static const char classfeat[] =
3222 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3223 UINT r;
3224 LONG res;
3225 HKEY hkey;
3226 LPSTR usersid;
3227 CHAR keypath[MAX_PATH];
3228 REGSAM access = KEY_ALL_ACCESS;
3230 if (is_process_limited())
3232 skip("process is limited\n");
3233 return;
3236 if (!(usersid = get_user_sid()))
3237 return;
3239 CreateDirectoryA("msitest", NULL);
3240 create_file("msitest\\maximus", 500);
3242 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3244 if (is_wow64)
3245 access |= KEY_WOW64_64KEY;
3247 MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
3249 /* PublishFeatures, current user */
3250 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
3251 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3253 skip("Not enough rights to perform tests\n");
3254 goto error;
3256 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3257 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3258 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3260 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3261 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3263 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3264 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3266 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3267 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3269 CHECK_REG_STR(hkey, "feature", "");
3270 CHECK_REG_STR(hkey, "montecristo", "");
3272 RegDeleteValueA(hkey, "feature");
3273 RegDeleteValueA(hkey, "montecristo");
3274 delete_key(hkey, "", access);
3275 RegCloseKey(hkey);
3277 sprintf(keypath, udfeatpath, usersid);
3278 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3279 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3281 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3282 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3284 RegDeleteValueA(hkey, "feature");
3285 RegDeleteValueA(hkey, "montecristo");
3286 delete_key(hkey, "", access);
3287 RegCloseKey(hkey);
3288 sprintf(keypath, udpridpath, usersid);
3289 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3291 /* PublishFeatures, machine */
3292 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
3293 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3294 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3295 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3297 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, featkey, 0, access, &hkey);
3298 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3300 res = RegOpenKeyA(HKEY_CURRENT_USER, cupath, &hkey);
3301 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3302 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, classfeat, 0, access, &hkey);
3303 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3305 CHECK_REG_STR(hkey, "feature", "");
3306 CHECK_REG_STR(hkey, "montecristo", "");
3308 RegDeleteValueA(hkey, "feature");
3309 RegDeleteValueA(hkey, "montecristo");
3310 delete_key(hkey, "", access);
3311 RegCloseKey(hkey);
3313 sprintf(keypath, udfeatpath, "S-1-5-18");
3314 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey);
3315 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3317 CHECK_REG_STR(hkey, "feature", "VGtfp^p+,?82@JU1j_KE");
3318 CHECK_REG_STR(hkey, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3320 RegDeleteValueA(hkey, "feature");
3321 RegDeleteValueA(hkey, "montecristo");
3322 delete_key(hkey, "", access);
3323 RegCloseKey(hkey);
3324 sprintf(keypath, udpridpath, "S-1-5-18");
3325 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3327 error:
3328 DeleteFileA(msifile);
3329 DeleteFileA("msitest\\maximus");
3330 RemoveDirectoryA("msitest");
3331 HeapFree(GetProcessHeap(), 0, usersid);
3334 static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
3336 DWORD len = 0;
3337 LPSTR val;
3338 LONG r;
3340 r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
3341 if (r != ERROR_SUCCESS)
3342 return NULL;
3344 len += sizeof (WCHAR);
3345 val = HeapAlloc(GetProcessHeap(), 0, len);
3346 if (!val) return NULL;
3347 val[0] = 0;
3348 RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len);
3349 return val;
3352 static void get_owner_company(LPSTR *owner, LPSTR *company)
3354 LONG res;
3355 HKEY hkey;
3356 REGSAM access = KEY_ALL_ACCESS;
3358 *owner = *company = NULL;
3360 if (is_wow64)
3361 access |= KEY_WOW64_64KEY;
3363 res = RegOpenKeyA(HKEY_CURRENT_USER,
3364 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
3365 if (res == ERROR_SUCCESS)
3367 *owner = reg_get_val_str(hkey, "DefName");
3368 *company = reg_get_val_str(hkey, "DefCompany");
3369 RegCloseKey(hkey);
3372 if (!*owner || !*company)
3374 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3375 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
3376 if (res == ERROR_SUCCESS)
3378 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3379 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3380 RegCloseKey(hkey);
3384 if (!*owner || !*company)
3386 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
3387 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
3388 if (res == ERROR_SUCCESS)
3390 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3391 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3392 RegCloseKey(hkey);
3397 static void test_register_user(void)
3399 UINT r;
3400 LONG res;
3401 HKEY props;
3402 LPSTR usersid;
3403 LPSTR owner, company;
3404 CHAR keypath[MAX_PATH];
3405 REGSAM access = KEY_ALL_ACCESS;
3407 static const CHAR keypropsfmt[] =
3408 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3409 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3410 static const CHAR keypridfmt[] =
3411 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3412 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3414 if (is_process_limited())
3416 skip("process is limited\n");
3417 return;
3420 if (!(usersid = get_user_sid()))
3421 return;
3423 get_owner_company(&owner, &company);
3425 CreateDirectoryA("msitest", NULL);
3426 create_file("msitest\\maximus", 500);
3428 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3430 if (is_wow64)
3431 access |= KEY_WOW64_64KEY;
3433 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3435 /* RegisterUser, per-user */
3436 r = MsiInstallProductA(msifile, "REGISTER_USER=1");
3437 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3439 skip("Not enough rights to perform tests\n");
3440 goto error;
3442 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3443 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3444 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3446 sprintf(keypath, keypropsfmt, usersid);
3447 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3448 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3450 CHECK_REG_STR(props, "ProductID", "none");
3451 CHECK_REG_STR(props, "RegCompany", company);
3452 CHECK_REG_STR(props, "RegOwner", owner);
3454 RegDeleteValueA(props, "ProductID");
3455 RegDeleteValueA(props, "RegCompany");
3456 RegDeleteValueA(props, "RegOwner");
3457 delete_key(props, "", access);
3458 RegCloseKey(props);
3459 sprintf(keypath, keypridfmt, usersid);
3460 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3462 /* RegisterUser, machine */
3463 r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
3464 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3465 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3466 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3468 sprintf(keypath, keypropsfmt, "S-1-5-18");
3469 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props);
3470 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3472 CHECK_REG_STR(props, "ProductID", "none");
3473 CHECK_REG_STR(props, "RegCompany", company);
3474 CHECK_REG_STR(props, "RegOwner", owner);
3476 RegDeleteValueA(props, "ProductID");
3477 RegDeleteValueA(props, "RegCompany");
3478 RegDeleteValueA(props, "RegOwner");
3479 delete_key(props, "", access);
3480 RegCloseKey(props);
3481 sprintf(keypath, keypridfmt, "S-1-5-18");
3482 delete_key(HKEY_LOCAL_MACHINE, keypath, access);
3484 error:
3485 HeapFree(GetProcessHeap(), 0, company);
3486 HeapFree(GetProcessHeap(), 0, owner);
3488 DeleteFileA(msifile);
3489 DeleteFileA("msitest\\maximus");
3490 RemoveDirectoryA("msitest");
3491 LocalFree(usersid);
3494 static void test_process_components(void)
3496 static const char keyfmt[] =
3497 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3498 static const char compkey[] =
3499 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3500 UINT r;
3501 LONG res;
3502 DWORD size;
3503 HKEY comp, hkey;
3504 LPSTR usersid;
3505 CHAR val[MAX_PATH];
3506 CHAR keypath[MAX_PATH];
3507 CHAR program_files_maximus[MAX_PATH];
3508 REGSAM access = KEY_ALL_ACCESS;
3510 if (is_process_limited())
3512 skip("process is limited\n");
3513 return;
3516 if (!(usersid = get_user_sid()))
3517 return;
3519 CreateDirectoryA("msitest", NULL);
3520 create_file("msitest\\maximus", 500);
3522 create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table));
3524 if (is_wow64)
3525 access |= KEY_WOW64_64KEY;
3527 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3529 /* ProcessComponents, per-user */
3530 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
3531 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3533 skip("Not enough rights to perform tests\n");
3534 goto error;
3536 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3537 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3538 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3540 sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
3541 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3542 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3544 size = MAX_PATH;
3545 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3546 NULL, NULL, (LPBYTE)val, &size);
3547 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3549 lstrcpyA(program_files_maximus,PROG_FILES_DIR);
3550 lstrcatA(program_files_maximus,"\\msitest\\maximus");
3552 ok(!lstrcmpiA(val, program_files_maximus),
3553 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3555 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3556 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3558 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3559 delete_key(comp, "", access);
3560 RegCloseKey(comp);
3562 sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
3563 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3564 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3566 size = MAX_PATH;
3567 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3568 NULL, NULL, (LPBYTE)val, &size);
3569 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3570 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3571 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3573 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3574 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3576 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3577 delete_key(comp, "", access);
3578 RegCloseKey(comp);
3580 /* ProcessComponents, machine */
3581 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3582 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3583 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3584 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3586 sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3587 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3588 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3590 size = MAX_PATH;
3591 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3592 NULL, NULL, (LPBYTE)val, &size);
3593 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3594 ok(!lstrcmpiA(val, program_files_maximus),
3595 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3597 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3598 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3600 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3601 delete_key(comp, "", access);
3602 RegCloseKey(comp);
3604 sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3605 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3606 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3608 size = MAX_PATH;
3609 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3610 NULL, NULL, (LPBYTE)val, &size);
3611 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3612 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3613 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3615 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3616 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3618 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3619 delete_key(comp, "", access);
3620 RegCloseKey(comp);
3622 error:
3623 DeleteFileA(msifile);
3624 DeleteFileA("msitest\\maximus");
3625 RemoveDirectoryA("msitest");
3626 LocalFree(usersid);
3629 static void test_publish(void)
3631 static const char subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3632 static const char subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3633 UINT r;
3634 LONG res;
3635 HKEY uninstall, prodkey, uninstall_32node = NULL;
3636 INSTALLSTATE state;
3637 char date[MAX_PATH], temp[MAX_PATH], prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3638 REGSAM access = KEY_ALL_ACCESS;
3639 DWORD error;
3641 if (!pMsiQueryFeatureStateExA)
3643 win_skip("MsiQueryFeatureStateExA is not available\n");
3644 return;
3646 if (is_process_limited())
3648 skip("process is limited\n");
3649 return;
3652 get_date_str(date);
3653 GetTempPathA(MAX_PATH, temp);
3655 if (is_wow64)
3656 access |= KEY_WOW64_64KEY;
3658 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
3659 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3661 if (is_64bit)
3663 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
3664 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3667 CreateDirectoryA("msitest", NULL);
3668 create_file("msitest\\maximus", 500);
3670 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
3672 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
3674 state = MsiQueryProductStateA(prodcode);
3675 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3677 state = MsiQueryFeatureStateA(prodcode, "feature");
3678 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3680 state = 0xdead;
3681 SetLastError(0xdeadbeef);
3682 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3683 error = GetLastError();
3684 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3685 ok(state == 0xdead, "got %d\n", state);
3686 ok(error == 0xdeadbeef, "got %u\n", error);
3688 state = 0xdead;
3689 SetLastError(0xdeadbeef);
3690 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3691 error = GetLastError();
3692 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3693 ok(state == 0xdead, "got %d\n", state);
3694 ok(error == ERROR_SUCCESS, "got %u\n", error);
3696 state = 0xdead;
3697 SetLastError(0xdeadbeef);
3698 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3699 error = GetLastError();
3700 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3701 ok(state == 0xdead, "got %d\n", state);
3702 ok(error == ERROR_SUCCESS, "got %u\n", error);
3704 state = MsiQueryFeatureStateA(prodcode, "feature");
3705 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3707 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3708 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3710 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3711 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3712 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3713 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3715 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3716 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3718 /* nothing published */
3719 r = MsiInstallProductA(msifile, NULL);
3720 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
3722 skip("Not enough rights to perform tests\n");
3723 goto error;
3725 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3726 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3727 ok(pf_exists("msitest"), "File not installed\n");
3729 state = MsiQueryProductStateA(prodcode);
3730 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3732 state = MsiQueryFeatureStateA(prodcode, "feature");
3733 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3735 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3736 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3738 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3739 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3740 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3741 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3743 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3744 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3746 /* PublishProduct and RegisterProduct */
3747 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3748 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3749 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3750 ok(pf_exists("msitest"), "File not installed\n");
3752 state = MsiQueryProductStateA(prodcode);
3753 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3755 state = MsiQueryFeatureStateA(prodcode, "feature");
3756 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3758 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3759 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3761 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3762 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3763 ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
3764 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3766 if (is_64bit)
3768 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3769 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3771 else
3773 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3774 if (is_wow64 && res == ERROR_FILE_NOT_FOUND) /* XP - Vista, Wow64 */
3775 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3776 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3779 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3780 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3781 CHECK_REG_STR(prodkey, "InstallDate", date);
3782 CHECK_REG_STR(prodkey, "InstallSource", temp);
3783 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3784 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3785 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3786 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3787 CHECK_REG_STR(prodkey, "Comments", NULL);
3788 CHECK_REG_STR(prodkey, "Contact", NULL);
3789 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3790 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3791 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3792 CHECK_REG_STR(prodkey, "Readme", NULL);
3793 CHECK_REG_STR(prodkey, "Size", NULL);
3794 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3795 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3796 CHECK_REG_DWORD(prodkey, "Language", 1033);
3797 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3798 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3799 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3800 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3801 todo_wine
3802 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3804 RegCloseKey(prodkey);
3806 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3808 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3809 ok(pf_exists("msitest"), "File deleted\n");
3811 state = MsiQueryProductStateA(prodcode);
3812 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3814 state = MsiQueryFeatureStateA(prodcode, "feature");
3815 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3817 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3818 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3820 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3821 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3822 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3823 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3825 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3826 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3828 /* complete install */
3829 r = MsiInstallProductA(msifile, "FULL=1");
3830 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3831 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3832 ok(pf_exists("msitest"), "File not installed\n");
3834 state = MsiQueryProductStateA(prodcode);
3835 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3837 state = MsiQueryFeatureStateA(prodcode, "feature");
3838 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3840 state = 0xdead;
3841 SetLastError(0xdeadbeef);
3842 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3843 error = GetLastError();
3844 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3845 ok(state == 0xdead, "got %d\n", state);
3846 ok(error == 0xdeadbeef, "got %u\n", error);
3848 state = 0xdead;
3849 SetLastError(0xdeadbeef);
3850 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3851 error = GetLastError();
3852 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3853 ok(state == 0xdead, "got %d\n", state);
3854 ok(error == ERROR_SUCCESS, "got %u\n", error);
3856 state = 0xdead;
3857 SetLastError(0xdeadbeef);
3858 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3859 error = GetLastError();
3860 ok(r == ERROR_SUCCESS, "got %u\n", r);
3861 ok(state == INSTALLSTATE_LOCAL, "got %d\n", state);
3862 ok(error == ERROR_SUCCESS, "got %u\n", error);
3864 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3865 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3867 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3868 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3869 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3870 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3872 if (is_64bit)
3874 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3875 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3877 else
3879 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3880 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3883 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3884 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3885 CHECK_REG_STR(prodkey, "InstallDate", date);
3886 CHECK_REG_STR(prodkey, "InstallSource", temp);
3887 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3888 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3889 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3890 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3891 CHECK_REG_STR(prodkey, "Comments", NULL);
3892 CHECK_REG_STR(prodkey, "Contact", NULL);
3893 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3894 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3895 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3896 CHECK_REG_STR(prodkey, "Readme", NULL);
3897 CHECK_REG_STR(prodkey, "Size", NULL);
3898 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3899 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3900 CHECK_REG_DWORD(prodkey, "Language", 1033);
3901 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3902 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3903 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3904 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3905 todo_wine
3906 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3908 RegCloseKey(prodkey);
3910 /* no UnpublishFeatures */
3911 r = MsiInstallProductA(msifile, "REMOVE=ALL");
3912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3913 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3914 ok(!pf_exists("msitest"), "Directory not deleted\n");
3916 state = MsiQueryProductStateA(prodcode);
3917 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3919 state = MsiQueryFeatureStateA(prodcode, "feature");
3920 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3922 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3923 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3925 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3926 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3927 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3928 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3930 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3931 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
3933 /* complete install */
3934 r = MsiInstallProductA(msifile, "FULL=1");
3935 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3936 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3937 ok(pf_exists("msitest"), "File not installed\n");
3939 state = MsiQueryProductStateA(prodcode);
3940 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3942 state = MsiQueryFeatureStateA(prodcode, "feature");
3943 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3945 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3946 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3948 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3949 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3950 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3951 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3953 if (is_64bit)
3955 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3956 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3958 else
3960 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3961 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
3964 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3965 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3966 CHECK_REG_STR(prodkey, "InstallDate", date);
3967 CHECK_REG_STR(prodkey, "InstallSource", temp);
3968 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3969 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3970 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3971 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
3972 CHECK_REG_STR(prodkey, "Comments", NULL);
3973 CHECK_REG_STR(prodkey, "Contact", NULL);
3974 CHECK_REG_STR(prodkey, "HelpLink", NULL);
3975 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
3976 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
3977 CHECK_REG_STR(prodkey, "Readme", NULL);
3978 CHECK_REG_STR(prodkey, "Size", NULL);
3979 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
3980 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
3981 CHECK_REG_DWORD(prodkey, "Language", 1033);
3982 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3983 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3984 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3985 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3986 todo_wine
3987 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
3989 RegCloseKey(prodkey);
3991 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
3992 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
3993 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3994 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3995 ok(pf_exists("msitest"), "Directory deleted\n");
3997 state = MsiQueryProductStateA(prodcode);
3998 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4000 state = MsiQueryFeatureStateA(prodcode, "feature");
4001 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4003 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4004 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4006 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4007 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4008 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4009 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4011 if (is_64bit)
4013 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4014 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4016 else
4018 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4019 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4022 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4023 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4024 CHECK_REG_STR(prodkey, "InstallDate", date);
4025 CHECK_REG_STR(prodkey, "InstallSource", temp);
4026 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4027 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4028 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4029 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
4030 CHECK_REG_STR(prodkey, "Comments", NULL);
4031 CHECK_REG_STR(prodkey, "Contact", NULL);
4032 CHECK_REG_STR(prodkey, "HelpLink", NULL);
4033 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
4034 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
4035 CHECK_REG_STR(prodkey, "Readme", NULL);
4036 CHECK_REG_STR(prodkey, "Size", NULL);
4037 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
4038 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
4039 CHECK_REG_DWORD(prodkey, "Language", 1033);
4040 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4041 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4042 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4043 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4044 todo_wine
4045 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
4047 RegCloseKey(prodkey);
4049 /* complete install */
4050 r = MsiInstallProductA(msifile, "FULL=1");
4051 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4052 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4053 ok(pf_exists("msitest"), "File not installed\n");
4055 state = MsiQueryProductStateA(prodcode);
4056 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4058 state = MsiQueryFeatureStateA(prodcode, "feature");
4059 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4061 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4062 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4064 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4065 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4067 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4069 if (is_64bit)
4071 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4072 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4074 else
4076 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4077 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4080 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4081 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4082 CHECK_REG_STR(prodkey, "InstallDate", date);
4083 CHECK_REG_STR(prodkey, "InstallSource", temp);
4084 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4085 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4086 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4087 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
4088 CHECK_REG_STR(prodkey, "Comments", NULL);
4089 CHECK_REG_STR(prodkey, "Contact", NULL);
4090 CHECK_REG_STR(prodkey, "HelpLink", NULL);
4091 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
4092 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
4093 CHECK_REG_STR(prodkey, "Readme", NULL);
4094 CHECK_REG_STR(prodkey, "Size", NULL);
4095 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
4096 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
4097 CHECK_REG_DWORD(prodkey, "Language", 1033);
4098 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4099 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4100 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4101 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4102 todo_wine
4103 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
4105 RegCloseKey(prodkey);
4107 /* UnpublishFeatures, both features removed */
4108 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4109 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4110 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4111 ok(!pf_exists("msitest"), "Directory not deleted\n");
4113 state = MsiQueryProductStateA(prodcode);
4114 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4116 state = MsiQueryFeatureStateA(prodcode, "feature");
4117 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4119 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4120 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4122 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4123 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4124 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4125 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4127 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4128 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4130 /* complete install */
4131 r = MsiInstallProductA(msifile, "FULL=1");
4132 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4133 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4134 ok(pf_exists("msitest"), "File not installed\n");
4136 state = MsiQueryProductStateA(prodcode);
4137 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4139 state = MsiQueryFeatureStateA(prodcode, "feature");
4140 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4142 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4143 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4145 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4146 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4147 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4148 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4150 if (is_64bit)
4152 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4153 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4155 else
4157 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4158 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4161 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4162 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4163 CHECK_REG_STR(prodkey, "InstallDate", date);
4164 CHECK_REG_STR(prodkey, "InstallSource", temp);
4165 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4166 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4167 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4168 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", NULL);
4169 CHECK_REG_STR(prodkey, "Comments", NULL);
4170 CHECK_REG_STR(prodkey, "Contact", NULL);
4171 CHECK_REG_STR(prodkey, "HelpLink", NULL);
4172 CHECK_REG_STR(prodkey, "HelpTelephone", NULL);
4173 CHECK_REG_STR(prodkey, "InstallLocation", NULL);
4174 CHECK_REG_STR(prodkey, "Readme", NULL);
4175 CHECK_REG_STR(prodkey, "Size", NULL);
4176 CHECK_REG_STR(prodkey, "URLInfoAbout", NULL);
4177 CHECK_REG_STR(prodkey, "URLUpdateInfo", NULL);
4178 CHECK_REG_DWORD(prodkey, "Language", 1033);
4179 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4180 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4181 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4182 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4183 todo_wine
4184 CHECK_REG_DWORD(prodkey, "EstimatedSize", get_estimated_size());
4186 RegCloseKey(prodkey);
4188 /* complete uninstall */
4189 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
4190 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4191 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4192 ok(!pf_exists("msitest"), "Directory not deleted\n");
4194 state = MsiQueryProductStateA(prodcode);
4195 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4197 state = MsiQueryFeatureStateA(prodcode, "feature");
4198 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4200 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4201 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4203 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4204 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4205 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4206 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4208 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4209 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4211 /* make sure 'Program Files\msitest' is removed */
4212 delete_pfmsitest_files();
4214 error:
4215 RegCloseKey(uninstall);
4216 RegCloseKey(uninstall_32node);
4217 DeleteFileA(msifile);
4218 DeleteFileA("msitest\\maximus");
4219 RemoveDirectoryA("msitest");
4222 static void test_publish_sourcelist(void)
4224 UINT r;
4225 DWORD size;
4226 CHAR value[MAX_PATH];
4227 CHAR path[MAX_PATH];
4228 CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4230 if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
4232 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4233 return;
4235 if (is_process_limited())
4237 skip("process is limited\n");
4238 return;
4241 CreateDirectoryA("msitest", NULL);
4242 create_file("msitest\\maximus", 500);
4244 create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
4246 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4248 r = MsiInstallProductA(msifile, NULL);
4249 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4251 skip("Not enough rights to perform tests\n");
4252 goto error;
4254 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4255 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4256 ok(pf_exists("msitest"), "File not installed\n");
4258 /* nothing published */
4259 size = MAX_PATH;
4260 lstrcpyA(value, "aaa");
4261 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4262 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4263 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4264 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4265 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4267 size = MAX_PATH;
4268 lstrcpyA(value, "aaa");
4269 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4270 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4271 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4272 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4273 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4275 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1");
4276 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4277 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4278 ok(pf_exists("msitest"), "File not installed\n");
4280 /* after RegisterProduct */
4281 size = MAX_PATH;
4282 lstrcpyA(value, "aaa");
4283 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4284 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4285 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4286 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4287 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4289 size = MAX_PATH;
4290 lstrcpyA(value, "aaa");
4291 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4292 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4293 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4294 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4295 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4297 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
4298 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4299 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4300 ok(pf_exists("msitest"), "File not installed\n");
4302 /* after ProcessComponents */
4303 size = MAX_PATH;
4304 lstrcpyA(value, "aaa");
4305 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4306 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4307 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4308 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4309 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4311 size = MAX_PATH;
4312 lstrcpyA(value, "aaa");
4313 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4314 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4315 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4316 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4317 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4319 r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1");
4320 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4321 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4322 ok(pf_exists("msitest"), "File not installed\n");
4324 /* after PublishFeatures */
4325 size = MAX_PATH;
4326 lstrcpyA(value, "aaa");
4327 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4328 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4329 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4330 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4331 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4333 size = MAX_PATH;
4334 lstrcpyA(value, "aaa");
4335 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4336 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4337 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4338 ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size);
4339 ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
4341 r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
4342 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4343 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4344 ok(pf_exists("msitest"), "File not installed\n");
4346 /* after PublishProduct */
4347 size = MAX_PATH;
4348 lstrcpyA(value, "aaa");
4349 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4350 MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
4351 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4352 ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
4353 ok(size == 11, "Expected 11, got %d\n", size);
4355 size = MAX_PATH;
4356 lstrcpyA(value, "aaa");
4357 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4358 MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
4359 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4360 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4361 ok(size == 0, "Expected 0, got %d\n", size);
4363 size = MAX_PATH;
4364 lstrcpyA(value, "aaa");
4365 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4366 MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
4367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4368 ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
4369 ok(size == 0, "Expected 0, got %d\n", size);
4371 lstrcpyA(path, CURR_DIR);
4372 lstrcatA(path, "\\");
4374 size = MAX_PATH;
4375 lstrcpyA(value, "aaa");
4376 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4377 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
4378 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4379 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4380 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4382 size = MAX_PATH;
4383 lstrcpyA(value, "aaa");
4384 r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4385 MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
4386 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4387 ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
4388 ok(size == 1, "Expected 1, got %d\n", size);
4390 size = MAX_PATH;
4391 lstrcpyA(value, "aaa");
4392 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4393 MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
4394 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4395 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4396 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
4398 size = MAX_PATH;
4399 lstrcpyA(value, "aaa");
4400 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4401 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
4402 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4403 ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
4404 ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
4406 size = MAX_PATH;
4407 lstrcpyA(value, "aaa");
4408 r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4409 MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
4410 ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
4411 ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
4412 ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
4414 /* complete uninstall */
4415 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
4416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4417 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4418 ok(!pf_exists("msitest"), "Directory not deleted\n");
4420 /* make sure 'Program Files\msitest' is removed */
4421 delete_pfmsitest_files();
4423 error:
4424 DeleteFileA(msifile);
4425 DeleteFileA("msitest\\maximus");
4426 RemoveDirectoryA("msitest");
4429 static void test_remove_files(void)
4431 UINT r;
4433 if (is_process_limited())
4435 skip("process is limited\n");
4436 return;
4439 CreateDirectoryA("msitest", NULL);
4440 create_file("msitest\\hydrogen", 500);
4441 create_file("msitest\\helium", 500);
4442 create_file("msitest\\lithium", 500);
4444 create_database(msifile, rem_tables, sizeof(rem_tables) / sizeof(msi_table));
4446 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4448 r = MsiInstallProductA(msifile, NULL);
4449 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4451 skip("Not enough rights to perform tests\n");
4452 goto error;
4454 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4455 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4456 ok(!pf_exists("msitest\\helium"), "File installed\n");
4457 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4458 ok(pf_exists("msitest"), "File not installed\n");
4460 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4461 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4462 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4463 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4464 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4465 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4467 create_pf("msitest", FALSE);
4468 create_pf("msitest\\hydrogen", TRUE);
4469 create_pf("msitest\\helium", TRUE);
4470 create_pf("msitest\\lithium", TRUE);
4472 r = MsiInstallProductA(msifile, NULL);
4473 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4474 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4475 ok(pf_exists("msitest\\helium"), "File not installed\n");
4476 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4477 ok(pf_exists("msitest"), "File not installed\n");
4479 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4480 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4481 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4482 ok(delete_pf("msitest\\helium", TRUE), "File deleted\n");
4483 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4484 ok(delete_pf("msitest", FALSE), "Directory deleted\n");
4486 create_pf("msitest", FALSE);
4487 create_pf("msitest\\furlong", TRUE);
4488 create_pf("msitest\\firkin", TRUE);
4489 create_pf("msitest\\fortnight", TRUE);
4490 create_pf("msitest\\becquerel", TRUE);
4491 create_pf("msitest\\dioptre", TRUE);
4492 create_pf("msitest\\attoparsec", TRUE);
4493 create_pf("msitest\\storeys", TRUE);
4494 create_pf("msitest\\block", TRUE);
4495 create_pf("msitest\\siriometer", TRUE);
4496 create_pf("msitest\\cabout", FALSE);
4497 create_pf("msitest\\cabout\\blocker", TRUE);
4499 r = MsiInstallProductA(msifile, NULL);
4500 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4501 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4502 ok(!pf_exists("msitest\\helium"), "File installed\n");
4503 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4504 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4505 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4506 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4507 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4508 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4509 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4510 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4511 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4512 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4513 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4514 ok(pf_exists("msitest"), "File not installed\n");
4516 create_pf("msitest\\furlong", TRUE);
4517 create_pf("msitest\\firkin", TRUE);
4518 create_pf("msitest\\fortnight", TRUE);
4519 create_pf("msitest\\storeys", TRUE);
4520 create_pf("msitest\\block", TRUE);
4521 create_pf("msitest\\siriometer", TRUE);
4523 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4524 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4525 ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
4526 ok(!delete_pf("msitest\\helium", TRUE), "File not deleted\n");
4527 ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
4528 ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
4529 ok(delete_pf("msitest\\firkin", TRUE), "File deleted\n");
4530 ok(delete_pf("msitest\\fortnight", TRUE), "File deleted\n");
4531 ok(!delete_pf("msitest\\becquerel", TRUE), "File not deleted\n");
4532 ok(!delete_pf("msitest\\dioptre", TRUE), "File not deleted\n");
4533 ok(delete_pf("msitest\\attoparsec", TRUE), "File deleted\n");
4534 ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
4535 ok(!delete_pf("msitest\\block", TRUE), "File not deleted\n");
4536 ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
4537 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4538 ok(pf_exists("msitest"), "Directory deleted\n");
4540 r = MsiInstallProductA(msifile, NULL);
4541 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4542 ok(delete_pf("msitest\\hydrogen", TRUE), "File not installed\n");
4543 ok(!delete_pf("msitest\\helium", TRUE), "File installed\n");
4544 ok(delete_pf("msitest\\lithium", TRUE), "File not installed\n");
4545 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4546 ok(pf_exists("msitest"), "Directory deleted\n");
4548 delete_pf("msitest\\cabout\\blocker", TRUE);
4550 r = MsiInstallProductA(msifile, "REMOVE=ALL");
4551 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4552 ok(!delete_pf("msitest\\cabout", FALSE), "Directory not deleted\n");
4553 delete_pf("msitest", FALSE);
4555 error:
4556 DeleteFileA(msifile);
4557 DeleteFileA("msitest\\hydrogen");
4558 DeleteFileA("msitest\\helium");
4559 DeleteFileA("msitest\\lithium");
4560 RemoveDirectoryA("msitest");
4563 static void test_move_files(void)
4565 UINT r;
4566 char props[MAX_PATH];
4568 if (is_process_limited())
4570 skip("process is limited\n");
4571 return;
4574 CreateDirectoryA("msitest", NULL);
4575 create_file("msitest\\augustus", 100);
4576 create_file("cameroon", 100);
4577 create_file("djibouti", 100);
4578 create_file("egypt", 100);
4579 create_file("finland", 100);
4580 create_file("gambai", 100);
4581 create_file("honduras", 100);
4582 create_file("msitest\\india", 100);
4583 create_file("japan", 100);
4584 create_file("kenya", 100);
4585 CreateDirectoryA("latvia", NULL);
4586 create_file("nauru", 100);
4587 create_file("peru", 100);
4588 create_file("apple", 100);
4589 create_file("application", 100);
4590 create_file("ape", 100);
4591 create_file("foo", 100);
4592 create_file("fao", 100);
4593 create_file("fbod", 100);
4594 create_file("budding", 100);
4595 create_file("buddy", 100);
4596 create_file("bud", 100);
4597 create_file("bar", 100);
4598 create_file("bur", 100);
4599 create_file("bird", 100);
4601 create_database(msifile, mov_tables, sizeof(mov_tables) / sizeof(msi_table));
4603 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4605 /* if the source or dest property is not a full path,
4606 * windows tries to access it as a network resource
4609 sprintf(props, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4610 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4611 CURR_DIR, PROG_FILES_DIR, CURR_DIR, CURR_DIR);
4613 r = MsiInstallProductA(msifile, props);
4614 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4616 skip("Not enough rights to perform tests\n");
4617 goto error;
4619 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4620 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4621 ok(!delete_pf("msitest\\dest", TRUE), "File copied\n");
4622 ok(delete_pf("msitest\\canada", TRUE), "File not copied\n");
4623 ok(delete_pf("msitest\\dominica", TRUE), "File not moved\n");
4624 ok(!delete_pf("msitest\\elsalvador", TRUE), "File moved\n");
4625 ok(!delete_pf("msitest\\france", TRUE), "File moved\n");
4626 ok(!delete_pf("msitest\\georgia", TRUE), "File moved\n");
4627 ok(delete_pf("msitest\\hungary", TRUE), "File not moved\n");
4628 ok(!delete_pf("msitest\\indonesia", TRUE), "File moved\n");
4629 ok(!delete_pf("msitest\\jordan", TRUE), "File moved\n");
4630 ok(delete_pf("msitest\\kiribati", TRUE), "File not moved\n");
4631 ok(!delete_pf("msitest\\lebanon", TRUE), "File moved\n");
4632 ok(!delete_pf("msitest\\lebanon", FALSE), "Directory moved\n");
4633 ok(delete_pf("msitest\\poland", TRUE), "File not moved\n");
4634 /* either apple or application will be moved depending on directory order */
4635 if (!delete_pf("msitest\\apple", TRUE))
4636 ok(delete_pf("msitest\\application", TRUE), "File not moved\n");
4637 else
4638 ok(!delete_pf("msitest\\application", TRUE), "File should not exist\n");
4639 ok(delete_pf("msitest\\wildcard", TRUE), "File not moved\n");
4640 ok(!delete_pf("msitest\\ape", TRUE), "File moved\n");
4641 /* either fao or foo will be moved depending on directory order */
4642 if (delete_pf("msitest\\foo", TRUE))
4643 ok(!delete_pf("msitest\\fao", TRUE), "File should not exist\n");
4644 else
4645 ok(delete_pf("msitest\\fao", TRUE), "File not moved\n");
4646 ok(delete_pf("msitest\\single", TRUE), "File not moved\n");
4647 ok(!delete_pf("msitest\\fbod", TRUE), "File moved\n");
4648 ok(delete_pf("msitest\\budding", TRUE), "File not moved\n");
4649 ok(delete_pf("msitest\\buddy", TRUE), "File not moved\n");
4650 ok(!delete_pf("msitest\\bud", TRUE), "File moved\n");
4651 ok(delete_pf("msitest\\bar", TRUE), "File not moved\n");
4652 ok(delete_pf("msitest\\bur", TRUE), "File not moved\n");
4653 ok(!delete_pf("msitest\\bird", TRUE), "File moved\n");
4654 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4655 ok(DeleteFileA("cameroon"), "File moved\n");
4656 ok(!DeleteFileA("djibouti"), "File not moved\n");
4657 ok(DeleteFileA("egypt"), "File moved\n");
4658 ok(DeleteFileA("finland"), "File moved\n");
4659 ok(DeleteFileA("gambai"), "File moved\n");
4660 ok(!DeleteFileA("honduras"), "File not moved\n");
4661 ok(DeleteFileA("msitest\\india"), "File moved\n");
4662 ok(DeleteFileA("japan"), "File moved\n");
4663 ok(!DeleteFileA("kenya"), "File not moved\n");
4664 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4665 ok(!DeleteFileA("nauru"), "File not moved\n");
4666 ok(!DeleteFileA("peru"), "File not moved\n");
4667 ok(!DeleteFileA("apple"), "File not moved\n");
4668 ok(!DeleteFileA("application"), "File not moved\n");
4669 ok(DeleteFileA("ape"), "File moved\n");
4670 ok(!DeleteFileA("foo"), "File not moved\n");
4671 ok(!DeleteFileA("fao"), "File not moved\n");
4672 ok(DeleteFileA("fbod"), "File moved\n");
4673 ok(!DeleteFileA("budding"), "File not moved\n");
4674 ok(!DeleteFileA("buddy"), "File not moved\n");
4675 ok(DeleteFileA("bud"), "File moved\n");
4676 ok(!DeleteFileA("bar"), "File not moved\n");
4677 ok(!DeleteFileA("bur"), "File not moved\n");
4678 ok(DeleteFileA("bird"), "File moved\n");
4680 error:
4681 DeleteFileA("cameroon");
4682 DeleteFileA("djibouti");
4683 DeleteFileA("egypt");
4684 DeleteFileA("finland");
4685 DeleteFileA("gambai");
4686 DeleteFileA("honduras");
4687 DeleteFileA("japan");
4688 DeleteFileA("kenya");
4689 DeleteFileA("nauru");
4690 DeleteFileA("peru");
4691 DeleteFileA("apple");
4692 DeleteFileA("application");
4693 DeleteFileA("ape");
4694 DeleteFileA("foo");
4695 DeleteFileA("fao");
4696 DeleteFileA("fbod");
4697 DeleteFileA("budding");
4698 DeleteFileA("buddy");
4699 DeleteFileA("bud");
4700 DeleteFileA("bar");
4701 DeleteFileA("bur");
4702 DeleteFileA("bird");
4703 DeleteFileA("msitest\\india");
4704 DeleteFileA("msitest\\augustus");
4705 RemoveDirectoryA("latvia");
4706 RemoveDirectoryA("msitest");
4707 DeleteFileA(msifile);
4710 static void test_duplicate_files(void)
4712 UINT r;
4714 if (is_process_limited())
4716 skip("process is limited\n");
4717 return;
4720 CreateDirectoryA("msitest", NULL);
4721 create_file("msitest\\maximus", 500);
4722 create_database(msifile, df_tables, sizeof(df_tables) / sizeof(msi_table));
4724 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4726 /* fails if the destination folder is not a valid property */
4728 r = MsiInstallProductA(msifile, NULL);
4729 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4731 skip("Not enough rights to perform tests\n");
4732 goto error;
4734 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4735 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4736 ok(delete_pf("msitest\\augustus", TRUE), "File not duplicated\n");
4737 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE), "File not duplicated\n");
4738 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE), "Directory not created\n");
4739 ok(delete_pf("msitest\\this\\doesnot", FALSE), "Directory not created\n");
4740 ok(delete_pf("msitest\\this", FALSE), "Directory not created\n");
4741 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4743 error:
4744 DeleteFileA("msitest\\maximus");
4745 RemoveDirectoryA("msitest");
4746 DeleteFileA(msifile);
4749 static void test_write_registry_values(void)
4751 UINT r;
4752 LONG res;
4753 HKEY hkey;
4754 DWORD type, size;
4755 CHAR path[MAX_PATH];
4756 BYTE buf[8];
4758 if (is_process_limited())
4760 skip("process is limited\n");
4761 return;
4764 CreateDirectoryA("msitest", NULL);
4765 create_file("msitest\\augustus", 500);
4767 create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table));
4769 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
4771 if (is_64bit)
4772 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL, 0,
4773 KEY_ALL_ACCESS, NULL, &hkey, NULL);
4774 else
4775 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, NULL, 0, KEY_ALL_ACCESS,
4776 NULL, &hkey, NULL);
4777 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4779 res = RegSetValueExA(hkey, "Value1", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5);
4780 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4781 res = RegSetValueExA(hkey, "Value2", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4782 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4783 res = RegSetValueExA(hkey, "Value3", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5);
4784 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4785 res = RegSetValueExA(hkey, "Value4", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4786 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4787 res = RegSetValueExA(hkey, "Value5", 0, REG_MULTI_SZ, (const BYTE *)"one\0two\0", 9);
4788 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4789 res = RegSetValueExA(hkey, "Value6", 0, REG_MULTI_SZ, (const BYTE *)"one\0", 5);
4790 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4791 res = RegSetValueExA(hkey, "Value7", 0, REG_SZ, (const BYTE *)"one", 4);
4792 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4793 RegCloseKey(hkey);
4795 r = MsiInstallProductA(msifile, NULL);
4796 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
4798 skip("Not enough rights to perform tests\n");
4799 goto error;
4801 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4802 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4803 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4805 if (is_64bit)
4806 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
4807 else
4808 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
4809 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4811 size = MAX_PATH;
4812 type = 0xdeadbeef;
4813 memset(path, 'a', MAX_PATH);
4814 res = RegQueryValueExA(hkey, "Value", NULL, &type, (LPBYTE)path, &size);
4815 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4816 ok(!memcmp(path, "one\0two\0three\0\0", size), "Wrong multi-sz data\n");
4817 ok(size == 15, "Expected 15, got %d\n", size);
4818 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4820 res = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL);
4821 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
4823 res = action_RegDeleteTreeA(hkey, "VisualStudio", KEY_ALL_ACCESS);
4824 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4826 size = MAX_PATH;
4827 type = 0xdeadbeef;
4828 memset(path, 'a', MAX_PATH);
4829 res = RegQueryValueExA(hkey, "Value1", NULL, &type, (LPBYTE)path, &size);
4830 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4831 ok(!memcmp(path, "one\0", size), "Wrong multi-sz data\n");
4832 ok(size == 5, "Expected 5, got %d\n", size);
4833 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4835 size = MAX_PATH;
4836 type = 0xdeadbeef;
4837 memset(path, 'a', MAX_PATH);
4838 res = RegQueryValueExA(hkey, "Value2", NULL, &type, (LPBYTE)path, &size);
4839 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4840 ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
4841 ok(size == 9, "Expected 9, got %d\n", size);
4842 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4844 size = MAX_PATH;
4845 type = 0xdeadbeef;
4846 memset(path, 'a', MAX_PATH);
4847 res = RegQueryValueExA(hkey, "Value3", NULL, &type, (LPBYTE)path, &size);
4848 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4849 ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
4850 ok(size == 9, "Expected 9, got %d\n", size);
4851 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4853 size = MAX_PATH;
4854 type = 0xdeadbeef;
4855 memset(path, 'a', MAX_PATH);
4856 res = RegQueryValueExA(hkey, "Value4", NULL, &type, (LPBYTE)path, &size);
4857 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4858 ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
4859 ok(size == 9, "Expected 9, got %d\n", size);
4860 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4862 size = MAX_PATH;
4863 type = 0xdeadbeef;
4864 memset(path, 'a', MAX_PATH);
4865 res = RegQueryValueExA(hkey, "Value5", NULL, &type, (LPBYTE)path, &size);
4866 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4867 ok(!memcmp(path, "one\0two\0three\0", size), "Wrong multi-sz data\n");
4868 ok(size == 15, "Expected 15, got %d\n", size);
4869 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4871 size = MAX_PATH;
4872 type = 0xdeadbeef;
4873 memset(path, 'a', MAX_PATH);
4874 res = RegQueryValueExA(hkey, "Value6", NULL, &type, (LPBYTE)path, &size);
4875 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4876 ok(!memcmp(path, "", size), "Wrong multi-sz data\n");
4877 ok(size == 1, "Expected 1, got %d\n", size);
4878 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4880 size = MAX_PATH;
4881 type = 0xdeadbeef;
4882 memset(path, 'a', MAX_PATH);
4883 res = RegQueryValueExA(hkey, "Value7", NULL, &type, (LPBYTE)path, &size);
4884 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4885 ok(!memcmp(path, "two\0", size), "Wrong multi-sz data\n");
4886 ok(size == 5, "Expected 5, got %d\n", size);
4887 ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
4889 size = sizeof(buf);
4890 type = 0xdeadbeef;
4891 memset(buf, 0, size);
4892 res = RegQueryValueExA(hkey, "Value8", NULL, &type, buf, &size);
4893 ok(res == ERROR_SUCCESS, "got %u\n", res);
4894 ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf);
4895 ok(size == 4, "got %u\n", size);
4896 ok(type == REG_DWORD, "got %u\n", type);
4898 size = sizeof(buf);
4899 type = 0xdeadbeef;
4900 memset(buf, 0, size);
4901 res = RegQueryValueExA(hkey, "Value9", NULL, &type, buf, &size);
4902 ok(res == ERROR_SUCCESS, "got %u\n", res);
4903 ok(buf[0] == 1, "got %u\n", buf[0]);
4904 ok(size == 1, "got %u\n", size);
4905 ok(type == REG_BINARY, "got %u\n", type);
4907 size = sizeof(buf);
4908 type = 0xdeadbeef;
4909 memset(buf, 0, size);
4910 res = RegQueryValueExA(hkey, "Value10", NULL, &type, buf, &size);
4911 ok(res == ERROR_SUCCESS, "got %u\n", res);
4912 ok(buf[0] == 1, "got %u\n", buf[0]);
4913 ok(size == 1, "got %u\n", size);
4914 ok(type == REG_BINARY, "got %u\n", type);
4916 size = sizeof(buf);
4917 type = 0xdeadbeef;
4918 memset(buf, 0, size);
4919 res = RegQueryValueExA(hkey, "Value11", NULL, &type, buf, &size);
4920 ok(res == ERROR_SUCCESS, "got %u\n", res);
4921 ok(buf[0] == 1, "got %u\n", buf[0]);
4922 ok(size == 1, "got %u\n", size);
4923 ok(type == REG_BINARY, "got %u\n", type);
4925 size = sizeof(buf);
4926 type = 0xdeadbeef;
4927 memset(buf, 0, size);
4928 res = RegQueryValueExA(hkey, "Value12", NULL, &type, buf, &size);
4929 ok(res == ERROR_SUCCESS, "got %u\n", res);
4930 ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf);
4931 ok(size == 4, "got %u\n", size);
4932 ok(type == REG_DWORD, "got %u\n", type);
4934 RegDeleteValueA(hkey, "Value");
4935 RegDeleteValueA(hkey, "Value1");
4936 RegDeleteValueA(hkey, "Value2");
4937 RegDeleteValueA(hkey, "Value3");
4938 RegDeleteValueA(hkey, "Value4");
4939 RegDeleteValueA(hkey, "Value5");
4940 RegDeleteValueA(hkey, "Value6");
4941 RegDeleteValueA(hkey, "Value7");
4942 RegDeleteValueA(hkey, "Value8");
4943 RegDeleteValueA(hkey, "Value9");
4944 RegDeleteValueA(hkey, "Value10");
4945 RegDeleteValueA(hkey, "Value11");
4946 RegDeleteValueA(hkey, "Value12");
4947 RegCloseKey(hkey);
4948 RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
4950 error:
4951 DeleteFileA(msifile);
4952 DeleteFileA("msitest\\augustus");
4953 RemoveDirectoryA("msitest");
4956 static void test_envvar(void)
4958 static const char *results[] =
4960 "1;2", /* MSITESTVAR11 */
4961 "1", /* MSITESTVAR12 */
4962 "1;2", /* MSITESTVAR13 */
4963 ";1;", /* MSITESTVAR14 */
4964 ";;1;;", /* MSITESTVAR15 */
4965 " 1 ", /* MSITESTVAR16 */
4966 ";;2;;1", /* MSITESTVAR17 */
4967 "1;;2;;", /* MSITESTVAR18 */
4968 "1", /* MSITESTVAR19 */
4969 "1", /* MSITESTVAR20 */
4970 "1", /* MSITESTVAR21 */
4971 NULL
4973 UINT r;
4974 HKEY env;
4975 LONG res;
4976 DWORD type, size;
4977 char buffer[16];
4978 UINT i;
4980 if (is_process_limited())
4982 skip("process is limited\n");
4983 return;
4986 create_test_files();
4987 create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table));
4989 res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
4990 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4992 res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2);
4993 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4995 res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2);
4996 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
4998 res = RegSetValueExA(env, "MSITESTVAR21", 0, REG_SZ, (const BYTE *)"1", 2);
4999 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5001 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5003 r = MsiInstallProductA(msifile, NULL);
5004 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5006 skip("Not enough rights to perform tests\n");
5007 goto error;
5009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5011 type = REG_NONE;
5012 size = sizeof(buffer);
5013 buffer[0] = 0;
5014 res = RegQueryValueExA(env, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
5015 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5016 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
5017 ok(!lstrcmpA(buffer, "1"), "Expected \"1\", got %s\n", buffer);
5019 res = RegDeleteValueA(env, "MSITESTVAR1");
5020 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5022 type = REG_NONE;
5023 size = sizeof(buffer);
5024 buffer[0] = 0;
5025 res = RegQueryValueExA(env, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
5026 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5027 ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type);
5028 ok(!lstrcmpA(buffer, "1"), "Expected \"1\", got %s\n", buffer);
5030 res = RegDeleteValueA(env, "MSITESTVAR2");
5031 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5033 res = RegDeleteValueA(env, "MSITESTVAR3");
5034 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5036 res = RegDeleteValueA(env, "MSITESTVAR4");
5037 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5039 res = RegDeleteValueA(env, "MSITESTVAR5");
5040 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5042 res = RegDeleteValueA(env, "MSITESTVAR6");
5043 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5045 res = RegDeleteValueA(env, "MSITESTVAR7");
5046 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5048 res = RegDeleteValueA(env, "MSITESTVAR8");
5049 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5051 res = RegDeleteValueA(env, "MSITESTVAR9");
5052 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5054 res = RegDeleteValueA(env, "MSITESTVAR10");
5055 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
5057 i = 11;
5058 while (results[i - 11])
5060 char name[20];
5061 sprintf(name, "MSITESTVAR%d", i);
5063 type = REG_NONE;
5064 size = sizeof(buffer);
5065 buffer[0] = 0;
5066 res = RegQueryValueExA(env, name, NULL, &type, (LPBYTE)buffer, &size);
5067 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
5068 ok(type == REG_SZ, "%d: Expected REG_SZ, got %u\n", i, type);
5069 ok(!lstrcmpA(buffer, results[i - 11]), "%d: Expected %s, got %s\n", i, results[i - 11], buffer);
5071 res = RegDeleteValueA(env, name);
5072 ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res);
5073 i++;
5076 delete_pf("msitest\\cabout\\new\\five.txt", TRUE);
5077 delete_pf("msitest\\cabout\\new", FALSE);
5078 delete_pf("msitest\\cabout\\four.txt", TRUE);
5079 delete_pf("msitest\\cabout", FALSE);
5080 delete_pf("msitest\\changed\\three.txt", TRUE);
5081 delete_pf("msitest\\changed", FALSE);
5082 delete_pf("msitest\\first\\two.txt", TRUE);
5083 delete_pf("msitest\\first", FALSE);
5084 delete_pf("msitest\\filename", TRUE);
5085 delete_pf("msitest\\one.txt", TRUE);
5086 delete_pf("msitest\\service.exe", TRUE);
5087 delete_pf("msitest\\service2.exe", TRUE);
5088 delete_pf("msitest", FALSE);
5090 error:
5091 RegDeleteValueA(env, "MSITESTVAR1");
5092 RegDeleteValueA(env, "MSITESTVAR2");
5093 RegDeleteValueA(env, "MSITESTVAR21");
5094 RegCloseKey(env);
5096 delete_test_files();
5097 DeleteFileA(msifile);
5100 static void test_create_remove_folder(void)
5102 UINT r;
5104 if (is_process_limited())
5106 skip("process is limited\n");
5107 return;
5110 CreateDirectoryA("msitest", NULL);
5111 CreateDirectoryA("msitest\\first", NULL);
5112 CreateDirectoryA("msitest\\second", NULL);
5113 create_file("msitest\\first\\one.txt", 1000);
5114 create_file("msitest\\second\\two.txt", 1000);
5115 create_database(msifile, cf_tables, sizeof(cf_tables) / sizeof(msi_table));
5117 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5119 r = MsiInstallProductA(msifile, NULL);
5120 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5122 skip("Not enough rights to perform tests\n");
5123 goto error;
5125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5127 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5128 ok(pf_exists("msitest\\first"), "directory not created\n");
5129 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5130 ok(pf_exists("msitest\\second"), "directory not created\n");
5131 ok(pf_exists("msitest\\third"), "directory not created\n");
5132 ok(pf_exists("msitest"), "directory not created\n");
5134 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5135 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5137 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5138 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5139 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5140 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5141 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5142 todo_wine ok(!pf_exists("msitest"), "directory not removed\n");
5144 error:
5145 DeleteFileA("msitest\\first\\one.txt");
5146 DeleteFileA("msitest\\second\\two.txt");
5147 RemoveDirectoryA("msitest\\first");
5148 RemoveDirectoryA("msitest\\second");
5149 RemoveDirectoryA("msitest");
5150 DeleteFileA(msifile);
5153 static void test_start_stop_services(void)
5155 UINT r;
5156 SC_HANDLE scm, service;
5157 BOOL ret;
5158 DWORD error = ERROR_SUCCESS;
5160 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5161 if (!scm && GetLastError() == ERROR_ACCESS_DENIED)
5163 skip("Not enough rights to perform tests\n");
5164 return;
5166 ok(scm != NULL, "Failed to open the SC Manager\n");
5167 if (!scm) return;
5169 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
5170 if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST)
5172 win_skip("The 'Spooler' service does not exist\n");
5173 CloseServiceHandle(scm);
5174 return;
5176 ok(service != NULL, "Failed to open Spooler, error %d\n", GetLastError());
5177 if (!service) {
5178 CloseServiceHandle(scm);
5179 return;
5182 ret = StartServiceA(service, 0, NULL);
5183 if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING)
5185 skip("Spooler service not available, skipping test\n");
5186 CloseServiceHandle(service);
5187 CloseServiceHandle(scm);
5188 return;
5191 CloseServiceHandle(service);
5192 CloseServiceHandle(scm);
5194 create_test_files();
5195 create_database(msifile, sss_tables, sizeof(sss_tables) / sizeof(msi_table));
5197 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5199 r = MsiInstallProductA(msifile, NULL);
5200 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5202 if (error == ERROR_SUCCESS)
5204 SERVICE_STATUS status;
5206 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5207 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
5209 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
5210 ok(ret, "ControlService failed %u\n", GetLastError());
5212 CloseServiceHandle(service);
5213 CloseServiceHandle(scm);
5216 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5217 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5219 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5220 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5221 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5222 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5223 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5224 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5225 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5226 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5227 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5228 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5229 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5230 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5231 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5233 if (error == ERROR_SUCCESS)
5235 SERVICE_STATUS status;
5237 scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5238 service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
5240 ret = ControlService(service, SERVICE_CONTROL_STOP, &status);
5241 ok(ret, "ControlService failed %u\n", GetLastError());
5243 CloseServiceHandle(service);
5244 CloseServiceHandle(scm);
5247 delete_test_files();
5248 DeleteFileA(msifile);
5251 static void delete_test_service(const char *name)
5253 BOOL ret;
5254 SC_HANDLE manager, service;
5256 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5257 ok(manager != NULL, "can't open service manager\n");
5258 if (!manager) return;
5260 service = OpenServiceA(manager, name, GENERIC_ALL);
5261 if (service)
5263 ret = DeleteService( service );
5264 ok( ret, "failed to delete service %u\n", GetLastError() );
5265 CloseServiceHandle(service);
5267 CloseServiceHandle(manager);
5270 static void test_delete_services(void)
5272 UINT r;
5273 SC_HANDLE manager, service;
5274 DWORD error;
5276 if (is_process_limited())
5278 skip("process is limited\n");
5279 return;
5282 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5283 ok(manager != NULL, "can't open service manager %u\n", GetLastError());
5284 if (!manager) return;
5286 service = CreateServiceA(manager, "TestService3", "TestService3",
5287 SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START,
5288 SERVICE_ERROR_NORMAL, "C:\\doesnt_exist.exe", NULL, NULL, NULL, NULL, NULL);
5289 ok(service != NULL, "can't create service %u\n", GetLastError());
5290 CloseServiceHandle(service);
5291 CloseServiceHandle(manager);
5292 if (!service) return;
5294 create_test_files();
5295 create_database(msifile, sds_tables, sizeof(sds_tables) / sizeof(msi_table));
5297 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5299 r = MsiInstallProductA(msifile, NULL);
5300 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5302 skip("Not enough rights to perform tests\n");
5303 goto error;
5305 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5307 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5308 ok(manager != NULL, "can't open service manager\n");
5309 if (!manager) goto error;
5311 service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
5312 error = GetLastError();
5313 ok(service == NULL, "TestService3 not deleted\n");
5314 ok(error == ERROR_SERVICE_DOES_NOT_EXIST, "wrong error %u\n", error);
5315 CloseServiceHandle(manager);
5317 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5318 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5320 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5321 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5322 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5323 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5324 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5325 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5326 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5327 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5328 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5329 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5330 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5331 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5332 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5334 error:
5335 delete_test_service("TestService");
5336 delete_test_service("TestService2");
5337 delete_test_service("TestService3");
5338 delete_test_files();
5339 DeleteFileA(msifile);
5342 static void test_install_services(void)
5344 UINT r;
5345 SC_HANDLE manager, service;
5346 LONG res;
5347 HKEY hKey;
5348 DWORD err_control, err_controlsize, err_controltype;
5350 if (is_process_limited())
5352 skip("process is limited\n");
5353 return;
5356 create_test_files();
5357 create_database(msifile, sis_tables, sizeof(sis_tables) / sizeof(msi_table));
5359 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5361 r = MsiInstallProductA(msifile, NULL);
5362 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5364 skip("Not enough rights to perform tests\n");
5365 goto error;
5367 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5369 manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
5370 ok(manager != NULL, "can't open service manager\n");
5371 if (!manager) goto error;
5373 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5374 ok(service != NULL, "TestService not installed\n");
5375 CloseServiceHandle(service);
5377 service = OpenServiceA(manager, "TestService4", GENERIC_ALL);
5378 ok(service == NULL, "TestService4 installed\n");
5380 res = RegOpenKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey);
5381 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5383 if (res == ERROR_SUCCESS)
5385 err_control = 0xBEEF;
5386 err_controltype = REG_DWORD;
5387 err_controlsize = sizeof(err_control);
5388 res = RegQueryValueExA(hKey, "ErrorControl", NULL, &err_controltype, (LPBYTE)&err_control, &err_controlsize);
5389 ok(err_control == 0, "TestService.ErrorControl wrong, expected 0, got %u\n", err_control);
5390 RegCloseKey(hKey);
5393 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5394 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5396 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5397 ok(service != NULL, "TestService deleted\n");
5398 CloseServiceHandle(service);
5399 CloseServiceHandle(manager);
5401 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5402 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5403 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5404 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5405 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5406 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5407 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5408 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5409 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5410 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5411 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5412 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5413 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5415 error:
5416 delete_test_service("TestService");
5417 delete_test_files();
5418 DeleteFileA(msifile);
5421 static void test_self_registration(void)
5423 HKEY key;
5424 UINT r;
5426 if (is_process_limited())
5428 skip("process is limited\n");
5429 return;
5432 create_test_files();
5433 extract_resource("selfreg.dll", "TESTDLL", "msitest\\selfreg.dll");
5434 create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table));
5436 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5438 r = MsiInstallProductA(msifile, NULL);
5439 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5441 skip("Not enough rights to perform tests\n");
5442 goto error;
5444 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5446 r = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
5447 ok(!r, "got %u\n", r);
5448 RegCloseKey(key);
5450 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5451 ok(!r, "got %u\n", r);
5453 r = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
5454 ok(r == ERROR_FILE_NOT_FOUND, "got %u\n", r);
5456 ok(!delete_pf("msitest\\selfreg.dll", TRUE), "file not removed\n");
5457 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5459 error:
5460 DeleteFileA("msitest\\selfreg.dll");
5461 delete_test_files();
5462 DeleteFileA(msifile);
5465 static void test_register_font(void)
5467 static const char regfont1[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5468 static const char regfont2[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5469 LONG ret;
5470 HKEY key;
5471 UINT r;
5472 REGSAM access = KEY_ALL_ACCESS;
5474 if (is_process_limited())
5476 skip("process is limited\n");
5477 return;
5480 create_test_files();
5481 create_file("msitest\\font.ttf", 1000);
5482 create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table));
5484 if (is_wow64)
5485 access |= KEY_WOW64_64KEY;
5487 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5489 r = MsiInstallProductA(msifile, NULL);
5490 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5492 skip("Not enough rights to perform tests\n");
5493 goto error;
5495 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5497 ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont1, 0, access, &key);
5498 if (ret)
5499 RegOpenKeyExA(HKEY_LOCAL_MACHINE, regfont2, 0, access, &key);
5501 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5502 ok(ret != ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
5504 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5505 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5507 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5509 ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
5510 ok(ret == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret);
5512 RegDeleteValueA(key, "msi test font");
5513 RegCloseKey(key);
5515 error:
5516 DeleteFileA("msitest\\font.ttf");
5517 delete_test_files();
5518 DeleteFileA(msifile);
5521 static void test_validate_product_id(void)
5523 UINT r;
5525 if (is_process_limited())
5527 skip("process is limited\n");
5528 return;
5531 create_test_files();
5532 create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table));
5534 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5536 r = MsiInstallProductA(msifile, NULL);
5537 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5539 skip("Not enough rights to perform tests\n");
5540 goto error;
5542 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5544 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=1");
5545 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5547 r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=2");
5548 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5550 r = MsiInstallProductA(msifile, "PIDKEY=123-1234567");
5551 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5553 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5554 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5555 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5556 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5557 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5558 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5559 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5560 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5561 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5562 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5563 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5564 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5565 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5567 error:
5568 delete_test_files();
5569 DeleteFileA(msifile);
5572 static void test_install_remove_odbc(void)
5574 int gotdriver = 0, gotdriver2 = 0;
5575 char buffer[1000], *p;
5576 WORD len;
5577 UINT r;
5579 if (is_process_limited())
5581 skip("process is limited\n");
5582 return;
5585 create_test_files();
5586 create_file("msitest\\ODBCdriver.dll", 1000);
5587 create_file("msitest\\ODBCdriver2.dll", 1000);
5588 create_file("msitest\\ODBCtranslator.dll", 1000);
5589 create_file("msitest\\ODBCtranslator2.dll", 1000);
5590 create_file("msitest\\ODBCsetup.dll", 1000);
5591 create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table));
5593 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5595 r = MsiInstallProductA(msifile, NULL);
5596 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5598 skip("Not enough rights to perform tests\n");
5599 goto error;
5601 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5603 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5604 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5605 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5606 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5607 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5609 r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
5610 ok(len < sizeof(buffer), "buffer too small\n");
5611 ok(r, "SQLGetInstalledDrivers failed\n");
5612 for (p = buffer; *p; p += strlen(p) + 1)
5614 if (!strcmp(p, "ODBC test driver"))
5615 gotdriver = 1;
5616 if (!strcmp(p, "ODBC test driver2"))
5617 gotdriver2 = 1;
5619 ok(gotdriver, "driver not installed\n");
5620 ok(gotdriver2, "driver 2 not installed\n");
5622 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5623 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5625 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not removed\n");
5626 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not removed\n");
5627 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not removed\n");
5628 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not removed\n");
5629 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
5630 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5632 gotdriver = gotdriver2 = 0;
5633 r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
5634 ok(len < sizeof(buffer), "buffer too small\n");
5635 ok(r, "SQLGetInstalledDrivers failed\n");
5636 for (p = buffer; *p; p += strlen(p) + 1)
5638 if (!strcmp(p, "ODBC test driver"))
5639 gotdriver = 1;
5640 if (!strcmp(p, "ODBC test driver2"))
5641 gotdriver2 = 1;
5643 ok(!gotdriver, "driver not installed\n");
5644 ok(!gotdriver2, "driver 2 not installed\n");
5646 error:
5647 DeleteFileA("msitest\\ODBCdriver.dll");
5648 DeleteFileA("msitest\\ODBCdriver2.dll");
5649 DeleteFileA("msitest\\ODBCtranslator.dll");
5650 DeleteFileA("msitest\\ODBCtranslator2.dll");
5651 DeleteFileA("msitest\\ODBCsetup.dll");
5652 delete_test_files();
5653 DeleteFileA(msifile);
5656 static void test_register_typelib(void)
5658 ITypeLib *tlb;
5659 HRESULT hr;
5660 UINT r;
5662 if (is_process_limited())
5664 skip("process is limited\n");
5665 return;
5668 /* UnregisterTypeLibraries action fails in 64-bit Windows <= 7 */
5669 if (sizeof(void *) == 8)
5671 win_skip("broken on 64-bit Windows\n");
5672 return;
5675 create_test_files();
5676 extract_resource("typelib.tlb", "TYPELIB", "msitest\\typelib.dll");
5677 create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table));
5679 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5681 r = MsiInstallProductA(msifile, NULL);
5682 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5684 skip("Not enough rights to perform tests\n");
5685 goto error;
5687 ok(r == ERROR_SUCCESS, "got %u\n", r);
5689 hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
5690 ok(hr == S_OK, "got %#x\n", hr);
5691 ITypeLib_Release(tlb);
5693 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5694 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5696 hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
5697 ok(hr == TYPE_E_LIBNOTREGISTERED, "got %#x\n", hr);
5699 ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n");
5700 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5702 error:
5703 DeleteFileA("msitest\\typelib.dll");
5704 delete_test_files();
5705 DeleteFileA(msifile);
5708 static void test_create_remove_shortcut(void)
5710 UINT r;
5712 if (is_process_limited())
5714 skip("process is limited\n");
5715 return;
5718 create_test_files();
5719 create_file("msitest\\target.txt", 1000);
5720 create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table));
5722 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5724 r = MsiInstallProductA(msifile, NULL);
5725 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5727 skip("Not enough rights to perform tests\n");
5728 goto error;
5730 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5732 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5733 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5735 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5736 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5738 ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n");
5739 ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n");
5740 todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5742 error:
5743 DeleteFileA("msitest\\target.txt");
5744 delete_test_files();
5745 DeleteFileA(msifile);
5748 static void test_publish_components(void)
5750 static const char keypath[] =
5751 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5752 static const char keypath2[] =
5753 "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5755 UINT r;
5756 LONG res;
5757 HKEY key;
5758 BYTE *data;
5759 DWORD size;
5761 if (is_process_limited())
5763 skip("process is limited\n");
5764 return;
5767 create_test_files();
5768 create_file("msitest\\english.txt", 1000);
5769 create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table));
5771 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5773 r = MsiInstallProductA(msifile, NULL);
5774 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5776 skip("Not enough rights to perform tests\n");
5777 goto error;
5779 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5781 size = 0;
5782 r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5783 "english.txt", INSTALLMODE_DEFAULT, NULL, &size);
5784 ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
5786 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5787 ok(res == ERROR_SUCCESS, "components key not created %d\n", res);
5789 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, &size);
5790 ok(res == ERROR_SUCCESS, "value not found %d\n", res);
5792 data = HeapAlloc(GetProcessHeap(), 0, size);
5793 res = RegQueryValueExA(key, "english.txt", NULL, NULL, data, &size);
5794 ok(res == ERROR_SUCCESS, "value not found %d\n", res);
5795 RegCloseKey(key);
5797 res = RegDeleteKeyA(HKEY_CURRENT_USER, keypath);
5798 ok(res == ERROR_SUCCESS, "RegDeleteKey failed %d\n", res);
5800 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath2, 0, NULL, REG_OPTION_NON_VOLATILE,
5801 MAXIMUM_ALLOWED | KEY_WOW64_64KEY, NULL, &key, NULL );
5802 ok(res == ERROR_SUCCESS, "RegCreateKeyEx failed %d\n", res);
5803 res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size);
5804 ok(res == ERROR_SUCCESS, "RegSetValueEx failed %d\n", res);
5805 RegCloseKey(key);
5807 size = 0;
5808 r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5809 "english.txt", INSTALLMODE_DEFAULT, NULL, &size);
5810 ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
5812 if (pRegDeleteKeyExA)
5813 res = pRegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0);
5814 else
5815 res = RegDeleteKeyA(HKEY_LOCAL_MACHINE, keypath2);
5816 ok(res == ERROR_SUCCESS, "RegDeleteKey failed %d\n", res);
5818 res = RegCreateKeyA(HKEY_CURRENT_USER, keypath, &key);
5819 ok(res == ERROR_SUCCESS, "RegCreateKey failed %d\n", res);
5821 res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size);
5822 ok(res == ERROR_SUCCESS, "RegSetValueEx failed %d\n", res);
5823 HeapFree(GetProcessHeap(), 0, data);
5824 RegCloseKey(key);
5826 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5827 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5829 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5830 ok(res == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", res);
5832 ok(!delete_pf("msitest\\english.txt", TRUE), "file not removed\n");
5833 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5835 error:
5836 DeleteFileA("msitest\\english.txt");
5837 delete_test_files();
5838 DeleteFileA(msifile);
5841 static void test_remove_duplicate_files(void)
5843 UINT r;
5845 if (is_process_limited())
5847 skip("process is limited\n");
5848 return;
5851 create_test_files();
5852 create_file("msitest\\original.txt", 1000);
5853 create_file("msitest\\original2.txt", 1000);
5854 create_file("msitest\\original3.txt", 1000);
5855 create_database(msifile, rd_tables, sizeof(rd_tables) / sizeof(msi_table));
5857 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5859 r = MsiInstallProductA(msifile, NULL);
5860 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5862 skip("Not enough rights to perform tests\n");
5863 goto error;
5865 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5867 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5868 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5869 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5870 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5871 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5873 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5874 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5876 ok(delete_pf("msitest\\original.txt", TRUE), "file removed\n");
5877 ok(!delete_pf("msitest\\original2.txt", TRUE), "file not removed\n");
5878 ok(!delete_pf("msitest\\original3.txt", TRUE), "file not removed\n");
5879 ok(!delete_pf("msitest\\duplicate.txt", TRUE), "file not removed\n");
5880 ok(!delete_pf("msitest\\duplicate2.txt", TRUE), "file not removed\n");
5881 ok(delete_pf("msitest", FALSE), "directory removed\n");
5883 error:
5884 DeleteFileA("msitest\\original.txt");
5885 DeleteFileA("msitest\\original2.txt");
5886 DeleteFileA("msitest\\original3.txt");
5887 delete_test_files();
5888 DeleteFileA(msifile);
5891 static void test_remove_registry_values(void)
5893 UINT r;
5894 LONG res;
5895 HKEY key;
5896 REGSAM access = KEY_ALL_ACCESS;
5898 if (is_process_limited())
5900 skip("process is limited\n");
5901 return;
5904 create_test_files();
5905 create_file("msitest\\registry.txt", 1000);
5906 create_database(msifile, rrv_tables, sizeof(rrv_tables) / sizeof(msi_table));
5908 if (is_wow64)
5909 access |= KEY_WOW64_64KEY;
5911 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
5913 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, NULL, 0, access, NULL, &key, NULL);
5914 RegSetValueExA(key, "value1", 0, REG_SZ, (const BYTE *)"1", 2);
5915 RegCloseKey(key);
5917 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
5918 RegSetValueExA(key, "value2", 0, REG_SZ, (const BYTE *)"2", 2);
5919 RegCloseKey(key);
5921 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, NULL, 0, access, NULL, &key, NULL);
5922 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
5923 RegSetValueExA(key, "valueA", 0, REG_SZ, (const BYTE *)"A", 2);
5924 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
5925 RegCloseKey(key);
5927 RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, NULL, 0, access, NULL, &key, NULL);
5928 RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
5929 RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
5930 RegCloseKey(key);
5932 r = MsiInstallProductA(msifile, NULL);
5933 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
5935 skip("Not enough rights to perform tests\n");
5936 goto error;
5938 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5940 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, access, &key);
5941 ok(res == ERROR_SUCCESS, "key removed\n");
5942 RegCloseKey(key);
5944 if (is_64bit)
5946 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
5947 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5949 else
5951 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
5952 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5955 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
5956 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
5957 RegCloseKey(key);
5959 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5960 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5962 if (is_64bit)
5964 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
5965 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5967 else
5969 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
5970 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5973 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, access, &key);
5974 ok(res == ERROR_SUCCESS, "key removed\n");
5975 RegCloseKey(key);
5977 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, access, &key);
5978 ok(res == ERROR_SUCCESS, "key removed\n");
5979 RegCloseKey(key);
5981 if (is_64bit)
5983 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
5984 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5986 else
5988 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
5989 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
5992 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
5993 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
5994 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine", access);
5996 ok(!delete_pf("msitest\\registry.txt", TRUE), "file not removed\n");
5997 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5999 error:
6000 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", access);
6001 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
6002 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
6003 delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", access);
6005 DeleteFileA("msitest\\registry.txt");
6006 delete_test_files();
6007 DeleteFileA(msifile);
6010 static void test_find_related_products(void)
6012 UINT r;
6014 if (is_process_limited())
6016 skip("process is limited\n");
6017 return;
6020 create_test_files();
6021 create_file("msitest\\product.txt", 1000);
6022 create_database(msifile, frp_tables, sizeof(frp_tables) / sizeof(msi_table));
6024 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6026 r = MsiInstallProductA(msifile, NULL);
6027 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6029 skip("Not enough rights to perform tests\n");
6030 goto error;
6032 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6034 /* install again, so it finds the upgrade code */
6035 r = MsiInstallProductA(msifile, NULL);
6036 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6038 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6039 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6041 ok(!delete_pf("msitest\\product.txt", TRUE), "file not removed\n");
6042 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6044 error:
6045 DeleteFileA("msitest\\product.txt");
6046 delete_test_files();
6047 DeleteFileA(msifile);
6050 static void test_remove_ini_values(void)
6052 UINT r;
6053 DWORD len;
6054 char inifile[MAX_PATH], buf[0x10];
6055 HANDLE file;
6056 BOOL ret;
6058 if (is_process_limited())
6060 skip("process is limited\n");
6061 return;
6064 create_test_files();
6065 create_file("msitest\\inifile.txt", 1000);
6066 create_database(msifile, riv_tables, sizeof(riv_tables) / sizeof(msi_table));
6068 lstrcpyA(inifile, PROG_FILES_DIR);
6069 lstrcatA(inifile, "\\msitest");
6070 ret = CreateDirectoryA(inifile, NULL);
6071 if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
6073 skip("Not enough rights to perform tests\n");
6074 goto error;
6076 lstrcatA(inifile, "\\test.ini");
6077 file = CreateFileA(inifile, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0, NULL);
6078 CloseHandle(file);
6080 ret = WritePrivateProfileStringA("section1", "key1", "value1", inifile);
6081 ok(ret, "failed to write profile string %u\n", GetLastError());
6083 ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile);
6084 ok(ret, "failed to write profile string %u\n", GetLastError());
6086 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6088 r = MsiInstallProductA(msifile, NULL);
6089 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6091 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
6092 ok(len == 6, "got %u expected 6\n", len);
6094 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
6095 ok(!len, "got %u expected 0\n", len);
6097 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6098 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6100 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
6101 ok(!len, "got %u expected 0\n", len);
6103 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
6104 ok(!len, "got %u expected 0\n", len);
6106 todo_wine ok(!delete_pf("msitest\\test.ini", TRUE), "file removed\n");
6107 ok(!delete_pf("msitest\\inifile.txt", TRUE), "file not removed\n");
6108 ok(delete_pf("msitest", FALSE), "directory removed\n");
6110 error:
6111 DeleteFileA("msitest\\inifile.txt");
6112 delete_test_files();
6113 DeleteFileA(msifile);
6116 static void test_remove_env_strings(void)
6118 UINT r;
6119 LONG res;
6120 HKEY key;
6121 DWORD type, size;
6122 char buffer[0x10];
6124 if (is_process_limited())
6126 skip("process is limited\n");
6127 return;
6130 create_test_files();
6131 create_file("msitest\\envvar.txt", 1000);
6132 create_database(msifile, res_tables, sizeof(res_tables) / sizeof(msi_table));
6134 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6136 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
6137 ok(!res, "failed to open environment key %d\n", res);
6139 RegSetValueExA(key, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"1", 2);
6140 RegSetValueExA(key, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"1", 2);
6141 RegSetValueExA(key, "MSITESTVAR3", 0, REG_SZ, (const BYTE *)"1", 2);
6142 RegSetValueExA(key, "MSITESTVAR4", 0, REG_SZ, (const BYTE *)"1", 2);
6143 RegSetValueExA(key, "MSITESTVAR5", 0, REG_SZ, (const BYTE *)"1", 2);
6144 RegSetValueExA(key, "MSITESTVAR6", 0, REG_SZ, (const BYTE *)"1;2", 4);
6145 RegSetValueExA(key, "MSITESTVAR7", 0, REG_SZ, (const BYTE *)"1;2", 4);
6146 RegSetValueExA(key, "MSITESTVAR8", 0, REG_SZ, (const BYTE *)"2;1;0", 6);
6147 RegSetValueExA(key, "MSITESTVAR9", 0, REG_SZ, (const BYTE *)"0;1;2", 6);
6148 RegSetValueExA(key, "MSITESTVAR10", 0, REG_SZ, (const BYTE *)"1", 2);
6149 RegSetValueExA(key, "MSITESTVAR11", 0, REG_SZ, (const BYTE *)"1", 2);
6151 RegCloseKey(key);
6153 r = MsiInstallProductA(msifile, NULL);
6154 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6156 skip("Not enough rights to perform tests\n");
6157 goto error;
6159 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6161 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
6162 ok(!res, "failed to open environment key %d\n", res);
6164 type = REG_NONE;
6165 buffer[0] = 0;
6166 size = sizeof(buffer);
6167 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size);
6168 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6169 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6170 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6172 type = REG_NONE;
6173 buffer[0] = 0;
6174 size = sizeof(buffer);
6175 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size);
6176 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6177 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6178 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6180 type = REG_NONE;
6181 buffer[0] = 0;
6182 size = sizeof(buffer);
6183 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
6184 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6185 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6186 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6188 type = REG_NONE;
6189 buffer[0] = 0;
6190 size = sizeof(buffer);
6191 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, &type, (LPBYTE)buffer, &size);
6192 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6193 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6194 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6196 type = REG_NONE;
6197 buffer[0] = 0;
6198 size = sizeof(buffer);
6199 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
6200 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6201 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6202 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6204 RegCloseKey(key);
6206 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6207 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6209 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
6210 ok(!res, "failed to open environment key %d\n", res);
6212 res = RegQueryValueExA(key, "MSITESTVAR1", NULL, NULL, NULL, NULL);
6213 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6215 res = RegQueryValueExA(key, "MSITESTVAR2", NULL, NULL, NULL, NULL);
6216 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6218 type = REG_NONE;
6219 buffer[0] = 0;
6220 size = sizeof(buffer);
6221 res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size);
6222 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6223 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6224 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6225 RegDeleteValueA(key, "MSITESTVAR3");
6227 res = RegQueryValueExA(key, "MSITESTVAR4", NULL, NULL, NULL, NULL);
6228 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6230 type = REG_NONE;
6231 buffer[0] = 0;
6232 size = sizeof(buffer);
6233 res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size);
6234 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6235 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6236 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6237 RegDeleteValueA(key, "MSITESTVAR5");
6239 type = REG_NONE;
6240 buffer[0] = 0;
6241 size = sizeof(buffer);
6242 res = RegQueryValueExA(key, "MSITESTVAR6", NULL, &type, (LPBYTE)buffer, &size);
6243 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6244 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6245 ok(!lstrcmpA(buffer, "2"), "expected \"2\", got \"%s\"\n", buffer);
6246 RegDeleteValueA(key, "MSITESTVAR6");
6248 type = REG_NONE;
6249 buffer[0] = 0;
6250 size = sizeof(buffer);
6251 res = RegQueryValueExA(key, "MSITESTVAR7", NULL, &type, (LPBYTE)buffer, &size);
6252 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6253 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6254 ok(!lstrcmpA(buffer, "2"), "expected \"2\", got \"%s\"\n", buffer);
6255 RegDeleteValueA(key, "MSITESTVAR7");
6257 type = REG_NONE;
6258 buffer[0] = 0;
6259 size = sizeof(buffer);
6260 res = RegQueryValueExA(key, "MSITESTVAR8", NULL, &type, (LPBYTE)buffer, &size);
6261 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6262 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6263 ok(!lstrcmpA(buffer, "2;0"), "expected \"2;0\", got \"%s\"\n", buffer);
6264 RegDeleteValueA(key, "MSITESTVAR8");
6266 type = REG_NONE;
6267 buffer[0] = 0;
6268 size = sizeof(buffer);
6269 res = RegQueryValueExA(key, "MSITESTVAR9", NULL, &type, (LPBYTE)buffer, &size);
6270 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6271 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6272 ok(!lstrcmpA(buffer, "0;2"), "expected \"0;2\", got \"%s\"\n", buffer);
6273 RegDeleteValueA(key, "MSITESTVAR9");
6275 type = REG_NONE;
6276 buffer[0] = 0;
6277 size = sizeof(buffer);
6278 res = RegQueryValueExA(key, "MSITESTVAR10", NULL, &type, (LPBYTE)buffer, &size);
6279 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6281 type = REG_NONE;
6282 buffer[0] = 0;
6283 size = sizeof(buffer);
6284 res = RegQueryValueExA(key, "MSITESTVAR11", NULL, &type, (LPBYTE)buffer, &size);
6285 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6286 ok(type == REG_SZ, "expected REG_SZ, got %u\n", type);
6287 ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer);
6288 RegDeleteValueA(key, "MSITESTVAR11");
6290 ok(!delete_pf("msitest\\envvar.txt", TRUE), "file not removed\n");
6291 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6293 error:
6294 RegDeleteValueA(key, "MSITESTVAR1");
6295 RegDeleteValueA(key, "MSITESTVAR2");
6296 RegDeleteValueA(key, "MSITESTVAR3");
6297 RegDeleteValueA(key, "MSITESTVAR4");
6298 RegDeleteValueA(key, "MSITESTVAR5");
6299 RegDeleteValueA(key, "MSITESTVAR6");
6300 RegDeleteValueA(key, "MSITESTVAR7");
6301 RegDeleteValueA(key, "MSITESTVAR8");
6302 RegDeleteValueA(key, "MSITESTVAR9");
6303 RegDeleteValueA(key, "MSITESTVAR10");
6304 RegDeleteValueA(key, "MSITESTVAR11");
6305 RegCloseKey(key);
6307 DeleteFileA("msitest\\envvar.txt");
6308 delete_test_files();
6309 DeleteFileA(msifile);
6312 static void test_register_class_info(void)
6314 UINT r;
6315 LONG res;
6316 HKEY hkey;
6318 if (is_process_limited())
6320 skip("process is limited\n");
6321 return;
6324 create_test_files();
6325 create_file("msitest\\class.txt", 1000);
6326 create_database(msifile, rci_tables, sizeof(rci_tables) / sizeof(msi_table));
6328 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6330 r = MsiInstallProductA(msifile, NULL);
6331 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6333 skip("Not enough rights to perform tests\n");
6334 goto error;
6336 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6338 if (is_64bit)
6339 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6340 else
6341 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6342 ok(res == ERROR_SUCCESS, "key not created\n");
6343 RegCloseKey(hkey);
6345 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6346 ok(res == ERROR_SUCCESS, "key not created\n");
6347 RegCloseKey(hkey);
6349 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
6350 ok(res == ERROR_SUCCESS, "key not created\n");
6351 RegCloseKey(hkey);
6353 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6354 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6356 if (is_64bit)
6357 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6358 else
6359 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6360 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6362 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6363 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6365 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey);
6366 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6368 ok(!delete_pf("msitest\\class.txt", TRUE), "file not removed\n");
6369 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6371 error:
6372 DeleteFileA("msitest\\class.txt");
6373 delete_test_files();
6374 DeleteFileA(msifile);
6377 static void test_register_extension_info(void)
6379 UINT r;
6380 LONG res;
6381 HKEY hkey;
6383 if (is_process_limited())
6385 skip("process is limited\n");
6386 return;
6389 create_test_files();
6390 create_file("msitest\\extension.txt", 1000);
6391 create_database(msifile, rei_tables, sizeof(rei_tables) / sizeof(msi_table));
6393 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6395 r = MsiInstallProductA(msifile, NULL);
6396 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6398 skip("Not enough rights to perform tests\n");
6399 goto error;
6401 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6403 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
6404 ok(res == ERROR_SUCCESS, "key not created\n");
6405 RegCloseKey(hkey);
6407 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &hkey);
6408 ok(res == ERROR_SUCCESS, "key not created\n");
6409 RegCloseKey(hkey);
6411 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6412 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6414 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &hkey);
6415 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6417 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1", &hkey);
6418 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6420 ok(!delete_pf("msitest\\extension.txt", TRUE), "file not removed\n");
6421 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6423 error:
6424 DeleteFileA("msitest\\extension.txt");
6425 delete_test_files();
6426 DeleteFileA(msifile);
6429 static void test_register_progid_info(void)
6431 UINT r;
6432 LONG res;
6433 HKEY hkey;
6435 if (is_process_limited())
6437 skip("process is limited\n");
6438 return;
6441 create_test_files();
6442 create_file("msitest\\progid.txt", 1000);
6443 create_database(msifile, rpi_tables, sizeof(rpi_tables) / sizeof(msi_table));
6445 res = RegCreateKeyExA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", 0, NULL, 0,
6446 KEY_ALL_ACCESS, NULL, &hkey, NULL);
6447 ok(res == ERROR_SUCCESS, "key not created\n");
6448 RegCloseKey(hkey);
6450 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6452 r = MsiInstallProductA(msifile, NULL);
6453 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6455 skip("Not enough rights to perform tests\n");
6456 goto error;
6458 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6460 if (is_64bit)
6461 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6462 else
6463 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6464 ok(res == ERROR_SUCCESS, "key not created\n");
6465 RegCloseKey(hkey);
6467 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &hkey);
6468 ok(res == ERROR_SUCCESS, "key not created\n");
6469 RegCloseKey(hkey);
6471 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &hkey);
6472 ok(res == ERROR_SUCCESS, "key not created\n");
6473 RegCloseKey(hkey);
6475 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &hkey);
6476 ok(res == ERROR_SUCCESS, "key not created\n");
6477 RegCloseKey(hkey);
6479 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass.1", &hkey);
6480 ok(res == ERROR_SUCCESS, "key not created\n");
6481 RegCloseKey(hkey);
6483 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass", &hkey);
6484 ok(res == ERROR_SUCCESS, "key not created\n");
6485 RegCloseKey(hkey);
6487 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass.1", &hkey);
6488 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6489 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6491 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass", &hkey);
6492 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6494 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", &hkey);
6495 ok(res == ERROR_SUCCESS, "key deleted\n");
6496 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6498 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned2", &hkey);
6499 ok(res == ERROR_FILE_NOT_FOUND, "key created\n");
6501 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Extension", &hkey);
6502 ok(res == ERROR_SUCCESS, "key not created\n");
6503 RegCloseKey(hkey);
6505 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6506 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6508 if (is_64bit)
6509 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6510 else
6511 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey);
6512 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6514 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &hkey);
6515 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6517 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &hkey);
6518 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6520 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &hkey);
6521 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6523 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass.1", &hkey);
6524 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6526 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.VerClass", &hkey);
6527 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6529 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass.1", &hkey);
6530 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6532 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.NoProgIdClass", &hkey);
6533 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6535 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", &hkey);
6536 ok(res == ERROR_SUCCESS, "key deleted\n");
6537 if (res == ERROR_SUCCESS) RegCloseKey(hkey);
6539 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned2", &hkey);
6540 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6542 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Extension", &hkey);
6543 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6545 ok(!delete_pf("msitest\\progid.txt", TRUE), "file not removed\n");
6546 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6548 error:
6549 DeleteFileA("msitest\\progid.txt");
6550 delete_test_files();
6551 DeleteFileA(msifile);
6552 RegDeleteKeyA(HKEY_CLASSES_ROOT, "Winetest.Orphaned");
6555 static void test_register_mime_info(void)
6557 UINT r;
6558 LONG res;
6559 HKEY hkey;
6561 if (is_process_limited())
6563 skip("process is limited\n");
6564 return;
6567 create_test_files();
6568 create_file("msitest\\mime.txt", 1000);
6569 create_database(msifile, rmi_tables, sizeof(rmi_tables) / sizeof(msi_table));
6571 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6573 r = MsiInstallProductA(msifile, NULL);
6574 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6576 skip("Not enough rights to perform tests\n");
6577 goto error;
6579 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6581 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
6582 ok(res == ERROR_SUCCESS, "key not created\n");
6583 RegCloseKey(hkey);
6585 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6586 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6588 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &hkey);
6589 ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
6591 ok(!delete_pf("msitest\\mime.txt", TRUE), "file not removed\n");
6592 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6594 error:
6595 DeleteFileA("msitest\\mime.txt");
6596 delete_test_files();
6597 DeleteFileA(msifile);
6600 static void test_publish_assemblies(void)
6602 static const char manifest[] =
6603 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6604 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6605 "processorArchitecture=\"x86\"/>";
6606 static const char manifest_local[] =
6607 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6608 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6609 "processorArchitecture=\"x86\"/>";
6610 static const char classes_path_dotnet[] =
6611 "Installer\\Assemblies\\Global";
6612 static const char classes_path_dotnet_local[] =
6613 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6614 static const char classes_path_dotnet_local_wow64[] =
6615 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6616 static const char classes_path_win32[] =
6617 "Installer\\Win32Assemblies\\Global";
6618 static const char classes_path_win32_local[] =
6619 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6620 static const char classes_path_win32_local_wow64[] =
6621 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6622 static const char path_dotnet[] =
6623 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6624 static const char path_dotnet_local[] =
6625 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6626 static const char path_dotnet_local_wow64[] =
6627 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6628 static const char path_win32[] =
6629 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6630 static const char path_win32_local[] =
6631 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6632 static const char path_win32_local_wow64[] =
6633 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6634 static const char name_dotnet[] =
6635 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6636 "version=\"1.0.0.0\",culture=\"neutral\"";
6637 static const char name_dotnet_local[] =
6638 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6639 "version=\"1.0.0.0\",culture=\"neutral\"";
6640 static const char name_win32[] =
6641 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6642 "type=\"win32\",version=\"1.0.0.0\"";
6643 static const char name_win32_local[] =
6644 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6645 "type=\"win32\",version=\"1.0.0.0\"";
6646 UINT r;
6647 LONG res;
6648 HKEY hkey;
6649 const char *path;
6650 int access;
6652 if (is_process_limited())
6654 skip("process is limited\n");
6655 return;
6658 create_test_files();
6659 create_file("msitest\\win32.txt", 1000);
6660 create_file("msitest\\win32_local.txt", 1000);
6661 create_file("msitest\\dotnet.txt", 1000);
6662 create_file("msitest\\dotnet_local.txt", 1000);
6663 create_file_data("msitest\\manifest.txt", manifest, 0);
6664 create_file_data("msitest\\manifest_local.txt", manifest_local, 0);
6665 create_file("msitest\\application_win32.txt", 1000);
6666 create_file("msitest\\application_dotnet.txt", 1000);
6667 create_database(msifile, pa_tables, sizeof(pa_tables) / sizeof(msi_table));
6669 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6671 r = MsiInstallProductA(msifile, NULL);
6672 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6674 skip("Not enough rights to perform tests\n");
6675 goto done;
6677 if (r == ERROR_INSTALL_FAILURE)
6679 skip("No support for installing side-by-side assemblies\n");
6680 goto done;
6682 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6684 res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey);
6685 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6686 CHECK_REG_STR(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6687 RegCloseKey(hkey);
6689 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6690 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6691 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6692 CHECK_REG_STR(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6693 RegCloseKey(hkey);
6695 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6696 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6697 "Expected ERROR_SUCCESS, got %d\n", res);
6698 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6699 RegCloseKey(hkey);
6701 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6702 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6703 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6704 "Expected ERROR_SUCCESS, got %d\n", res);
6705 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6706 RegCloseKey(hkey);
6708 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6709 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6711 res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey);
6712 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6713 if (res == ERROR_SUCCESS)
6715 res = RegDeleteValueA(hkey, name_dotnet);
6716 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6717 RegCloseKey(hkey);
6720 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6721 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6722 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6724 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6725 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6726 if (res == ERROR_SUCCESS)
6728 res = RegDeleteValueA(hkey, name_win32);
6729 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6730 RegCloseKey(hkey);
6733 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6734 res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey);
6735 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6737 r = MsiInstallProductA(msifile, "ALLUSERS=1");
6738 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6740 access = KEY_QUERY_VALUE;
6741 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6742 if (res == ERROR_FILE_NOT_FOUND && is_wow64) /* Vista WOW64 */
6744 trace("Using 64-bit registry view for HKCR\\Installer\n");
6745 access = KEY_QUERY_VALUE | KEY_WOW64_64KEY;
6746 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6748 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6749 CHECK_REG_STR(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6750 RegCloseKey(hkey);
6752 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6753 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6754 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
6755 CHECK_REG_STR(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6756 RegCloseKey(hkey);
6758 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_win32, 0, access, &hkey);
6759 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6760 "Expected ERROR_SUCCESS, got %d\n", res);
6761 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6762 RegCloseKey(hkey);
6764 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6765 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey);
6766 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */,
6767 "Expected ERROR_SUCCESS, got %d\n", res);
6768 if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6769 RegCloseKey(hkey);
6771 r = MsiInstallProductA(msifile, "REMOVE=ALL ALLUSERS=1");
6772 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6774 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_dotnet, &hkey);
6775 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6776 if (res == ERROR_SUCCESS)
6778 res = RegDeleteValueA(hkey, name_dotnet);
6779 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6780 RegCloseKey(hkey);
6783 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6784 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6785 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6787 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_win32, &hkey);
6788 ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
6789 if (res == ERROR_SUCCESS)
6791 res = RegDeleteValueA(hkey, name_win32);
6792 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6793 RegCloseKey(hkey);
6796 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6797 res = RegOpenKeyA(HKEY_CLASSES_ROOT, path, &hkey);
6798 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
6800 done:
6801 DeleteFileA("msitest\\win32.txt");
6802 DeleteFileA("msitest\\win32_local.txt");
6803 DeleteFileA("msitest\\dotnet.txt");
6804 DeleteFileA("msitest\\dotnet_local.txt");
6805 DeleteFileA("msitest\\manifest.txt");
6806 DeleteFileA("msitest\\manifest_local.txt");
6807 DeleteFileA("msitest\\application_win32.txt");
6808 DeleteFileA("msitest\\application_dotnet.txt");
6809 delete_test_files();
6810 DeleteFileA(msifile);
6813 static void test_remove_existing_products(void)
6815 UINT r;
6817 if (is_process_limited())
6819 skip("process is limited\n");
6820 return;
6823 create_test_files();
6824 create_file("msitest\\rep.txt", 1000);
6825 create_database(msifile, rep_tables, sizeof(rep_tables) / sizeof(msi_table));
6827 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
6829 r = MsiInstallProductA(msifile, NULL);
6830 if (r == ERROR_INSTALL_PACKAGE_REJECTED)
6832 skip("Not enough rights to perform tests\n");
6833 goto error;
6835 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6837 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6840 ok(!delete_pf("msitest\\rep.txt", TRUE), "file not removed\n");
6841 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
6843 error:
6844 DeleteFileA("msitest\\rep.txt");
6845 delete_test_files();
6846 DeleteFileA(msifile);
6849 START_TEST(action)
6851 DWORD len;
6852 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6853 STATEMGRSTATUS status;
6854 BOOL ret = FALSE;
6856 init_functionpointers();
6858 if (pIsWow64Process)
6859 pIsWow64Process(GetCurrentProcess(), &is_wow64);
6861 GetCurrentDirectoryA(MAX_PATH, prev_path);
6862 GetTempPathA(MAX_PATH, temp_path);
6863 SetCurrentDirectoryA(temp_path);
6865 lstrcpyA(CURR_DIR, temp_path);
6866 len = lstrlenA(CURR_DIR);
6868 if(len && (CURR_DIR[len - 1] == '\\'))
6869 CURR_DIR[len - 1] = 0;
6871 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6872 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6874 /* Create a restore point ourselves so we circumvent the multitude of restore points
6875 * that would have been created by all the installation and removal tests.
6877 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6878 * creation of restore points.
6880 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
6882 memset(&status, 0, sizeof(status));
6883 ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
6886 /* Create only one log file and don't append. We have to pass something
6887 * for the log mode for this to work. The logfile needs to have an absolute
6888 * path otherwise we still end up with some extra logfiles as some tests
6889 * change the current directory.
6891 lstrcpyA(log_file, temp_path);
6892 lstrcatA(log_file, "\\msitest.log");
6893 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
6895 test_register_product();
6896 test_publish_product();
6897 test_publish_features();
6898 test_register_user();
6899 test_process_components();
6900 test_publish();
6901 test_publish_sourcelist();
6902 test_remove_files();
6903 test_move_files();
6904 test_duplicate_files();
6905 test_write_registry_values();
6906 test_envvar();
6907 test_create_remove_folder();
6908 test_start_stop_services();
6909 test_delete_services();
6910 test_install_services();
6911 test_self_registration();
6912 test_register_font();
6913 test_validate_product_id();
6914 test_install_remove_odbc();
6915 test_register_typelib();
6916 test_create_remove_shortcut();
6917 test_publish_components();
6918 test_remove_duplicate_files();
6919 test_remove_registry_values();
6920 test_find_related_products();
6921 test_remove_ini_values();
6922 test_remove_env_strings();
6923 test_register_class_info();
6924 test_register_extension_info();
6925 test_register_progid_info();
6926 test_register_mime_info();
6927 test_publish_assemblies();
6928 test_remove_existing_products();
6930 DeleteFileA(log_file);
6932 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
6934 ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
6935 if (ret)
6936 remove_restore_point(status.llSequenceNumber);
6938 FreeLibrary(hsrclient);
6940 SetCurrentDirectoryA(prev_path);